diff --git a/.clang-format b/.clang-format index f3d4b9afd3..d984ee12f5 100644 --- a/.clang-format +++ b/.clang-format @@ -23,4 +23,4 @@ AllowShortEnumsOnASingleLine: false AlignEscapedNewlines: Left AlignTrailingComments: true SortIncludes: false -TypenameMacros: ['BAD_RETURN'] +TypenameMacros: ['BAD_RETURN', 'ALIGNED'] diff --git a/Makefile b/Makefile index e241f8364d..ac9cb6e489 100644 --- a/Makefile +++ b/Makefile @@ -181,10 +181,6 @@ endif OBJDUMP_FLAGS := -d -r -z -Mreg-names=32 -DISASM_DATA_DIR := tools/disasm/$(VERSION) -DISASM_FLAGS += --custom-suffix _unknown --sequential-label-names --no-use-fpccsr --no-cop0-named-registers -DISASM_FLAGS += --config-dir $(DISASM_DATA_DIR) --symbol-addrs $(DISASM_DATA_DIR)/functions.txt --symbol-addrs $(DISASM_DATA_DIR)/variables.txt - #### Files #### # ROM image @@ -223,11 +219,6 @@ O_FILES := $(foreach f,$(S_FILES:.s=.o),$(BUILD_DIR)/$f) \ OVL_RELOC_FILES := $(shell $(CPP) $(CPPFLAGS) $(SPEC) | $(SPEC_REPLACE_VARS) | grep -o '[^"]*_reloc.o' ) -DISASM_BASEROM := $(BASEROM_DIR)/baserom-decompressed.z64 -DISASM_DATA_FILES := $(wildcard $(DISASM_DATA_DIR)/*.csv) $(wildcard $(DISASM_DATA_DIR)/*.txt) -DISASM_S_FILES := $(shell test -e $(PYTHON) && $(PYTHON) tools/disasm/list_generated_files.py -o $(EXPECTED_DIR) --config-dir $(DISASM_DATA_DIR)) -DISASM_O_FILES := $(DISASM_S_FILES:.s=.o) - # Automatic dependency files # (Only asm_processor dependencies and reloc dependencies are handled for now) DEP_FILES := $(O_FILES:.o=.asmproc.d) $(OVL_RELOC_FILES:.o=.d) @@ -247,7 +238,7 @@ $(BUILD_DIR)/src/boot/stackcheck.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_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/jpegutils.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/code/jpegdecoder.o: OPTFLAGS := -O2 @@ -370,9 +361,12 @@ setup: venv # TODO: for now, we only extract assets from the Debug ROM ifeq ($(VERSION),gc-eu-mq-dbg) $(PYTHON) extract_assets.py -j$(N_THREADS) + $(PYTHON) tools/msgdis.py --text-out assets/text/message_data.h --staff-text-out assets/text/message_data_staff.h endif -disasm: $(DISASM_O_FILES) +disasm: + $(RM) -r $(EXPECTED_DIR) + VERSION=$(VERSION) DISASM_BASEROM=$(BASEROM_DIR)/baserom-decompressed.z64 DISASM_DIR=$(EXPECTED_DIR) PYTHON=$(PYTHON) AS_CMD='$(AS) $(ASFLAGS)' LD=$(LD) ./tools/disasm/do_disasm.sh run: $(ROM) ifeq ($(N64_EMULATOR),) @@ -494,13 +488,6 @@ $(BUILD_DIR)/assets/%.bin.inc.c: assets/%.bin $(BUILD_DIR)/assets/%.jpg.inc.c: assets/%.jpg $(ZAPD) bren -eh -i $< -o $@ -$(EXPECTED_DIR)/.disasm: $(DISASM_DATA_FILES) - $(PYTHON) tools/disasm/disasm.py $(DISASM_FLAGS) $(DISASM_BASEROM) -o $(EXPECTED_DIR) --split-functions $(EXPECTED_DIR)/functions - touch $@ - -$(EXPECTED_DIR)/%.o: $(EXPECTED_DIR)/.disasm - $(AS) $(ASFLAGS) $(@:.o=.s) -o $@ - -include $(DEP_FILES) # Print target for debugging diff --git a/README.md b/README.md index 8e9b44817b..0e3e1bd13d 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ cd oot #### 3. Prepare a base ROM 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. @@ -115,7 +116,7 @@ make setup ``` 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. #### 5. Build the ROM diff --git a/data/fault_drawer.bss.s b/data/fault_drawer.bss.s index 0c64984b33..89a29d8bb4 100644 --- a/data/fault_drawer.bss.s +++ b/data/fault_drawer.bss.s @@ -13,6 +13,7 @@ glabel sFaultDrawer .space 0x3C + .space 0x04 # padding -glabel D_8016B6BC - .space 0x24 +glabel D_8016B6C0 + .space 0x20 diff --git a/extract_assets.py b/extract_assets.py index defac57dcd..ced7da4a1c 100755 --- a/extract_assets.py +++ b/extract_assets.py @@ -96,7 +96,7 @@ def processZAPDArgs(argsZ): def main(): parser = argparse.ArgumentParser(description="baserom asset extractor") parser.add_argument("-s", "--single", help="asset path relative to assets/, e.g. objects/gameplay_keep") - parser.add_argument("-f", "--force", help="Force the extraction of every xml instead of checking the touched ones, and text (overwriting current files).", action="store_true") + parser.add_argument("-f", "--force", help="Force the extraction of every xml instead of checking the touched ones (overwriting current files).", action="store_true") parser.add_argument("-j", "--jobs", help="Number of cpu cores to extract with.") parser.add_argument("-u", "--unaccounted", help="Enables ZAPD unaccounted detector warning system.", action="store_true") parser.add_argument("-Z", help="Pass the argument on to ZAPD, e.g. `-ZWunaccounted` to warn about unaccounted blocks in XMLs. Each argument should be passed separately, *without* the leading dash.", metavar="ZAPD_ARG", action="append") @@ -128,21 +128,6 @@ def main(): del extractedAssetsTracker[fullPath] ExtractFunc(fullPath) else: - extract_text_path = "assets/text/message_data.h" - extract_staff_text_path = "assets/text/message_data_staff.h" - - # Only extract text if the header does not already exist, or if --force was passed - if not args.force: - if os.path.isfile(extract_text_path): - extract_text_path = None - if os.path.isfile(extract_staff_text_path): - extract_staff_text_path = None - - if extract_text_path is not None or extract_staff_text_path is not None: - print("Extracting text") - from tools import msgdis - msgdis.extract_all_text(extract_text_path, extract_staff_text_path) - xmlFiles = [] for currentPath, _, files in os.walk(os.path.join("assets", "xml")): for file in files: diff --git a/include/alignment.h b/include/alignment.h index e26a1d3f33..2169f90d3f 100644 --- a/include/alignment.h +++ b/include/alignment.h @@ -8,9 +8,9 @@ #define ALIGN256(val) (((val) + 0xFF) & ~0xFF) #ifdef __GNUC__ -#define ALIGNED8 __attribute__ ((aligned (8))) +#define ALIGNED(n) __attribute__ ((aligned (n))) #else -#define ALIGNED8 +#define ALIGNED(n) #endif #ifdef __sgi /* IDO compiler */ diff --git a/include/fault.h b/include/fault.h index 778f708e9b..df125487e5 100644 --- a/include/fault.h +++ b/include/fault.h @@ -44,7 +44,7 @@ void Fault_Init(void); // Fatal Errors 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 diff --git a/include/functions.h b/include/functions.h index d8d09222c9..9b3e0bf72c 100644 --- a/include/functions.h +++ b/include/functions.h @@ -39,7 +39,7 @@ void isPrintfInit(void); void rmonPrintf(const char* fmt, ...); #if OOT_DEBUG 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 OSPiHandle* osDriveRomInit(void); void Mio0_Decompress(u8* src, u8* dst); @@ -51,11 +51,11 @@ u32 StackCheck_CheckAll(void); u32 StackCheck_Check(StackEntry* entry); #if OOT_DEBUG void LogUtils_LogHexDump(void* ptr, s32 size0); -void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 line); -void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, s32 line); -void LogUtils_LogThreadId(const char* name, 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, int line); +void LogUtils_LogThreadId(const char* name, int line); #endif -void LogUtils_HungupThread(const char* name, s32 line); +void LogUtils_HungupThread(const char* name, int line); void LogUtils_ResetHungup(void); void __osPiCreateAccessQueue(void); void __osPiGetAccess(void); @@ -913,10 +913,10 @@ void ZeldaArena_Cleanup(void); u8 ZeldaArena_IsInitialized(void); #if OOT_DEBUG 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_MallocRDebug(u32 size, const char* file, s32 line); -void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line); -void ZeldaArena_FreeDebug(void* ptr, const char* file, s32 line); +void* ZeldaArena_MallocDebug(u32 size, const char* file, int line); +void* ZeldaArena_MallocRDebug(u32 size, const char* file, int line); +void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line); +void ZeldaArena_FreeDebug(void* ptr, const char* file, int line); void ZeldaArena_Display(void); #endif void MapMark_Init(PlayState* play); @@ -1155,10 +1155,10 @@ void Sram_WriteSramHeader(SramContext* sramCtx); void Sram_InitSram(GameState* gameState, SramContext* sramCtx); void Sram_Alloc(GameState* gameState, SramContext* sramCtx); void Sram_Init(PlayState* play, SramContext* sramCtx); -void SsSram_Init(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize, u8 handleRelDuration, +void SsSram_Init(s32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize, u8 handleRelDuration, u8 handlePulse, u32 handleSpeed); void SsSram_Dma(void* dramAddr, size_t size, s32 direction); -void SsSram_ReadWrite(u32 addr, void* dramAddr, size_t size, s32 direction); +void SsSram_ReadWrite(s32 addr, void* dramAddr, size_t size, s32 direction); View* View_New(GraphicsContext* gfxCtx); void View_Free(View* view); void View_Init(View*, GraphicsContext*); @@ -1316,8 +1316,8 @@ void GameState_Destroy(GameState* gameState); GameStateFunc GameState_GetInit(GameState* gameState); u32 GameState_IsRunning(GameState* gameState); #if OOT_DEBUG -void* GameState_Alloc(GameState* gameState, size_t size, char* file, s32 line); -void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const 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, int line); #endif void* GameAlloc_Malloc(GameAlloc* this, u32 size); 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_Alloc2(GraphicsContext* gfxCtx, size_t size); #if OOT_DEBUG -void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, s32 line); -void Graph_CloseDisps(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, int line); #endif Gfx* Gfx_Open(Gfx* gfx); 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); Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest); #if OOT_DEBUG -Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line); -Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line); +Mtx* Matrix_ToMtx(Mtx* dest, const char* file, int line); +Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, const char* file, int line); #else Mtx* Matrix_ToMtx(Mtx* dest); 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_RotateAxis(f32 angle, Vec3f* axis, u8 mode); #if OOT_DEBUG -MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line); +MtxF* Matrix_CheckFloats(MtxF* mf, const char* file, int line); #endif void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 translateX, f32 translateY, f32 translateZ); @@ -1476,10 +1476,10 @@ void DebugArena_Cleanup(void); u8 DebugArena_IsInitialized(void); #if OOT_DEBUG 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_MallocRDebug(u32 size, const char* file, s32 line); -void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line); -void DebugArena_FreeDebug(void* ptr, const char* file, s32 line); +void* DebugArena_MallocDebug(u32 size, const char* file, int line); +void* DebugArena_MallocRDebug(u32 size, const char* file, int line); +void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line); +void DebugArena_FreeDebug(void* ptr, const char* file, int line); void DebugArena_Display(void); #endif void UCodeDisas_Init(UCodeDisas*); @@ -1774,10 +1774,10 @@ void SystemArena_Init(void* start, u32 size); void SystemArena_Cleanup(void); u8 SystemArena_IsInitialized(void); #if OOT_DEBUG -void* SystemArena_MallocDebug(u32 size, const char* file, s32 line); -void* SystemArena_MallocRDebug(u32 size, const char* file, s32 line); -void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line); -void SystemArena_FreeDebug(void* ptr, const char* file, s32 line); +void* SystemArena_MallocDebug(u32 size, const char* file, int line); +void* SystemArena_MallocRDebug(u32 size, const char* file, int line); +void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line); +void SystemArena_FreeDebug(void* ptr, const char* file, int line); void SystemArena_Display(void); #endif 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); u32 __osCheckArena(Arena* arena); #if OOT_DEBUG -void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line); -void* __osMallocRDebug(Arena* arena, u32 size, const char* file, s32 line); -void __osFreeDebug(Arena* arena, void* ptr, const char* file, s32 line); -void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, 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, int line); +void __osFreeDebug(Arena* arena, void* ptr, const char* file, int line); +void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, int line); void __osDisplayArena(Arena* arena); #endif s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args); diff --git a/include/macro.inc b/include/macro.inc index b153bc5449..882093744c 100644 --- a/include/macro.inc +++ b/include/macro.inc @@ -1,3 +1,8 @@ +# Evaluate this file only once in case it's included more than once +.ifndef _MACRO_INC_GUARD +.internal _MACRO_INC_GUARD +.set _MACRO_INC_GUARD, 1 + .macro glabel label .global \label \label: @@ -47,3 +52,5 @@ .set $fs4f, $f29 .set $fs5, $f30 .set $fs5f, $f31 + +.endif diff --git a/include/macros.h b/include/macros.h index b0a35844f4..97627d9b4c 100644 --- a/include/macros.h +++ b/include/macros.h @@ -114,7 +114,7 @@ // argument errors instead. // Note some tools define __sgi but preprocess with a modern cpp implementation, // 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 #define PRINTF osSyncPrintf diff --git a/include/ultra64/controller.h b/include/ultra64/controller.h index 8b759db77f..9178991d94 100644 --- a/include/ultra64/controller.h +++ b/include/ultra64/controller.h @@ -119,6 +119,12 @@ #define BTN_B 0x4000 #define BTN_A 0x8000 +#ifdef __GNUC__ +// Ensure data cache coherency for OSPifRam structures by aligning to the data cache line size. +// On older compilers such as IDO this was done by placing each OSPifRam at the top of the file it is declared in, +// however file alignment should not be relied on in general. +__attribute__((aligned(0x10))) +#endif typedef union { struct { /* 0x00 */ u32 ram[15]; diff --git a/include/variables.h b/include/variables.h index f0fa2b9fe8..1c7e4ebc85 100644 --- a/include/variables.h +++ b/include/variables.h @@ -143,13 +143,17 @@ extern u16 D_801333D0; extern Vec3f gSfxDefaultPos; extern f32 gSfxDefaultFreqAndVolScale; extern s8 gSfxDefaultReverb; +#if OOT_DEBUG extern u8 D_801333F0; extern u8 gAudioSfxSwapOff; extern u8 D_801333F8; +#endif extern u8 gSeqCmdWritePos; extern u8 gSeqCmdReadPos; extern u8 gStartSeqDisabled; +#if OOT_DEBUG extern u8 gAudioDebugPrintSeqCmd; +#endif extern u8 gSoundModeList[]; extern u8 gAudioSpecId; extern u8 D_80133418; @@ -231,6 +235,5 @@ extern u64 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE / sizeof(u64)]; // 0xC00 byt extern u64 gGfxSPTaskStack[SP_DRAM_STACK_SIZE64]; // 0x400 bytes extern GfxPool gGfxPools[2]; // 0x24820 bytes extern u8 gAudioHeap[0x38000]; // 0x38000 bytes -extern u8 gSystemHeap[]; #endif diff --git a/include/z64.h b/include/z64.h index 92ce7fb686..afdf4a95c1 100644 --- a/include/z64.h +++ b/include/z64.h @@ -717,7 +717,7 @@ typedef struct ArenaNode { /* 0x0C */ struct ArenaNode* prev; #if OOT_DEBUG // TODO: This debug info is also present in N64 retail builds /* 0x10 */ const char* filename; - /* 0x14 */ s32 line; + /* 0x14 */ int line; /* 0x18 */ OSId threadId; /* 0x1C */ Arena* arena; /* 0x20 */ OSTime time; @@ -755,7 +755,12 @@ typedef struct OverlayRelocationSection { /* 0x14 */ u32 relocations[1]; // size is nRelocations } OverlayRelocationSection; // size >= 0x18 -typedef struct { +// This struct is used at osAppNMIBuffer which is not at an 8-byte aligned address. This causes an unaligned access +// crash if the OSTime variables use 64-bit load/store instructions, which is the case in any MIPS ABI other than O32 +// where 64-bit load/store instructions are emulated with 2x 32-bit load/store instructions. The alignment attribute +// conveys that this structure will not always be 8-bytes aligned, allowing a modern compiler to generate non-crashing +// code for accessing these. This is not an issue in the original compiler as it only output O32 ABI code. +ALIGNED(4) typedef struct { /* 0x00 */ u32 resetting; /* 0x04 */ u32 resetCount; /* 0x08 */ OSTime duration; diff --git a/include/z64dma.h b/include/z64dma.h index fb9d03c720..e740fcba9e 100755 --- a/include/z64dma.h +++ b/include/z64dma.h @@ -9,7 +9,7 @@ typedef struct { /* 0x04 */ void* dramAddr; // DRAM address (destination) /* 0x08 */ size_t size; // File Transfer size /* 0x0C */ const char* filename; // Filename for debugging - /* 0x10 */ s32 line; // Line for debugging + /* 0x10 */ int line; // Line number for debugging /* 0x14 */ s32 unk_14; /* 0x18 */ OSMesgQueue* notifyQueue; // Message queue for the 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); #if OOT_DEBUG s32 DmaMgr_RequestAsyncDebug(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue, - OSMesg msg, const char* file, s32 line); -s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, 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, int line); #endif // Special-purpose DMA Requests diff --git a/requirements.txt b/requirements.txt index 677bf2d3e5..318b6e2fee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,6 +14,6 @@ pycparser toml # tools -mapfile-parser>=1.2.1,<2.0.0 +mapfile-parser>=2.3.5,<3.0.0 rabbitizer>=1.0.0,<2.0.0 -spimdisasm>=1.20.0,<2.0.0 +spimdisasm>=1.21.0,<2.0.0 diff --git a/retail_progress.py b/retail_progress.py index 53a137a2d6..21a98ccdbc 100755 --- a/retail_progress.py +++ b/retail_progress.py @@ -5,16 +5,34 @@ import argparse import collections +from colorama import Fore, Style from dataclasses import dataclass import difflib -from enum import Enum import itertools import math from pathlib import Path import re import subprocess import sys -from typing import Iterator, List, Optional, Tuple +import multiprocessing +import multiprocessing.pool +from typing import Dict, Iterator, List, Optional, Tuple + + +def green(s: str) -> str: + return f"{Fore.GREEN}{s}{Style.RESET_ALL}" + + +def red(s: str) -> str: + return f"{Fore.RED}{s}{Style.RESET_ALL}" + + +# Make interrupting with ^C less jank +# https://stackoverflow.com/questions/72967793/keyboardinterrupt-with-python-multiprocessing-pool +def set_sigint_ignored(): + import signal + + signal.signal(signal.SIGINT, signal.SIG_IGN) @dataclass @@ -68,30 +86,25 @@ def parse_inst(func_name: str, line: str) -> Inst: return Inst(func_name, mnemonic, regs, imm, None, None) -def run_objdump(path: Path) -> List[Inst]: +def run_objdump(path: Path, args: List[str]) -> str: if not path.exists(): raise Exception(f"file {path} does not exist") - command = [ - "mips-linux-gnu-objdump", - "-drz", - "-m", - "mips:4300", - "-j", - ".text", - str(path), - ] + command = ["mips-linux-gnu-objdump"] + args + [str(path)] try: - lines = subprocess.run( + return subprocess.run( command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True, encoding="utf-8", - ).stdout.splitlines() + ).stdout except subprocess.CalledProcessError as e: - return [] + return "" + +def disassemble(path: Path) -> List[Inst]: + lines = run_objdump(path, ["-drz", "-m", "mips:4300", "-j", ".text"]).splitlines() result = [] func_name = None @@ -156,14 +169,47 @@ def has_diff(inst1: Inst, inst2: Inst) -> bool: return inst1 != inst2 +def get_section_sizes(path: Path) -> Dict[str, int]: + lines = run_objdump(path, ["-h"]).splitlines() + if len(lines) < 5: + return {} + + result = {} + for i in range(5, len(lines), 2): + parts = lines[i].split() + name = parts[1] + size = int(parts[2], 16) + # Pad to 0x10-byte alignment + result[parts[1]] = (size + 0xF) & ~0xF + return result + + +def get_section_hex_dump(path: Path, section: str) -> List[str]: + lines = run_objdump(path, ["-s", "-j", section]).splitlines() + return lines[4:] + + +def parse_hex_dump(lines: List[str]) -> bytes: + result = bytearray() + for line in lines: + data = line[6:41].replace(" ", "") + result.extend(bytes.fromhex(data)) + + # pad to 0x10-byte alignment + while len(result) % 0x10: + result.append(0) + + return result + + def find_functions_with_diffs(version: str, c_path: str): object_path = Path(c_path).with_suffix(".o") expected_dir = Path("expected/build") / version build_dir = Path("build") / version - insts1 = run_objdump(expected_dir / object_path) - insts2 = run_objdump(build_dir / object_path) + insts1 = disassemble(expected_dir / object_path) + insts2 = disassemble(build_dir / object_path) functions_with_diffs = collections.OrderedDict() for inst1, inst2 in pair_instructions(insts1, insts2): @@ -184,49 +230,156 @@ def find_functions_with_diffs(version: str, c_path: str): print(f" {func_name}") -def print_summary(version: str, csv: bool): +def find_data_diffs(version: str, c_path: str): + object_path = Path(c_path).with_suffix(".o") + expected_dir = Path("expected/build") / version build_dir = Path("build") / version - if csv: - print("path,expected,actual,added,removed,changed,progress") - for object_file in sorted(expected_dir.glob("src/**/*.o")): - object_path = object_file.relative_to(expected_dir) - c_path = object_path.with_suffix(".c") + sizes1 = get_section_sizes(expected_dir / object_path) + sizes2 = get_section_sizes(build_dir / object_path) + rodata_dump1 = get_section_hex_dump(expected_dir / object_path, ".rodata") + rodata_dump2 = get_section_hex_dump(build_dir / object_path, ".rodata") + rodata1 = parse_hex_dump(rodata_dump1) + rodata2 = parse_hex_dump(rodata_dump2) - insts1 = run_objdump(expected_dir / object_path) - insts2 = run_objdump(build_dir / object_path) + rodata_matches = rodata1 == rodata2 + data_size_matches = sizes1.get(".data", 0) == sizes2.get(".data", 0) + bss_size_matches = sizes1.get(".bss", 0) == sizes2.get(".bss", 0) - added = 0 - removed = 0 - changed = 0 - for inst1, inst2 in pair_instructions(insts1, insts2): - if inst1 is None and inst2 is not None: - added += 1 - elif inst1 is not None and inst2 is None: - removed += 1 - elif inst1 is not None and inst2 is not None and has_diff(inst1, inst2): - changed += 1 + if rodata_matches: + print(f"{c_path} .rodata OK") + else: + print( + f"{c_path} .rodata differs: expected size 0x{sizes1.get('.rodata', 0):04x} vs build size 0x{sizes2.get('.rodata', 0):04x}" + ) + print(f" expected:") + print("\n".join(rodata_dump1)) + print(f" build:") + print("\n".join(rodata_dump2)) - if insts1: - progress = max(1.0 - (added + removed + changed) / len(insts1), 0) - else: - progress = 1.0 + if data_size_matches: + print(f"{c_path} .data size OK") + else: + print( + f"{c_path} .data size differs: expected size 0x{sizes1.get('.data', 0):04x} vs build size 0x{sizes2.get('.data', 0):04x}" + ) - if csv: - print( - f"{c_path},{len(insts1)},{len(insts2)},{added},{removed},{changed},{progress:.3f}" + if bss_size_matches: + print(f"{c_path} .bss size OK") + else: + print( + f"{c_path} .bss size differs: expected size 0x{sizes1.get('.bss', 0):04x} vs build size 0x{sizes2.get('.bss', 0):04x}" + ) + + +@dataclass +class ObjectDataForComparison: + insts1: List[Inst] + insts2: List[Inst] + sizes1: Dict[str, int] + sizes2: Dict[str, int] + rodata1: bytes + rodata2: bytes + + +def get_object_data_for_comparison(object1: Path, object2: Path): + insts1 = disassemble(object1) + insts2 = disassemble(object2) + sizes1 = get_section_sizes(object1) + sizes2 = get_section_sizes(object2) + rodata_dump1 = get_section_hex_dump(object1, ".rodata") + rodata_dump2 = get_section_hex_dump(object2, ".rodata") + rodata1 = parse_hex_dump(rodata_dump1) + rodata2 = parse_hex_dump(rodata_dump2) + return ObjectDataForComparison(insts1, insts2, sizes1, sizes2, rodata1, rodata2) + + +def print_summary(version: str, csv: bool, only_not_ok: bool): + expected_dir = Path("expected/build") / version + build_dir = Path("build") / version + + expected_object_files = sorted(expected_dir.glob("src/**/*.o")) + + comparison_data_list: List[multiprocessing.pool.AsyncResult] = [] + + with multiprocessing.Pool(initializer=set_sigint_ignored) as p: + for expected_object in expected_object_files: + build_object = build_dir / expected_object.relative_to(expected_dir) + comparison_data_list.append( + p.apply_async( + get_object_data_for_comparison, + (expected_object, build_object), + ) ) - elif progress == 1.0: - print(f" OK {c_path}") - else: - print(f" {math.floor(progress * 100):>2}% {c_path}") + if csv: + print("path,expected,actual,.text,.rodata,.data size,.bss size") + for expected_object, data_async in zip( + expected_object_files, comparison_data_list + ): + c_path = expected_object.relative_to(expected_dir).with_suffix(".c") + data = data_async.get() + + insts1 = data.insts1 + insts2 = data.insts2 + + added = 0 + removed = 0 + changed = 0 + for inst1, inst2 in pair_instructions(insts1, insts2): + if inst1 is None and inst2 is not None: + added += 1 + elif inst1 is not None and inst2 is None: + removed += 1 + elif inst1 is not None and inst2 is not None and has_diff(inst1, inst2): + changed += 1 + + if insts1: + text_progress = max(1.0 - (added + removed + changed) / len(insts1), 0) + else: + text_progress = 1.0 + + sizes1 = data.sizes1 + sizes2 = data.sizes2 + rodata1 = data.rodata1 + rodata2 = data.rodata2 + + rodata_matches = rodata1 == rodata2 + data_size_matches = sizes1.get(".data", 0) == sizes2.get(".data", 0) + bss_size_matches = sizes1.get(".bss", 0) == sizes2.get(".bss", 0) + + if only_not_ok: + if ( + text_progress == 1 + and rodata_matches + and data_size_matches + and bss_size_matches + ): + continue + + if csv: + print( + f"{c_path},{len(insts1)},{len(insts2)},{text_progress:.3f},{rodata_matches},{data_size_matches},{bss_size_matches}" + ) + else: + ok = green("OK") + diff = red("diff") + text_progress_str = ( + ok + if text_progress == 1 + else red(f"{math.floor(text_progress * 100):>2}%") + ) + rodata_str = ok if rodata_matches else diff + data_size_str = ok if data_size_matches else diff + bss_size_str = ok if bss_size_matches else diff + print( + f"text:{text_progress_str:<13} rodata:{rodata_str:<13} data size:{data_size_str:<13} bss size:{bss_size_str:<13} {c_path}" + ) + sys.stdout.flush() if __name__ == "__main__": - parser = argparse.ArgumentParser( - description="Calculate progress matching .text sections" - ) + parser = argparse.ArgumentParser(description="Calculate progress matching retail") parser.add_argument( "file", metavar="FILE", @@ -236,10 +389,24 @@ if __name__ == "__main__": parser.add_argument( "-v", "--version", help="version to compare", default="gc-eu-mq" ) + parser.add_argument( + "--data", + help="diff .data size, .bss size, and .rodata contents instead of text", + action="store_true", + ) + parser.add_argument( + "--not-ok", + help="only print non-OK files", + action="store_true", + dest="only_not_ok", + ) parser.add_argument("--csv", help="print summary CSV", action="store_true") args = parser.parse_args() if args.file is not None: - find_functions_with_diffs(args.version, args.file) + if args.data: + find_data_diffs(args.version, args.file) + else: + find_functions_with_diffs(args.version, args.file) else: - print_summary(args.version, args.csv) + print_summary(args.version, args.csv, args.only_not_ok) diff --git a/spec b/spec index f571845445..d5eb8e851f 100644 --- a/spec +++ b/spec @@ -20,13 +20,17 @@ beginseg include "$(BUILD_DIR)/src/boot/z_std_dma.o" include "$(BUILD_DIR)/src/boot/yaz0.o" include "$(BUILD_DIR)/src/boot/z_locale.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/boot/assert.o" +#endif include "$(BUILD_DIR)/src/boot/is_debug.o" include "$(BUILD_DIR)/src/libultra/io/driverominit.o" include "$(BUILD_DIR)/src/boot/mio0.o" include "$(BUILD_DIR)/src/boot/stackcheck.o" include "$(BUILD_DIR)/src/boot/logutils.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/libultra/libc/sprintf.o" +#endif include "$(BUILD_DIR)/src/libultra/io/piacs.o" include "$(BUILD_DIR)/src/libultra/os/sendmesg.o" include "$(BUILD_DIR)/src/libultra/os/stopthread.o" @@ -57,10 +61,14 @@ beginseg include "$(BUILD_DIR)/src/libultra/os/probetlb.o" include "$(BUILD_DIR)/src/libultra/os/getmemsize.o" include "$(BUILD_DIR)/src/libultra/os/seteventmesg.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/libultra/libc/xprintf.o" +#endif include "$(BUILD_DIR)/src/libultra/os/unmaptlball.o" include "$(BUILD_DIR)/src/libultra/io/epidma.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/libultra/libc/string.o" +#endif include "$(BUILD_DIR)/src/libultra/os/invalicache.o" include "$(BUILD_DIR)/src/libultra/os/createmesgqueue.o" include "$(BUILD_DIR)/src/libultra/os/invaldcache.o" @@ -88,17 +96,23 @@ beginseg include "$(BUILD_DIR)/src/libultra/io/epiread.o" include "$(BUILD_DIR)/src/libultra/io/visetspecial.o" include "$(BUILD_DIR)/src/libultra/io/cartrominit.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/libultra/io/vimodefpallan1.o" +#endif include "$(BUILD_DIR)/src/libultra/os/setfpccsr.o" include "$(BUILD_DIR)/src/libultra/os/getfpccsr.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/libultra/io/epiwrite.o" +#endif include "$(BUILD_DIR)/src/libultra/os/maptlbrdb.o" include "$(BUILD_DIR)/src/libultra/os/yieldthread.o" include "$(BUILD_DIR)/src/libultra/os/getcause.o" include "$(BUILD_DIR)/src/libultra/io/epirawwrite.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/libultra/libc/xlitob.o" include "$(BUILD_DIR)/src/libultra/libc/ldiv.o" include "$(BUILD_DIR)/src/libultra/libc/xldtob.o" +#endif include "$(BUILD_DIR)/src/boot/build.o" include "$(BUILD_DIR)/src/libultra/io/sirawwrite.o" include "$(BUILD_DIR)/src/libultra/io/vimgr.o" @@ -342,7 +356,9 @@ beginseg include "$(BUILD_DIR)/src/code/z_lights.o" include "$(BUILD_DIR)/src/code/z_malloc.o" include "$(BUILD_DIR)/src/code/z_map_mark.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/code/z_moji.o" +#endif include "$(BUILD_DIR)/src/code/z_prenmi_buff.o" include "$(BUILD_DIR)/src/code/z_nulltask.o" include "$(BUILD_DIR)/src/code/z_olib.o" @@ -369,7 +385,9 @@ beginseg include "$(BUILD_DIR)/src/code/z_sram.o" include "$(BUILD_DIR)/src/code/z_ss_sram.o" include "$(BUILD_DIR)/src/code/z_rumble.o" +#if OOT_DEBUG include "$(BUILD_DIR)/data/z_text.data.o" +#endif include "$(BUILD_DIR)/data/unk_8012ABC0.data.o" include "$(BUILD_DIR)/src/code/z_view.o" include "$(BUILD_DIR)/src/code/z_vimode.o" @@ -385,9 +403,13 @@ beginseg include "$(BUILD_DIR)/src/code/z_fbdemo_circle.o" include "$(BUILD_DIR)/src/code/z_fbdemo_fade.o" include "$(BUILD_DIR)/src/code/shrink_window.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/code/db_camera.o" +#endif include "$(BUILD_DIR)/src/code/code_800BB0A0.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/code/mempak.o" +#endif include "$(BUILD_DIR)/src/code/z_kaleido_manager.o" include "$(BUILD_DIR)/src/code/z_kaleido_scope_call.o" include "$(BUILD_DIR)/src/code/z_play.o" @@ -415,7 +437,9 @@ beginseg include "$(BUILD_DIR)/src/code/sys_rumble.o" include "$(BUILD_DIR)/src/code/code_800D31A0.o" include "$(BUILD_DIR)/src/code/irqmgr.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/code/debug_malloc.o" +#endif include "$(BUILD_DIR)/src/code/fault.o" include "$(BUILD_DIR)/src/code/fault_drawer.o" #ifndef NON_MATCHING @@ -423,7 +447,9 @@ beginseg include "$(BUILD_DIR)/data/fault_drawer.bss.o" #endif include "$(BUILD_DIR)/src/code/kanread.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/code/ucode_disas.o" +#endif pad_text // audio library aligned to 32 bytes? include "$(BUILD_DIR)/src/audio/lib/data.o" include "$(BUILD_DIR)/src/audio/lib/synthesis.o" @@ -445,7 +471,9 @@ beginseg include "$(BUILD_DIR)/src/code/gfxprint.o" include "$(BUILD_DIR)/src/code/rcp_utils.o" include "$(BUILD_DIR)/src/code/loadfragment2.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/code/mtxuty-cvt.o" +#endif include "$(BUILD_DIR)/src/code/relocation.o" include "$(BUILD_DIR)/src/code/load.o" include "$(BUILD_DIR)/src/code/code_800FC620.o" @@ -454,13 +482,18 @@ beginseg include "$(BUILD_DIR)/src/code/code_800FCE80.o" include "$(BUILD_DIR)/src/code/fp.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" +#if !OOT_DEBUG + include "$(BUILD_DIR)/src/libultra/libc/sprintf.o" +#endif include "$(BUILD_DIR)/src/code/printutils.o" include "$(BUILD_DIR)/src/code/sleep.o" include "$(BUILD_DIR)/src/code/jpegutils.o" include "$(BUILD_DIR)/src/code/jpegdecoder.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/libultra/io/pfsfreeblocks.o" +#endif include "$(BUILD_DIR)/src/libultra/mgu/scale.o" include "$(BUILD_DIR)/src/libultra/gu/sinf.o" include "$(BUILD_DIR)/src/libultra/gu/sins.o" @@ -473,19 +506,29 @@ beginseg include "$(BUILD_DIR)/src/libultra/io/sprawdma.o" include "$(BUILD_DIR)/src/libultra/io/sirawdma.o" include "$(BUILD_DIR)/src/libultra/io/sptaskyield.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/libultra/io/pfsreadwritefile.o" include "$(BUILD_DIR)/src/libultra/io/pfsgetstatus.o" +#endif include "$(BUILD_DIR)/src/libultra/mgu/mtxidentf.o" include "$(BUILD_DIR)/src/libultra/gu/lookat.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/libultra/io/pfsallocatefile.o" +#endif include "$(BUILD_DIR)/src/libultra/os/stoptimer.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/libultra/io/contpfs.o" include "$(BUILD_DIR)/src/libultra/mgu/mtxl2f.o" include "$(BUILD_DIR)/src/libultra/io/pfsfindfile.o" +#endif include "$(BUILD_DIR)/src/libultra/gu/sqrtf.o" include "$(BUILD_DIR)/src/libultra/os/afterprenmi.o" include "$(BUILD_DIR)/src/libultra/io/contquery.o" include "$(BUILD_DIR)/src/libultra/gu/lookathil.o" +#if !OOT_DEBUG + include "$(BUILD_DIR)/src/libultra/libc/xprintf.o" + include "$(BUILD_DIR)/src/libultra/libc/string.o" +#endif include "$(BUILD_DIR)/src/libultra/io/sp.o" include "$(BUILD_DIR)/src/libultra/mgu/mtxident.o" include "$(BUILD_DIR)/src/libultra/gu/position.o" @@ -496,25 +539,44 @@ beginseg include "$(BUILD_DIR)/src/libultra/mgu/normalize.o" include "$(BUILD_DIR)/src/libultra/io/dpgetstat.o" include "$(BUILD_DIR)/src/libultra/io/dpsetstat.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/libultra/io/pfsdeletefile.o" +#endif include "$(BUILD_DIR)/src/libultra/gu/ortho.o" include "$(BUILD_DIR)/src/libultra/gu/cosf.o" include "$(BUILD_DIR)/src/libultra/gu/libm_vals.o" include "$(BUILD_DIR)/src/libultra/gu/coss.o" include "$(BUILD_DIR)/src/libultra/io/visetevent.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/libultra/io/pfsisplug.o" +#endif include "$(BUILD_DIR)/src/libultra/gu/us2dex.o" include "$(BUILD_DIR)/src/libultra/io/pfsselectbank.o" include "$(BUILD_DIR)/src/libultra/io/contsetch.o" +#if OOT_DEBUG include "$(BUILD_DIR)/src/libultra/io/pfsfilestate.o" include "$(BUILD_DIR)/src/libultra/io/pfsinitpak.o" include "$(BUILD_DIR)/src/libultra/io/pfschecker.o" +#endif include "$(BUILD_DIR)/src/libultra/io/aigetlen.o" include "$(BUILD_DIR)/src/libultra/mgu/translate.o" include "$(BUILD_DIR)/src/libultra/io/contramwrite.o" +#if !OOT_DEBUG + include "$(BUILD_DIR)/src/libultra/io/vimodefpallan1.o" + include "$(BUILD_DIR)/src/libultra/io/pfsgetstatus.o" + include "$(BUILD_DIR)/src/libultra/io/contpfs.o" +#endif include "$(BUILD_DIR)/src/libultra/io/contramread.o" include "$(BUILD_DIR)/src/libultra/io/crc.o" +#if !OOT_DEBUG + include "$(BUILD_DIR)/src/libultra/io/pfsisplug.o" +#endif include "$(BUILD_DIR)/src/libultra/os/settimer.o" +#if !OOT_DEBUG + include "$(BUILD_DIR)/src/libultra/libc/xldtob.o" + include "$(BUILD_DIR)/src/libultra/libc/ldiv.o" + include "$(BUILD_DIR)/src/libultra/libc/xlitob.o" +#endif include "$(BUILD_DIR)/src/libultra/io/spgetstat.o" include "$(BUILD_DIR)/src/libultra/io/spsetstat.o" include "$(BUILD_DIR)/src/libultra/os/writebackdcacheall.o" @@ -542,7 +604,7 @@ beginseg align 0x40 include "$(BUILD_DIR)/src/buffers/zbuffer.o" include "$(BUILD_DIR)/src/buffers/gfxbuffers.o" - include "$(BUILD_DIR)/src/buffers/heaps.o" + include "$(BUILD_DIR)/src/buffers/audio_heap.o" endseg beginseg @@ -2911,7 +2973,7 @@ beginseg name "ovl_En_Mb" compress include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mb/z_en_mb.o" - include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mb/ovl_En_Mb_reloc.o" + include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Mb/ovl_En_Mb_reloc.o" endseg beginseg diff --git a/src/audio/data.c b/src/audio/data.c index 6a4c29eda7..1c84d5e704 100644 --- a/src/audio/data.c +++ b/src/audio/data.c @@ -44,18 +44,20 @@ s8 gSfxDefaultReverb = 0; s32 D_801333EC = 0; // unused +#if OOT_DEBUG u8 D_801333F0 = 0; - u8 gAudioSfxSwapOff = 0; - u8 D_801333F8 = 0; - s32 D_801333FC = 0; // unused +#endif u8 gSeqCmdWritePos = 0; u8 gSeqCmdReadPos = 0; u8 gStartSeqDisabled = false; + +#if OOT_DEBUG u8 gAudioDebugPrintSeqCmd = true; +#endif u8 gSoundModeList[] = { SOUNDMODE_STEREO, diff --git a/src/audio/general.c b/src/audio/general.c index a70a35823b..f261a5ae55 100644 --- a/src/audio/general.c +++ b/src/audio/general.c @@ -1212,8 +1212,10 @@ OcarinaSongButtons gOcarinaSongButtons[OCARINA_SONG_MAX] = { { 0, { 0 } }, }; +#if OOT_DEBUG u32 sAudioUpdateStartTime; u32 sAudioUpdateEndTime; +#endif f32 D_8016B7A8; f32 D_8016B7AC; f32 D_8016B7B0; @@ -1223,20 +1225,26 @@ FreqLerp sWaterfallFreqScaleLerp; f32 D_8016B7D8; s8 D_8016B7DC; f32 D_8016B7E0; +#if OOT_DEBUG u16 D_8016B7E4; struct { char str[5]; u16 num; } sAudioScrPrtBuf[SCROLL_PRINT_BUF_SIZE]; +#endif u8 sRiverSoundMainBgmVol; u8 sRiverSoundMainBgmCurrentVol; u8 sRiverSoundMainBgmLower; u8 sRiverSoundMainBgmRestore; u8 sGanonsTowerVol; SfxPlayerState sSfxChannelState[0x10]; +#if OOT_DEBUG char sBinToStrBuf[0x20]; +#endif u8 sMalonSingingTimer; +#if OOT_DEBUG u8 sAudioSpecPeakNumNotes[0x12]; +#endif u8 sMalonSingingDisabled; u8 D_8016B9F3; u8 sFanfareStartTimer; @@ -1264,8 +1272,10 @@ u16 sMusicStaffCurHeldLength[OCARINA_SONG_MAX]; u16 sMusicStaffExpectedLength[OCARINA_SONG_MAX]; u8 sMusicStaffExpectedPitch[OCARINA_SONG_MAX]; OcarinaNote sScarecrowsLongSongSecondNote; +#if OOT_DEBUG u8 sIsMalonSinging; f32 sMalonSingingDist; +#endif void PadMgr_RequestPadData(PadMgr* padMgr, Input* inputs, s32 gameRequest); diff --git a/src/audio/lib/data.c b/src/audio/lib/data.c index d1bd4acc12..8dc4729ff9 100644 --- a/src/audio/lib/data.c +++ b/src/audio/lib/data.c @@ -1,7 +1,7 @@ #include "global.h" // clang-format off -s16 gSawtoothWaveSample[] = { +ALIGNED(16) s16 gSawtoothWaveSample[] = { // Frequency of 1 0, 1023, 2047, 3071, 4095, 5119, 6143, 7167, 8191, 9215, 10239, 11263, 12287, 13311, 14335, 15359, @@ -43,7 +43,7 @@ s16 gSawtoothWaveSample[] = { 0, 8191, 16383, 24575, -32767, -24575, -16383, -8191, }; -s16 gTriangleWaveSample[] = { +ALIGNED(16) s16 gTriangleWaveSample[] = { // Frequency of 1 0, 2047, 4095, 6143, 8191, 10239, 12287, 14335, 16383, 18431, 20479, 22527, 24575, 26623, 28671, 30719, @@ -85,7 +85,7 @@ s16 gTriangleWaveSample[] = { 0, 16383, 32767, 16383, 0, -16383, -32767, -16383, }; -s16 gSineWaveSample[] = { +ALIGNED(16) s16 gSineWaveSample[] = { // Frequency of 1 0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, 23169, 25329, 27244, 28897, 30272, 31356, 32137, 32609, @@ -127,7 +127,7 @@ s16 gSineWaveSample[] = { 0, 23169, 32767, 23169, 0, -23169, -32767, -23169, }; -s16 gSquareWaveSample[] = { +ALIGNED(16) s16 gSquareWaveSample[] = { // Frequency of 1 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -169,7 +169,7 @@ s16 gSquareWaveSample[] = { 0, 0, 32767, 32767, 0, 0, -32767, -32767, }; -s16 gWhiteNoiseSample[] = { +ALIGNED(16) s16 gWhiteNoiseSample[] = { // Frequency of 1 0, -25689, -25791, 27803, -27568, -21030, 22174, 6298, 27071, -18531, 28649, 2284, 3380, 6890, -12682, -21114, @@ -212,7 +212,7 @@ s16 gWhiteNoiseSample[] = { }; // Sine White Noise? -s16 D_8012EA90[] = { +ALIGNED(16) s16 D_8012EA90[] = { // Frequency of 1 0, 16316, 20148, 20257, 27209, -32657, 29264, 27259, -29394, -21494, -26410, 30770, 30033, 29130, 20206, 14129, @@ -255,7 +255,7 @@ s16 D_8012EA90[] = { }; // Pulse Wave (duty cycle = 12.5%) -s16 gEighthPulseWaveSample[] = { +ALIGNED(16) s16 gEighthPulseWaveSample[] = { // Frequency of 1 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -298,7 +298,7 @@ s16 gEighthPulseWaveSample[] = { }; // Pulse Wave (duty cycle = 25%) -s16 gQuarterPulseWaveSample[] = { +ALIGNED(16) s16 gQuarterPulseWaveSample[] = { // Frequency of 1 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -686,7 +686,7 @@ f32 gDefaultPanVolume[] = { 0.086471f, 0.074143f, 0.061803f, 0.049454f, 0.037097f, 0.024734f, 0.012368f, 0.0f, }; -s16 gLowPassFilterData[16 * 8] = { +ALIGNED(16) s16 gLowPassFilterData[16 * 8] = { /* 0x0 */ 0, 0, 0, 32767, 0, 0, 0, 0, // Identity filter (delta function) /* 0x1 */ 3854, 4188, 4398, 4469, 4398, 4188, 3854, 3416, /* 0x2 */ 3415, 4314, 4915, 5126, 4915, 4314, 3415, 2351, @@ -705,7 +705,7 @@ s16 gLowPassFilterData[16 * 8] = { /* 0xF */ 841, -853, 863, 26829, 863, -853, 841, -820, }; -s16 gHighPassFilterData[15 * 8] = { +ALIGNED(16) s16 gHighPassFilterData[15 * 8] = { /* 0x0 */ -289, -291, -289, 30736, -289, -291, -289, -290, /* 0x1 */ -464, -467, -467, 29506, -467, -467, -464, -463, /* 0x2 */ -662, -670, -672, 28101, -672, -670, -662, -656, @@ -723,7 +723,7 @@ s16 gHighPassFilterData[15 * 8] = { /* 0xE */ -772, -3, -6985, 17240, -6985, -3, -772, -3, }; -s16 D_80130418[8 * 8] = { +ALIGNED(16) s16 D_80130418[8 * 8] = { /* 0x0 */ 0, 6392, 12539, 18204, 23169, 27244, 30272, 32137, /* 0x1 */ 32767, 32137, 30272, 27244, 23169, 18204, 12539, 6392, /* 0x2 */ 0, -3211, -6392, -9511, -12539, -15446, -18204, -20787, diff --git a/src/audio/lib/load.c b/src/audio/lib/load.c index c542c80620..0d2fe051dd 100644 --- a/src/audio/lib/load.c +++ b/src/audio/lib/load.c @@ -1133,9 +1133,19 @@ void AudioLoad_Init(void* heap, u32 heapSize) { s32 i; u8* audioContextPtr = (u8*)&gAudioCtx; +#ifndef AVOID_UB + //! @bug This clearing loop sets one extra byte to 0 following gAudioCtx. + //! In practice this is harmless as it would set the most significant byte in gAudioCustomUpdateFunction to 0, + //! which was just reset to NULL above. for (i = sizeof(gAudioCtx); i >= 0; i--) { *audioContextPtr++ = 0; } +#else + // Avoid out-of-bounds variable access + for (i = sizeof(gAudioCtx); i > 0; i--) { + *audioContextPtr++ = 0; + } +#endif } // 1000 is a conversion from seconds to milliseconds diff --git a/src/audio/sfx.c b/src/audio/sfx.c index 9f87874678..a11d8dc0ec 100644 --- a/src/audio/sfx.c +++ b/src/audio/sfx.c @@ -33,9 +33,12 @@ ActiveSfx gActiveSfx[7][3]; u8 sCurSfxPlayerChannelIndex; u8 gSfxBankMuted[7]; UnusedBankLerp sUnusedBankLerp[7]; + +#if OOT_DEBUG u16 gAudioSfxSwapSource[10]; u16 gAudioSfxSwapTarget[10]; u8 gAudioSfxSwapMode[10]; +#endif void Audio_SetSfxBanksMute(u16 muteMask) { u8 bankId; diff --git a/src/boot/idle.c b/src/boot/idle.c index f7074bd2fe..dec3006b01 100644 --- a/src/boot/idle.c +++ b/src/boot/idle.c @@ -46,7 +46,8 @@ void Idle_ThreadEntry(void* arg) { PRINTF("ダイナミックバッファのサイズは %d キロバイトです\n", 0x92); PRINTF("FIFOバッファのサイズは %d キロバイトです\n", 0x60); PRINTF("YIELDバッファのサイズは %d キロバイトです\n", 3); - PRINTF("オーディオヒープのサイズは %d キロバイトです\n", ((intptr_t)gSystemHeap - (intptr_t)gAudioHeap) / 1024); + PRINTF("オーディオヒープのサイズは %d キロバイトです\n", + ((intptr_t)&gAudioHeap[ARRAY_COUNT(gAudioHeap)] - (intptr_t)gAudioHeap) / 1024); PRINTF(VT_RST); osCreateViManager(OS_PRIORITY_VIMGR); diff --git a/src/boot/is_debug.c b/src/boot/is_debug.c index b5d077212a..dc2cedc4b8 100644 --- a/src/boot/is_debug.c +++ b/src/boot/is_debug.c @@ -1,11 +1,11 @@ #include "global.h" -OSPiHandle* sISVHandle; // official name : is_Handle - #define gISVDbgPrnAdrs ((ISVDbg*)0xB3FF0000) #define ASCII_TO_U32(a, b, c, d) ((u32)((a << 24) | (b << 16) | (c << 8) | (d << 0))) #if OOT_DEBUG +OSPiHandle* sISVHandle; // official name : is_Handle + void isPrintfInit(void) { sISVHandle = osCartRomInit(); osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, 0); @@ -95,7 +95,7 @@ void* is_proutSyncPrintf(void* arg, const char* str, size_t count) { 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); while (true) { ; diff --git a/src/boot/logutils.c b/src/boot/logutils.c index 1015984820..68fcda21a4 100644 --- a/src/boot/logutils.c +++ b/src/boot/logutils.c @@ -2,7 +2,7 @@ #include "terminal.h" #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) { if (value < min || max < value) { 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; } -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) { if (value < min || max < value) { 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); } -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); 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) { 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) { 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); } #endif -void LogUtils_HungupThread(const char* name, s32 line) { +void LogUtils_HungupThread(const char* name, int line) { OSId threadId = osGetThreadId(NULL); PRINTF("*** HungUp in thread %d, [%s:%d] ***\n", threadId, name, line); diff --git a/src/boot/stackcheck.c b/src/boot/stackcheck.c index f7eefad718..aa0972d2f8 100644 --- a/src/boot/stackcheck.c +++ b/src/boot/stackcheck.c @@ -98,6 +98,11 @@ u32 StackCheck_GetState(StackEntry* entry) { 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, entry->name != NULL ? entry->name : "(null)"); PRINTF(VT_RST); diff --git a/src/boot/yaz0.c b/src/boot/yaz0.c index 448ab38350..8ea1a52959 100644 --- a/src/boot/yaz0.c +++ b/src/boot/yaz0.c @@ -1,6 +1,6 @@ #include "global.h" -u8 sYaz0DataBuffer[0x400]; +ALIGNED(16) u8 sYaz0DataBuffer[0x400]; u8* sYaz0DataBufferEnd; uintptr_t sYaz0CurRomStart; size_t sYaz0CurSize; diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index a949197bf4..4fc8bc370e 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -598,7 +598,7 @@ void DmaMgr_Init(void) { * @see DmaMgr_RequestAsync */ 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->line = line; 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 */ -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; s32 ret; OSMesgQueue queue; diff --git a/src/buffers/audio_heap.c b/src/buffers/audio_heap.c new file mode 100644 index 0000000000..b6474ccc6a --- /dev/null +++ b/src/buffers/audio_heap.c @@ -0,0 +1,3 @@ +#include "z64.h" + +ALIGNED(16) u8 gAudioHeap[0x38000]; diff --git a/src/buffers/gfxbuffers.c b/src/buffers/gfxbuffers.c index 978dede543..fa466bc829 100644 --- a/src/buffers/gfxbuffers.c +++ b/src/buffers/gfxbuffers.c @@ -1,13 +1,9 @@ #include "z64.h" -// 0x18000 bytes -u64 gGfxSPTaskOutputBuffer[0x3000]; +ALIGNED(16) u64 gGfxSPTaskOutputBuffer[0x3000]; -// 0xC00 bytes -u64 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE / sizeof(u64)]; +ALIGNED(16) u64 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE / sizeof(u64)]; -// 0x400 bytes -u64 gGfxSPTaskStack[SP_DRAM_STACK_SIZE64]; +ALIGNED(16) u64 gGfxSPTaskStack[SP_DRAM_STACK_SIZE64]; -// 0x12410 bytes each; 0x24820 bytes total -GfxPool gGfxPools[2]; +ALIGNED(16) GfxPool gGfxPools[2]; diff --git a/src/buffers/heaps.c b/src/buffers/heaps.c deleted file mode 100644 index e39afc33f4..0000000000 --- a/src/buffers/heaps.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "z64.h" - -// 0x38000 bytes -u8 gAudioHeap[0x38000]; - -u8 gSystemHeap[UNK_SIZE]; diff --git a/src/buffers/zbuffer.c b/src/buffers/zbuffer.c index 555d9fdd72..d9e5d2784a 100644 --- a/src/buffers/zbuffer.c +++ b/src/buffers/zbuffer.c @@ -1,4 +1,3 @@ #include "z64.h" -// 0x25800 bytes -u16 gZBuffer[SCREEN_HEIGHT][SCREEN_WIDTH]; +ALIGNED(64) u16 gZBuffer[SCREEN_HEIGHT][SCREEN_WIDTH]; diff --git a/src/code/PreRender.c b/src/code/PreRender.c index f2d7acbf99..df71d059ef 100644 --- a/src/code/PreRender.c +++ b/src/code/PreRender.c @@ -681,6 +681,14 @@ void PreRender_AntiAliasFilter(PreRender* this, s32 x, s32 y) { (((a2) >= (a1)) ? (((a3) >= (a2)) ? (a2) : (((a1) >= (a3)) ? (a1) : (a3))) \ : (((a2) >= (a3)) ? (a2) : (((a3) >= (a1)) ? (a1) : (a3)))) +#if OOT_DEBUG +#define R_HREG_MODE_DEBUG R_HREG_MODE +#else +#define R_HREG_MODE_DEBUG ((void)0, 0) +#endif + +#define PRERENDER_DIVOT_CONTROL (R_HREG_MODE_DEBUG == HREG_MODE_PRERENDER ? R_PRERENDER_DIVOT_CONTROL : 0) + /** * Applies the Video Interface divot filter to an image. * @@ -696,7 +704,7 @@ void PreRender_AntiAliasFilter(PreRender* this, s32 x, s32 y) { void PreRender_DivotFilter(PreRender* this) { s32 x; s32 y; - s32 pad1; + s32 cvg; u8* buffR = alloca(this->width); u8* buffG = alloca(this->width); u8* buffB = alloca(this->width); @@ -704,14 +712,14 @@ void PreRender_DivotFilter(PreRender* this) { s32 pxR; s32 pxG; s32 pxB; + Color_RGBA16 pxIn; + Color_RGBA16 pxOut; for (y = 0; y < this->height; y++) { // The divot filter is applied row-by-row as it only needs to use pixels that are horizontally adjacent // Decompose each pixel into color channels for (x = 0; x < this->width; x++) { - Color_RGBA16 pxIn; - pxIn.rgba = this->fbufSave[x + y * this->width]; buffR[x] = pxIn.r; buffG[x] = pxIn.g; @@ -721,8 +729,7 @@ void PreRender_DivotFilter(PreRender* this) { // Apply the divot filter itself. For pixels with partial coverage, the filter selects the median value from a // window of 3 pixels in a horizontal row and uses that as the value for the center pixel. for (x = 1; x < this->width - 1; x++) { - Color_RGBA16 pxOut; - s32 cvg = this->cvgSave[x + y * this->width]; + cvg = this->cvgSave[x + y * this->width]; // Reject pixels with full coverage. The hardware video filter divot circuit checks if all 3 pixels in the // window have partial coverage, here only the center pixel is checked. @@ -732,11 +739,10 @@ void PreRender_DivotFilter(PreRender* this) { } // This condition is checked before entering this function, it will always pass if it runs. - if ((R_HREG_MODE == HREG_MODE_PRERENDER ? R_PRERENDER_DIVOT_CONTROL : 0) != 0) { - if ((R_HREG_MODE == HREG_MODE_PRERENDER ? R_PRERENDER_DIVOT_CONTROL : 0) != 0) {} + if (PRERENDER_DIVOT_CONTROL != 0) { + if (PRERENDER_DIVOT_CONTROL != 0) {} - if ((R_HREG_MODE == HREG_MODE_PRERENDER ? R_PRERENDER_DIVOT_CONTROL : 0) == - PRERENDER_DIVOT_PARTIAL_CVG_RED) { + if (PRERENDER_DIVOT_CONTROL == PRERENDER_DIVOT_PARTIAL_CVG_RED) { // Fill the pixel with full red, likely for debugging pxR = 31; pxG = 0; @@ -747,8 +753,7 @@ void PreRender_DivotFilter(PreRender* this) { u8* windowG = &buffG[x - 1]; u8* windowB = &buffB[x - 1]; - if ((R_HREG_MODE == HREG_MODE_PRERENDER ? R_PRERENDER_DIVOT_CONTROL : 0) == - PRERENDER_DIVOT_PRINT_COLOR) { + if (PRERENDER_DIVOT_CONTROL == PRERENDER_DIVOT_PRINT_COLOR) { PRINTF("red=%3d %3d %3d %3d grn=%3d %3d %3d %3d blu=%3d %3d %3d %3d \n", windowR[0], windowR[1], windowR[2], MEDIAN3(windowR[0], windowR[1], windowR[2]), windowG[0], windowG[1], windowG[2], MEDIAN3(windowG[0], windowG[1], windowG[2]), windowB[0], windowB[1], @@ -758,8 +763,7 @@ void PreRender_DivotFilter(PreRender* this) { // Sample the median value from the 3 pixel wide window // (Both blocks contain the same code) - if ((R_HREG_MODE == HREG_MODE_PRERENDER ? R_PRERENDER_DIVOT_CONTROL : 0) == - PRERENDER_DIVOT_ALTERNATE_COLOR) { + if (PRERENDER_DIVOT_CONTROL == PRERENDER_DIVOT_ALTERNATE_COLOR) { pxR = MEDIAN3(windowR[0], windowR[1], windowR[2]); pxG = MEDIAN3(windowG[0], windowG[1], windowG[2]); pxB = MEDIAN3(windowB[0], windowB[1], windowB[2]); @@ -803,11 +807,9 @@ void PreRender_ApplyFilters(PreRender* this) { } } -#if OOT_DEBUG - if ((R_HREG_MODE == HREG_MODE_PRERENDER ? R_PRERENDER_DIVOT_CONTROL : 0) != 0) { + if (PRERENDER_DIVOT_CONTROL != 0) { // Apply divot filter PreRender_DivotFilter(this); } -#endif } } diff --git a/src/code/__osMalloc.c b/src/code/__osMalloc.c index 6119f8af07..5c4a423d2c 100644 --- a/src/code/__osMalloc.c +++ b/src/code/__osMalloc.c @@ -100,7 +100,7 @@ void ArenaImpl_UnsetCheckFreeBlock(Arena* arena) { 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->line = line; 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; u32 blockSize; ArenaNode* newNode; @@ -299,7 +299,7 @@ void* __osMalloc_NoLockDebug(Arena* arena, u32 size, const char* file, s32 line) 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; ArenaImpl_Lock(arena); @@ -309,7 +309,7 @@ void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line) { 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* newNode; u32 blockSize; @@ -528,7 +528,7 @@ void __osFree(Arena* arena, void* ptr) { } #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* next; 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); __osFree_NoLockDebug(arena, ptr, file, line); ArenaImpl_Unlock(arena); @@ -695,7 +695,7 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) { } #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); } #endif @@ -852,7 +852,11 @@ u32 __osCheckArena(Arena* arena) { while (iter != NULL) { if (iter && iter->magic == NODE_MAGIC) { // "Oops!! (%08x %08x)" +#if OOT_DEBUG osSyncPrintf(VT_COL(RED, WHITE) "おおっと!! (%08x %08x)\n" VT_RST, iter, iter->magic); +#else + osSyncPrintf("おおっと!! (%08x %08x)\n", iter, iter->magic); +#endif error = 1; break; } diff --git a/src/code/audio_thread_manager.c b/src/code/audio_thread_manager.c index bbec08dead..32c5826a5d 100644 --- a/src/code/audio_thread_manager.c +++ b/src/code/audio_thread_manager.c @@ -105,7 +105,7 @@ void AudioMgr_ThreadEntry(void* arg) { IrqMgr_AddClient(audioMgr->irqMgr, &irqClient, &audioMgr->interruptQueue); // Spin waiting for events - while (true) { + for (;;) { osRecvMesg(&audioMgr->interruptQueue, (OSMesg*)&msg, OS_MESG_BLOCK); switch (*msg) { diff --git a/src/code/code_800FD970.c b/src/code/code_800FD970.c deleted file mode 100644 index cc9dc5e63c..0000000000 --- a/src/code/code_800FD970.c +++ /dev/null @@ -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; -} diff --git a/src/code/debug_malloc.c b/src/code/debug_malloc.c index 1f00167bd2..3ca092bd36 100644 --- a/src/code/debug_malloc.c +++ b/src/code/debug_malloc.c @@ -36,7 +36,7 @@ void* DebugArena_Malloc(u32 size) { } #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); DEBUG_ARENA_CHECK_POINTER(ptr, size, "debug_malloc_DEBUG", "確保"); // "Secure" @@ -52,7 +52,7 @@ void* DebugArena_MallocR(u32 size) { } #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); 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 -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); DEBUG_ARENA_CHECK_POINTER(ptr, newSize, "debug_realloc_DEBUG", "再確保"); // "Re-securing" return ptr; @@ -79,7 +79,7 @@ void DebugArena_Free(void* ptr) { } #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); } #endif diff --git a/src/code/fault.c b/src/code/fault.c index 593613f50f..8b05fb8208 100644 --- a/src/code/fault.c +++ b/src/code/fault.c @@ -1322,7 +1322,7 @@ NORETURN void Fault_AddHungupAndCrashImpl(const char* exp1, const char* exp2) { * Like `Fault_AddHungupAndCrashImpl`, however provides a fixed message containing * 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]; sprintf(msg, "HungUp %s:%d", file, line); diff --git a/src/code/fault_drawer.c b/src/code/fault_drawer.c index 181e682691..8f5fbcbe49 100644 --- a/src/code/fault_drawer.c +++ b/src/code/fault_drawer.c @@ -102,11 +102,11 @@ FaultDrawer sFaultDrawerDefault = { #ifndef NON_MATCHING // TODO: match .bss (has reordering issues) extern FaultDrawer sFaultDrawer; -extern char D_8016B6BC[0x24]; +extern char D_8016B6C0[0x20]; #else // Non-matching version for struct shiftability FaultDrawer sFaultDrawer; -char D_8016B6BC[0x24]; +char D_8016B6C0[0x20]; #endif void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) { diff --git a/src/code/game.c b/src/code/game.c index ea6e399f5b..7d290e3329 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -6,10 +6,11 @@ VisCvg sVisCvg; VisZBuf sVisZBuf; VisMono sVisMono; ViMode sViMode; + +#if OOT_DEBUG FaultClient sGameFaultClient; u16 sLastButtonPressed; -#if OOT_DEBUG void GameState_FaultPrint(void) { static char sBtnChars[] = "ABZSuldr*+LRudlr"; s32 i; @@ -408,7 +409,10 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g gameState->destroy = NULL; gameState->running = 1; 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; @@ -494,7 +498,7 @@ u32 GameState_IsRunning(GameState* gameState) { } #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; if (THA_IsCrash(&gameState->tha)) { diff --git a/src/code/gamealloc.c b/src/code/gamealloc.c index c5e8e52432..b80ece7b26 100644 --- a/src/code/gamealloc.c +++ b/src/code/gamealloc.c @@ -13,7 +13,7 @@ void GameAlloc_Log(GameAlloc* this) { } #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); if (ptr != NULL) { diff --git a/src/code/graph.c b/src/code/graph.c index 36cfa633d9..4f230b205d 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -14,8 +14,13 @@ OSTime sGraphPrevUpdateEndTime; */ OSTime sGraphPrevTaskTimeStart; +#if OOT_DEBUG FaultClient sGraphFaultClient; +#endif + CfbInfo sGraphCfbInfos[3]; + +#if OOT_DEBUG FaultClient sGraphUcodeFaultClient; UCodeInfo D_8012D230[3] = { @@ -30,7 +35,6 @@ UCodeInfo D_8012D248[3] = { { UCODE_S2DEX, gspS2DEX2d_fifoTextStart }, }; -#if OOT_DEBUG void Graph_FaultClient(void) { void* nextFb = osViGetNextFramebuffer(); 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 -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) { dispRefs[0] = gfxCtx->polyOpa.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 (dispRefs[0] + 1 == gfxCtx->polyOpa.p) { gfxCtx->polyOpa.p = dispRefs[0]; diff --git a/src/code/main.c b/src/code/main.c index 15eeed80c4..13a96e2633 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -1,6 +1,8 @@ #include "global.h" #include "terminal.h" +extern u8 _buffersSegmentEnd[]; + s32 gScreenWidth = SCREEN_WIDTH; s32 gScreenHeight = SCREEN_HEIGHT; u32 gSystemHeapSize = 0; @@ -29,7 +31,8 @@ OSMesg sSerialMsgBuf[1]; void Main_LogSystemHeap(void) { PRINTF(VT_FGCOL(GREEN)); // "System heap size% 08x (% dKB) Start address% 08x" - PRINTF("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", gSystemHeapSize, gSystemHeapSize / 1024, gSystemHeap); + PRINTF("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", gSystemHeapSize, gSystemHeapSize / 1024, + _buffersSegmentEnd); PRINTF(VT_RST); } #endif @@ -48,7 +51,7 @@ void Main(void* arg) { PreNmiBuff_Init(gAppNmiBufferPtr); Fault_Init(); SysCfb_Init(0); - systemHeapStart = (uintptr_t)gSystemHeap; + systemHeapStart = (uintptr_t)_buffersSegmentEnd; fb = (uintptr_t)SysCfb_GetFbPtr(0); gSystemHeapSize = fb - systemHeapStart; // "System heap initalization" diff --git a/src/code/rand.c b/src/code/rand.c new file mode 100644 index 0000000000..4a0c5dc4a3 --- /dev/null +++ b/src/code/rand.c @@ -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; +} diff --git a/src/code/sched.c b/src/code/sched.c index b398f3e457..fbfc42dc07 100644 --- a/src/code/sched.c +++ b/src/code/sched.c @@ -45,14 +45,14 @@ #define RDP_DONE_MSG 668 #define NOTIFY_MSG 670 // original name: ENTRY_MSG -vs32 sSchedDebugPrintfEnabled = false; - OSTime sRSPGfxTimeStart; OSTime sRSPAudioTimeStart; OSTime sRSPOtherTimeStart; OSTime sRDPTimeStart; #if OOT_DEBUG +vs32 sSchedDebugPrintfEnabled = false; + #define SCHED_DEBUG_PRINTF \ if (sSchedDebugPrintfEnabled) \ PRINTF diff --git a/src/code/sys_matrix.c b/src/code/sys_matrix.c index b90ddaad52..2ca6e4cf47 100644 --- a/src/code/sys_matrix.c +++ b/src/code/sys_matrix.c @@ -605,11 +605,11 @@ Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) { #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); } -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); } @@ -970,7 +970,7 @@ void Matrix_RotateAxis(f32 angle, Vec3f* axis, u8 mode) { } #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; for (i = 0; i < 4; i++) { diff --git a/src/code/system_malloc.c b/src/code/system_malloc.c index 74e69ed46f..efee95dbdc 100644 --- a/src/code/system_malloc.c +++ b/src/code/system_malloc.c @@ -36,7 +36,7 @@ void* SystemArena_Malloc(u32 size) { } #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); SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_DEBUG", "確保"); // "Secure" @@ -52,7 +52,7 @@ void* SystemArena_MallocR(u32 size) { } #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); SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_r_DEBUG", "確保"); // "Secure" @@ -67,7 +67,7 @@ void* SystemArena_Realloc(void* ptr, u32 newSize) { } #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); SYSTEM_ARENA_CHECK_POINTER(ptr, newSize, "realloc_DEBUG", "再確保"); // "Re-securing" return ptr; @@ -79,7 +79,7 @@ void SystemArena_Free(void* ptr) { } #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); } #endif diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c index 23159e7ede..0dd90d3352 100644 --- a/src/code/z_actor_dlftbls.c +++ b/src/code/z_actor_dlftbls.c @@ -23,6 +23,8 @@ #undef DEFINE_ACTOR_UNSET // Actor Overlay Table definition +#if OOT_DEBUG + #define DEFINE_ACTOR(name, _1, allocType, nameString) \ { (uintptr_t)_ovl_##name##SegmentRomStart, \ (uintptr_t)_ovl_##name##SegmentRomEnd, \ @@ -37,6 +39,24 @@ #define DEFINE_ACTOR_INTERNAL(name, _1, allocType, nameString) \ { 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 }, ActorOverlay gActorOverlayTable[] = { diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 488d9464f8..4906fc556e 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -79,10 +79,11 @@ u16 sSurfaceMaterialToSfxOffset[SURFACE_MATERIAL_MAX] = { SURFACE_SFX_OFFSET_CARPET, // SURFACE_MATERIAL_CARPET }; +#if OOT_DEBUG /** * 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 || pos->y <= -BGCHECK_XYZ_ABSMAX || pos->z >= BGCHECK_XYZ_ABSMAX || pos->z <= -BGCHECK_XYZ_ABSMAX) { PRINTF(VT_FGCOL(RED)); @@ -94,6 +95,7 @@ s32 BgCheck_PosErrorCheck(Vec3f* pos, char* file, s32 line) { } return false; } +#endif /** * Set SSNode @@ -194,30 +196,24 @@ void BgCheck_Vec3fToVec3s(Vec3s* dst, Vec3f* src) { * Get CollisionPoly's lowest y point */ s16 CollisionPoly_GetMinY(CollisionPoly* poly, Vec3s* vtxList) { - s32 a; - s32 b; - s32 c; - s16 min; - //! @bug Due to rounding errors, some polys with a slight slope have a y normal of 1.0f/-1.0f. As such, this //! optimization returns the wrong minimum y for a subset of these polys. if (poly->normal.y == COLPOLY_SNORMAL(1.0f) || poly->normal.y == COLPOLY_SNORMAL(-1.0f)) { return vtxList[COLPOLY_VTX_INDEX(poly->flags_vIA)].y; - } + } else { + s32 a = COLPOLY_VTX_INDEX(poly->flags_vIA); + s32 b = COLPOLY_VTX_INDEX(poly->flags_vIB); + s32 c = poly->vIC; + s16 min = vtxList[a].y; - a = COLPOLY_VTX_INDEX(poly->flags_vIA); - b = COLPOLY_VTX_INDEX(poly->flags_vIB); - c = poly->vIC; - - min = vtxList[a].y; - - if (min > vtxList[b].y) { - min = vtxList[b].y; + if (min > vtxList[b].y) { + min = vtxList[b].y; + } + if (min < vtxList[c].y) { + return min; + } + return vtxList[c].y; } - if (min < vtxList[c].y) { - return min; - } - return vtxList[c].y; } /** @@ -491,8 +487,8 @@ void StaticLookup_AddPolyToSSList(CollisionContext* colCtx, SSList* ssList, Coll SSNode* curNode; SSNode* nextNode; s32 polyYMin; - u16 newNodeId; s16 curPolyId; + u16 newNodeId; // if list is null if (ssList->head == SS_NULL) { @@ -514,6 +510,8 @@ void StaticLookup_AddPolyToSSList(CollisionContext* colCtx, SSList* ssList, Coll while (true) { // if at the end of the list if (curNode->next == SS_NULL) { + s32 pad; + newNodeId = SSNodeList_GetNextNodeIdx(&colCtx->polyNodes); SSNode_SetValue(&colCtx->polyNodes.tbl[newNodeId], &polyId, SS_NULL); curNode->next = newNodeId; @@ -681,8 +679,8 @@ s32 BgCheck_ComputeWallDisplacement(CollisionContext* colCtx, CollisionPoly* pol s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 xpFlags, f32* outX, f32* outZ, Vec3f* pos, f32 radius, CollisionPoly** outPoly) { Vec3f resultPos; - f32 temp_f2; - f32 temp_f2_2; + f32 zTemp; + f32 xTemp; f32 planeDist; f32 intersect; s32 result; @@ -690,17 +688,14 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 CollisionPoly* polyList; SSNode* curNode; f32 invNormalXZ; - f32 zTemp; - f32 xTemp; s32 polyId; f32 normalXZ; f32 nx; f32 ny; f32 nz; - f32 temp_f16; + s32 pad; Vec3s* vtxList; - u16 pad; - + f32 temp_f16; f32 zMin; f32 zMax; f32 xMin; @@ -780,8 +775,10 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 } } if (CollisionPoly_CheckZIntersectApprox(curPoly, vtxList, resultPos.x, pos->y, &intersect)) { - if (fabsf(intersect - resultPos.z) <= radius / temp_f16) { - if ((intersect - resultPos.z) * nz <= 4.0f) { + f32 zIntersectDist = intersect - resultPos.z; + + if (fabsf(zIntersectDist) <= radius / temp_f16) { + if (zIntersectDist * nz <= 4.0f) { BgCheck_ComputeWallDisplacement(colCtx, curPoly, &resultPos.x, &resultPos.z, nx, ny, nz, invNormalXZ, planeDist, radius, outPoly); result = true; @@ -790,9 +787,8 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 } if (curNode->next == SS_NULL) { break; - } else { - curNode = &colCtx->polyNodes.tbl[curNode->next]; } + curNode = &colCtx->polyNodes.tbl[curNode->next]; } curNode = &colCtx->polyNodes.tbl[lookup->wall.head]; @@ -861,8 +857,10 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 } } if (CollisionPoly_CheckXIntersectApprox(curPoly, vtxList, pos->y, resultPos.z, &intersect)) { - if (fabsf(intersect - resultPos.x) <= radius / temp_f16) { - if ((intersect - resultPos.x) * nx <= 4.0f) { + f32 xIntersectDist = intersect - resultPos.x; + + if (fabsf(xIntersectDist) <= radius / temp_f16) { + if (xIntersectDist * nx <= 4.0f) { BgCheck_ComputeWallDisplacement(colCtx, curPoly, &resultPos.x, &resultPos.z, nx, ny, nz, invNormalXZ, planeDist, radius, outPoly); result = true; @@ -871,10 +869,8 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 } if (curNode->next == SS_NULL) { break; - } else { - curNode = &colCtx->polyNodes.tbl[curNode->next]; - continue; } + curNode = &colCtx->polyNodes.tbl[curNode->next]; } *outX = resultPos.x; @@ -909,6 +905,9 @@ s32 BgCheck_CheckStaticCeiling(StaticLookup* lookup, u16 xpFlags, CollisionConte *outY = pos->y; while (true) { + f32 intersectDist; + f32 ny; + curPolyId = curNode->polyId; if (COLPOLY_VTX_CHECK_FLAGS_ANY(colCtx->colHeader->polyList[curPolyId].flags_vIA, xpFlags)) { if (curNode->next == SS_NULL) { @@ -921,8 +920,8 @@ s32 BgCheck_CheckStaticCeiling(StaticLookup* lookup, u16 xpFlags, CollisionConte curPoly = &polyList[curPolyId]; if (CollisionPoly_CheckYIntersectApprox2(curPoly, vtxList, pos->x, pos->z, &ceilingY)) { - f32 intersectDist = ceilingY - *outY; - f32 ny = COLPOLY_GET_NORMAL(curPoly->normal.y); + intersectDist = ceilingY - *outY; + ny = COLPOLY_GET_NORMAL(curPoly->normal.y); if (intersectDist > 0.0f && intersectDist < checkHeight && intersectDist * ny <= 0) { *outY = ceilingY - checkHeight; @@ -958,7 +957,6 @@ s32 BgCheck_CheckLineAgainstSSList(SSList* ssList, CollisionContext* colCtx, u16 s32 result; f32 minY; f32 distSq; - s16 polyId; result = false; polyList = colCtx->colHeader->polyList; @@ -968,7 +966,8 @@ s32 BgCheck_CheckLineAgainstSSList(SSList* ssList, CollisionContext* colCtx, u16 curNode = &colCtx->polyNodes.tbl[ssList->head]; while (true) { - polyId = curNode->polyId; + s16 polyId = curNode->polyId; + checkedPoly = &colCtx->polyNodes.polyCheckTbl[polyId]; if (*checkedPoly == true || COLPOLY_VTX_CHECK_FLAGS_ANY(polyList[polyId].flags_vIA, xpFlags1) || @@ -1051,13 +1050,12 @@ s32 BgCheck_SphVsFirstStaticPolyList(SSNode* node, u16 xpFlags, CollisionContext CollisionPoly** outPoly) { CollisionPoly* polyList = colCtx->colHeader->polyList; Vec3s* vtxList = colCtx->colHeader->vtxList; - CollisionPoly* curPoly; - u16 nextId; - s16 curPolyId; while (true) { - curPolyId = node->polyId; - curPoly = &polyList[curPolyId]; + u16 nextId; + s16 curPolyId = node->polyId; + CollisionPoly* curPoly = &polyList[curPolyId]; + if (COLPOLY_VTX_CHECK_FLAGS_ANY(colCtx->colHeader->polyList[curPolyId].flags_vIA, xpFlags)) { if (node->next == SS_NULL) { break; @@ -1542,10 +1540,10 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader u32 tblMax; u32 memSize; u32 lookupTblMemSize; - SSNodeList* nodeList; - s32 useCustomSubdivisions; - u32 customMemSize; s32 customNodeListMax; + SSNodeList* nodeList; + u32 customMemSize; + s32 useCustomSubdivisions; s32 i; colCtx->colHeader = colHeader; @@ -1717,11 +1715,15 @@ f32 BgCheck_RaycastDownImpl(PlayState* play, CollisionContext* colCtx, u16 xpFla if (checkPos.y < colCtx->minBounds.y) { break; } + +#if OOT_DEBUG if (BgCheck_PosErrorCheck(&checkPos, "../z_bgcheck.c", 4410)) { if (actor != NULL) { PRINTF("こいつ,pself_actor->name %d\n", actor->id); } } +#endif + lookup = BgCheck_GetStaticLookup(colCtx, lookupTbl, &checkPos); if (lookup == NULL) { checkPos.y -= colCtx->subdivLength.y; @@ -1735,16 +1737,16 @@ f32 BgCheck_RaycastDownImpl(PlayState* play, CollisionContext* colCtx, u16 xpFla checkPos.y -= colCtx->subdivLength.y; } + dynaRaycastDown.play = play; dynaRaycastDown.colCtx = colCtx; dynaRaycastDown.xpFlags = xpFlags; + dynaRaycastDown.resultPoly = outPoly; dynaRaycastDown.yIntersect = yIntersect; dynaRaycastDown.pos = pos; + dynaRaycastDown.bgId = outBgId; dynaRaycastDown.actor = actor; dynaRaycastDown.downChkFlags = downChkFlags; dynaRaycastDown.chkDist = chkDist; - dynaRaycastDown.play = play; - dynaRaycastDown.resultPoly = outPoly; - dynaRaycastDown.bgId = outBgId; yIntersectDyna = BgCheck_RaycastDownDyna(&dynaRaycastDown); @@ -1951,11 +1953,11 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul Vec3f checkLinePrev; f32 n2XZDist; f32 n3XZDist; - f32 nx3, nz3; s32 bccFlags; + f32 nx; + f32 nz; Vec3f posIntersect2; s32 bgId2; - f32 nx, ny, nz; // unit normal of polygon result = false; *outBgId = BGCHECK_SCENE; @@ -1966,12 +1968,14 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul dy = posNext->y - posPrev->y; dz = posNext->z - posPrev->z; +#if OOT_DEBUG if (BgCheck_PosErrorCheck(posNext, "../z_bgcheck.c", 4831) == true || BgCheck_PosErrorCheck(posPrev, "../z_bgcheck.c", 4832) == true) { if (actor != NULL) { PRINTF("こいつ,pself_actor->name %d\n", actor->id); } } +#endif // if there's movement on the xz plane, and argA flag is 0, if ((dx != 0.0f || dz != 0.0f) && (argA & 1) == 0) { @@ -1980,7 +1984,8 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul result = BgCheck_CheckLineImpl(colCtx, xpFlags, COLPOLY_IGNORE_NONE, posPrev, posNext, &posIntersect, &poly, &bgId, actor, 1.0f, BGCHECK_CHECK_ALL & ~BGCHECK_CHECK_CEILING); if (result) { - ny = COLPOLY_GET_NORMAL(poly->normal.y); + f32 ny = COLPOLY_GET_NORMAL(poly->normal.y); + // if poly is floor, push result underneath the floor if (ny > 0.5f) { posResult->x = posIntersect.x; @@ -2061,8 +2066,9 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul if (dynaPolyCollision == true || *outBgId != BGCHECK_SCENE) { if (BgCheck_CheckLineImpl(colCtx, xpFlags, COLPOLY_IGNORE_NONE, posPrev, posResult, &posIntersect2, &poly, &bgId2, actor, 1.0f, BGCHECK_CHECK_ONE_FACE | BGCHECK_CHECK_WALL)) { - nx3 = COLPOLY_GET_NORMAL(poly->normal.x); - nz3 = COLPOLY_GET_NORMAL(poly->normal.z); + f32 nx3 = COLPOLY_GET_NORMAL(poly->normal.x); + f32 nz3 = COLPOLY_GET_NORMAL(poly->normal.z); + n3XZDist = sqrtf(SQ(nx3) + SQ(nz3)); // if poly is not a "flat" floor or "flat" ceiling @@ -2155,11 +2161,15 @@ s32 BgCheck_CheckCeilingImpl(CollisionContext* colCtx, u16 xpFlags, f32* outY, V *outBgId = BGCHECK_SCENE; *outY = pos->y; + +#if OOT_DEBUG if (BgCheck_PosErrorCheck(pos, "../z_bgcheck.c", 5206) == true) { if (actor != NULL) { PRINTF("こいつ,pself_actor->name %d\n", actor->id); } } +#endif + lookupTbl = colCtx->lookupTbl; if (!BgCheck_PosInStaticBoundingBox(colCtx, pos)) { return false; @@ -2222,13 +2232,10 @@ s32 BgCheck_CheckLineImpl(CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, Vec3f posBTemp = *posB; Vec3f sectorMin; Vec3f sectorMax; - s32 k; - StaticLookup* lookup; - s32 j; - StaticLookup* jLookup; - s32 temp_lo; *outBgId = BGCHECK_SCENE; + +#if OOT_DEBUG if (BgCheck_PosErrorCheck(posA, "../z_bgcheck.c", 5334) == true || BgCheck_PosErrorCheck(posB, "../z_bgcheck.c", 5335) == true) { if (actor != NULL) { @@ -2237,6 +2244,7 @@ s32 BgCheck_CheckLineImpl(CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, PRINTF("pself_actor == NULLで犯人不明\n"); } } +#endif BgCheck_ResetPolyCheckTbl(&colCtx->polyNodes, colCtx->colHeader->numPolygons); BgCheck_GetStaticLookupIndicesFromPos(colCtx, posA, (Vec3i*)&subdivMin); @@ -2247,6 +2255,10 @@ s32 BgCheck_CheckLineImpl(CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, *outPoly = NULL; if (subdivMin[0] != subdivMax[0] || subdivMin[1] != subdivMax[1] || subdivMin[2] != subdivMax[2]) { + s32 k; + s32 temp_lo; + s32 j; + for (i = 0; i < 3; i++) { if (subdivMax[i] < subdivMin[i]) { j = subdivMax[i]; @@ -2260,12 +2272,14 @@ s32 BgCheck_CheckLineImpl(CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, sectorMax.z = colCtx->subdivLength.z + sectorMin.z; for (i = subdivMin[2]; i < subdivMax[2] + 1; i++) { - jLookup = iLookup + subdivMin[1] * colCtx->subdivAmount.x; + StaticLookup* jLookup = iLookup + subdivMin[1] * colCtx->subdivAmount.x; + sectorMin.y = subdivMin[1] * colCtx->subdivLength.y + colCtx->minBounds.y; sectorMax.y = colCtx->subdivLength.y + sectorMin.y; for (j = subdivMin[1]; j < subdivMax[1] + 1; j++) { - lookup = jLookup + subdivMin[0]; + StaticLookup* lookup = jLookup + subdivMin[0]; + sectorMin.x = subdivMin[0] * colCtx->subdivLength.x + colCtx->minBounds.x; sectorMax.x = colCtx->subdivLength.x + sectorMin.x; @@ -2443,11 +2457,14 @@ s32 BgCheck_SphVsFirstPolyImpl(CollisionContext* colCtx, u16 xpFlags, CollisionP StaticLookup* lookup; *outBgId = BGCHECK_SCENE; + +#if OOT_DEBUG if (BgCheck_PosErrorCheck(center, "../z_bgcheck.c", 5852) == true) { if (actor != NULL) { PRINTF("こいつ,pself_actor->name %d\n", actor->id); } } +#endif lookup = BgCheck_GetStaticLookup(colCtx, colCtx->lookupTbl, center); if (lookup == NULL) { @@ -2784,12 +2801,12 @@ void DynaPoly_DeleteBgActor(PlayState* play, DynaCollisionContext* dyna, s32 bgI PRINTF(VT_RST); if (!DynaPoly_IsBgIdBgActor(bgId)) { +#if OOT_DEBUG if (bgId == -1) { PRINTF(VT_FGCOL(GREEN)); // "The index that should have been deleted(? ) was(== -1), processing aborted." PRINTF("DynaPolyInfo_delReserve():削除されているはずの(?)\nインデックス(== -1)のため,処理を中止します。\n"); PRINTF(VT_RST); - return; } else { PRINTF(VT_FGCOL(RED)); // "Unable to deallocate index / index unallocated, processing aborted." @@ -2797,15 +2814,17 @@ void DynaPoly_DeleteBgActor(PlayState* play, DynaCollisionContext* dyna, s32 bgI "確保していない/出来なかったインデックスの解放のため、処理を中止します。index == %d\n", bgId); PRINTF(VT_RST); - return; } - } - actor = DynaPoly_GetActor(&play->colCtx, bgId); - if (actor != NULL) { +#endif - actor->bgId = BGACTOR_NEG_ONE; - dyna->bgActors[bgId].actor = NULL; - dyna->bgActorFlags[bgId] |= BGACTOR_1; + } else { + actor = DynaPoly_GetActor(&play->colCtx, bgId); + if (actor != NULL) { + + actor->bgId = BGACTOR_NEG_ONE; + dyna->bgActors[bgId].actor = NULL; + dyna->bgActorFlags[bgId] |= BGACTOR_1; + } } } @@ -2821,7 +2840,7 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3 MtxF mtx; Actor* actor; s32 pad; - s32 pad2; + f32 radiusSq; f32 numVtxInverse; s32 i; Vec3f pos; @@ -2851,6 +2870,7 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3 return; } +#if OOT_DEBUG if (!(dyna->polyListMax >= *polyStartIndex + pbgdata->numPolygons)) { PRINTF(VT_FGCOL(RED)); // "do not use if %d exceeds %d" @@ -2869,6 +2889,7 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3 "pdyna_poly_info->poly_num >= *pstart_poly_index + pbgdata->poly_num", "../z_bgcheck.c", 6687); ASSERT(dyna->vtxListMax >= *vtxStartIndex + pbgdata->numVertices, "pdyna_poly_info->vert_num >= *pstart_vert_index + pbgdata->vtx_num", "../z_bgcheck.c", 6688); +#endif if (!(dyna->bitFlag & DYNAPOLY_INVALIDATE_LOOKUP) && (BgActor_IsTransformUnchanged(&dyna->bgActors[bgId]) == true)) { @@ -2898,111 +2919,111 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3 *polyStartIndex += pbgdata->numPolygons; *vtxStartIndex += pbgdata->numVertices; - } else { - SkinMatrix_SetTranslateRotateYXZScale( - &mtx, dyna->bgActors[bgId].curTransform.scale.x, dyna->bgActors[bgId].curTransform.scale.y, - dyna->bgActors[bgId].curTransform.scale.z, dyna->bgActors[bgId].curTransform.rot.x, - dyna->bgActors[bgId].curTransform.rot.y, dyna->bgActors[bgId].curTransform.rot.z, - dyna->bgActors[bgId].curTransform.pos.x, dyna->bgActors[bgId].curTransform.pos.y, - dyna->bgActors[bgId].curTransform.pos.z); - - numVtxInverse = 1.0f / pbgdata->numVertices; - newCenterPoint.x = newCenterPoint.y = newCenterPoint.z = 0.0f; - for (i = 0; i < pbgdata->numVertices; i++) { - Vec3f vtx; - Vec3f vtxT; // Vtx after mtx transform - - Math_Vec3s_ToVec3f(&vtx, &pbgdata->vtxList[i]); - SkinMatrix_Vec3fMtxFMultXYZ(&mtx, &vtx, &vtxT); - BgCheck_Vec3fToVec3s(&dyna->vtxList[*vtxStartIndex + i], &vtxT); - - if (i == 0) { - dyna->bgActors[bgId].minY = dyna->bgActors[bgId].maxY = vtxT.y; - } else if (vtxT.y < dyna->bgActors[bgId].minY) { - dyna->bgActors[bgId].minY = vtxT.y; - } else if (dyna->bgActors[bgId].maxY < vtxT.y) { - dyna->bgActors[bgId].maxY = vtxT.y; - } - newCenterPoint.x += vtxT.x; - newCenterPoint.y += vtxT.y; - newCenterPoint.z += vtxT.z; - } - - newCenterPoint.x *= numVtxInverse; - newCenterPoint.y *= numVtxInverse; - newCenterPoint.z *= numVtxInverse; - sphere->center.x = newCenterPoint.x; - sphere->center.y = newCenterPoint.y; - sphere->center.z = newCenterPoint.z; - newRadiusSq = -SQ(10.0f); - - for (i = 0; i < pbgdata->numVertices; i++) { - f32 radiusSq; - - newVtx.x = dyna->vtxList[*vtxStartIndex + i].x; - newVtx.y = dyna->vtxList[*vtxStartIndex + i].y; - newVtx.z = dyna->vtxList[*vtxStartIndex + i].z; - radiusSq = Math3D_Vec3fDistSq(&newVtx, &newCenterPoint); - if (newRadiusSq < radiusSq) { - newRadiusSq = radiusSq; - } - } - - sphere->radius = sqrtf(newRadiusSq) * 1.1f; - - for (i = 0; i < pbgdata->numPolygons; i++) { - CollisionPoly* newPoly = &dyna->polyList[*polyStartIndex + i]; - f32 newNormMagnitude; - - *newPoly = pbgdata->polyList[i]; - - // Yeah, this is all kinds of fake, but my God, it matches. - newPoly->flags_vIA = (COLPOLY_VTX_INDEX(newPoly->flags_vIA) + *vtxStartIndex) | - COLPOLY_VTX_FLAGS_MASKED((*newPoly).flags_vIA); - newPoly->flags_vIB = (COLPOLY_VTX_INDEX(newPoly->flags_vIB) + *vtxStartIndex) | - COLPOLY_VTX_FLAGS_MASKED((*newPoly).flags_vIB); - newPoly->vIC = *vtxStartIndex + newPoly->vIC; - dVtxList = dyna->vtxList; - vtxA.x = dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIA)].x; - vtxA.y = dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIA)].y; - vtxA.z = dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIA)].z; - vtxB.x = dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIB)].x; - vtxB.y = dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIB)].y; - vtxB.z = dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIB)].z; - vtxC.x = dVtxList[newPoly->vIC].x; - vtxC.y = dVtxList[newPoly->vIC].y; - vtxC.z = dVtxList[newPoly->vIC].z; - Math3D_SurfaceNorm(&vtxA, &vtxB, &vtxC, &newNormal); - newNormMagnitude = Math3D_Vec3fMagnitude(&newNormal); - - if (!IS_ZERO(newNormMagnitude)) { - newNormal.x *= (1.0f / newNormMagnitude); - newNormal.y *= (1.0f / newNormMagnitude); - newNormal.z *= (1.0f / newNormMagnitude); - newPoly->normal.x = COLPOLY_SNORMAL(newNormal.x); - newPoly->normal.y = COLPOLY_SNORMAL(newNormal.y); - newPoly->normal.z = COLPOLY_SNORMAL(newNormal.z); - } - - newPoly->dist = -DOTXYZ(newNormal, dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIA)]); - if (newNormal.y > 0.5f) { - s16 polyId = *polyStartIndex + i; - - DynaSSNodeList_SetSSListHead(&dyna->polyNodes, &dyna->bgActors[bgId].dynaLookup.floor, &polyId); - } else if (newNormal.y < -0.8f) { - s16 polyId = *polyStartIndex + i; - - DynaSSNodeList_SetSSListHead(&dyna->polyNodes, &dyna->bgActors[bgId].dynaLookup.ceiling, &polyId); - } else { - s16 polyId = *polyStartIndex + i; - - DynaSSNodeList_SetSSListHead(&dyna->polyNodes, &dyna->bgActors[bgId].dynaLookup.wall, &polyId); - } - } - - *polyStartIndex += pbgdata->numPolygons; - *vtxStartIndex += pbgdata->numVertices; + return; } + + SkinMatrix_SetTranslateRotateYXZScale( + &mtx, dyna->bgActors[bgId].curTransform.scale.x, dyna->bgActors[bgId].curTransform.scale.y, + dyna->bgActors[bgId].curTransform.scale.z, dyna->bgActors[bgId].curTransform.rot.x, + dyna->bgActors[bgId].curTransform.rot.y, dyna->bgActors[bgId].curTransform.rot.z, + dyna->bgActors[bgId].curTransform.pos.x, dyna->bgActors[bgId].curTransform.pos.y, + dyna->bgActors[bgId].curTransform.pos.z); + + numVtxInverse = 1.0f / pbgdata->numVertices; + newCenterPoint.x = newCenterPoint.y = newCenterPoint.z = 0.0f; + for (i = 0; i < pbgdata->numVertices; i++) { + Vec3f vtx; + Vec3f vtxT; // Vtx after mtx transform + s32 pad2; + + Math_Vec3s_ToVec3f(&vtx, &pbgdata->vtxList[i]); + SkinMatrix_Vec3fMtxFMultXYZ(&mtx, &vtx, &vtxT); + BgCheck_Vec3fToVec3s(&dyna->vtxList[*vtxStartIndex + i], &vtxT); + + if (i == 0) { + dyna->bgActors[bgId].minY = dyna->bgActors[bgId].maxY = vtxT.y; + } else if (vtxT.y < dyna->bgActors[bgId].minY) { + dyna->bgActors[bgId].minY = vtxT.y; + } else if (dyna->bgActors[bgId].maxY < vtxT.y) { + dyna->bgActors[bgId].maxY = vtxT.y; + } + newCenterPoint.x += vtxT.x; + newCenterPoint.y += vtxT.y; + newCenterPoint.z += vtxT.z; + } + + newCenterPoint.x *= numVtxInverse; + newCenterPoint.y *= numVtxInverse; + newCenterPoint.z *= numVtxInverse; + sphere->center.x = newCenterPoint.x; + sphere->center.y = newCenterPoint.y; + sphere->center.z = newCenterPoint.z; + newRadiusSq = -SQ(10.0f); + + for (i = 0; i < pbgdata->numVertices; i++) { + newVtx.x = dyna->vtxList[*vtxStartIndex + i].x; + newVtx.y = dyna->vtxList[*vtxStartIndex + i].y; + newVtx.z = dyna->vtxList[*vtxStartIndex + i].z; + radiusSq = Math3D_Vec3fDistSq(&newVtx, &newCenterPoint); + if (newRadiusSq < radiusSq) { + newRadiusSq = radiusSq; + } + } + + sphere->radius = sqrtf(newRadiusSq) * 1.1f; + + for (i = 0; i < pbgdata->numPolygons; i++) { + CollisionPoly* newPoly = &dyna->polyList[*polyStartIndex + i]; + f32 newNormMagnitude; + + *newPoly = pbgdata->polyList[i]; + + // Yeah, this is all kinds of fake, but my God, it matches. + newPoly->flags_vIA = + (COLPOLY_VTX_INDEX(newPoly->flags_vIA) + *vtxStartIndex) | COLPOLY_VTX_FLAGS_MASKED((*newPoly).flags_vIA); + newPoly->flags_vIB = + (COLPOLY_VTX_INDEX(newPoly->flags_vIB) + *vtxStartIndex) | COLPOLY_VTX_FLAGS_MASKED((*newPoly).flags_vIB); + newPoly->vIC = *vtxStartIndex + newPoly->vIC; + dVtxList = dyna->vtxList; + vtxA.x = dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIA)].x; + vtxA.y = dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIA)].y; + vtxA.z = dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIA)].z; + vtxB.x = dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIB)].x; + vtxB.y = dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIB)].y; + vtxB.z = dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIB)].z; + vtxC.x = dVtxList[newPoly->vIC].x; + vtxC.y = dVtxList[newPoly->vIC].y; + vtxC.z = dVtxList[newPoly->vIC].z; + Math3D_SurfaceNorm(&vtxA, &vtxB, &vtxC, &newNormal); + newNormMagnitude = Math3D_Vec3fMagnitude(&newNormal); + + if (!IS_ZERO(newNormMagnitude)) { + newNormal.x *= (1.0f / newNormMagnitude); + newNormal.y *= (1.0f / newNormMagnitude); + newNormal.z *= (1.0f / newNormMagnitude); + newPoly->normal.x = COLPOLY_SNORMAL(newNormal.x); + newPoly->normal.y = COLPOLY_SNORMAL(newNormal.y); + newPoly->normal.z = COLPOLY_SNORMAL(newNormal.z); + } + + newPoly->dist = -DOTXYZ(newNormal, dVtxList[(u32)COLPOLY_VTX_INDEX(newPoly->flags_vIA)]); + if (newNormal.y > 0.5f) { + s16 polyId = *polyStartIndex + i; + + DynaSSNodeList_SetSSListHead(&dyna->polyNodes, &dyna->bgActors[bgId].dynaLookup.floor, &polyId); + } else if (newNormal.y < -0.8f) { + s16 polyId = *polyStartIndex + i; + + DynaSSNodeList_SetSSListHead(&dyna->polyNodes, &dyna->bgActors[bgId].dynaLookup.ceiling, &polyId); + } else { + s16 polyId = *polyStartIndex + i; + + DynaSSNodeList_SetSSListHead(&dyna->polyNodes, &dyna->bgActors[bgId].dynaLookup.wall, &polyId); + } + } + + *polyStartIndex += pbgdata->numPolygons; + *vtxStartIndex += pbgdata->numVertices; } void DynaPoly_UnsetAllInteractFlags(PlayState* play, DynaCollisionContext* dyna, Actor* actor) { @@ -3155,7 +3176,7 @@ f32 BgCheck_RaycastDownDyna(DynaRaycastDown* dynaRaycastDown) { s32 i2; s32 isPaused; DynaPolyActor* dynaActor; - s32 pad; + CollisionPoly* poly; Vec3f polyVtx[3]; Vec3f polyNorm; u32 polyIndex; @@ -3167,7 +3188,6 @@ f32 BgCheck_RaycastDownDyna(DynaRaycastDown* dynaRaycastDown) { Vec3f vtx; f32 intersect; ScaleRotPos* curTransform; - CollisionPoly* poly; result = BGCHECK_Y_MIN; *dynaRaycastDown->bgId = BGCHECK_SCENE; @@ -3239,9 +3259,12 @@ f32 BgCheck_RaycastDownDyna(DynaRaycastDown* dynaRaycastDown) { vtxList = dynaRaycastDown->dyna->bgActors[*dynaRaycastDown->bgId].colHeader->vtxList; for (i2 = 0; i2 < 3; i2++) { + s32 pad; + Math_Vec3s_ToVec3f(&vtx, &vtxList[COLPOLY_VTX_INDEX(poly->vtxData[i2])]); SkinMatrix_Vec3fMtxFMultXYZ(&srpMtx, &vtx, &polyVtx[i2]); } + Math3D_SurfaceNorm(&polyVtx[0], &polyVtx[1], &polyVtx[2], &polyNorm); magnitude = Math3D_Vec3fMagnitude(&polyNorm); @@ -3290,8 +3313,6 @@ s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCo f32 invNormalXZ; f32 planeDist; f32 temp_f18; - f32 zIntersectDist; - f32 xIntersectDist; f32 zMin; f32 zMax; f32 xMin; @@ -3360,8 +3381,10 @@ s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCo } } if (CollisionPoly_CheckZIntersectApprox(poly, dyna->vtxList, resultPos.x, pos->y, &intersect)) { - if (fabsf(intersect - resultPos.z) <= radius / temp_f18) { - if ((intersect - resultPos.z) * nz <= 4.0f) { + f32 zIntersectDist = intersect - resultPos.z; + + if (fabsf(zIntersectDist) <= radius / temp_f18) { + if (zIntersectDist * nz <= 4.0f) { if (BgCheck_ComputeWallDisplacement(colCtx, poly, &resultPos.x, &resultPos.z, nx, ny, nz, invNormalXZ, planeDist, radius, outPoly)) { *outBgId = bgId; @@ -3434,7 +3457,8 @@ s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCo } if (CollisionPoly_CheckXIntersectApprox(poly, dyna->vtxList, pos->y, resultPos.z, &intersect)) { - xIntersectDist = intersect - resultPos.x; + f32 xIntersectDist = intersect - resultPos.x; + if (fabsf(xIntersectDist) <= radius / temp_f18) { if (xIntersectDist * nx <= 4.0f) { if (BgCheck_ComputeWallDisplacement(colCtx, poly, &resultPos.x, &resultPos.z, nx, ny, nz, @@ -4223,6 +4247,8 @@ f32 sZorasDomainWaterBoxMaxZ = -967.0f; s32 WaterBox_GetSurface1(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox) { if (play->sceneId == SCENE_ZORAS_DOMAIN) { + s32 pad; + if (sZorasDomainWaterBoxMinX < x && x < sZorasDomainWaterBoxMaxX && sZorasDomainWaterBoxMinY < *ySurface && *ySurface < sZorasDomainWaterBoxMaxY && sZorasDomainWaterBoxMinZ < z && z < sZorasDomainWaterBoxMaxZ) { *outWaterBox = &sZorasDomainWaterBox; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 7db82ed358..7410dbb2e8 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -7048,12 +7048,16 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState R_CAM_DATA(i) = sCamDataRegsInit[i]; } +#if OOT_DEBUG DebugCamera_Reset(camera, &D_8015BD80); +#endif sInitRegs = false; PREG(88) = -1; } camera->play = D_8015BD7C = play; +#if OOT_DEBUG DebugCamera_Init(&D_8015BD80, camera); +#endif curUID = sNextUID; sNextUID++; while (curUID != 0) { @@ -7722,7 +7726,9 @@ Vec3s Camera_Update(Camera* camera) { if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_START)) { gDebugCamEnabled ^= 1; if (gDebugCamEnabled) { +#if OOT_DEBUG DebugCamera_Enable(&D_8015BD80, camera); +#endif } else if (camera->play->csCtx.state != CS_STATE_IDLE) { Cutscene_StopManual(camera->play, &camera->play->csCtx); } @@ -7731,7 +7737,9 @@ Vec3s Camera_Update(Camera* camera) { // Debug cam update if (gDebugCamEnabled) { camera->play->view.fovy = D_8015BD80.fov; +#if OOT_DEBUG DebugCamera_Update(&D_8015BD80, camera); +#endif View_LookAt(&camera->play->view, &D_8015BD80.eye, &D_8015BD80.at, &D_8015BD80.unk_1C); if (R_DEBUG_CAM_UPDATE) { PRINTF("camera: debug out\n"); diff --git a/src/code/z_common_data.c b/src/code/z_common_data.c index 94d8b7a3f8..2d7c36fc81 100644 --- a/src/code/z_common_data.c +++ b/src/code/z_common_data.c @@ -1,7 +1,6 @@ #include "global.h" -// The use of ALIGNED8 here is just a temporary solution until the SaveContext is re-structured -ALIGNED8 SaveContext gSaveContext; +ALIGNED(16) SaveContext gSaveContext; u32 D_8015FA88; u32 D_8015FA8C; diff --git a/src/code/z_debug.c b/src/code/z_debug.c index 8fd35af197..652b6f643a 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -29,6 +29,7 @@ Color_RGBA8 sDebugCamTextColors[] = { { 128, 255, 32, 128 }, // DEBUG_CAM_TEXT_GREEN }; +#if OOT_DEBUG InputCombo sRegGroupInputCombos[REG_GROUPS] = { { BTN_L, BTN_CUP }, // REG { BTN_L, BTN_CLEFT }, // SREG @@ -93,6 +94,7 @@ char sRegGroupChars[REG_GROUPS] = { 'k', // kREG 'b', // bREG }; +#endif void Regs_Init(void) { s32 i; diff --git a/src/code/z_fbdemo.c b/src/code/z_fbdemo.c index b1ad5a2089..1a3916ffa0 100644 --- a/src/code/z_fbdemo.c +++ b/src/code/z_fbdemo.c @@ -40,6 +40,22 @@ Gfx sTransTileSetupDL[] = { gsSPEndDisplayList(), }; +#define SET_VERTEX(vtx, x, y, z, s, t, nx, ny, nz, alpha) \ + { \ + Vtx_tn* vtxn = &(vtx)->n; \ + vtxn->ob[0] = (x); \ + vtxn->ob[1] = (y); \ + vtxn->ob[2] = (z); \ + vtxn->flag = 0; \ + vtxn->tc[0] = (s); \ + vtxn->tc[1] = (t); \ + vtxn->n[0] = (nx); \ + vtxn->n[1] = (ny); \ + vtxn->n[2] = (nz); \ + vtxn->a = (alpha); \ + } \ + (void)0 + void TransitionTile_InitGraphics(TransitionTile* this) { s32 frame; s32 col; @@ -61,20 +77,7 @@ void TransitionTile_InitGraphics(TransitionTile* this) { for (row = 0; row < this->rows + 1; row++) { colTex = 0; for (col = 0; col < this->cols + 1; col++) { - Vtx_tn* vtxn = &vtx->n; - - vtx++; - vtxn->tc[0] = colTex << 6; - vtxn->ob[0] = col * 0x20; - vtxn->ob[1] = row * 0x20; - vtxn->ob[2] = -5; - vtxn->flag = 0; - vtxn->tc[1] = rowTex << 6; - vtxn->n[0] = 0; - vtxn->n[1] = 0; - vtxn->n[2] = 120; - vtxn->a = 255; - + SET_VERTEX(vtx++, col * 0x20, row * 0x20, -5, colTex << 6, rowTex << 6, 0, 0, 120, 255); colTex += 0x20; } diff --git a/src/code/z_fbdemo_fade.c b/src/code/z_fbdemo_fade.c index 1d76e8ec71..1f0843176d 100644 --- a/src/code/z_fbdemo_fade.c +++ b/src/code/z_fbdemo_fade.c @@ -62,7 +62,7 @@ void TransitionFade_Update(void* thisx, s32 updateRate) { break; case TRANS_FADE_TYPE_ONE_WAY: - this->timer += updateRate; + ((TransitionFade*)thisx)->timer += updateRate; if (this->timer >= gSaveContext.transFadeDuration) { this->timer = gSaveContext.transFadeDuration; this->isDone = true; diff --git a/src/code/z_fcurve_data_skelanime.c b/src/code/z_fcurve_data_skelanime.c index 2348fa13a4..e4d4b8a772 100644 --- a/src/code/z_fcurve_data_skelanime.c +++ b/src/code/z_fcurve_data_skelanime.c @@ -162,6 +162,8 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelCurve* skelCurve, Ov OPEN_DISPS(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 279); + if (1) {} + Matrix_Push(); if ((overrideLimbDraw == NULL) || diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c index 35a6bc4a7c..6792b34f92 100644 --- a/src/code/z_kaleido_manager.c +++ b/src/code/z_kaleido_manager.c @@ -80,9 +80,10 @@ void KaleidoManager_Destroy(void) { void* KaleidoManager_GetRamAddr(void* vram) { KaleidoMgrOverlay* iter = gKaleidoMgrCurOvl; KaleidoMgrOverlay* ovl = iter; - u32 i; if (ovl == NULL) { + u32 i; + iter = &gKaleidoMgrOverlayTable[0]; for (i = 0; i < ARRAY_COUNT(gKaleidoMgrOverlayTable); i++) { if (((uintptr_t)vram >= (uintptr_t)iter->vramStart) && ((uintptr_t)iter->vramEnd >= (uintptr_t)vram)) { diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c index 4108514981..3f04804257 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -56,19 +56,25 @@ void KaleidoScopeCall_Update(PlayState* play) { KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]; PauseContext* pauseCtx = &play->pauseCtx; - if (IS_PAUSED(pauseCtx)) { + if (IS_PAUSED(&play->pauseCtx)) { if (pauseCtx->state == PAUSE_STATE_WAIT_LETTERBOX) { if (Letterbox_GetSize() == 0) { +#if OOT_DEBUG R_HREG_MODE = HREG_MODE_UCODE_DISAS; R_UCODE_DISAS_LOG_MODE = 3; +#endif + R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_SETUP; pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_APPEARING; pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1; // PAUSE_STATE_WAIT_BG_PRERENDER } } else if (pauseCtx->state == PAUSE_STATE_8) { +#if OOT_DEBUG R_HREG_MODE = HREG_MODE_UCODE_DISAS; R_UCODE_DISAS_LOG_MODE = 3; +#endif + R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_SETUP; pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_APPEARING; diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index 6aab77e3ae..3c5cab5ced 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -50,7 +50,7 @@ void KaleidoSetup_Update(PlayState* play) { (play->sceneId != SCENE_BOMBCHU_BOWLING_ALLEY || !Flags_GetSwitch(play, 0x38))) { if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) { - if (BREG(0)) { + if (OOT_DEBUG && BREG(0)) { pauseCtx->debugState = 3; } } else if (CHECK_BTN_ALL(input->press.button, BTN_START)) { @@ -102,22 +102,23 @@ void KaleidoSetup_Update(PlayState* play) { void KaleidoSetup_Init(PlayState* play) { PauseContext* pauseCtx = &play->pauseCtx; - u64 temp = 0; // Necessary to match pauseCtx->state = PAUSE_STATE_OFF; pauseCtx->debugState = 0; - pauseCtx->alpha = 0; - pauseCtx->switchPageTimer = 0; - pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; - pauseCtx->nextPageMode = 0; - pauseCtx->pageIndex = PAUSE_ITEM; - pauseCtx->itemPageRoll = pauseCtx->equipPageRoll = pauseCtx->mapPageRoll = pauseCtx->questPageRoll = 160.0f; // Setting the eye xz here is irrelevant, it's set on pausing in KaleidoSetup_Update + // x = -PAUSE_EYE_DIST * PAUSE_ITEM_X + pauseCtx->eye.x = pauseCtx->eye.y = 0.0f; pauseCtx->eye.z = -PAUSE_EYE_DIST * PAUSE_ITEM_Z; - pauseCtx->eye.y = 0.0f; - pauseCtx->eye.x = 0.0f; // -PAUSE_EYE_DIST * PAUSE_ITEM_X + pauseCtx->savePromptOffsetDepth_ = 936.0f; + pauseCtx->itemPageRoll = pauseCtx->equipPageRoll = pauseCtx->mapPageRoll = pauseCtx->questPageRoll = 160.0f; + + pauseCtx->alpha = 0; + + // mainState = PAUSE_MAIN_STATE_IDLE , pageIndex = PAUSE_ITEM + pauseCtx->switchPageTimer = pauseCtx->mainState = pauseCtx->nextPageMode = pauseCtx->pageIndex = 0; + pauseCtx->rollRotSavePrompt_ = -314.0f; pauseCtx->cursorPoint[PAUSE_ITEM] = 0; @@ -130,8 +131,8 @@ void KaleidoSetup_Init(PlayState* play) { pauseCtx->cursorY[PAUSE_ITEM] = 0; pauseCtx->cursorX[PAUSE_MAP] = 0; pauseCtx->cursorY[PAUSE_MAP] = 0; - pauseCtx->cursorX[PAUSE_QUEST] = temp; - pauseCtx->cursorY[PAUSE_QUEST] = temp; + pauseCtx->cursorX[PAUSE_QUEST] = 0; + pauseCtx->cursorY[PAUSE_QUEST] = 0; pauseCtx->cursorX[PAUSE_EQUIP] = EQUIP_VALUE_SWORD_KOKIRI; pauseCtx->cursorY[PAUSE_EQUIP] = EQUIP_TYPE_SWORD; diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c index e1ab29cef9..5b3bb2e670 100644 --- a/src/code/z_kanfont.c +++ b/src/code/z_kanfont.c @@ -9,8 +9,10 @@ void func_8006EE50(Font* font, u16 arg1, u16 arg2) { * at `codePointIndex`. The value of `character` is the ASCII codepoint subtract ' '/0x20. */ void Font_LoadChar(Font* font, u8 character, u16 codePointIndex) { + u8 charTmp = character; + DMA_REQUEST_SYNC(&font->charTexBuf[codePointIndex], - (uintptr_t)_nes_font_staticSegmentRomStart + character * FONT_CHAR_TEX_SIZE, FONT_CHAR_TEX_SIZE, + (uintptr_t)_nes_font_staticSegmentRomStart + charTmp * FONT_CHAR_TEX_SIZE, FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 93); } @@ -31,10 +33,7 @@ void Font_LoadMessageBoxIcon(Font* font, u16 icon) { * the font buffer. */ void Font_LoadOrderedFont(Font* font) { - u8* fontBuf; - uintptr_t fontStatic; s32 len; - s32 jj; s32 codePointIndex; s32 fontBufIndex; u32 offset; @@ -44,23 +43,22 @@ void Font_LoadOrderedFont(Font* font) { DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, len, "../z_kanfont.c", 122); - PRINTF("msg_data=%x, msg_data0=%x jj=%x\n", font->msgOffset, font->msgLength, jj = len); - len = jj; - for (fontBufIndex = 0, codePointIndex = 0; font->msgBuf[codePointIndex] != MESSAGE_END; codePointIndex++) { - if (codePointIndex > len) { + PRINTF("msg_data=%x, msg_data0=%x jj=%x\n", font->msgOffset, font->msgLength, len * 1); + + fontBufIndex = 0; + for (codePointIndex = 0; font->msgBuf[codePointIndex] != MESSAGE_END; codePointIndex++) { + if (codePointIndex > (len * 1)) { PRINTF("ERROR!! エラー!!! error───!!!!\n"); return; } if (font->msgBuf[codePointIndex] != MESSAGE_NEWLINE) { - fontBuf = font->fontBuf + fontBufIndex * 8; - fontStatic = (uintptr_t)_nes_font_staticSegmentRomStart; - PRINTF("nes_mes_buf[%d]=%d\n", codePointIndex, font->msgBuf[codePointIndex]); offset = (font->msgBuf[codePointIndex] - ' ') * FONT_CHAR_TEX_SIZE; - DMA_REQUEST_SYNC(fontBuf, fontStatic + offset, FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 134); + DMA_REQUEST_SYNC(font->fontBuf + fontBufIndex * 8, (uintptr_t)_nes_font_staticSegmentRomStart + offset, + FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 134); fontBufIndex += FONT_CHAR_TEX_SIZE / 8; } } diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index 771cc1d377..db80807355 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -252,7 +252,8 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused) gSaveContext.sunsSongState = SUNSSONG_INACTIVE; - if (((void)0, gSaveContext.save.dayTime) > CLOCK_TIME(18, 0) || + //! FAKE: (void)0 on CLOCK_TIME(18, 0) + if (((void)0, gSaveContext.save.dayTime) > ((void)0, CLOCK_TIME(18, 0)) || ((void)0, gSaveContext.save.dayTime) < CLOCK_TIME(6, 30)) { ((void)0, gSaveContext.save.nightFlag = 1); } else { @@ -335,12 +336,17 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused) envCtx->lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE; envCtx->lightBlendRateOverride = LIGHT_BLENDRATE_OVERRIDE_NONE; - R_ENV_TIME_SPEED_OLD = gTimeSpeed = envCtx->sceneTimeSpeed = 0; + envCtx->sceneTimeSpeed = 0; + gTimeSpeed = envCtx->sceneTimeSpeed; + +#if OOT_DEBUG + R_ENV_TIME_SPEED_OLD = gTimeSpeed; R_ENV_DISABLE_DBG = true; if (CREG(3) != 0) { gSaveContext.chamberCutsceneNum = CREG(3) - 1; } +#endif play->envCtx.precipitation[PRECIP_RAIN_MAX] = 0; play->envCtx.precipitation[PRECIP_RAIN_CUR] = 0; @@ -405,6 +411,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused) gSkyboxIsChanging = false; gSaveContext.retainWeatherMode = false; +#if OOT_DEBUG R_ENV_LIGHT1_DIR(0) = 80; R_ENV_LIGHT1_DIR(1) = 80; R_ENV_LIGHT1_DIR(2) = 80; @@ -419,6 +426,8 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused) cREG(12) = 0; cREG(13) = 0; cREG(14) = 0; +#endif + gUseCutsceneCam = true; for (i = 0; i < ARRAY_COUNT(sLightningBolts); i++) { @@ -512,10 +521,9 @@ u8 Environment_SmoothStepToS8(s8* pvalue, s8 target, u8 scale, u8 step, u8 minSt f32 Environment_LerpWeight(u16 max, u16 min, u16 val) { f32 diff = max - min; - f32 ret; if (diff != 0.0f) { - ret = 1.0f - (max - val) / diff; + f32 ret = 1.0f - (max - val) / diff; if (!(ret >= 1.0f)) { return ret; @@ -700,10 +708,12 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon } } +#if OOT_DEBUG if (newSkybox1Index == 0xFF) { // "Environment VR data acquisition failed! Report to Sasaki!" PRINTF(VT_COL(RED, WHITE) "\n環境VRデータ取得失敗! ささきまでご報告を!" VT_RST); } +#endif if ((envCtx->skybox1Index != newSkybox1Index) && (envCtx->skyboxDmaState == SKYBOX_DMA_INACTIVE)) { envCtx->skyboxDmaState = SKYBOX_DMA_TEXTURE1_START; @@ -815,6 +825,7 @@ void Environment_DisableUnderwaterLights(PlayState* play) { } } +#if OOT_DEBUG void Environment_PrintDebugInfo(PlayState* play, Gfx** gfx) { GfxPrint printer; s32 pad[2]; @@ -869,6 +880,7 @@ void Environment_PrintDebugInfo(PlayState* play, Gfx** gfx) { *gfx = GfxPrint_Close(&printer); GfxPrint_Destroy(&printer); } +#endif void Environment_PlayTimeBasedSequence(PlayState* play); void Environment_UpdateRain(PlayState* play); @@ -881,7 +893,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex u16 j; u16 time; EnvLightSettings* lightSettingsList = play->envCtx.lightSettingsList; - s32 adjustment; + u8 blendRate; if ((((void)0, gSaveContext.gameMode) != GAMEMODE_NORMAL) && (((void)0, gSaveContext.gameMode) != GAMEMODE_END_CREDITS)) { @@ -951,6 +963,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex gSaveContext.save.nightFlag = 0; } +#if OOT_DEBUG if (R_ENABLE_ARENA_DBG != 0 || CREG(2) != 0) { Gfx* displayList; Gfx* prevDisplayList; @@ -967,249 +980,247 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_kankyo.c", 1690); } +#endif if ((envCtx->lightSettingOverride != LIGHT_SETTING_OVERRIDE_NONE) && (envCtx->lightBlendOverride != LIGHT_BLEND_OVERRIDE_FULL_CONTROL) && (envCtx->lightSetting != envCtx->lightSettingOverride) && (envCtx->lightBlend >= 1.0f) && (envCtx->lightSettingOverride <= LIGHT_SETTING_MAX)) { + envCtx->lightBlend = 0.0f; envCtx->prevLightSetting = envCtx->lightSetting; envCtx->lightSetting = envCtx->lightSettingOverride; - envCtx->lightBlend = 0.0f; } - if (envCtx->lightSettingOverride != LIGHT_SETTING_OVERRIDE_FULL_CONTROL) { - if ((envCtx->lightMode == LIGHT_MODE_TIME) && - (envCtx->lightSettingOverride == LIGHT_SETTING_OVERRIDE_NONE)) { - for (i = 0; i < ARRAY_COUNT(sTimeBasedLightConfigs[envCtx->lightConfig]); i++) { - if ((gSaveContext.skyboxTime >= sTimeBasedLightConfigs[envCtx->lightConfig][i].startTime) && - ((gSaveContext.skyboxTime < sTimeBasedLightConfigs[envCtx->lightConfig][i].endTime) || - sTimeBasedLightConfigs[envCtx->lightConfig][i].endTime == 0xFFFF)) { - u8 blend8[2]; - s16 blend16[2]; + if (envCtx->lightSettingOverride == LIGHT_SETTING_OVERRIDE_FULL_CONTROL) { + // Do nothing; Skip updating lights based on time or light settings + } else if ((envCtx->lightMode == LIGHT_MODE_TIME) && + (envCtx->lightSettingOverride == LIGHT_SETTING_OVERRIDE_NONE)) { + for (i = 0; i < ARRAY_COUNT(sTimeBasedLightConfigs[envCtx->lightConfig]); i++) { + if ((gSaveContext.skyboxTime >= sTimeBasedLightConfigs[envCtx->lightConfig][i].startTime) && + ((gSaveContext.skyboxTime < sTimeBasedLightConfigs[envCtx->lightConfig][i].endTime) || + sTimeBasedLightConfigs[envCtx->lightConfig][i].endTime == 0xFFFF)) { + u8 blend8[2]; + s16 blend16[2]; - timeChangeBlend = - Environment_LerpWeight(sTimeBasedLightConfigs[envCtx->lightConfig][i].endTime, - sTimeBasedLightConfigs[envCtx->lightConfig][i].startTime, - ((void)0, gSaveContext.skyboxTime)); + timeChangeBlend = Environment_LerpWeight(sTimeBasedLightConfigs[envCtx->lightConfig][i].endTime, + sTimeBasedLightConfigs[envCtx->lightConfig][i].startTime, + ((void)0, gSaveContext.skyboxTime)); - sSandstormColorIndex = sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting & 3; - sNextSandstormColorIndex = sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting & 3; - sSandstormLerpScale = timeChangeBlend; + sSandstormColorIndex = sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting & 3; + sNextSandstormColorIndex = sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting & 3; + sSandstormLerpScale = timeChangeBlend; - if (envCtx->changeLightEnabled) { - configChangeBlend = - ((f32)envCtx->changeDuration - envCtx->changeLightTimer) / envCtx->changeDuration; - envCtx->changeLightTimer--; + if (envCtx->changeLightEnabled) { + configChangeBlend = + ((f32)envCtx->changeDuration - envCtx->changeLightTimer) / envCtx->changeDuration; + envCtx->changeLightTimer--; - if (envCtx->changeLightTimer <= 0) { - envCtx->changeLightEnabled = false; - envCtx->lightConfig = envCtx->changeLightNextConfig; - } + if (envCtx->changeLightTimer <= 0) { + envCtx->changeLightEnabled = false; + envCtx->lightConfig = envCtx->changeLightNextConfig; } + } - for (j = 0; j < 3; j++) { - // blend ambient color - blend8[0] = - LERP(lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting] - .ambientColor[j], - lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting] - .ambientColor[j], - timeChangeBlend); - blend8[1] = LERP( - lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting] - .ambientColor[j], - lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i] - .nextLightSetting] - .ambientColor[j], - timeChangeBlend); - *(envCtx->lightSettings.ambientColor + j) = LERP(blend8[0], blend8[1], configChangeBlend); - } - - // set light1 direction for the sun - envCtx->lightSettings.light1Dir[0] = - -(Math_SinS(((void)0, gSaveContext.save.dayTime) - CLOCK_TIME(12, 0)) * 120.0f); - envCtx->lightSettings.light1Dir[1] = - Math_CosS(((void)0, gSaveContext.save.dayTime) - CLOCK_TIME(12, 0)) * 120.0f; - envCtx->lightSettings.light1Dir[2] = - Math_CosS(((void)0, gSaveContext.save.dayTime) - CLOCK_TIME(12, 0)) * 20.0f; - - // set light2 direction for the moon - envCtx->lightSettings.light2Dir[0] = -envCtx->lightSettings.light1Dir[0]; - envCtx->lightSettings.light2Dir[1] = -envCtx->lightSettings.light1Dir[1]; - envCtx->lightSettings.light2Dir[2] = -envCtx->lightSettings.light1Dir[2]; - - for (j = 0; j < 3; j++) { - // blend light1Color - blend8[0] = - LERP(lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting] - .light1Color[j], - lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting] - .light1Color[j], - timeChangeBlend); - blend8[1] = LERP( - lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting] - .light1Color[j], - lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i] - .nextLightSetting] - .light1Color[j], - timeChangeBlend); - *(envCtx->lightSettings.light1Color + j) = LERP(blend8[0], blend8[1], configChangeBlend); - - // blend light2Color - blend8[0] = - LERP(lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting] - .light2Color[j], - lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting] - .light2Color[j], - timeChangeBlend); - blend8[1] = LERP( - lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting] - .light2Color[j], - lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i] - .nextLightSetting] - .light2Color[j], - timeChangeBlend); - *(envCtx->lightSettings.light2Color + j) = LERP(blend8[0], blend8[1], configChangeBlend); - } - - // blend fogColor - for (j = 0; j < 3; j++) { - blend8[0] = - LERP(lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting] - .fogColor[j], - lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting] - .fogColor[j], - timeChangeBlend); - blend8[1] = LERP( - lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting] - .fogColor[j], - lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i] - .nextLightSetting] - .fogColor[j], - timeChangeBlend); - *(envCtx->lightSettings.fogColor + j) = LERP(blend8[0], blend8[1], configChangeBlend); - } - - blend16[0] = LERP16( - ENV_LIGHT_SETTINGS_FOG_NEAR( - lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting] - .blendRateAndFogNear), - ENV_LIGHT_SETTINGS_FOG_NEAR( - lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting] - .blendRateAndFogNear), - timeChangeBlend); - blend16[1] = LERP16( - ENV_LIGHT_SETTINGS_FOG_NEAR( - lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting] - .blendRateAndFogNear), - ENV_LIGHT_SETTINGS_FOG_NEAR( - lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i] - .nextLightSetting] - .blendRateAndFogNear), - timeChangeBlend); - - envCtx->lightSettings.fogNear = LERP16(blend16[0], blend16[1], configChangeBlend); - - blend16[0] = LERP16( - lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting].zFar, - lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting].zFar, - timeChangeBlend); - blend16[1] = LERP16( + for (j = 0; j < 3; j++) { + // blend ambient color + blend8[0] = + LERP(lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting] + .ambientColor[j], + lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting] + .ambientColor[j], + timeChangeBlend); + blend8[1] = LERP( lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting] - .zFar, + .ambientColor[j], lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting] - .zFar, + .ambientColor[j], timeChangeBlend); - - envCtx->lightSettings.zFar = LERP16(blend16[0], blend16[1], configChangeBlend); - - if (sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting >= - envCtx->numLightSettings) { - // "The color palette setting seems to be wrong!" - PRINTF(VT_COL(RED, WHITE) "\nカラーパレットの設定がおかしいようです!" VT_RST); - - // "Palette setting = [] Last palette number = []" - PRINTF(VT_COL(RED, WHITE) "\n設定パレット=[%d] 最後パレット番号=[%d]\n" VT_RST, - sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting, - envCtx->numLightSettings - 1); - } - break; - } - } - } else { - if (!envCtx->lightBlendEnabled) { - for (i = 0; i < 3; i++) { - envCtx->lightSettings.ambientColor[i] = lightSettingsList[envCtx->lightSetting].ambientColor[i]; - envCtx->lightSettings.light1Dir[i] = lightSettingsList[envCtx->lightSetting].light1Dir[i]; - envCtx->lightSettings.light1Color[i] = lightSettingsList[envCtx->lightSetting].light1Color[i]; - envCtx->lightSettings.light2Dir[i] = lightSettingsList[envCtx->lightSetting].light2Dir[i]; - envCtx->lightSettings.light2Color[i] = lightSettingsList[envCtx->lightSetting].light2Color[i]; - envCtx->lightSettings.fogColor[i] = lightSettingsList[envCtx->lightSetting].fogColor[i]; + envCtx->lightSettings.ambientColor[j] = LERP(blend8[0], blend8[1], configChangeBlend); } - envCtx->lightSettings.fogNear = - ENV_LIGHT_SETTINGS_FOG_NEAR(lightSettingsList[envCtx->lightSetting].blendRateAndFogNear); - envCtx->lightSettings.zFar = lightSettingsList[envCtx->lightSetting].zFar; - envCtx->lightBlend = 1.0f; - } else { - u8 blendRate = - ENV_LIGHT_SETTINGS_BLEND_RATE_U8(lightSettingsList[envCtx->lightSetting].blendRateAndFogNear); + // set light1 direction for the sun + envCtx->lightSettings.light1Dir[0] = + -(Math_SinS(((void)0, gSaveContext.save.dayTime) - CLOCK_TIME(12, 0)) * 120.0f); + envCtx->lightSettings.light1Dir[1] = + Math_CosS(((void)0, gSaveContext.save.dayTime) - CLOCK_TIME(12, 0)) * 120.0f; + envCtx->lightSettings.light1Dir[2] = + Math_CosS(((void)0, gSaveContext.save.dayTime) - CLOCK_TIME(12, 0)) * 20.0f; - if (blendRate == 0) { - blendRate++; + // set light2 direction for the moon + envCtx->lightSettings.light2Dir[0] = -envCtx->lightSettings.light1Dir[0]; + envCtx->lightSettings.light2Dir[1] = -envCtx->lightSettings.light1Dir[1]; + envCtx->lightSettings.light2Dir[2] = -envCtx->lightSettings.light1Dir[2]; + + for (j = 0; j < 3; j++) { + // blend light1Color + blend8[0] = + LERP(lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting] + .light1Color[j], + lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting] + .light1Color[j], + timeChangeBlend); + blend8[1] = LERP( + lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting] + .light1Color[j], + lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting] + .light1Color[j], + timeChangeBlend); + envCtx->lightSettings.light1Color[j] = LERP(blend8[0], blend8[1], configChangeBlend); + + // blend light2Color + blend8[0] = + LERP(lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting] + .light2Color[j], + lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting] + .light2Color[j], + timeChangeBlend); + blend8[1] = LERP( + lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting] + .light2Color[j], + lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting] + .light2Color[j], + timeChangeBlend); + envCtx->lightSettings.light2Color[j] = LERP(blend8[0], blend8[1], configChangeBlend); } - if (envCtx->lightBlendRateOverride != LIGHT_BLENDRATE_OVERRIDE_NONE) { - blendRate = envCtx->lightBlendRateOverride; + // blend fogColor + for (j = 0; j < 3; j++) { + blend8[0] = LERP( + lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting].fogColor[j], + lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting] + .fogColor[j], + timeChangeBlend); + blend8[1] = LERP( + lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting] + .fogColor[j], + lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting] + .fogColor[j], + timeChangeBlend); + envCtx->lightSettings.fogColor[j] = LERP(blend8[0], blend8[1], configChangeBlend); } - if (envCtx->lightBlendOverride == LIGHT_BLEND_OVERRIDE_NONE) { - envCtx->lightBlend += blendRate / 255.0f; + blend16[0] = + LERP16(ENV_LIGHT_SETTINGS_FOG_NEAR( + lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting] + .blendRateAndFogNear), + ENV_LIGHT_SETTINGS_FOG_NEAR( + lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting] + .blendRateAndFogNear), + timeChangeBlend); + blend16[1] = LERP16( + ENV_LIGHT_SETTINGS_FOG_NEAR( + lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting] + .blendRateAndFogNear), + ENV_LIGHT_SETTINGS_FOG_NEAR( + lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting] + .blendRateAndFogNear), + timeChangeBlend); + + envCtx->lightSettings.fogNear = LERP16(blend16[0], blend16[1], configChangeBlend); + + blend16[0] = + LERP16(lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting].zFar, + lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].nextLightSetting].zFar, + timeChangeBlend); + blend16[1] = LERP16( + lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting].zFar, + lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting] + .zFar, + timeChangeBlend); + + envCtx->lightSettings.zFar = LERP16(blend16[0], blend16[1], configChangeBlend); + +#if OOT_DEBUG + if (sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting >= + envCtx->numLightSettings) { + // "The color palette setting seems to be wrong!" + PRINTF(VT_COL(RED, WHITE) "\nカラーパレットの設定がおかしいようです!" VT_RST); + + // "Palette setting = [] Last palette number = []" + PRINTF(VT_COL(RED, WHITE) "\n設定パレット=[%d] 最後パレット番号=[%d]\n" VT_RST, + sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting, + envCtx->numLightSettings - 1); } +#endif - if (envCtx->lightBlend > 1.0f) { - envCtx->lightBlend = 1.0f; - } - - for (i = 0; i < 3; i++) { - envCtx->lightSettings.ambientColor[i] = - LERP(lightSettingsList[envCtx->prevLightSetting].ambientColor[i], - lightSettingsList[envCtx->lightSetting].ambientColor[i], envCtx->lightBlend); - envCtx->lightSettings.light1Dir[i] = - LERP16(lightSettingsList[envCtx->prevLightSetting].light1Dir[i], - lightSettingsList[envCtx->lightSetting].light1Dir[i], envCtx->lightBlend); - envCtx->lightSettings.light1Color[i] = - LERP(lightSettingsList[envCtx->prevLightSetting].light1Color[i], - lightSettingsList[envCtx->lightSetting].light1Color[i], envCtx->lightBlend); - envCtx->lightSettings.light2Dir[i] = - LERP16(lightSettingsList[envCtx->prevLightSetting].light2Dir[i], - lightSettingsList[envCtx->lightSetting].light2Dir[i], envCtx->lightBlend); - envCtx->lightSettings.light2Color[i] = - LERP(lightSettingsList[envCtx->prevLightSetting].light2Color[i], - lightSettingsList[envCtx->lightSetting].light2Color[i], envCtx->lightBlend); - envCtx->lightSettings.fogColor[i] = - LERP(lightSettingsList[envCtx->prevLightSetting].fogColor[i], - lightSettingsList[envCtx->lightSetting].fogColor[i], envCtx->lightBlend); - } - envCtx->lightSettings.fogNear = LERP16( - ENV_LIGHT_SETTINGS_FOG_NEAR(lightSettingsList[envCtx->prevLightSetting].blendRateAndFogNear), - ENV_LIGHT_SETTINGS_FOG_NEAR(lightSettingsList[envCtx->lightSetting].blendRateAndFogNear), - envCtx->lightBlend); - envCtx->lightSettings.zFar = - LERP16(lightSettingsList[envCtx->prevLightSetting].zFar, - lightSettingsList[envCtx->lightSetting].zFar, envCtx->lightBlend); - } - - if (envCtx->lightSetting >= envCtx->numLightSettings) { - // "The color palette seems to be wrong!" - PRINTF("\n" VT_FGCOL(RED) "カラーパレットがおかしいようです!"); - - // "Palette setting = [] Last palette number = []" - PRINTF("\n" VT_FGCOL(YELLOW) "設定パレット=[%d] パレット数=[%d]\n" VT_RST, envCtx->lightSetting, - envCtx->numLightSettings); + break; } } + } else { + if (!envCtx->lightBlendEnabled) { + for (i = 0; i < 3; i++) { + envCtx->lightSettings.ambientColor[i] = lightSettingsList[envCtx->lightSetting].ambientColor[i]; + envCtx->lightSettings.light1Dir[i] = lightSettingsList[envCtx->lightSetting].light1Dir[i]; + envCtx->lightSettings.light1Color[i] = lightSettingsList[envCtx->lightSetting].light1Color[i]; + envCtx->lightSettings.light2Dir[i] = lightSettingsList[envCtx->lightSetting].light2Dir[i]; + envCtx->lightSettings.light2Color[i] = lightSettingsList[envCtx->lightSetting].light2Color[i]; + envCtx->lightSettings.fogColor[i] = lightSettingsList[envCtx->lightSetting].fogColor[i]; + } + + envCtx->lightSettings.fogNear = + ENV_LIGHT_SETTINGS_FOG_NEAR(lightSettingsList[envCtx->lightSetting].blendRateAndFogNear); + envCtx->lightSettings.zFar = lightSettingsList[envCtx->lightSetting].zFar; + envCtx->lightBlend = 1.0f; + } else { + blendRate = + ENV_LIGHT_SETTINGS_BLEND_RATE_U8(lightSettingsList[envCtx->lightSetting].blendRateAndFogNear); + + if (blendRate == 0) { + blendRate++; + } + + if (envCtx->lightBlendRateOverride != LIGHT_BLENDRATE_OVERRIDE_NONE) { + blendRate = envCtx->lightBlendRateOverride; + } + + if (envCtx->lightBlendOverride == LIGHT_BLEND_OVERRIDE_NONE) { + envCtx->lightBlend += blendRate / 255.0f; + } + + if (envCtx->lightBlend > 1.0f) { + envCtx->lightBlend = 1.0f; + } + + for (i = 0; i < 3; i++) { + envCtx->lightSettings.ambientColor[i] = + LERP(lightSettingsList[envCtx->prevLightSetting].ambientColor[i], + lightSettingsList[envCtx->lightSetting].ambientColor[i], envCtx->lightBlend); + envCtx->lightSettings.light1Dir[i] = + LERP16(lightSettingsList[envCtx->prevLightSetting].light1Dir[i], + lightSettingsList[envCtx->lightSetting].light1Dir[i], envCtx->lightBlend); + envCtx->lightSettings.light1Color[i] = + LERP(lightSettingsList[envCtx->prevLightSetting].light1Color[i], + lightSettingsList[envCtx->lightSetting].light1Color[i], envCtx->lightBlend); + envCtx->lightSettings.light2Dir[i] = + LERP16(lightSettingsList[envCtx->prevLightSetting].light2Dir[i], + lightSettingsList[envCtx->lightSetting].light2Dir[i], envCtx->lightBlend); + envCtx->lightSettings.light2Color[i] = + LERP(lightSettingsList[envCtx->prevLightSetting].light2Color[i], + lightSettingsList[envCtx->lightSetting].light2Color[i], envCtx->lightBlend); + envCtx->lightSettings.fogColor[i] = + LERP(lightSettingsList[envCtx->prevLightSetting].fogColor[i], + lightSettingsList[envCtx->lightSetting].fogColor[i], envCtx->lightBlend); + } + + envCtx->lightSettings.fogNear = + LERP16(ENV_LIGHT_SETTINGS_FOG_NEAR(lightSettingsList[envCtx->prevLightSetting].blendRateAndFogNear), + ENV_LIGHT_SETTINGS_FOG_NEAR(lightSettingsList[envCtx->lightSetting].blendRateAndFogNear), + envCtx->lightBlend); + envCtx->lightSettings.zFar = LERP16(lightSettingsList[envCtx->prevLightSetting].zFar, + lightSettingsList[envCtx->lightSetting].zFar, envCtx->lightBlend); + } + +#if OOT_DEBUG + if (envCtx->lightSetting >= envCtx->numLightSettings) { + // "The color palette seems to be wrong!" + PRINTF("\n" VT_FGCOL(RED) "カラーパレットがおかしいようです!"); + + // "Palette setting = [] Last palette number = []" + PRINTF("\n" VT_FGCOL(YELLOW) "設定パレット=[%d] パレット数=[%d]\n" VT_RST, envCtx->lightSetting, + envCtx->numLightSettings); + } +#endif } envCtx->lightBlendEnabled = true; @@ -1261,22 +1272,20 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex envCtx->dirLight2.params.dir.z = envCtx->lightSettings.light2Dir[2]; // Adjust fog near and far if necessary - adjustment = envCtx->lightSettings.fogNear + envCtx->adjFogNear; - if (adjustment <= ENV_FOGNEAR_MAX) { - lightCtx->fogNear = adjustment; + if ((envCtx->lightSettings.fogNear + envCtx->adjFogNear) <= ENV_FOGNEAR_MAX) { + lightCtx->fogNear = envCtx->lightSettings.fogNear + envCtx->adjFogNear; } else { lightCtx->fogNear = ENV_FOGNEAR_MAX; } - adjustment = envCtx->lightSettings.zFar + envCtx->adjZFar; - - if (adjustment <= ENV_ZFAR_MAX) { - lightCtx->zFar = adjustment; + if ((envCtx->lightSettings.zFar + envCtx->adjZFar) <= ENV_ZFAR_MAX) { + lightCtx->zFar = envCtx->lightSettings.zFar + envCtx->adjZFar; } else { lightCtx->zFar = ENV_ZFAR_MAX; } +#if OOT_DEBUG // When environment debug is enabled, various environment related variables can be configured via the reg editor if (R_ENV_DISABLE_DBG) { R_ENV_AMBIENT_COLOR(0) = lightCtx->ambientColor[0]; @@ -1357,6 +1366,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex envCtx->windDirection.z = R_ENV_WIND_DIR(2); envCtx->windSpeed = R_ENV_WIND_SPEED; } +#endif if ((envCtx->dirLight1.params.dir.x == 0) && (envCtx->dirLight1.params.dir.y == 0) && (envCtx->dirLight1.params.dir.z == 0)) { @@ -2366,9 +2376,6 @@ void Environment_DrawSandstorm(PlayState* play, u8 sandstormState) { Color_RGBA8 envColor; s32 pad; f32 sp98; - u16 sp96; - u16 sp94; - u16 sp92; switch (sandstormState) { case SANDSTORM_ACTIVE: @@ -2475,25 +2482,27 @@ void Environment_DrawSandstorm(PlayState* play, u8 sandstormState) { envColor.g = ((envColor.g * sp98) + ((6.0f - sp98) * primColor.g)) * (1.0f / 6.0f); envColor.b = ((envColor.b * sp98) + ((6.0f - sp98) * primColor.b)) * (1.0f / 6.0f); - sp96 = (s32)(sSandstormScroll * (11.0f / 6.0f)); - sp94 = (s32)(sSandstormScroll * (9.0f / 6.0f)); - sp92 = (s32)(sSandstormScroll * (6.0f / 6.0f)); + { + u16 sp96 = (s32)(sSandstormScroll * (11.0f / 6.0f)); + u16 sp94 = (s32)(sSandstormScroll * (9.0f / 6.0f)); + u16 sp92 = (s32)(sSandstormScroll * (6.0f / 6.0f)); - OPEN_DISPS(play->state.gfxCtx, "../z_kankyo.c", 4044); + OPEN_DISPS(play->state.gfxCtx, "../z_kankyo.c", 4044); - POLY_XLU_DISP = Gfx_SetupDL_64(POLY_XLU_DISP); + POLY_XLU_DISP = Gfx_SetupDL_64(POLY_XLU_DISP); - gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_NOISE); - gDPSetColorDither(POLY_XLU_DISP++, G_CD_NOISE); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, primColor.r, primColor.g, primColor.b, play->envCtx.sandstormPrimA); - gDPSetEnvColor(POLY_XLU_DISP++, envColor.r, envColor.g, envColor.b, play->envCtx.sandstormEnvA); - gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (u32)sp96 % 4096, 0, 512, 32, 1, (u32)sp94 % 4096, - 4095 - ((u32)sp92 % 4096), 256, 64)); - gDPSetTextureLUT(POLY_XLU_DISP++, G_TT_NONE); - gSPDisplayList(POLY_XLU_DISP++, gFieldSandstormDL); + gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_NOISE); + gDPSetColorDither(POLY_XLU_DISP++, G_CD_NOISE); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, primColor.r, primColor.g, primColor.b, play->envCtx.sandstormPrimA); + gDPSetEnvColor(POLY_XLU_DISP++, envColor.r, envColor.g, envColor.b, play->envCtx.sandstormEnvA); + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (u32)sp96 % 4096, 0, 512, 32, 1, + (u32)sp94 % 4096, 4095 - ((u32)sp92 % 4096), 256, 64)); + gDPSetTextureLUT(POLY_XLU_DISP++, G_TT_NONE); + gSPDisplayList(POLY_XLU_DISP++, gFieldSandstormDL); - CLOSE_DISPS(play->state.gfxCtx, "../z_kankyo.c", 4068); + CLOSE_DISPS(play->state.gfxCtx, "../z_kankyo.c", 4068); + } sSandstormScroll += (s32)sp98; } diff --git a/src/code/z_malloc.c b/src/code/z_malloc.c index 41685a60e2..f4910479d5 100644 --- a/src/code/z_malloc.c +++ b/src/code/z_malloc.c @@ -35,7 +35,7 @@ void* ZeldaArena_Malloc(u32 size) { } #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); ZELDA_ARENA_CHECK_POINTER(ptr, size, "zelda_malloc_DEBUG", "確保"); // "Secure" @@ -51,7 +51,7 @@ void* ZeldaArena_MallocR(u32 size) { } #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); 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 -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); ZELDA_ARENA_CHECK_POINTER(ptr, newSize, "zelda_realloc_DEBUG", "再確保"); // "Re-securing" return ptr; @@ -78,7 +78,7 @@ void ZeldaArena_Free(void* ptr) { } #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); } #endif diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c index 47d3d2bdae..31d9f93ad2 100644 --- a/src/code/z_map_mark.c +++ b/src/code/z_map_mark.c @@ -118,8 +118,8 @@ void MapMark_DrawForDungeon(PlayState* play) { markInfo->textureWidth, markInfo->textureHeight, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - rectLeft = (GREG(94) + markPoint->x + 204) << 2; - rectTop = (GREG(95) + markPoint->y + 140) << 2; + rectLeft = ((OOT_DEBUG ? GREG(94) : 0) + markPoint->x + 204) << 2; + rectTop = ((OOT_DEBUG ? GREG(95) : 0) + markPoint->y + 140) << 2; gSPTextureRectangle(OVERLAY_DISP++, rectLeft, rectTop, markInfo->rectWidth + rectLeft, rectTop + markInfo->rectHeight, G_TX_RENDERTILE, 0, 0, markInfo->dsdx, markInfo->dtdy); diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index cc8e6042f2..8b98ed0aa3 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -291,17 +291,15 @@ void Message_GrowTextbox(MessageContext* msgCtx) { void Message_FindMessage(PlayState* play, u16 textId) { const char* foundSeg; const char* nextSeg; + Font* font = &play->msgCtx.font; MessageTableEntry* messageTableEntry = sNesMessageEntryTablePtr; const char** languageSegmentTable; - Font* font; const char* seg; if (gSaveContext.language == LANGUAGE_ENG) { seg = messageTableEntry->segment; while (messageTableEntry->textId != 0xFFFF) { - font = &play->msgCtx.font; - if (messageTableEntry->textId == textId) { foundSeg = messageTableEntry->segment; font->charTexBuf[0] = messageTableEntry->typePos; @@ -323,8 +321,6 @@ void Message_FindMessage(PlayState* play, u16 textId) { seg = messageTableEntry->segment; while (messageTableEntry->textId != 0xFFFF) { - font = &play->msgCtx.font; - if (messageTableEntry->textId == textId) { foundSeg = *languageSegmentTable; font->charTexBuf[0] = messageTableEntry->typePos; @@ -344,7 +340,6 @@ void Message_FindMessage(PlayState* play, u16 textId) { } // "Message not found!!!" PRINTF(" メッセージが,見つからなかった!!! = %x\n", textId); - font = &play->msgCtx.font; messageTableEntry = sNesMessageEntryTablePtr; if (gSaveContext.language == LANGUAGE_ENG) { @@ -368,13 +363,11 @@ void Message_FindCreditsMessage(PlayState* play, u16 textId) { const char* foundSeg; const char* nextSeg; const char* seg; + Font* font = &play->msgCtx.font; MessageTableEntry* messageTableEntry = sStaffMessageEntryTablePtr; - Font* font; seg = messageTableEntry->segment; while (messageTableEntry->textId != 0xFFFF) { - font = &play->msgCtx.font; - if (messageTableEntry->textId == textId) { foundSeg = messageTableEntry->segment; font->charTexBuf[0] = messageTableEntry->typePos; @@ -981,7 +974,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { sMessageHasSetSfx = true; // "Sound (SE)" PRINTF("サウンド(SE)\n"); - sfxHi = msgCtx->msgBufDecoded[i + 1] << 8; + sfxHi = msgCtx->msgBufDecoded[i + 1]; + sfxHi <<= 8; Audio_PlaySfxGeneral(sfxHi | msgCtx->msgBufDecoded[i + 2], &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } @@ -1369,8 +1363,8 @@ void Message_Decode(PlayState* play) { } if (loadChar) { Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); - msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; PRINTF("%x(%x) ", digits[i] + '0' - ' ', digits[i]); decodedBufPos++; } @@ -1390,8 +1384,8 @@ void Message_Decode(PlayState* play) { for (i = 0; i < 2; i++) { if (i == 1 || digits[i] != 0) { Font_LoadChar(font, digits[i] + '0' - ' ', charTexIdx); - msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; charTexIdx += FONT_CHAR_TEX_SIZE; + msgCtx->msgBufDecoded[decodedBufPos] = digits[i] + '0'; PRINTF("%x(%x) ", digits[i] + '0' - ' ', digits[i]); decodedBufPos++; } @@ -1579,9 +1573,10 @@ void Message_OpenText(PlayState* play, u16 textId) { Font* font = &msgCtx->font; s16 textBoxType; - if (msgCtx->msgMode == MSGMODE_NONE) { - gSaveContext.prevHudVisibilityMode = gSaveContext.hudVisibilityMode; - } + // clang-format off + if (msgCtx->msgMode == MSGMODE_NONE) { gSaveContext.prevHudVisibilityMode = gSaveContext.hudVisibilityMode; } + // clang-format on + if (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT) { Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE); } @@ -1707,6 +1702,7 @@ void Message_StartTextbox(PlayState* play, u16 textId, Actor* actor) { } void Message_ContinueTextbox(PlayState* play, u16 textId) { + s32 pad; MessageContext* msgCtx = &play->msgCtx; PRINTF(VT_FGCOL(GREEN)); @@ -2951,6 +2947,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { *p = gfx; } +#if OOT_DEBUG /** * If the s16 variable pointed to by `var` changes in value, a black bar and white box * are briefly drawn onto the screen. It can only watch one variable per build due to @@ -3002,14 +2999,19 @@ void Message_DrawDebugText(PlayState* play, Gfx** p) { *p = GfxPrint_Close(&printer); GfxPrint_Destroy(&printer); } +#endif void Message_Draw(PlayState* play) { Gfx* plusOne; Gfx* polyOpaP; + +#if OOT_DEBUG s16 watchVar; +#endif OPEN_DISPS(play->state.gfxCtx, "../z_message_PAL.c", 3554); +#if OOT_DEBUG watchVar = gSaveContext.save.info.scarecrowLongSongSet; Message_DrawDebugVariableChanged(&watchVar, play->state.gfxCtx); if (BREG(0) != 0 && play->msgCtx.textId != 0) { @@ -3021,6 +3023,8 @@ void Message_Draw(PlayState* play) { POLY_OPA_DISP = plusOne; } if (1) {} +#endif + plusOne = Gfx_Open(polyOpaP = POLY_OPA_DISP); gSPDisplayList(OVERLAY_DISP++, plusOne); Message_DrawMain(play, &plusOne); @@ -3063,6 +3067,7 @@ void Message_Update(PlayState* play) { s16 playerFocusScreenPosY; s16 actorFocusScreenPosY; +#if OOT_DEBUG if (BREG(0) != 0) { if (CHECK_BTN_ALL(input->press.button, BTN_DDOWN) && CHECK_BTN_ALL(input->cur.button, BTN_L)) { PRINTF("msgno=%d\n", D_80153D78); @@ -3088,256 +3093,257 @@ void Message_Update(PlayState* play) { } } } +#endif - if (msgCtx->msgLength == 0) { - return; - } + if (msgCtx->msgLength != 0) { - switch (msgCtx->msgMode) { - case MSGMODE_TEXT_START: - D_8014B2F4++; + switch (msgCtx->msgMode) { + case MSGMODE_TEXT_START: + D_8014B2F4++; - var = false; - if (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_MARKET) { - if (D_8014B2F4 >= 4) { + var = false; + if (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_MARKET) { + if (D_8014B2F4 >= 4) { + var = true; + } + } else if (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_DEFAULT || + play->sceneId == SCENE_CASTLE_COURTYARD_GUARDS_DAY) { + var = true; + } else if (D_8014B2F4 >= 4 || msgCtx->talkActor == NULL) { var = true; } - } else if (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_DEFAULT || - play->sceneId == SCENE_CASTLE_COURTYARD_GUARDS_DAY) { - var = true; - } else if (D_8014B2F4 >= 4 || msgCtx->talkActor == NULL) { - var = true; - } - if (var) { - if (msgCtx->talkActor != NULL) { - Actor_GetScreenPos(play, &GET_PLAYER(play)->actor, &focusScreenPosX, &playerFocusScreenPosY); - Actor_GetScreenPos(play, msgCtx->talkActor, &focusScreenPosX, &actorFocusScreenPosY); + if (var) { + if (msgCtx->talkActor != NULL) { + Actor_GetScreenPos(play, &GET_PLAYER(play)->actor, &focusScreenPosX, &playerFocusScreenPosY); + Actor_GetScreenPos(play, msgCtx->talkActor, &focusScreenPosX, &actorFocusScreenPosY); - if (playerFocusScreenPosY >= actorFocusScreenPosY) { - averageY = ((playerFocusScreenPosY - actorFocusScreenPosY) / 2) + actorFocusScreenPosY; + if (playerFocusScreenPosY >= actorFocusScreenPosY) { + averageY = ((playerFocusScreenPosY - actorFocusScreenPosY) / 2) + actorFocusScreenPosY; + } else { + averageY = ((actorFocusScreenPosY - playerFocusScreenPosY) / 2) + playerFocusScreenPosY; + } + PRINTF("dxpos=%d dypos=%d dypos1 dypos2=%d\n", focusScreenPosX, averageY, + playerFocusScreenPosY, actorFocusScreenPosY); } else { - averageY = ((actorFocusScreenPosY - playerFocusScreenPosY) / 2) + playerFocusScreenPosY; + R_TEXTBOX_X = R_TEXTBOX_X_TARGET; + R_TEXTBOX_Y = R_TEXTBOX_Y_TARGET; } - PRINTF("dxpos=%d dypos=%d dypos1 dypos2=%d\n", focusScreenPosX, averageY, playerFocusScreenPosY, - actorFocusScreenPosY); - } else { - R_TEXTBOX_X = R_TEXTBOX_X_TARGET; - R_TEXTBOX_Y = R_TEXTBOX_Y_TARGET; - } - var = msgCtx->textBoxType; + var = msgCtx->textBoxType; - if (!msgCtx->textBoxPos) { // variable position - if (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_DEFAULT || - play->sceneId == SCENE_CASTLE_COURTYARD_GUARDS_DAY) { - if (averageY < XREG(92)) { - R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var]; + if (!msgCtx->textBoxPos) { // variable position + if (R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_DEFAULT || + play->sceneId == SCENE_CASTLE_COURTYARD_GUARDS_DAY) { + if (averageY < XREG(92)) { + R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var]; + } else { + R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var]; + } + } else if (play->sceneId == SCENE_MARKET_DAY || play->sceneId == SCENE_MARKET_NIGHT || + play->sceneId == SCENE_MARKET_RUINS) { + if (averageY < XREG(93)) { + R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var]; + } else { + R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var]; + } } else { - R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var]; - } - } else if (play->sceneId == SCENE_MARKET_DAY || play->sceneId == SCENE_MARKET_NIGHT || - play->sceneId == SCENE_MARKET_RUINS) { - if (averageY < XREG(93)) { - R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var]; - } else { - R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var]; + if (averageY < XREG(94)) { + R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var]; + } else { + R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var]; + } } + } else if (msgCtx->textBoxPos == TEXTBOX_POS_TOP) { + R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var]; + } else if (msgCtx->textBoxPos == TEXTBOX_POS_MIDDLE) { + R_TEXTBOX_Y_TARGET = sTextboxMidYPositions[var]; } else { - if (averageY < XREG(94)) { - R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var]; - } else { - R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var]; - } + R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var]; } - } else if (msgCtx->textBoxPos == TEXTBOX_POS_TOP) { - R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var]; - } else if (msgCtx->textBoxPos == TEXTBOX_POS_MIDDLE) { - R_TEXTBOX_Y_TARGET = sTextboxMidYPositions[var]; - } else { - R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var]; - } - R_TEXTBOX_X_TARGET = sTextboxXPositions[var]; - R_TEXTBOX_END_YPOS = sTextboxEndIconYOffset[var] + R_TEXTBOX_Y_TARGET; - R_TEXT_CHOICE_YPOS(0) = R_TEXTBOX_Y_TARGET + 20; - R_TEXT_CHOICE_YPOS(1) = R_TEXTBOX_Y_TARGET + 32; - R_TEXT_CHOICE_YPOS(2) = R_TEXTBOX_Y_TARGET + 44; - PRINTF("message->msg_disp_type=%x\n", msgCtx->textBoxProperties & 0xF0); - if (msgCtx->textBoxType == TEXTBOX_TYPE_NONE_BOTTOM || - msgCtx->textBoxType == TEXTBOX_TYPE_NONE_NO_SHADOW) { - msgCtx->msgMode = MSGMODE_TEXT_STARTING; - R_TEXTBOX_X = R_TEXTBOX_X_TARGET; - R_TEXTBOX_Y = R_TEXTBOX_Y_TARGET; - R_TEXTBOX_WIDTH = 256; - R_TEXTBOX_HEIGHT = 64; - R_TEXTBOX_TEXWIDTH = 512; - R_TEXTBOX_TEXHEIGHT = 512; - } else { - Message_GrowTextbox(msgCtx); - Audio_PlaySfxIfNotInCutscene(NA_SE_NONE); - msgCtx->stateTimer = 0; - msgCtx->msgMode = MSGMODE_TEXT_BOX_GROWING; + R_TEXTBOX_X_TARGET = sTextboxXPositions[var]; + R_TEXTBOX_END_YPOS = sTextboxEndIconYOffset[var] + R_TEXTBOX_Y_TARGET; + R_TEXT_CHOICE_YPOS(0) = R_TEXTBOX_Y_TARGET + 20; + R_TEXT_CHOICE_YPOS(1) = R_TEXTBOX_Y_TARGET + 32; + R_TEXT_CHOICE_YPOS(2) = R_TEXTBOX_Y_TARGET + 44; + PRINTF("message->msg_disp_type=%x\n", msgCtx->textBoxProperties & 0xF0); + if (msgCtx->textBoxType == TEXTBOX_TYPE_NONE_BOTTOM || + msgCtx->textBoxType == TEXTBOX_TYPE_NONE_NO_SHADOW) { + msgCtx->msgMode = MSGMODE_TEXT_STARTING; + R_TEXTBOX_X = R_TEXTBOX_X_TARGET; + R_TEXTBOX_Y = R_TEXTBOX_Y_TARGET; + R_TEXTBOX_WIDTH = 256; + R_TEXTBOX_HEIGHT = 64; + R_TEXTBOX_TEXWIDTH = 512; + R_TEXTBOX_TEXHEIGHT = 512; + } else { + Message_GrowTextbox(msgCtx); + Audio_PlaySfxIfNotInCutscene(NA_SE_NONE); + msgCtx->stateTimer = 0; + msgCtx->msgMode = MSGMODE_TEXT_BOX_GROWING; + } } - } - break; - case MSGMODE_TEXT_BOX_GROWING: - Message_GrowTextbox(msgCtx); - break; - case MSGMODE_TEXT_STARTING: - msgCtx->msgMode = MSGMODE_TEXT_NEXT_MSG; - if (YREG(31) == 0) { - Interface_SetDoAction(play, DO_ACTION_NEXT); - } - break; - case MSGMODE_TEXT_NEXT_MSG: - Message_Decode(play); - if (sTextFade) { - Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING); - } - if (D_80153D74 != 0) { - msgCtx->textDrawPos = msgCtx->decodedTextLen; - D_80153D74 = 0; - } - break; - case MSGMODE_TEXT_CONTINUING: - msgCtx->stateTimer--; - if (msgCtx->stateTimer == 0) { + break; + case MSGMODE_TEXT_BOX_GROWING: + Message_GrowTextbox(msgCtx); + break; + case MSGMODE_TEXT_STARTING: + msgCtx->msgMode = MSGMODE_TEXT_NEXT_MSG; + if (YREG(31) == 0) { + Interface_SetDoAction(play, DO_ACTION_NEXT); + } + break; + case MSGMODE_TEXT_NEXT_MSG: Message_Decode(play); - } - break; - case MSGMODE_TEXT_DISPLAYING: - if (msgCtx->textBoxType != TEXTBOX_TYPE_NONE_BOTTOM && YREG(31) == 0 && - CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B) && !msgCtx->textUnskippable) { - sTextboxSkipped = true; - msgCtx->textDrawPos = msgCtx->decodedTextLen; - } - break; - case MSGMODE_TEXT_AWAIT_INPUT: - if (YREG(31) == 0 && Message_ShouldAdvance(play)) { - msgCtx->msgMode = MSGMODE_TEXT_DISPLAYING; - msgCtx->textDrawPos++; - } - break; - case MSGMODE_TEXT_DELAYED_BREAK: - msgCtx->stateTimer--; - if (msgCtx->stateTimer == 0) { - msgCtx->msgMode = MSGMODE_TEXT_NEXT_MSG; - } - break; - case MSGMODE_TEXT_AWAIT_NEXT: - if (Message_ShouldAdvance(play)) { - msgCtx->msgMode = MSGMODE_TEXT_NEXT_MSG; - msgCtx->textUnskippable = false; - msgCtx->msgBufPos++; - } - break; - case MSGMODE_TEXT_DONE: - if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_FADING) { + if (sTextFade) { + Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING); + } + if (D_80153D74 != 0) { + msgCtx->textDrawPos = msgCtx->decodedTextLen; + D_80153D74 = 0; + } + break; + case MSGMODE_TEXT_CONTINUING: msgCtx->stateTimer--; if (msgCtx->stateTimer == 0) { - Message_CloseTextbox(play); + Message_Decode(play); } - } else if (msgCtx->textboxEndType != TEXTBOX_ENDTYPE_PERSISTENT && - msgCtx->textboxEndType != TEXTBOX_ENDTYPE_EVENT && YREG(31) == 0) { - if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_2_CHOICE && play->msgCtx.ocarinaMode == OCARINA_MODE_01) { - if (Message_ShouldAdvance(play)) { - PRINTF("OCARINA_MODE=%d -> ", play->msgCtx.ocarinaMode); - play->msgCtx.ocarinaMode = (msgCtx->choiceIndex == 0) ? OCARINA_MODE_02 : OCARINA_MODE_04; - PRINTF("InRaceSeq=%d(%d) OCARINA_MODE=%d --> ", GET_EVENTINF_HORSES_STATE(), 1, - play->msgCtx.ocarinaMode); - Message_CloseTextbox(play); - PRINTF("OCARINA_MODE=%d\n", play->msgCtx.ocarinaMode); - } - } else if (Message_ShouldAdvanceSilent(play)) { - PRINTF("select=%d\n", msgCtx->textboxEndType); - if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_HAS_NEXT) { - Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Message_ContinueTextbox(play, sNextTextId); - } else { - Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Message_CloseTextbox(play); - } - } - } - break; - case MSGMODE_TEXT_CLOSING: - msgCtx->stateTimer--; - if (msgCtx->stateTimer != 0) { break; - } - if ((msgCtx->textId >= 0xC2 && msgCtx->textId < 0xC7) || - (msgCtx->textId >= 0xFA && msgCtx->textId < 0xFE)) { - gSaveContext.healthAccumulator = 0x140; // Refill 20 hearts - } - if (msgCtx->textId == 0x301F || msgCtx->textId == 0xA || msgCtx->textId == 0xC || msgCtx->textId == 0xCF || - msgCtx->textId == 0x21C || msgCtx->textId == 9 || msgCtx->textId == 0x4078 || - msgCtx->textId == 0x2015 || msgCtx->textId == 0x3040) { - gSaveContext.prevHudVisibilityMode = HUD_VISIBILITY_ALL; - } - if (play->csCtx.state == 0) { - PRINTF(VT_FGCOL(GREEN)); - PRINTF("day_time=%x active_camera=%d ", gSaveContext.save.cutsceneIndex, play->activeCamId); - - if (msgCtx->textId != 0x2061 && msgCtx->textId != 0x2025 && msgCtx->textId != 0x208C && - ((msgCtx->textId < 0x88D || msgCtx->textId >= 0x893) || msgCtx->choiceIndex != 0) && - (msgCtx->textId != 0x3055 && gSaveContext.save.cutsceneIndex < 0xFFF0)) { - PRINTF("=== day_time=%x ", ((void)0, gSaveContext.save.cutsceneIndex)); - if (play->activeCamId == CAM_ID_MAIN) { - if (gSaveContext.prevHudVisibilityMode == HUD_VISIBILITY_NO_CHANGE || - gSaveContext.prevHudVisibilityMode == HUD_VISIBILITY_NOTHING || - gSaveContext.prevHudVisibilityMode == HUD_VISIBILITY_NOTHING_ALT) { - gSaveContext.prevHudVisibilityMode = HUD_VISIBILITY_ALL; + case MSGMODE_TEXT_DISPLAYING: + if (msgCtx->textBoxType != TEXTBOX_TYPE_NONE_BOTTOM && YREG(31) == 0 && + CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B) && !msgCtx->textUnskippable) { + sTextboxSkipped = true; + msgCtx->textDrawPos = msgCtx->decodedTextLen; + } + break; + case MSGMODE_TEXT_AWAIT_INPUT: + if (YREG(31) == 0 && Message_ShouldAdvance(play)) { + msgCtx->msgMode = MSGMODE_TEXT_DISPLAYING; + msgCtx->textDrawPos++; + } + break; + case MSGMODE_TEXT_DELAYED_BREAK: + msgCtx->stateTimer--; + if (msgCtx->stateTimer == 0) { + msgCtx->msgMode = MSGMODE_TEXT_NEXT_MSG; + } + break; + case MSGMODE_TEXT_AWAIT_NEXT: + if (Message_ShouldAdvance(play)) { + msgCtx->msgMode = MSGMODE_TEXT_NEXT_MSG; + msgCtx->textUnskippable = false; + msgCtx->msgBufPos++; + } + break; + case MSGMODE_TEXT_DONE: + if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_FADING) { + msgCtx->stateTimer--; + if (msgCtx->stateTimer == 0) { + Message_CloseTextbox(play); + } + } else if (msgCtx->textboxEndType != TEXTBOX_ENDTYPE_PERSISTENT && + msgCtx->textboxEndType != TEXTBOX_ENDTYPE_EVENT && YREG(31) == 0) { + if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_2_CHOICE && + play->msgCtx.ocarinaMode == OCARINA_MODE_01) { + if (Message_ShouldAdvance(play)) { + PRINTF("OCARINA_MODE=%d -> ", play->msgCtx.ocarinaMode); + play->msgCtx.ocarinaMode = (msgCtx->choiceIndex == 0) ? OCARINA_MODE_02 : OCARINA_MODE_04; + PRINTF("InRaceSeq=%d(%d) OCARINA_MODE=%d --> ", GET_EVENTINF_HORSES_STATE(), 1, + play->msgCtx.ocarinaMode); + Message_CloseTextbox(play); + PRINTF("OCARINA_MODE=%d\n", play->msgCtx.ocarinaMode); + } + } else if (Message_ShouldAdvanceSilent(play)) { + PRINTF("select=%d\n", msgCtx->textboxEndType); + if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_HAS_NEXT) { + Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_PASS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + Message_ContinueTextbox(play, sNextTextId); + } else { + Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + Message_CloseTextbox(play); } - gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; - Interface_ChangeHudVisibilityMode(gSaveContext.prevHudVisibilityMode); } } - } - PRINTF(VT_RST); - msgCtx->msgLength = 0; - msgCtx->msgMode = MSGMODE_NONE; - interfaceCtx->unk_1FA = interfaceCtx->unk_1FC = 0; - msgCtx->textId = msgCtx->stateTimer = 0; + break; + case MSGMODE_TEXT_CLOSING: + msgCtx->stateTimer--; + if (msgCtx->stateTimer != 0) { + break; + } + if ((msgCtx->textId >= 0xC2 && msgCtx->textId < 0xC7) || + (msgCtx->textId >= 0xFA && msgCtx->textId < 0xFE)) { + gSaveContext.healthAccumulator = 0x140; // Refill 20 hearts + } + if (msgCtx->textId == 0x301F || msgCtx->textId == 0xA || msgCtx->textId == 0xC || + msgCtx->textId == 0xCF || msgCtx->textId == 0x21C || msgCtx->textId == 9 || + msgCtx->textId == 0x4078 || msgCtx->textId == 0x2015 || msgCtx->textId == 0x3040) { + gSaveContext.prevHudVisibilityMode = HUD_VISIBILITY_ALL; + } + if (play->csCtx.state == 0) { + PRINTF(VT_FGCOL(GREEN)); + PRINTF("day_time=%x active_camera=%d ", gSaveContext.save.cutsceneIndex, play->activeCamId); - if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_PERSISTENT) { - msgCtx->textboxEndType = TEXTBOX_ENDTYPE_DEFAULT; - play->msgCtx.ocarinaMode = OCARINA_MODE_02; - } else { - msgCtx->textboxEndType = TEXTBOX_ENDTYPE_DEFAULT; - } - if ((s32)(gSaveContext.save.info.inventory.questItems & 0xF0000000) == (4 << QUEST_HEART_PIECE_COUNT)) { - gSaveContext.save.info.inventory.questItems ^= (4 << QUEST_HEART_PIECE_COUNT); - gSaveContext.save.info.playerData.healthCapacity += 0x10; - gSaveContext.save.info.playerData.health += 0x10; - } - if (msgCtx->ocarinaAction != OCARINA_ACTION_CHECK_NOWARP_DONE) { - if (sLastPlayedSong == OCARINA_SONG_SARIAS) { - //! @bug The last played song is not unset often, and if something interrupts the message system - // before it reaches this point after playing Saria's song, the song will be "stored". - // Later, if the ocarina has not been played and another textbox is closed, this handling - // for Saria's song will be carried out. - player->naviTextId = -0xE0; - player->naviActor->flags |= ACTOR_FLAG_16; - } - if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY_DONE && - (play->msgCtx.ocarinaMode == OCARINA_MODE_01 || play->msgCtx.ocarinaMode == OCARINA_MODE_0B)) { - play->msgCtx.ocarinaMode = OCARINA_MODE_04; - if (msgCtx->unk_E3F2 == OCARINA_SONG_SUNS) { - play->msgCtx.ocarinaMode = OCARINA_MODE_01; + if (msgCtx->textId != 0x2061 && msgCtx->textId != 0x2025 && msgCtx->textId != 0x208C && + ((msgCtx->textId < 0x88D || msgCtx->textId >= 0x893) || msgCtx->choiceIndex != 0) && + (msgCtx->textId != 0x3055 && gSaveContext.save.cutsceneIndex < 0xFFF0)) { + PRINTF("=== day_time=%x ", ((void)0, gSaveContext.save.cutsceneIndex)); + if (play->activeCamId == CAM_ID_MAIN) { + if (gSaveContext.prevHudVisibilityMode == HUD_VISIBILITY_NO_CHANGE || + gSaveContext.prevHudVisibilityMode == HUD_VISIBILITY_NOTHING || + gSaveContext.prevHudVisibilityMode == HUD_VISIBILITY_NOTHING_ALT) { + gSaveContext.prevHudVisibilityMode = HUD_VISIBILITY_ALL; + } + gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; + Interface_ChangeHudVisibilityMode(gSaveContext.prevHudVisibilityMode); + } } } - } - sLastPlayedSong = 0xFF; - PRINTF("OCARINA_MODE=%d chk_ocarina_no=%d\n", play->msgCtx.ocarinaMode, msgCtx->unk_E3F2); - break; - case MSGMODE_PAUSED: - break; - default: - msgCtx->lastOcarinaButtonIndex = OCARINA_BTN_INVALID; - break; + PRINTF(VT_RST); + msgCtx->msgLength = 0; + msgCtx->msgMode = MSGMODE_NONE; + interfaceCtx->unk_1FA = interfaceCtx->unk_1FC = 0; + msgCtx->textId = msgCtx->stateTimer = 0; + + if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_PERSISTENT) { + msgCtx->textboxEndType = TEXTBOX_ENDTYPE_DEFAULT; + play->msgCtx.ocarinaMode = OCARINA_MODE_02; + } else { + msgCtx->textboxEndType = TEXTBOX_ENDTYPE_DEFAULT; + } + if ((s32)(gSaveContext.save.info.inventory.questItems & 0xF0000000) == (4 << QUEST_HEART_PIECE_COUNT)) { + gSaveContext.save.info.inventory.questItems ^= (4 << QUEST_HEART_PIECE_COUNT); + gSaveContext.save.info.playerData.healthCapacity += 0x10; + gSaveContext.save.info.playerData.health += 0x10; + } + if (msgCtx->ocarinaAction != OCARINA_ACTION_CHECK_NOWARP_DONE) { + if (sLastPlayedSong == OCARINA_SONG_SARIAS) { + //! @bug The last played song is not unset often, and if something interrupts the message system + // before it reaches this point after playing Saria's song, the song will be "stored". + // Later, if the ocarina has not been played and another textbox is closed, this handling + // for Saria's song will be carried out. + player->naviTextId = -0xE0; + player->naviActor->flags |= ACTOR_FLAG_16; + } + if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY_DONE && + (play->msgCtx.ocarinaMode == OCARINA_MODE_01 || play->msgCtx.ocarinaMode == OCARINA_MODE_0B)) { + play->msgCtx.ocarinaMode = OCARINA_MODE_04; + if (msgCtx->unk_E3F2 == OCARINA_SONG_SUNS) { + play->msgCtx.ocarinaMode = OCARINA_MODE_01; + } + } + } + sLastPlayedSong = 0xFF; + PRINTF("OCARINA_MODE=%d chk_ocarina_no=%d\n", play->msgCtx.ocarinaMode, msgCtx->unk_E3F2); + break; + case MSGMODE_PAUSED: + break; + default: + msgCtx->lastOcarinaButtonIndex = OCARINA_BTN_INVALID; + break; + } } } diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c index 41834bacec..17193eee96 100644 --- a/src/code/z_onepointdemo.c +++ b/src/code/z_onepointdemo.c @@ -7,7 +7,123 @@ static s16 sDisableAttention = false; static s16 sUnused = -1; static s32 sPrevFrameCs1100 = -4096; -#include "z_onepointdemo_data.inc.c" +static CutsceneCameraPoint D_8012013C[14] = { + { CS_CAM_CONTINUE, 25, 40, 70.79991f, { -1814, 533, -1297 } }, + { CS_CAM_CONTINUE, 20, 40, 70.99991f, { -1805, 434, -1293 } }, + { CS_CAM_CONTINUE, 10, 30, 60.0f, { -1794, 323, -1280 } }, + { CS_CAM_CONTINUE, 5, 25, 60.0f, { -1817, 218, -1270 } }, + { CS_CAM_CONTINUE, 3, 20, 60.0f, { -1836, 168, -1243 } }, + { CS_CAM_CONTINUE, 0, 20, 60.0f, { -1905, 115, -1193 } }, + { CS_CAM_CONTINUE, 0, 30, 55.0f, { -1969, 58, -1212 } }, + { CS_CAM_CONTINUE, 0, 30, 55.0f, { -1969, 31, -1164 } }, + { CS_CAM_CONTINUE, 0, 30, 60.0f, { -1969, 54, -1209 } }, + { CS_CAM_CONTINUE, 0, 30, 60.0f, { -1973, 35, -1206 } }, + { CS_CAM_CONTINUE, 0, 50, 60.0f, { -1974, 12, -1179 } }, + { CS_CAM_CONTINUE, 0, 50, 60.0f, { -1974, 12, -1179 } }, + { CS_CAM_STOP, 0, 50, 60.0f, { -1974, 12, -1179 } }, + { CS_CAM_STOP, 0, 30, 60.0f, { -1974, 12, -1179 } }, +}; +static CutsceneCameraPoint D_8012021C[14] = { + { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1751, 604, -1233 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1752, 516, -1233 } }, + { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1751, 417, -1233 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1767, 306, -1219 } }, + { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1776, 257, -1205 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1881, 147, -1149 } }, + { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1969, 72, -1077 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1969, 7, -1048 } }, + { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1969, 1, -1030 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1987, 17, -1076 } }, + { CS_CAM_CONTINUE, 0, 0, 60.0f, { -2007, 10, -1004 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { -2007, 10, -1004 } }, + { CS_CAM_STOP, 0, 0, 60.0f, { -2007, 10, -1004 } }, { CS_CAM_STOP, 0, 0, 60.0f, { -2007, 10, -1004 } }, +}; +static s16 D_801202FC = 13; +static s16 D_80120300 = 210; +static s16 D_80120304 = 0; + +static CutsceneCameraPoint sCrawlspaceAtPoints[9] = { + { CS_CAM_CONTINUE, 0, 10, 40.0f, { 0, 4, 0 } }, { CS_CAM_CONTINUE, 0, 10, 40.000004f, { 0, 4, 0 } }, + { CS_CAM_CONTINUE, 0, 10, 50.0f, { 0, 9, 0 } }, { CS_CAM_CONTINUE, 0, 12, 55.0f, { 0, 12, 0 } }, + { CS_CAM_CONTINUE, 0, 15, 61.0f, { 0, 18, 0 } }, { CS_CAM_CONTINUE, 0, 20, 65.0f, { 0, 29, 0 } }, + { CS_CAM_CONTINUE, 0, 40, 60.0f, { 0, 34, 0 } }, { CS_CAM_STOP, 0, 40, 60.0f, { 0, 34, 0 } }, + { CS_CAM_STOP, 0, 10, 60.0f, { 0, 34, 0 } }, +}; +static CutsceneCameraPoint sCrawlspaceForwardsEyePoints[9] = { + { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 9, 45 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 8, 50 } }, + { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 17, 58 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 21, 78 } }, + { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 46, 109 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 58, 118 } }, + { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 63, 119 } }, { CS_CAM_STOP, 0, 0, 60.0f, { 0, 62, 119 } }, + { CS_CAM_STOP, 0, 0, 60.0f, { 0, 62, 119 } }, +}; +static s16 sCrawlspaceUnused = 9; +static s16 sCrawlspaceTimer = 90; +static s16 sCrawlspaceActionParam = 1; +static CutsceneCameraPoint sCrawlspaceBackwardsEyePoints[10] = { + { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 9, -45 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 9, -45 } }, + { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 8, -50 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 17, -58 } }, + { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 21, -78 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 46, -109 } }, + { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 58, -118 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 63, -119 } }, + { CS_CAM_STOP, 0, 0, 60.0f, { 0, 62, -119 } }, { CS_CAM_STOP, 0, 0, 60.0f, { 0, 62, -119 } }, +}; + +static CutsceneCameraPoint D_801204D4[14] = { + { CS_CAM_CONTINUE, -15, 40, 80.600006f, { -60, 332, 183 } }, + { CS_CAM_CONTINUE, -22, 30, 80.600006f, { -60, 332, 183 } }, + { CS_CAM_CONTINUE, -20, 38, 80.600006f, { -118, 344, 41 } }, + { CS_CAM_CONTINUE, -18, 32, 80.600006f, { -80, 251, -8 } }, + { CS_CAM_CONTINUE, -12, 28, 80.600006f, { -64, 259, -28 } }, + { CS_CAM_CONTINUE, -8, 22, 80.600006f, { -79, 200, -342 } }, + { CS_CAM_CONTINUE, -5, 10, 65.80005f, { -110, 140, -549 } }, + { CS_CAM_CONTINUE, -2, 8, 65.2f, { -74, 109, -507 } }, + { CS_CAM_CONTINUE, 0, 10, 65.80002f, { -32, 78, -680 } }, + { CS_CAM_CONTINUE, 0, 20, 85.199936f, { 25, 127, -950 } }, + { CS_CAM_CONTINUE, 0, 30, 85.199936f, { 25, 127, -950 } }, + { CS_CAM_CONTINUE, 0, 40, 85.199936f, { 25, 127, -950 } }, + { CS_CAM_STOP, 6, 30, 85.199936f, { 25, 127, -950 } }, + { CS_CAM_STOP, 0, 30, 85.199936f, { 25, 127, -950 } }, +}; +static CutsceneCameraPoint D_801205B4[14] = { + { CS_CAM_CONTINUE, 0, 0, 60.0f, { -225, 785, -242 } }, + { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -245, 784, -242 } }, + { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -288, 485, -379 } }, + { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -250, 244, -442 } }, + { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -163, 21, -415 } }, + { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -98, 86, -520 } }, + { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -86, 31, -816 } }, + { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -74, 18, -931 } }, + { CS_CAM_CONTINUE, 1, 0, 80.600006f, { -91, 80, -1220 } }, + { CS_CAM_CONTINUE, 0, 0, 85.199936f, { 14, 153, -1340 } }, + { CS_CAM_CONTINUE, 0, 0, 85.199936f, { 28, 125, -1340 } }, + { CS_CAM_CONTINUE, 0, 0, 85.199936f, { 48, 124, -1340 } }, + { CS_CAM_STOP, 0, 0, 85.199936f, { 48, 124, -1502 } }, + { CS_CAM_STOP, 0, 0, 85.199936f, { 48, 124, -1262 } }, +}; +static s16 D_80120694 = 14; +static s16 D_80120698 = 190; +static s16 D_8012069C = 8; + +static CutsceneCameraPoint D_801206A0[12] = { + { CS_CAM_CONTINUE, 6, 20, 80.0f, { -96, 40, 170 } }, { CS_CAM_CONTINUE, 6, 20, 80.0f, { -96, 40, 170 } }, + { CS_CAM_CONTINUE, 6, 20, 70.0f, { -70, 35, 150 } }, { CS_CAM_CONTINUE, 5, 10, 60.0f, { -57, 34, 133 } }, + { CS_CAM_CONTINUE, 4, 25, 65.0f, { -22, 32, 110 } }, { CS_CAM_CONTINUE, 3, 12, 60.0f, { -9, 33, 98 } }, + { CS_CAM_CONTINUE, 3, 5, 65.0f, { -3, 29, 87 } }, { CS_CAM_CONTINUE, 2, 10, 65.0f, { -1, 15, 84 } }, + { CS_CAM_CONTINUE, 1, 200, 65.0f, { 0, 17, 82 } }, { CS_CAM_CONTINUE, 1, 500, 65.0f, { 0, 18, 82 } }, + { CS_CAM_STOP, 8, 50, 65.0f, { 0, 18, 82 } }, { CS_CAM_STOP, 11, 60, 65.0f, { 0, 18, 82 } }, +}; +static CutsceneCameraPoint D_80120760[12] = { + { CS_CAM_CONTINUE, 6, 0, 80.0f, { -50, 10, 180 } }, { CS_CAM_CONTINUE, 6, 0, 80.0f, { -50, 20, 180 } }, + { CS_CAM_CONTINUE, 6, 0, 70.0f, { -40, 30, 177 } }, { CS_CAM_CONTINUE, 5, 0, 65.0f, { 0, 35, 172 } }, + { CS_CAM_CONTINUE, 4, 0, 65.0f, { 34, 35, 162 } }, { CS_CAM_CONTINUE, 3, 0, 65.0f, { 61, 32, 147 } }, + { CS_CAM_CONTINUE, 3, 0, 65.0f, { 72, 30, 128 } }, { CS_CAM_CONTINUE, 2, 0, 65.0f, { 74, 20, 125 } }, + { CS_CAM_CONTINUE, 1, 0, 65.0f, { 75, 18, 123 } }, { CS_CAM_CONTINUE, 1, 0, 65.0f, { 75, 10, 123 } }, + { CS_CAM_STOP, 0, 0, 65.0f, { 75, 10, 122 } }, { CS_CAM_STOP, 0, 0, 65.0f, { 75, 10, 122 } }, +}; +static CutsceneCameraPoint D_80120820[12] = { + { CS_CAM_CONTINUE, 6, 0, 80.0f, { 85, 5, 170 } }, { CS_CAM_CONTINUE, 6, 0, 80.0f, { 85, 10, 170 } }, + { CS_CAM_CONTINUE, 6, 0, 70.0f, { 80, 20, 167 } }, { CS_CAM_CONTINUE, 5, 0, 65.0f, { 74, 25, 165 } }, + { CS_CAM_CONTINUE, 4, 0, 65.0f, { 63, 30, 162 } }, { CS_CAM_CONTINUE, 3, 0, 65.0f, { 66, 34, 147 } }, + { CS_CAM_CONTINUE, 3, 0, 65.0f, { 72, 34, 128 } }, { CS_CAM_CONTINUE, 2, 0, 65.0f, { 74, 20, 125 } }, + { CS_CAM_CONTINUE, 1, 0, 65.0f, { 75, 18, 123 } }, { CS_CAM_CONTINUE, 1, 0, 65.0f, { 75, 10, 123 } }, + { CS_CAM_STOP, 0, 0, 65.0f, { 75, 10, 122 } }, { CS_CAM_STOP, 0, 0, 65.0f, { 75, 10, 122 } }, +}; +static s16 D_801208E0 = 12; +static s16 D_801208E4 = 90; +static s16 D_801208E8 = 8; Vec3f OnePointCutscene_AddVecGeoToVec3f(Vec3f* a, VecGeo* geo) { Vec3f sum; @@ -73,7 +189,43 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act OnePointCsInfo* csInfo = &subCam->paramData.uniq9.csInfo; switch (csId) { - case 1020: // smoothly return to main camera from current view + case 1020: { // smoothly return to main camera from current view + static OnePointCsFull D_801208EC[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0x0101, + 1, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 1, + 0, + 60.0f, + 1.0f, + { 0.0f, -10.0f, 0.0f }, + { 0.0f, 0.0f, 150.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; + if (timer < 20) { timer = 20; } @@ -92,8 +244,34 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 1030: { + static OnePointCsFull D_80120964[2] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 1, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0xA121, + 1, + 0, + 75.0f, + 0.6f, + { 0.0f, -10.0f, 0.0f }, + { 0.0f, 0.0f, 150.0f }, + }, + }; - case 1030: D_80120964[0].atTargetInit = play->view.at; D_80120964[0].eyeTargetInit = play->view.eye; D_80120964[0].fovTargetInit = play->view.fovy; @@ -106,8 +284,56 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 5000: { + static OnePointCsFull D_801209B4[4] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0x0101, + 1, + 0, + 60.0f, + 0.9f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0100, + 29, + 0, + 45.0f, + 0.1f, + { 0.0f, -10.0f, 0.0f }, + { 0.0f, 0.0f, 150.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 10, + 0, + 60.0f, + 0.2f, + { 0.0f, -10.0f, 0.0f }, + { 0.0f, 0.0f, 150.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 5000: D_801209B4[0].atTargetInit = D_801209B4[1].atTargetInit = play->view.at; D_801209B4[0].eyeTargetInit = play->view.eye; D_801209B4[0].fovTargetInit = D_801209B4[2].fovTargetInit = play->view.fovy; @@ -121,6 +347,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } case 5010: // attention cutscene // Setup keyFrames in `Camera_Demo5` @@ -129,13 +356,108 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act subCam->roll = 0; break; - case 9500: + case 9500: { + static OnePointCsFull D_80120A54[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2525, + 1, + 0, + 75.0f, + 0.1f, + { 0.0f, 20.0f, -10.0f }, + { 0.0f, 10.0f, -40.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 9, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0022, + 5000, + 0, + 75.0f, + 0.005f, + { 0.0f, 0.0f, -10.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; + csInfo->keyFrames = D_80120A54; csInfo->keyFrameCount = ARRAY_COUNT(D_80120A54); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 2260: { + static OnePointCsFull D_80120ACC[5] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0442, + 10, + 0, + 40.0f, + 1.0f, + { -10.0f, 45.0f, 20.0f }, + { 20.0f, 30.0f, 160.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 40.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0442, + 10, + 0, + 40.0f, + 1.0f, + { -10.0f, 45.0f, 20.0f }, + { 20.0f, 30.0f, 160.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 40.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 2260: D_80120ACC[0].atTargetInit.x = D_80120ACC[2].atTargetInit.x = ((mainCam->play->state.frames & 1) ? -10.0f : 10.0f) + (Rand_ZeroOne() * 8.0f); @@ -147,8 +469,133 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 2270: { + static OnePointCsFull D_80120B94[11] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x2142, + 1, + 0, + 40.0f, + 1.0f, + { 20.0f, 40.0f, 20.0f }, + { -20.0f, 0.0f, -30.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0404, + 19, + 5, + 70.0f, + 0.01f, + { 0.0f, 30.0f, 20.0f }, + { 120.0f, 60.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0404, + 20, + 0, + 60.0f, + 0.01f, + { 0.0f, 20.0f, 20.0f }, + { 120.0f, 60.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0404, + 40, + -10, + 50.0f, + 0.02f, + { 0.0f, 30.0f, 20.0f }, + { 120.0f, 60.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4141, + 1, + 0, + 40.0f, + 1.0f, + { 0.0f, -10.0f, 20.0f }, + { 0.0f, 20.0f, 50.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0404, + 19, + 0, + 70.0f, + 0.01f, + { 0.0f, 30.0f, 20.0f }, + { 120.0f, 60.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0404, + 40, + 10, + 50.0f, + 0.01f, + { 0.0f, 20.0f, 20.0f }, + { 120.0f, 60.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0404, + 70, + 0, + 60.0f, + 0.01f, + { 0.0f, 30.0f, 20.0f }, + { 120.0f, 60.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4141, + 1, + 0, + 50.0f, + 1.0f, + { 0.0f, -10.0f, 0.0f }, + { 80.0f, 20.0f, 60.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_13, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4141, + 150, + 0, + 50.0f, + 1.0f, + { 0.0f, 5.0f, 0.0f }, + { 0.0f, 4.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_24, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 50.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 2270: csInfo->keyFrames = D_80120B94; csInfo->keyFrameCount = ARRAY_COUNT(D_80120B94); @@ -170,8 +617,89 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 4, 5, 40, 0x3C); Quake_SetDuration(i, 1600); break; + } + + case 2280: { + static OnePointCsFull D_80120D4C[7] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x2142, + 1, + 0, + 40.0f, + 1.0f, + { 20.0f, 40.0f, 20.0f }, + { -20.0f, 0.0f, -30.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0404, + 19, + 5, + 70.0f, + 0.01f, + { 0.0f, 30.0f, 20.0f }, + { 120.0f, 60.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0404, + 20, + 0, + 60.0f, + 0.01f, + { 0.0f, 20.0f, 20.0f }, + { 120.0f, 60.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0404, + 40, + -10, + 50.0f, + 0.02f, + { 0.0f, 30.0f, 20.0f }, + { 120.0f, 60.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4141, + 1, + 0, + 50.0f, + 1.0f, + { 0.0f, -10.0f, 0.0f }, + { 80.0f, 20.0f, 60.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_13, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4141, + 150, + 0, + 50.0f, + 1.0f, + { 0.0f, 5.0f, 0.0f }, + { 0.0f, 4.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_24, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 50.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 2280: csInfo->keyFrames = D_80120D4C; csInfo->keyFrameCount = ARRAY_COUNT(D_80120D4C); @@ -192,8 +720,100 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 2, 3, 200, 0x32); Quake_SetDuration(i, 9999); break; + } + + case 2220: { + static OnePointCsFull D_80120E64[8] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, true, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x2142, + 20, + 0, + 50.0f, + 1.0f, + { -25.0f, 20.0f, 0.0f }, + { 0.0f, 0.0f, 5.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 80, + 0, + 50.0f, + 1.0f, + { -25.0f, 20.0f, 0.0f }, + { 0.0f, 0.0f, 5.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 8, + 0, + 60.0f, + 0.1f, + { -25.0f, 20.0f, 0.0f }, + { 0.0f, 0.0f, 5.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 15, + 4, + 55.0f, + 0.05f, + { -50.0f, 20.0f, 20.0f }, + { 0.0f, 0.0f, 5.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 15, + -4, + 50.0f, + 0.05f, + { 0.0f, 20.0f, 0.0f }, + { 0.0f, 0.0f, 5.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 15, + 0, + 50.0f, + 0.1f, + { -25.0f, 20.0f, 0.0f }, + { 0.0f, 0.0f, 5.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 40, + 0, + 50.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 2220: csInfo->keyFrames = D_80120E64; csInfo->keyFrameCount = ARRAY_COUNT(D_80120E64); @@ -204,8 +824,78 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 2, 2, 50, 0); Quake_SetDuration(i, 280); break; + } + + case 2230: { + static OnePointCsFull D_80120FA4[6] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x2143, + 30, + 0, + 70.0f, + 0.4f, + { 0.0f, 40.0f, 50.0f }, + { 30.0f, 10.0f, -50.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 50.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2222, + 10, + 0, + 42.0f, + 1.0f, + { 0.0f, 40.0f, 0.0f }, + { 0.0f, 85.0f, 45.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 50.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2121, + 10, + 0, + 60.0f, + 1.0f, + { 0.0f, 10.0f, 0.0f }, + { 30.0f, 10.0f, -80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 2230: if (player->actor.world.pos.z < 1000.0f) { D_80120FA4[0].eyeTargetInit.x = -D_80120FA4[0].eyeTargetInit.x; D_80120FA4[2].eyeTargetInit.x = -D_80120FA4[2].eyeTargetInit.x; @@ -216,8 +906,45 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 2340: { + static OnePointCsFull D_80121094[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0x2101, + 20, + 0, + 50.0f, + 1.0f, + { 3840.0f, 10.0f, 950.0f }, + { 0.0f, 0.0f, 5.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x2101, + 50, + 0, + 55.0f, + 1.0f, + { 4000.0f, 50.0f, 1000.0f }, + { 0.0f, 0.0f, 5.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 2340: csInfo->keyFrames = D_80121094; csInfo->keyFrameCount = ARRAY_COUNT(D_80121094); @@ -228,15 +955,101 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 2, 2, 50, 0); Quake_SetDuration(i, 60); break; + } + + case 2350: { + static OnePointCsFull D_8012110C[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_5), + 0x2142, + 1, + 0, + 50.0f, + 1.0f, + { -25.0f, 20.0f, 0.0f }, + { 0.0f, 0.0f, 5.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, true, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2121, + 10, + 0, + 60.0f, + 1.0f, + { 0.0f, 10.0f, 0.0f }, + { 0.0f, 10.0f, -80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 2350: csInfo->keyFrames = D_8012110C; csInfo->keyFrameCount = ARRAY_COUNT(D_8012110C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } case 2200: { + static OnePointCsFull D_80121184[2] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0101, + 40, + 0, + -1.0f, + 0.1f, + { 0.0f, 10.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; + static OnePointCsFull D_801211D4[2] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0x0101, + 50, + 0, + 60.0f, + 1.0f, + { 0.0f, 10.0f, 0.0f }, + { -10.0f, 85.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; s16 sp82; s16 sp80; s16 sp7E; @@ -271,9 +1084,78 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act } Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_UNK3); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); - } break; + break; + } case 2290: { + static OnePointCsFull D_80121224[6] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x4141, + 2, + 0, + 60.0f, + 1.0f, + { 0.0f, 5.0f, 10.0f }, + { 0.0f, 0.0f, 45.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4141, + 18, + 0, + 45.0f, + 1.0f, + { 0.0f, 5.0f, 10.0f }, + { 0.0f, -10.0f, 50.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_52), + 0x4104, + 80, + 0, + 70.0f, + 0.05f, + { 0.0f, 0.0f, 60.0f }, + { 0.0f, 250.0f, -50.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0000, + 20, + 0, + 70.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0421, + 60, + 0, + 50.0f, + 1.0f, + { 0.0f, -30.0f, 20.0f }, + { 10.0f, 5.0f, -50.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; Actor* rideActor = player->rideActor; Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); @@ -285,9 +1167,24 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act csInfo->keyFrameCount = ARRAY_COUNT(D_80121224); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); - } break; + break; + } + + case 5120: { + static OnePointCsFull D_80121314[1] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0x4141, + 1000, + 0, + 75.0f, + 0.6f, + { 0.0f, 0.0f, 10.0f }, + { 0.0f, 0.0f, 100.0f }, + }, + }; - case 5120: Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); csInfo->keyFrames = D_80121314; @@ -295,8 +1192,45 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4510: { + static OnePointCsFull D_8012133C[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0141, + 40, + 0, + 75.0f, + 1.0f, + { 0.0f, 60.0f, 0.0f }, + { 0.0f, 0.0f, 100.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2121, + 20, + 0, + 60.0f, + 0.2f, + { 0.0f, -10.0f, -10.0f }, + { 0.0f, 10.0f, -100.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4510: D_8012133C[0].eyeTargetInit = actor->world.pos; D_8012133C[0].eyeTargetInit.y = player->actor.world.pos.y + 40.0f; Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); @@ -306,6 +1240,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } case 4500: spA0 = Actor_GetFocus(actor); @@ -326,7 +1261,65 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act } break; - case 2210: + case 2210: { + static OnePointCsFull D_801213B4[5] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0xC2C2, + 40, + 0, + 70.0f, + 1.0f, + { 80.0f, 0.0f, 20.0f }, + { 20.0f, 0.0f, 80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0xC2C2, + 120, + 0, + 70.0f, + 0.1f, + { 80.0f, 0.0f, 20.0f }, + { 20.0f, 0.0f, 80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_83), + 0xC2C2, + 30, + 0, + 50.0f, + 1.0f, + { 60.0f, 0.0f, 20.0f }, + { 60.0f, 0.0f, 60.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_69), + 0x4222, + 30, + 0, + 60.0f, + 0.1f, + { 0.0f, 50.0f, 0.0f }, + { 5.0f, 30.0f, 220.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 75.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; + spD0 = OLib_Vec3fDiffToVecGeo(&player->actor.world.pos, &actor->world.pos); D_801213B4[0].eyeTargetInit.y = D_801213B4[1].eyeTargetInit.y = D_801213B4[2].eyeTargetInit.y = D_801213B4[2].atTargetInit.y = CAM_BINANG_TO_DEG(spD0.yaw); @@ -340,6 +1333,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } case 1010: Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2); @@ -362,12 +1356,60 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act sCrawlspaceAtPoints, sCrawlspaceBackwardsEyePoints); break; - case 4175: + case 4175: { + static OnePointCsFull D_8012147C[4] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0101, + 40, + 0, + 45.0f, + 1.0f, + { 820.0f, 1600.0f, -400.0f }, + { 777.0f, 1577.0f, -577.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0142, + 1, + 0, + 50.0f, + 1.0f, + { -50.0f, 80.0f, 0.0f }, + { 900.0f, 1575.0f, 850.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0x0142, + 89, + -4, + 80.0f, + 0.07f, + { -50.0f, 70.0f, 0.0f }, + { 975.0f, 1575.0f, 770.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; + csInfo->keyFrames = D_8012147C; csInfo->keyFrameCount = ARRAY_COUNT(D_8012147C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } case 4180: spC0.x = -1881.0f; @@ -383,7 +1425,32 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); break; - case 3040: + case 3040: { + static OnePointCsFull D_8012151C[2] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0101, + 29, + 0, + 60.0f, + 1.0f, + { -700.0f, 875.0f, -100.0f }, + { -550.0f, 920.0f, -150.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; + Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); D_8012151C[0].timerInit = timer - 1; @@ -392,8 +1459,34 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 3020: { + static OnePointCsFull D_8012156C[2] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_77), + 0x4242, + 1, + 0, + 65.0f, + 1.0f, + { 60.0f, 30.0f, 0.0f }, + { 50.0f, 20.0f, 150.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + -1, + 0, + 65.0f, + 1.0f, + { -50.0f, 60.0f, 0.0f }, + { -60.0f, 40.0f, 150.0f }, + }, + }; - case 3020: D_8012156C[1].timerInit = timer - 1; if (mainCam->play->state.frames & 1) { D_8012156C[0].atTargetInit.x = -D_8012156C[0].atTargetInit.x; @@ -411,8 +1504,23 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); break; + } + + case 3010: { + static OnePointCsFull D_801215BC[1] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 5, + 0, + 65.0f, + 1.0f, + { -1185.0f, 655.0f, 1185.0f }, + { -1255.0f, 735.0f, 1255.0f }, + }, + }; - case 3010: D_801215BC[0].timerInit = timer; csInfo->keyFrames = D_801215BC; @@ -420,8 +1528,122 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 3070: { + static OnePointCsFull D_801215E4[10] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0x4141, + 20, + 0, + 30.0f, + 1.0f, + { 0.0f, 120.0f, 0.0f }, + { -10.0f, 140.0f, -90.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0101, + 1, + 4, + 75.0f, + 1.0f, + { -1360.0f, -940.0f, -3343.0f }, + { -1060.0f, -980.0f, -3325.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4141, + 129, + 0, + 75.0f, + 0.5f, + { 0.0f, 50.0f, 0.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0303, + 30, + 0, + 70.0f, + 0.05f, + { 0.0f, 80.0f, 0.0f }, + { -10.0f, 120.0f, 10.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_9), + 0x0101, + 40, + -5, + 70.0f, + 1.0f, + { -973.0f, -924.0f, -3263.0f }, + { -1190.0f, -1010.0f, -3365.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0101, + 1, + 0, + 75.0f, + 1.0f, + { -1355.0f, -700.0f, -3340.0f }, + { -1040.0f, -940.0f, -3345.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 60, + 0, + 45.0f, + 0.8f, + { -1370.0f, -875.0f, -3345.0f }, + { -1230.0f, -885.0f, -3345.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 10, + 0, + 70.0f, + 1.0f, + { -1370.0f, -875.0f, -3345.0f }, + { -1210.0f, -900.0f, -3420.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 20, + 0, + 70.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 3070: csInfo->keyFrames = D_801215E4; csInfo->keyFrameCount = ARRAY_COUNT(D_801215E4); @@ -432,15 +1654,111 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 2, 0, 200, 0); Quake_SetDuration(i, 10); break; + } + + case 3080: { + static OnePointCsFull D_80121774[4] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0x0101, + 1, + -2, + 75.0f, + 1.0f, + { -1340.0f, -860.0f, -3345.0f }, + { -1415.0f, -940.0f, -3520.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0142, + 39, + 2, + 70.0f, + 1.0f, + { 0.0f, -20.0f, 10.0f }, + { -1140.0f, -1010.0f, -3560.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_5), + 0x0121, + 20, + 0, + 60.0f, + 1.0f, + { 0.0f, -20.0f, 20.0f }, + { -1220.0f, -1005.0f, -3660.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 3080: csInfo->keyFrames = D_80121774; csInfo->keyFrameCount = ARRAY_COUNT(D_80121774); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 3090: { + static OnePointCsFull D_80121814[4] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_76), + 0x0101, + 5, + 0, + 40.0f, + 1.0f, + { -1400.0f, -540.0f, -3327.0f }, + { -1254.0f, -20.0f, -3357.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 70, + 0, + 75.0f, + 0.75f, + { -1327.0f, 100.0f, -3342.0f }, + { -1320.0f, 350.0f, -3540.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2121, + 10, + 0, + 60.0f, + 0.75f, + { 0.0f, 10.0f, 0.0f }, + { 0.0f, 20.0f, -150.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 3090: Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); csInfo->keyFrames = D_80121814; @@ -448,6 +1766,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } case 3100: VEC_SET(spB4, 0.0f, -280.0f, -1400.0f); @@ -462,7 +1781,32 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act break; case 3380: - case 3065: + case 3065: { + static OnePointCsFull D_801218B4[2] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 60, + 0, + 65.0f, + 1.0f, + { 0.0f, 350.0f, -1520.0f }, + { 0.0f, 715.0f, -885.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 100, + 0, + 70.0f, + 0.02f, + { 0.0f, 75.0f, -1335.0f }, + { 0.0f, 20.0f, -1190.0f }, + }, + }; + csInfo->keyFrames = D_801218B4; csInfo->keyFrameCount = ARRAY_COUNT(D_801218B4); @@ -474,16 +1818,43 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 2, 0, 0, 0); Quake_SetDuration(i, 160); break; + } + + case 3060: { + static OnePointCsFull D_80121904[2] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 50, + 10, + 65.0f, + 1.0f, + { 165.0f, 85.0f, -920.0f }, + { 65.0f, -30.0f, -720.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 3060: csInfo->keyFrames = D_80121904; csInfo->keyFrameCount = ARRAY_COUNT(D_80121904); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } - case 3050: + case 3050: { Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3); Player_SetCsActionWithHaltedActors(play, &player->actor, PLAYER_CSACTION_5); OnePointCutscene_SetCsCamPoints(subCam, D_80120304 | 0x2000, D_80120300, D_8012013C, D_8012021C); @@ -508,8 +1879,84 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 2, 1, 1, 0); Quake_SetDuration(i, 200); break; + } + + case 3120: { + static OnePointCsFull D_80121954[3][2] = { + { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 20, + 5, + 60.0f, + 1.0f, + { -700.0f, 940.0f, 300.0f }, + { -765.0f, 1000.0f, 335.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 80, + -10, + 70.0f, + 0.1f, + { -540.0f, 875.0f, 245.0f }, + { -585.0f, 900.0f, 335.0f }, + }, + }, + { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 40, + -30, + 70.0f, + 1.0f, + { -80.0f, 115.0f, -180.0f }, + { -5.0f, 240.0f, -190.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 60, + 20, + 70.0f, + 0.1f, + { -100.0f, 350.0f, -175.0f }, + { -5.0f, 240.0f, -190.0f }, + }, + }, + { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 80, + 5, + 70.0f, + 0.2f, + { 960.0f, 900.0f, 260.0f }, + { 970.0f, 950.0f, 250.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 20, + 5, + 70.0f, + 1.0f, + { 960.0f, 900.0f, 260.0f }, + { 970.0f, 950.0f, 250.0f }, + }, + }, + }; - case 3120: csInfo->keyFrames = D_80121954[-(timer + 101)]; subCam->timer = 100; subCam->stateFlags |= CAM_STATE_CHECK_WATER; @@ -518,8 +1965,144 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 3130: { + static OnePointCsFull D_80121A44[12] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_5), + 0x2121, + 10, + 0, + 60.0f, + 1.0f, + { 0.0f, -5.0f, 0.0f }, + { 0.0f, 0.0f, -80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, true, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x4242, + 30, + 0, + 50.0f, + 1.0f, + { 0.0f, 45.0f, 0.0f }, + { 0.0f, 45.0f, 50.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, true, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_5), + 0x2222, + 40, + 5, + 50.0f, + 1.0f, + { 0.0f, 50.0f, 0.0f }, + { 0.0f, 50.0f, 50.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x4242, + 40, + 5, + 60.0f, + 1.0f, + { 30.0f, 30.0f, 15.0f }, + { 70.0f, 30.0f, -40.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, true, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 30, + -5, + 50.0f, + 1.0f, + { 20.0f, 30.0f, -5.0f }, + { 0.0f, 70.0f, 70.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, true, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x2242, + 40, + 0, + 45.0f, + 1.0f, + { 0.0f, 30.0f, 30.0f }, + { 25.0f, 60.0f, -60.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x22C2, + 140, + 0, + 60.0f, + 0.04f, + { 0.0f, 0.0f, 30.0f }, + { 25.0f, 60.0f, -60.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_9, true, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2222, + 20, + 0, + 60.0f, + 0.8f, + { 0.0f, 50.0f, 0.0f }, + { 0.0f, 60.0f, -60.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 3130: csInfo->keyFrames = D_80121A44; csInfo->keyFrameCount = ARRAY_COUNT(D_80121A44); @@ -527,8 +2110,89 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); subCam->stateFlags |= CAM_STATE_CHECK_WATER; break; + } + + case 3140: { + static OnePointCsFull D_80121C24[7] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_5), + 0x0101, + 1, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 89, + 0, + 50.0f, + 0.4f, + { 125.0f, 320.0f, -1500.0f }, + { 125.0f, 500.0f, -1150.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0x0101, + 40, + 4, + 55.0f, + 1.0f, + { 0.0f, 375.0f, -1440.0f }, + { 5.0f, 365.0f, -1315.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 40, + -4, + 55.0f, + 1.0f, + { 250.0f, 375.0f, -1440.0f }, + { 235.0f, 365.0f, -1315.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 100, + 0, + 95.0f, + 1.0f, + { 125.0f, 345.0f, -1500.0f }, + { 125.0f, 255.0f, -1350.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 100, + 0, + 60.0f, + 1.0f, + { 125.0f, 325.0f, -1500.0f }, + { 125.0f, 480.0f, -1000.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 3140: D_80121C24[0].atTargetInit = play->view.at; D_80121C24[0].eyeTargetInit = play->view.eye; D_80121C24[0].fovTargetInit = play->view.fovy; @@ -538,6 +2202,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } case 3150: spC0.x = 1890.0f; @@ -666,7 +2331,43 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); break; - case 3240: + case 3240: { + static OnePointCsFull D_80121D3C[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 1, + 0, + 60.0f, + 1.0f, + { 1023.0f, 738.0f, -2628.0f }, + { 993.0f, 770.0f, -2740.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 4, + 0, + 50.0f, + 1.0f, + { 1255.0f, 350.0f, -1870.0f }, + { 1240.0f, 575.0f, -2100.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + -1, + 0, + 75.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; + D_80121D3C[2].timerInit = timer - 5; csInfo->keyFrames = D_80121D3C; @@ -675,6 +2376,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } case 6001: Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3); @@ -705,7 +2407,109 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetDuration(i, D_80120698 - 20); break; - case 3390: + case 3390: { + static OnePointCsFull D_80121DB4[9] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 40, + 0, + 70.0f, + 1.0f, + { 4290.0f, -1332.0f, -1900.0f }, + { 4155.0f, -1360.0f, -1840.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 60, + 0, + 70.0f, + 1.0f, + { 4215.0f, -975.0f, -2095.0f }, + { 4070.0f, -1000.0f, -2025.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 5, + 0, + 70.0f, + 1.0f, + { 4215.0f, -975.0f, -2095.0f }, + { 4070.0f, -1000.0f, -2025.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 80, + 8, + 75.0f, + 1.0f, + { 4010.0f, -1152.0f, -1728.0f }, + { 3997.0f, -1194.0f, -1629.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_57), + 0x2121, + 1, + 8, + 75.0f, + 1.0f, + { 20.0f, 20.0f, 0.0f }, + { 50.0f, 30.0f, 200.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2121, + 99, + 2, + 70.0f, + 0.02f, + { -20.0f, 0.0f, 20.0f }, + { 300.0f, 50.0f, -500.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_9, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_56), + 0x2121, + 149, + -20, + 70.0f, + 0.1f, + { 100.0f, 50.0f, -100.0f }, + { 5000.0f, 1055.0f, -2250.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2121, + 1, + 0, + 60.0f, + 1.0f, + { 0.0f, -20.0f, 0.0f }, + { 0.0f, 20.0f, -150.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; + player->actor.shape.rot.y = player->actor.world.rot.y = player->yaw = -0x3FD9; csInfo->keyFrames = D_80121DB4; @@ -714,6 +2518,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } case 3310: Play_RequestCameraSetting(play, subCamId, CAM_SET_FIRE_STAIRCASE); @@ -726,7 +2531,54 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetDuration(i, timer); break; - case 3290: + case 3290: { + static OnePointCsFull D_80121F1C[4] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0x0101, + 10, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2121, + 10, + 0, + 50.0f, + 0.5f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 150.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_2), + 0x2121, + 23, + 0, + 50.0f, + 0.5f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 150.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; + D_80121F1C[0].atTargetInit = play->view.at; D_80121F1C[0].eyeTargetInit = play->view.eye; D_80121F1C[0].fovTargetInit = play->view.fovy; @@ -743,8 +2595,56 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 0, 0, 1000, 0); Quake_SetDuration(i, 5); break; + } + + case 3340: { + static OnePointCsFull D_80121FBC[4] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 5, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 10, + 0, + 30.0f, + 1.0f, + { -2130.0f, 2885.0f, -1055.0f }, + { -2085.0f, 2875.0f, -1145.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 30, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 3340: D_80121FBC[0].atTargetInit = play->view.at; D_80121FBC[0].eyeTargetInit = play->view.eye; D_80121FBC[0].fovTargetInit = play->view.fovy; @@ -760,16 +2660,112 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 0, 0, 1000, 0); Quake_SetDuration(i, 5); break; + } + + case 3360: { + static OnePointCsFull D_8012205C[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x42C2, + 1, + 0, + 50.0f, + 1.0f, + { 0.0f, 220.0f, 0.0f }, + { 0.0f, 220.0f, 240.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0080, + 29, + 0, + 50.0f, + 1.0f, + { 0.0f, 220.0f, 0.0f }, + { 0.0f, 220.0f, 240.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x21A1, + 10, + 0, + 60.0f, + 1.0f, + { 0.0f, -10.0f, 0.0f }, + { 0.0f, 10.0f, -200.0f }, + }, + }; - case 3360: csInfo->keyFrames = D_8012205C; csInfo->keyFrameCount = ARRAY_COUNT(D_8012205C); Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 3350: { + static OnePointCsFull D_801220D4[5] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0101, + 5, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4141, + 10, + 5, + 55.0f, + 0.75f, + { 400.0f, -50.0f, 800.0f }, + { 600.0f, -60.0f, 800.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4141, + 15, + 10, + 40.0f, + 0.75f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 10.0f, 200.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 25, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 3350: D_801220D4[0].atTargetInit = play->view.at; D_801220D4[0].eyeTargetInit = play->view.eye; D_801220D4[0].fovTargetInit = play->view.fovy; @@ -788,16 +2784,156 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 3330: { + static OnePointCsFull D_8012219C[7] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2121, + 5, + 0, + 60.0f, + 1.0f, + { 0.0f, -5.0f, 0.0f }, + { 0.0f, 0.0f, -80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 15, + 0, + 40.0f, + 0.4f, + { 0.0f, 60.0f, -20.0f }, + { 0.0f, 60.0f, 100.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 20, + 0, + 40.0f, + 1.0f, + { 0.0f, 60.0f, -20.0f }, + { 0.0f, 60.0f, 100.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 20, + 0, + 60.0f, + 1.0f, + { 20.0f, 60.0f, 20.0f }, + { 40.0f, 60.0f, -80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 90, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 3330: csInfo->keyFrames = D_8012219C; csInfo->keyFrameCount = ARRAY_COUNT(D_8012219C); Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 3410: { + static OnePointCsFull D_801222B4[5] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 20, + 10, + 45.0f, + 1.0f, + { -1200.0f, 730.0f, -860.0f }, + { -1100.0f, 500.0f, -1025.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 20, + 10, + 45.0f, + 0.1f, + { -880.0f, 480.0f, -860.0f }, + { -1100.0f, 500.0f, -1025.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), + ONEPOINT_CS_INIT_FIELD_ACTORCAT(ACTORCAT_BG), + 0x0101, + 20, + 10, + 45.0f, + 0.1f, + { -880.0f, 500.0f, -860.0f }, + { -1100.0f, 500.0f, -1025.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), + ONEPOINT_CS_INIT_FIELD_ACTORCAT(ACTORCAT_DOOR), + 0x0101, + 5, + 10, + 45.0f, + 0.1f, + { -880.0f, 500.0f, -860.0f }, + { -1100.0f, 500.0f, -1025.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 3410: csInfo->keyFrames = D_801222B4; csInfo->keyFrameCount = ARRAY_COUNT(D_801222B4); @@ -809,8 +2945,34 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 4, 0, 0, 0); Quake_SetDuration(i, 20); break; + } + + case 3450: { + static OnePointCsFull D_8012237C[2] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 20, + -2, + 65.0f, + 1.0f, + { -625.0f, 185.0f, -685.0f }, + { -692.0f, 226.0f, -515.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 3450: csInfo->keyFrames = D_8012237C; csInfo->keyFrameCount = ARRAY_COUNT(D_8012237C); @@ -822,8 +2984,78 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 2, 0, 0, 0); Quake_SetDuration(i, 10); break; + } + + case 3440: { + static OnePointCsFull D_801223CC[6] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 20, + 0, + 55.0f, + 1.0f, + { 60.0f, 1130.0f, -1430.0f }, + { 60.0f, 1130.0f, -1190.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 18, + -13, + 68.0f, + 1.0f, + { 60.0f, 1130.0f, -1445.0f }, + { 180.0f, 1170.0f, -1240.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 16, + 18, + 75.0f, + 1.0f, + { 42.0f, 1040.0f, -1400.0f }, + { -20.0f, 940.0f, -1280.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 4, + 0, + 60.0f, + 1.0f, + { 60.0f, 1100.0f, -1465.0f }, + { 60.0f, 1100.0f, -1180.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 32, + 0, + 70.0f, + 1.0f, + { 60.0f, 1100.0f, -1030.0f }, + { 60.0f, 1150.0f, -740.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 3440: csInfo->keyFrames = D_801223CC; csInfo->keyFrameCount = ARRAY_COUNT(D_801223CC); @@ -837,8 +3069,89 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 2, 0, 0, 0); Quake_SetDuration(i, 10); break; + } + + case 3430: { + static OnePointCsFull D_801224BC[7] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 5, + 0, + 70.0f, + 1.0f, + { 60.0f, 1800.0f, -920.0f }, + { 60.0f, 1860.0f, -800.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 20, + 0, + 70.0f, + 0.1f, + { 60.0f, 1720.0f, -920.0f }, + { 60.0f, 1780.0f, -800.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0142, + 1, + 0, + 75.0f, + 1.0f, + { 0.0f, 70.0f, 0.0f }, + { 60.0f, 990.0f, -690.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0142, + 119, + 0, + 75.0f, + 0.05f, + { 0.0f, 70.0f, 0.0f }, + { 60.0f, 990.0f, -690.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 20, + 0, + 60.0f, + 0.1f, + { 0.0f, 70.0f, 0.0f }, + { 0.0f, 100.0f, 200.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 3430: csInfo->keyFrames = D_801224BC; csInfo->keyFrameCount = ARRAY_COUNT(D_801224BC); @@ -850,8 +3163,67 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 1, 0, 10, 0); Quake_SetDuration(i, 20); break; + } + + case 4100: { + static OnePointCsFull D_801225D4[5] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0x0101, + 1, + 0, + 50.0f, + 1.0f, + { 4100.0f, 1200.0f, -1400.0f }, + { 3900.0f, 1100.0f, -1400.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_59), + 0x0101, + 60, + 4, + 50.0f, + 0.94f, + { 4100.0f, 965.0f, -1385.0f }, + { 3790.0f, 825.0f, -1325.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 90, + -5, + 130.0f, + 0.02f, + { 4100.0f, 975.0f, -1375.0f }, + { 3735.0f, 715.0f, -1325.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0x2323, + 2, + 0, + 60.0f, + 1.0f, + { 0.0f, 60.0f, 0.0f }, + { -10.0f, 15.0f, -200.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4100: csInfo->keyFrames = D_801225D4; csInfo->keyFrameCount = ARRAY_COUNT(D_801225D4); @@ -859,16 +3231,101 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); break; + } + + case 4110: { + static OnePointCsFull D_8012269C[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 20, + 2, + 45.0f, + 1.0f, + { 975.0f, 225.0f, -1195.0f }, + { 918.0f, 228.0f, -1228.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4110: csInfo->keyFrames = D_8012269C; csInfo->keyFrameCount = ARRAY_COUNT(D_8012269C); Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4120: { + static OnePointCsFull D_80122714[4] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 20, + 0, + 45.0f, + 1.0f, + { -915.0f, -2185.0f, 6335.0f }, + { -915.0f, -2290.0f, 6165.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + -1, + 0, + 80.0f, + 0.8f, + { -920.0f, -2270.0f, 6140.0f }, + { -920.0f, -2280.0f, 6070.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 20, + 0, + 80.0f, + 0.9f, + { -920.0f, -2300.0f, 6140.0f }, + { -920.0f, -2300.0f, 6070.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4120: Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); D_80122714[1].timerInit = 80; csInfo->keyFrames = D_80122714; @@ -876,16 +3333,145 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4140: { + static OnePointCsFull D_801227B4[6] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 30, + 0, + 60.0f, + 1.0f, + { 1400.0f, 100.0f, -170.0f }, + { 1250.0f, 100.0f, -170.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 130, + 0, + 60.0f, + 0.2f, + { 0.0f, -5.0f, 0.0f }, + { -150.0f, -5.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0303, + 69, + 0, + 85.0f, + 1.0f, + { -40.0f, 0.0f, 0.0f }, + { -40.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0303, + 20, + 0, + 60.0f, + 1.0f, + { 10.0f, 0.0f, 0.0f }, + { 10.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4140: csInfo->keyFrames = D_801227B4; csInfo->keyFrameCount = ARRAY_COUNT(D_801227B4); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Camera_RequestMode(mainCam, CAM_MODE_NORMAL); break; + } + + case 4150: { + static OnePointCsFull D_801228A4[5] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0101, + 20, + 5, + 30.0f, + 1.0f, + { 800.0f, -40.0f, 2170.0f }, + { 512.0f, 142.0f, 2020.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 20, + -2, + 70.0f, + 0.8f, + { 800.0f, -40.0f, 2170.0f }, + { 512.0f, 142.0f, 2020.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), + 0x0101, + 90, + 2, + 62.0f, + 1.0f, + { 1140.0f, 125.0f, 1920.0f }, + { 1255.0f, 150.0f, 1785.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2121, + 10, + 0, + 60.0f, + 1.0f, + { 0.0f, 10.0f, 0.0f }, + { 30.0f, 10.0f, -80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4150: csInfo->keyFrames = D_801228A4; csInfo->keyFrameCount = ARRAY_COUNT(D_801228A4); @@ -893,8 +3479,56 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Camera_RequestMode(mainCam, CAM_MODE_NORMAL); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4160: { + static OnePointCsFull D_8012296C[4] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 20, + -10, + 70.0f, + 1.0f, + { -930.0f, 765.0f, -3075.0f }, + { -700.0f, 700.0f, -3075.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 80, + -10, + 70.0f, + 0.05f, + { -930.0f, 205.0f, -3075.0f }, + { -700.0f, 140.0f, -3075.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 120, + 0, + 70.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4160: csInfo->keyFrames = D_8012296C; csInfo->keyFrameCount = ARRAY_COUNT(D_8012296C); @@ -902,8 +3536,34 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Camera_RequestMode(mainCam, CAM_MODE_NORMAL); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4170: { + static OnePointCsFull D_80122A0C[2] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 60, + 4, + 50.0f, + 1.0f, + { 0.0f, 400.0f, -1000.0f }, + { -200.0f, 500.0f, -850.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 50.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4170: csInfo->keyFrames = D_80122A0C; csInfo->keyFrameCount = ARRAY_COUNT(D_80122A0C); @@ -911,8 +3571,100 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Camera_RequestMode(mainCam, CAM_MODE_NORMAL); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4190: { + static OnePointCsFull D_80122A5C[8] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 1, + -15, + 70.0f, + 1.0f, + { 230.0f, 3675.0f, -4230.0f }, + { -45.0f, 3650.0f, -4415.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 1, + 0, + 60.0f, + 1.0f, + { -120.0f, 2187.0f, -3286.0f }, + { -110.0f, 2162.0f, -3262.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 55, + 0, + 60.0f, + 1.0f, + { -38.0f, 1467.0f, -1102.0f }, + { 64.0f, 1423.0f, -1188.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 1, + -15, + 70.0f, + 1.0f, + { 230.0f, 3675.0f, -4230.0f }, + { -20.0f, 3650.0f, -4400.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4190: csInfo->keyFrames = D_80122A5C; csInfo->keyFrameCount = ARRAY_COUNT(D_80122A5C); @@ -920,8 +3672,45 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Camera_RequestMode(mainCam, CAM_MODE_NORMAL); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4200: { + static OnePointCsFull D_80122B9C[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 60, + 0, + 65.0f, + 1.0f, + { 1095.0f, 2890.0f, -2980.0f }, + { 1166.0f, 2695.0f, -2710.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 60, + 15, + 65.0f, + 1.0f, + { 566.0f, 4654.0f, -4550.0f }, + { 606.0f, 5160.0f, -4740.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4200: csInfo->keyFrames = D_80122B9C; csInfo->keyFrameCount = ARRAY_COUNT(D_80122B9C); @@ -929,8 +3718,23 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Camera_RequestMode(mainCam, CAM_MODE_NORMAL); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4210: { + static OnePointCsFull D_80122C14[1] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 999, + 0, + 85.0f, + 1.0f, + { -15.0f, 185.0f, 160.0f }, + { -15.0f, 210.0f, 250.0f }, + }, + }; - case 4210: player->actor.freezeTimer = timer; csInfo->keyFrames = D_80122C14; @@ -943,8 +3747,36 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 0, 1, 100, 0); Quake_SetDuration(i, timer - 80); break; + } + + case 4220: { + static OnePointCsFull D_80122C3C[1] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 999, + -2, + 70.0f, + 1.0f, + { -62.0f, 60.0f, -315.0f }, + { -115.0f, 30.0f, -445.0f }, + }, + }; + static OnePointCsFull D_80122C64[1] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 999, + 3, + 70.0f, + 1.0f, + { -40.0f, 80.0f, 375.0f }, + { -85.0f, 45.0f, 485.0f }, + }, + }; - case 4220: csInfo->keyFrames = (player->actor.world.pos.z < -15.0f) ? D_80122C3C : D_80122C64; csInfo->keyFrameCount = ARRAY_COUNT(D_80122C3C); @@ -956,16 +3788,57 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Quake_SetPerturbations(i, 0, 1, 10, 0); Quake_SetDuration(i, timer - 10); break; + } + + case 4221: { + static OnePointCsFull D_80122C8C[1] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 999, + 5, + 60.0f, + 1.0f, + { -70.0f, 140.0f, 25.0f }, + { 10.0f, 180.0f, 195.0f }, + }, + }; - case 4221: csInfo->keyFrames = D_80122C8C; csInfo->keyFrameCount = ARRAY_COUNT(D_80122C8C); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 3260: { + static OnePointCsFull D_80122CB4[2] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 5, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, 1000.0f }, + { 0.0f, 0.0f, 1100.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + -1, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, -100.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + }; - case 3260: Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); D_80122CB4[1].timerInit = timer - 5; @@ -974,8 +3847,34 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 3261: { + static OnePointCsFull D_80122D04[2] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 10, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, -100.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + -1, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, 1000.0f }, + { 0.0f, 0.0f, 1100.0f }, + }, + }; - case 3261: Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); D_80122D04[1].timerInit = timer - 10; @@ -984,22 +3883,258 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 8010: { + static OnePointCsFull D_80122D54[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 1, + -4, + 50.0f, + 1.0f, + { 230.0f, 65.0f, 300.0f }, + { 50.0f, 50.0f, 225.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 8010: csInfo->keyFrames = D_80122D54; csInfo->keyFrameCount = ARRAY_COUNT(D_80122D54); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 8002: { + static OnePointCsFull D_80122DCC[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 1, + 0, + 50.0f, + 1.0f, + { 0.0f, 5.0f, -145.0f }, + { 0.0f, 55.0f, 55.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 8002: csInfo->keyFrames = D_80122DCC; csInfo->keyFrameCount = ARRAY_COUNT(D_80122DCC); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 8700: { + static OnePointCsFull D_80122E44[2][7] = { + { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2222, + 10, + 5, + 90.0f, + 0.2f, + { 50.0f, 100.0f, 140.0f }, + { -30.0f, 10.0f, -20.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 20, + 0, + 90.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4343, + 30, + -5, + 50.0f, + 0.2f, + { -10.0f, 80.0f, 10.0f }, + { 20.0f, 20.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -5, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x4343, + 160, + 10, + 80.0f, + 0.005f, + { -50.0f, 60.0f, 0.0f }, + { -100.0f, 20.0f, 50.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0501, + 50, + 0, + 60.0f, + 1.0f, + { 0.0f, -10.0f, 0.0f }, + { 0.0f, 10.0f, 80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_19, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }, + { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2222, + 10, + -5, + 90.0f, + 0.2f, + { -50.0f, 100.0f, 140.0f }, + { 30.0f, 10.0f, -20.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 20, + 0, + 90.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4343, + 30, + 5, + 50.0f, + 0.2f, + { 10.0f, 80.0f, 10.0f }, + { -20.0f, 20.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 5, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x4343, + 160, + -10, + 80.0f, + 0.005f, + { 50.0f, 60.0f, 0.0f }, + { 100.0f, 20.0f, 50.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0501, + 50, + 0, + 60.0f, + 1.0f, + { 0.0f, -10.0f, 0.0f }, + { 0.0f, 10.0f, 80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_19, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + -1, + -1.0f, + -1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }, + }; - case 8700: spA0 = Actor_GetFocus(actor); sp8C = Actor_GetFocus(&player->actor); D_80122E44[timer & 1][0].atTargetInit.y = ((spA0.pos.y - sp8C.pos.y) / 10.0f) + 90.0f; @@ -1010,14 +4145,109 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } case 1100: { s32 tempDiff = play->state.frames - sPrevFrameCs1100; if ((tempDiff > 3600) || (tempDiff < -3600)) { + static OnePointCsFull D_80123074[5] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0xA2A2, + 2, + 8, + 70.0f, + 1.0f, + { -27.0f, -96.0f, 25.0f }, + { 37.0f, -5.0f, 100.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0xA2A2, + 38, + 4, + 60.0f, + 1.0f, + { 64.0f, -109.0f, 55.0f }, + { 37.0f, 150.0f, 155.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0xA2A2, + 2, + 8, + 70.0f, + 1.0f, + { 45.0f, 123.0f, 45.0f }, + { 70.0f, 5.0f, 125.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0xA2A2, + 58, + 4, + 60.0f, + 0.9f, + { 82.0f, 95.0f, 55.0f }, + { 25.0f, -175.0f, 180.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; + csInfo->keyFrames = D_80123074; csInfo->keyFrameCount = ARRAY_COUNT(D_80123074); } else { + static OnePointCsFull D_8012313C[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0xA2A2, + 20, + 8, + 70.0f, + 1.0f, + { 65.0f, -150.0f, 50.0f }, + { 30.0f, 10.0f, 90.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0xA2A2, + 100, + 0, + 60.0f, + 1.0f, + { 70.0f, -160.0f, 50.0f }, + { 25.0f, 180.0f, 180.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; + if (play->state.frames & 1) { D_8012313C[0].rollTargetInit = -D_8012313C[0].rollTargetInit; D_8012313C[0].atTargetInit.y = -D_8012313C[0].atTargetInit.y; @@ -1030,7 +4260,8 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); sPrevFrameCs1100 = play->state.frames; - } break; + break; + } case 9806: subCam->timer = -99; @@ -1045,6 +4276,53 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act case 9908: if (Play_CamIsNotFixed(play)) { + static OnePointCsFull D_801231B4[4] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), + 0x4343, + 1, + 0, + 50.0f, + 1.0f, + { 0.0f, 20.0f, 0.0f }, + { 0.0f, 5.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), + ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), + 0x4343, + 48, + 0, + 50.0f, + 0.75f, + { 0.0f, 80.0f, 0.0f }, + { 0.0f, 15.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), + 0x4343, + 1, + 5, + 45.0f, + 1.0f, + { 0.0f, 0.0f, 30.0f }, + { 30.0f, 120.0f, 60.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), + ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), + 0x4343, + -1, + 0, + -1.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; + D_801231B4[0].eyeTargetInit.z = D_801231B4[1].eyeTargetInit.z = !LINK_IS_ADULT ? 100.0f : 120.0f; if (player->stateFlags1 & PLAYER_STATE1_27) { @@ -1065,6 +4343,31 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); } else { + static OnePointCsFull D_80123254[2] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 1, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), + 0x0101, + 49, + 0, + 50.0f, + 0.05f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + }; + D_80123254[1].timerInit = timer - 1; D_80123254[0].fovTargetInit = mainCam->fov; D_80123254[0].atTargetInit = D_80123254[1].atTargetInit = mainCam->at; @@ -1077,7 +4380,21 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act } break; - case 1000: + case 1000: { + static OnePointCsFull D_801232A4[1] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_69), + 0x0101, + 9999, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + }; + D_801232A4[0].atTargetInit = play->view.at; D_801232A4[0].eyeTargetInit = play->view.eye; D_801232A4[0].fovTargetInit = play->view.fovy; @@ -1087,57 +4404,496 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 8603: { + static OnePointCsFull D_801232CC[5] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 45, + -3, + 65.0f, + 1.0f, + { -52.0f, 84.0f, -846.0f }, + { -159.0f, 33.0f, -729.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 10, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2121, + 15, + 0, + 60.0f, + 1.0f, + { 10.0f, -5.0f, 0.0f }, + { 0.0f, 0.0f, -150.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 8603: csInfo->keyFrames = D_801232CC; csInfo->keyFrameCount = ARRAY_COUNT(D_801232CC); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 8604: { + static OnePointCsFull D_80123394[5] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 45, + 3, + 65.0f, + 1.0f, + { -16.0f, 87.0f, -829.0f }, + { 98.0f, 24.0f, -714.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 10, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2121, + 15, + 0, + 60.0f, + 1.0f, + { 10.0f, -5.0f, 0.0f }, + { 0.0f, 0.0f, -150.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 8604: csInfo->keyFrames = D_80123394; csInfo->keyFrameCount = ARRAY_COUNT(D_80123394); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4000: { + static OnePointCsFull D_8012345C[4] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x4242, + 40, + 0, + 40.0f, + 1.0f, + { 0.0f, 50.0f, -40.0f }, + { 0.0f, 60.0f, -160.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_77), + 0x4242, + 40, + 0, + 60.0f, + 0.3f, + { 0.0f, 90.0f, -40.0f }, + { 0.0f, 60.0f, -160.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x2121, + 10, + 0, + 60.0f, + 0.2f, + { 0.0f, -10.0f, 10.0f }, + { 0.0f, 10.0f, -80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4000: csInfo->keyFrames = D_8012345C; csInfo->keyFrameCount = ARRAY_COUNT(D_8012345C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4010: { + static OnePointCsFull D_801234FC[5] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_5), + 0x0441, + 10, + 0, + 70.0f, + 1.0f, + { 0.0f, -10.0f, 20.0f }, + { 0.0f, 0.0f, 120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4141, + 30, + 0, + 50.0f, + 0.1f, + { 0.0f, -10.0f, 20.0f }, + { 0.0f, 10.0f, 80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2121, + 10, + 0, + 60.0f, + 0.9f, + { 0.0f, -10.0f, 0.0f }, + { 0.0f, 10.0f, -80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4010: csInfo->keyFrames = D_801234FC; csInfo->keyFrameCount = ARRAY_COUNT(D_801234FC); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4011: { + static OnePointCsFull D_801235C4[5] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), + 0x4141, + 1, + 0, + 50.0f, + 1.0f, + { 0.0f, -10.0f, 20.0f }, + { 0.0f, 10.0f, 60.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0441, + 39, + 0, + 70.0f, + 0.1f, + { 0.0f, -10.0f, 20.0f }, + { 0.0f, 0.0f, 100.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x2121, + 15, + 0, + 60.0f, + 0.9f, + { 0.0f, -10.0f, 0.0f }, + { 0.0f, 10.0f, -80.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4011: csInfo->keyFrames = D_801235C4; csInfo->keyFrameCount = ARRAY_COUNT(D_801235C4); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4020: { + static OnePointCsFull D_8012368C[4] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 10, + 0, + 60.0f, + 1.0f, + { -1110.0f, -180.0f, -840.0f }, + { -985.0f, -220.0f, -840.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 70, + -45, + 75.0f, + 1.0f, + { -1060.0f, -160.0f, -840.0f }, + { -1005.0f, -230.0f, -840.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 10, + -45, + 75.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 180, + 9, + 80.0f, + 1.0f, + { -1205.0f, -175.0f, -840.0f }, + { -1305.0f, -230.0f, -828.0f }, + }, + }; - case 4020: csInfo->keyFrames = D_8012368C; csInfo->keyFrameCount = ARRAY_COUNT(D_8012368C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4021: { + static OnePointCsFull D_8012372C[4] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0142, + 10, + 0, + 70.0f, + 1.0f, + { 0.0f, 80.0f, 0.0f }, + { -1650.0f, 200.0f, -2920.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0142, + 110, + -2, + 50.0f, + 0.5f, + { 0.0f, 150.0f, 0.0f }, + { -1320.0f, 170.0f, -2900.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 100, + 2, + 70.0f, + 0.1f, + { 0.0f, 150.0f, 50.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 60, + 2, + 45.0f, + 0.01f, + { 0.0f, 150.0f, 50.0f }, + { 0.0f, 200.0f, -80.0f }, + }, + }; - case 4021: csInfo->keyFrames = D_8012372C; csInfo->keyFrameCount = ARRAY_COUNT(D_8012372C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 4022: { + static OnePointCsFull D_801237CC[5] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 20, + 0, + 50.0f, + 1.0f, + { 0.0f, 50.0f, -10.0f }, + { 0.0f, 0.0f, 100.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_10, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 80, + 0, + 75.0f, + 1.0f, + { 2900.0f, 1300.0f, 530.0f }, + { 2800.0f, 1190.0f, 540.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 10, + 0, + 75.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 55, + 0, + 75.0f, + 1.0f, + { 2900.0f, 1300.0f, 530.0f }, + { 1500.0f, 1415.0f, 650.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 100, + -45, + 75.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 4022: subCam->timer = D_801237CC[0].timerInit + D_801237CC[3].timerInit + D_801237CC[1].timerInit + D_801237CC[2].timerInit + D_801237CC[4].timerInit; @@ -1146,8 +4902,45 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 9703: { + static OnePointCsFull D_80123894[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 60, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 30, + 0, + 50.0f, + 1.0f, + { 0.0f, 28.0f, 0.0f }, + { 0.0f, 20.0f, 40.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_13, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 120, + 0, + 180.0f, + 0.4f, + { 0.0f, -5.0f, 0.0f }, + { 0.0f, 2.0f, 40.0f }, + }, + }; - case 9703: D_80123894[0].atTargetInit = play->view.at; D_80123894[0].eyeTargetInit = play->view.eye; D_80123894[0].fovTargetInit = play->view.fovy; @@ -1161,8 +4954,34 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 9704: { + static OnePointCsFull D_8012390C[2] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 30, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 180, + 0, + 60.0f, + 1.0f, + { 0.0f, 78.0f, 0.0f }, + { 0.0f, 78.0f, 200.0f }, + }, + }; - case 9704: D_8012390C[0].atTargetInit = play->view.at; D_8012390C[0].eyeTargetInit = play->view.eye; D_8012390C[0].fovTargetInit = play->view.fovy; @@ -1172,8 +4991,45 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 9705: { + static OnePointCsFull D_8012395C[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0101, + 60, + 0, + 60.0f, + 1.0f, + { 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 30, + 0, + 50.0f, + 1.0f, + { 0.0f, 28.0f, 0.0f }, + { 0.0f, 20.0f, -45.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_13, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 120, + 0, + 180.0f, + 0.4f, + { 0.0f, -5.0f, 0.0f }, + { 0.0f, 2.0f, 45.0f }, + }, + }; - case 9705: D_8012395C[0].atTargetInit = play->view.at; D_8012395C[0].eyeTargetInit = play->view.eye; D_8012395C[0].fovTargetInit = play->view.fovy; @@ -1183,8 +5039,45 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); break; + } + + case 5110: { + static OnePointCsFull D_801239D4[3] = { + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 5, + 0, + 60.0f, + 1.0f, + { 0.0f, 20.0f, 0.0f }, + { 0.0f, 40.0f, -120.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_9, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x4242, + 0, + 0, + 60.0f, + 1.0f, + { 0.0f, 20.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f }, + }, + { + ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), + ONEPOINT_CS_INIT_FIELD_NONE, + 0x0000, + 1, + 0, + 60.0f, + 1.0f, + { -1.0f, -1.0f, -1.0f }, + { -1.0f, -1.0f, -1.0f }, + }, + }; - case 5110: D_801239D4[1].timerInit = 10; csInfo->keyFrames = D_801239D4; @@ -1192,6 +5085,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_InitCameraDataUsingPlayer(play, subCamId, (Player*)actor, CAM_SET_CS_C); break; + } default: PRINTF(VT_COL(RED, WHITE) "onepointdemo camera: demo number not found !! (%d)\n" VT_RST, csId); @@ -1234,7 +5128,8 @@ s32 OnePointCutscene_RemoveCamera(PlayState* play, s16 subCamId) { #define vChildCamId temp2 #define vSubCamStatus temp1 #define vCurCamId temp2 -#define vNextCamId temp1 +#define vNextCamId temp3 +#define vParentCamId temp1 /** * Creates a cutscene subcamera with the specified ID, duration, and targeted actor. The camera is placed into the @@ -1242,10 +5137,11 @@ s32 OnePointCutscene_RemoveCamera(PlayState* play, s16 subCamId) { * queue. */ s16 OnePointCutscene_Init(PlayState* play, s16 csId, s16 timer, Actor* actor, s16 parentCamId) { + Camera* subCam; + s16 subCamId; s16 temp1; s16 temp2; - s16 subCamId; - Camera* subCam; + s16 temp3; if (parentCamId == CAM_ID_NONE) { parentCamId = play->activeCamId; @@ -1292,15 +5188,12 @@ s16 OnePointCutscene_Init(PlayState* play, s16 csId, s16 timer, Actor* actor, s1 vNextCamId = play->cameraPtrs[subCamId]->childCamId; while (vNextCamId >= CAM_ID_SUB_FIRST) { - s16 nextCsId = play->cameraPtrs[vNextCamId]->csId; - s16 thisCsId = play->cameraPtrs[subCamId]->csId; - - if ((nextCsId / 100) < (thisCsId / 100)) { + if ((play->cameraPtrs[vNextCamId]->csId / 100) < (play->cameraPtrs[subCamId]->csId / 100)) { PRINTF(VT_COL(YELLOW, BLACK) "onepointdemo camera[%d]: killed 'coz low priority (%d < %d)\n" VT_RST, - vNextCamId, nextCsId, thisCsId); + vNextCamId, play->cameraPtrs[vNextCamId]->csId, play->cameraPtrs[subCamId]->csId); if (play->cameraPtrs[vNextCamId]->csId != 5010) { - if ((vNextCamId = OnePointCutscene_RemoveCamera(play, vNextCamId)) != CAM_ID_NONE) { - Play_ChangeCameraStatus(play, vNextCamId, CAM_STAT_ACTIVE); + if ((vParentCamId = OnePointCutscene_RemoveCamera(play, vNextCamId)) != CAM_ID_NONE) { + Play_ChangeCameraStatus(play, vParentCamId, CAM_STAT_ACTIVE); } } else { vCurCamId = vNextCamId; @@ -1347,10 +5240,13 @@ s32 OnePointCutscene_Attention(PlayState* play, Actor* actor) { s32 temp2; s32 timer; +#if OOT_DEBUG if (sDisableAttention) { PRINTF(VT_COL(YELLOW, BLACK) "actor attention demo camera: canceled by other camera\n" VT_RST); return CAM_ID_NONE; } +#endif + sUnused = -1; parentCam = play->cameraPtrs[CAM_ID_MAIN]; diff --git a/src/code/z_onepointdemo_data.inc.c b/src/code/z_onepointdemo_data.inc.c deleted file mode 100644 index be16be1cef..0000000000 --- a/src/code/z_onepointdemo_data.inc.c +++ /dev/null @@ -1,3830 +0,0 @@ -#include "global.h" - -static CutsceneCameraPoint D_8012013C[14] = { - { CS_CAM_CONTINUE, 25, 40, 70.79991f, { -1814, 533, -1297 } }, - { CS_CAM_CONTINUE, 20, 40, 70.99991f, { -1805, 434, -1293 } }, - { CS_CAM_CONTINUE, 10, 30, 60.0f, { -1794, 323, -1280 } }, - { CS_CAM_CONTINUE, 5, 25, 60.0f, { -1817, 218, -1270 } }, - { CS_CAM_CONTINUE, 3, 20, 60.0f, { -1836, 168, -1243 } }, - { CS_CAM_CONTINUE, 0, 20, 60.0f, { -1905, 115, -1193 } }, - { CS_CAM_CONTINUE, 0, 30, 55.0f, { -1969, 58, -1212 } }, - { CS_CAM_CONTINUE, 0, 30, 55.0f, { -1969, 31, -1164 } }, - { CS_CAM_CONTINUE, 0, 30, 60.0f, { -1969, 54, -1209 } }, - { CS_CAM_CONTINUE, 0, 30, 60.0f, { -1973, 35, -1206 } }, - { CS_CAM_CONTINUE, 0, 50, 60.0f, { -1974, 12, -1179 } }, - { CS_CAM_CONTINUE, 0, 50, 60.0f, { -1974, 12, -1179 } }, - { CS_CAM_STOP, 0, 50, 60.0f, { -1974, 12, -1179 } }, - { CS_CAM_STOP, 0, 30, 60.0f, { -1974, 12, -1179 } }, -}; -static CutsceneCameraPoint D_8012021C[14] = { - { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1751, 604, -1233 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1752, 516, -1233 } }, - { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1751, 417, -1233 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1767, 306, -1219 } }, - { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1776, 257, -1205 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1881, 147, -1149 } }, - { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1969, 72, -1077 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1969, 7, -1048 } }, - { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1969, 1, -1030 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { -1987, 17, -1076 } }, - { CS_CAM_CONTINUE, 0, 0, 60.0f, { -2007, 10, -1004 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { -2007, 10, -1004 } }, - { CS_CAM_STOP, 0, 0, 60.0f, { -2007, 10, -1004 } }, { CS_CAM_STOP, 0, 0, 60.0f, { -2007, 10, -1004 } }, -}; -static s16 D_801202FC = 13; -static s16 D_80120300 = 210; -static s16 D_80120304 = 0; - -static CutsceneCameraPoint sCrawlspaceAtPoints[9] = { - { CS_CAM_CONTINUE, 0, 10, 40.0f, { 0, 4, 0 } }, { CS_CAM_CONTINUE, 0, 10, 40.000004f, { 0, 4, 0 } }, - { CS_CAM_CONTINUE, 0, 10, 50.0f, { 0, 9, 0 } }, { CS_CAM_CONTINUE, 0, 12, 55.0f, { 0, 12, 0 } }, - { CS_CAM_CONTINUE, 0, 15, 61.0f, { 0, 18, 0 } }, { CS_CAM_CONTINUE, 0, 20, 65.0f, { 0, 29, 0 } }, - { CS_CAM_CONTINUE, 0, 40, 60.0f, { 0, 34, 0 } }, { CS_CAM_STOP, 0, 40, 60.0f, { 0, 34, 0 } }, - { CS_CAM_STOP, 0, 10, 60.0f, { 0, 34, 0 } }, -}; -static CutsceneCameraPoint sCrawlspaceForwardsEyePoints[9] = { - { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 9, 45 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 8, 50 } }, - { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 17, 58 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 21, 78 } }, - { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 46, 109 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 58, 118 } }, - { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 63, 119 } }, { CS_CAM_STOP, 0, 0, 60.0f, { 0, 62, 119 } }, - { CS_CAM_STOP, 0, 0, 60.0f, { 0, 62, 119 } }, -}; -static s16 sCrawlspaceUnused = 9; -static s16 sCrawlspaceTimer = 90; -static s16 sCrawlspaceActionParam = 1; -static CutsceneCameraPoint sCrawlspaceBackwardsEyePoints[10] = { - { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 9, -45 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 9, -45 } }, - { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 8, -50 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 17, -58 } }, - { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 21, -78 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 46, -109 } }, - { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 58, -118 } }, { CS_CAM_CONTINUE, 0, 0, 60.0f, { 0, 63, -119 } }, - { CS_CAM_STOP, 0, 0, 60.0f, { 0, 62, -119 } }, { CS_CAM_STOP, 0, 0, 60.0f, { 0, 62, -119 } }, -}; - -static CutsceneCameraPoint D_801204D4[14] = { - { CS_CAM_CONTINUE, -15, 40, 80.600006f, { -60, 332, 183 } }, - { CS_CAM_CONTINUE, -22, 30, 80.600006f, { -60, 332, 183 } }, - { CS_CAM_CONTINUE, -20, 38, 80.600006f, { -118, 344, 41 } }, - { CS_CAM_CONTINUE, -18, 32, 80.600006f, { -80, 251, -8 } }, - { CS_CAM_CONTINUE, -12, 28, 80.600006f, { -64, 259, -28 } }, - { CS_CAM_CONTINUE, -8, 22, 80.600006f, { -79, 200, -342 } }, - { CS_CAM_CONTINUE, -5, 10, 65.80005f, { -110, 140, -549 } }, - { CS_CAM_CONTINUE, -2, 8, 65.2f, { -74, 109, -507 } }, - { CS_CAM_CONTINUE, 0, 10, 65.80002f, { -32, 78, -680 } }, - { CS_CAM_CONTINUE, 0, 20, 85.199936f, { 25, 127, -950 } }, - { CS_CAM_CONTINUE, 0, 30, 85.199936f, { 25, 127, -950 } }, - { CS_CAM_CONTINUE, 0, 40, 85.199936f, { 25, 127, -950 } }, - { CS_CAM_STOP, 6, 30, 85.199936f, { 25, 127, -950 } }, - { CS_CAM_STOP, 0, 30, 85.199936f, { 25, 127, -950 } }, -}; -static CutsceneCameraPoint D_801205B4[14] = { - { CS_CAM_CONTINUE, 0, 0, 60.0f, { -225, 785, -242 } }, - { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -245, 784, -242 } }, - { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -288, 485, -379 } }, - { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -250, 244, -442 } }, - { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -163, 21, -415 } }, - { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -98, 86, -520 } }, - { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -86, 31, -816 } }, - { CS_CAM_CONTINUE, -21, 0, 80.600006f, { -74, 18, -931 } }, - { CS_CAM_CONTINUE, 1, 0, 80.600006f, { -91, 80, -1220 } }, - { CS_CAM_CONTINUE, 0, 0, 85.199936f, { 14, 153, -1340 } }, - { CS_CAM_CONTINUE, 0, 0, 85.199936f, { 28, 125, -1340 } }, - { CS_CAM_CONTINUE, 0, 0, 85.199936f, { 48, 124, -1340 } }, - { CS_CAM_STOP, 0, 0, 85.199936f, { 48, 124, -1502 } }, - { CS_CAM_STOP, 0, 0, 85.199936f, { 48, 124, -1262 } }, -}; -static s16 D_80120694 = 14; -static s16 D_80120698 = 190; -static s16 D_8012069C = 8; - -static CutsceneCameraPoint D_801206A0[12] = { - { CS_CAM_CONTINUE, 6, 20, 80.0f, { -96, 40, 170 } }, { CS_CAM_CONTINUE, 6, 20, 80.0f, { -96, 40, 170 } }, - { CS_CAM_CONTINUE, 6, 20, 70.0f, { -70, 35, 150 } }, { CS_CAM_CONTINUE, 5, 10, 60.0f, { -57, 34, 133 } }, - { CS_CAM_CONTINUE, 4, 25, 65.0f, { -22, 32, 110 } }, { CS_CAM_CONTINUE, 3, 12, 60.0f, { -9, 33, 98 } }, - { CS_CAM_CONTINUE, 3, 5, 65.0f, { -3, 29, 87 } }, { CS_CAM_CONTINUE, 2, 10, 65.0f, { -1, 15, 84 } }, - { CS_CAM_CONTINUE, 1, 200, 65.0f, { 0, 17, 82 } }, { CS_CAM_CONTINUE, 1, 500, 65.0f, { 0, 18, 82 } }, - { CS_CAM_STOP, 8, 50, 65.0f, { 0, 18, 82 } }, { CS_CAM_STOP, 11, 60, 65.0f, { 0, 18, 82 } }, -}; -static CutsceneCameraPoint D_80120760[12] = { - { CS_CAM_CONTINUE, 6, 0, 80.0f, { -50, 10, 180 } }, { CS_CAM_CONTINUE, 6, 0, 80.0f, { -50, 20, 180 } }, - { CS_CAM_CONTINUE, 6, 0, 70.0f, { -40, 30, 177 } }, { CS_CAM_CONTINUE, 5, 0, 65.0f, { 0, 35, 172 } }, - { CS_CAM_CONTINUE, 4, 0, 65.0f, { 34, 35, 162 } }, { CS_CAM_CONTINUE, 3, 0, 65.0f, { 61, 32, 147 } }, - { CS_CAM_CONTINUE, 3, 0, 65.0f, { 72, 30, 128 } }, { CS_CAM_CONTINUE, 2, 0, 65.0f, { 74, 20, 125 } }, - { CS_CAM_CONTINUE, 1, 0, 65.0f, { 75, 18, 123 } }, { CS_CAM_CONTINUE, 1, 0, 65.0f, { 75, 10, 123 } }, - { CS_CAM_STOP, 0, 0, 65.0f, { 75, 10, 122 } }, { CS_CAM_STOP, 0, 0, 65.0f, { 75, 10, 122 } }, -}; -static CutsceneCameraPoint D_80120820[12] = { - { CS_CAM_CONTINUE, 6, 0, 80.0f, { 85, 5, 170 } }, { CS_CAM_CONTINUE, 6, 0, 80.0f, { 85, 10, 170 } }, - { CS_CAM_CONTINUE, 6, 0, 70.0f, { 80, 20, 167 } }, { CS_CAM_CONTINUE, 5, 0, 65.0f, { 74, 25, 165 } }, - { CS_CAM_CONTINUE, 4, 0, 65.0f, { 63, 30, 162 } }, { CS_CAM_CONTINUE, 3, 0, 65.0f, { 66, 34, 147 } }, - { CS_CAM_CONTINUE, 3, 0, 65.0f, { 72, 34, 128 } }, { CS_CAM_CONTINUE, 2, 0, 65.0f, { 74, 20, 125 } }, - { CS_CAM_CONTINUE, 1, 0, 65.0f, { 75, 18, 123 } }, { CS_CAM_CONTINUE, 1, 0, 65.0f, { 75, 10, 123 } }, - { CS_CAM_STOP, 0, 0, 65.0f, { 75, 10, 122 } }, { CS_CAM_STOP, 0, 0, 65.0f, { 75, 10, 122 } }, -}; -static s16 D_801208E0 = 12; -static s16 D_801208E4 = 90; -static s16 D_801208E8 = 8; - -static OnePointCsFull D_801208EC[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0x0101, - 1, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 1, - 0, - 60.0f, - 1.0f, - { 0.0f, -10.0f, 0.0f }, - { 0.0f, 0.0f, 150.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80120964[2] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 1, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0xA121, - 1, - 0, - 75.0f, - 0.6f, - { 0.0f, -10.0f, 0.0f }, - { 0.0f, 0.0f, 150.0f }, - }, -}; - -static OnePointCsFull D_801209B4[4] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0x0101, - 1, - 0, - 60.0f, - 0.9f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0100, - 29, - 0, - 45.0f, - 0.1f, - { 0.0f, -10.0f, 0.0f }, - { 0.0f, 0.0f, 150.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 10, - 0, - 60.0f, - 0.2f, - { 0.0f, -10.0f, 0.0f }, - { 0.0f, 0.0f, 150.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80120A54[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2525, - 1, - 0, - 75.0f, - 0.1f, - { 0.0f, 20.0f, -10.0f }, - { 0.0f, 10.0f, -40.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 9, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0022, - 5000, - 0, - 75.0f, - 0.005f, - { 0.0f, 0.0f, -10.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80120ACC[5] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0442, - 10, - 0, - 40.0f, - 1.0f, - { -10.0f, 45.0f, 20.0f }, - { 20.0f, 30.0f, 160.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 40.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0442, - 10, - 0, - 40.0f, - 1.0f, - { -10.0f, 45.0f, 20.0f }, - { 20.0f, 30.0f, 160.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 40.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80120B94[11] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x2142, - 1, - 0, - 40.0f, - 1.0f, - { 20.0f, 40.0f, 20.0f }, - { -20.0f, 0.0f, -30.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0404, - 19, - 5, - 70.0f, - 0.01f, - { 0.0f, 30.0f, 20.0f }, - { 120.0f, 60.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0404, - 20, - 0, - 60.0f, - 0.01f, - { 0.0f, 20.0f, 20.0f }, - { 120.0f, 60.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0404, - 40, - -10, - 50.0f, - 0.02f, - { 0.0f, 30.0f, 20.0f }, - { 120.0f, 60.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4141, - 1, - 0, - 40.0f, - 1.0f, - { 0.0f, -10.0f, 20.0f }, - { 0.0f, 20.0f, 50.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0404, - 19, - 0, - 70.0f, - 0.01f, - { 0.0f, 30.0f, 20.0f }, - { 120.0f, 60.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0404, - 40, - 10, - 50.0f, - 0.01f, - { 0.0f, 20.0f, 20.0f }, - { 120.0f, 60.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0404, - 70, - 0, - 60.0f, - 0.01f, - { 0.0f, 30.0f, 20.0f }, - { 120.0f, 60.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4141, - 1, - 0, - 50.0f, - 1.0f, - { 0.0f, -10.0f, 0.0f }, - { 80.0f, 20.0f, 60.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_13, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4141, - 150, - 0, - 50.0f, - 1.0f, - { 0.0f, 5.0f, 0.0f }, - { 0.0f, 4.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_24, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 50.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80120D4C[7] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x2142, - 1, - 0, - 40.0f, - 1.0f, - { 20.0f, 40.0f, 20.0f }, - { -20.0f, 0.0f, -30.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0404, - 19, - 5, - 70.0f, - 0.01f, - { 0.0f, 30.0f, 20.0f }, - { 120.0f, 60.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0404, - 20, - 0, - 60.0f, - 0.01f, - { 0.0f, 20.0f, 20.0f }, - { 120.0f, 60.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0404, - 40, - -10, - 50.0f, - 0.02f, - { 0.0f, 30.0f, 20.0f }, - { 120.0f, 60.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4141, - 1, - 0, - 50.0f, - 1.0f, - { 0.0f, -10.0f, 0.0f }, - { 80.0f, 20.0f, 60.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_13, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4141, - 150, - 0, - 50.0f, - 1.0f, - { 0.0f, 5.0f, 0.0f }, - { 0.0f, 4.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_24, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 50.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80120E64[8] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, true, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x2142, - 20, - 0, - 50.0f, - 1.0f, - { -25.0f, 20.0f, 0.0f }, - { 0.0f, 0.0f, 5.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 80, - 0, - 50.0f, - 1.0f, - { -25.0f, 20.0f, 0.0f }, - { 0.0f, 0.0f, 5.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 8, - 0, - 60.0f, - 0.1f, - { -25.0f, 20.0f, 0.0f }, - { 0.0f, 0.0f, 5.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 15, - 4, - 55.0f, - 0.05f, - { -50.0f, 20.0f, 20.0f }, - { 0.0f, 0.0f, 5.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 15, - -4, - 50.0f, - 0.05f, - { 0.0f, 20.0f, 0.0f }, - { 0.0f, 0.0f, 5.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 15, - 0, - 50.0f, - 0.1f, - { -25.0f, 20.0f, 0.0f }, - { 0.0f, 0.0f, 5.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 40, - 0, - 50.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80120FA4[6] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x2143, - 30, - 0, - 70.0f, - 0.4f, - { 0.0f, 40.0f, 50.0f }, - { 30.0f, 10.0f, -50.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 50.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2222, - 10, - 0, - 42.0f, - 1.0f, - { 0.0f, 40.0f, 0.0f }, - { 0.0f, 85.0f, 45.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 50.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2121, - 10, - 0, - 60.0f, - 1.0f, - { 0.0f, 10.0f, 0.0f }, - { 30.0f, 10.0f, -80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80121094[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0x2101, - 20, - 0, - 50.0f, - 1.0f, - { 3840.0f, 10.0f, 950.0f }, - { 0.0f, 0.0f, 5.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x2101, - 50, - 0, - 55.0f, - 1.0f, - { 4000.0f, 50.0f, 1000.0f }, - { 0.0f, 0.0f, 5.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_8012110C[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_5), - 0x2142, - 1, - 0, - 50.0f, - 1.0f, - { -25.0f, 20.0f, 0.0f }, - { 0.0f, 0.0f, 5.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, true, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2121, - 10, - 0, - 60.0f, - 1.0f, - { 0.0f, 10.0f, 0.0f }, - { 0.0f, 10.0f, -80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80121184[2] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0101, - 40, - 0, - -1.0f, - 0.1f, - { 0.0f, 10.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_801211D4[2] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0x0101, - 50, - 0, - 60.0f, - 1.0f, - { 0.0f, 10.0f, 0.0f }, - { -10.0f, 85.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80121224[6] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x4141, - 2, - 0, - 60.0f, - 1.0f, - { 0.0f, 5.0f, 10.0f }, - { 0.0f, 0.0f, 45.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4141, - 18, - 0, - 45.0f, - 1.0f, - { 0.0f, 5.0f, 10.0f }, - { 0.0f, -10.0f, 50.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_52), - 0x4104, - 80, - 0, - 70.0f, - 0.05f, - { 0.0f, 0.0f, 60.0f }, - { 0.0f, 250.0f, -50.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0000, - 20, - 0, - 70.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0421, - 60, - 0, - 50.0f, - 1.0f, - { 0.0f, -30.0f, 20.0f }, - { 10.0f, 5.0f, -50.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80121314[1] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0x4141, - 1000, - 0, - 75.0f, - 0.6f, - { 0.0f, 0.0f, 10.0f }, - { 0.0f, 0.0f, 100.0f }, - }, -}; - -static OnePointCsFull D_8012133C[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0141, - 40, - 0, - 75.0f, - 1.0f, - { 0.0f, 60.0f, 0.0f }, - { 0.0f, 0.0f, 100.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2121, - 20, - 0, - 60.0f, - 0.2f, - { 0.0f, -10.0f, -10.0f }, - { 0.0f, 10.0f, -100.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_801213B4[5] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0xC2C2, - 40, - 0, - 70.0f, - 1.0f, - { 80.0f, 0.0f, 20.0f }, - { 20.0f, 0.0f, 80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0xC2C2, - 120, - 0, - 70.0f, - 0.1f, - { 80.0f, 0.0f, 20.0f }, - { 20.0f, 0.0f, 80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_83), - 0xC2C2, - 30, - 0, - 50.0f, - 1.0f, - { 60.0f, 0.0f, 20.0f }, - { 60.0f, 0.0f, 60.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_69), - 0x4222, - 30, - 0, - 60.0f, - 0.1f, - { 0.0f, 50.0f, 0.0f }, - { 5.0f, 30.0f, 220.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 75.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_8012147C[4] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0101, - 40, - 0, - 45.0f, - 1.0f, - { 820.0f, 1600.0f, -400.0f }, - { 777.0f, 1577.0f, -577.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0142, - 1, - 0, - 50.0f, - 1.0f, - { -50.0f, 80.0f, 0.0f }, - { 900.0f, 1575.0f, 850.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0x0142, - 89, - -4, - 80.0f, - 0.07f, - { -50.0f, 70.0f, 0.0f }, - { 975.0f, 1575.0f, 770.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_8012151C[2] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0101, - 29, - 0, - 60.0f, - 1.0f, - { -700.0f, 875.0f, -100.0f }, - { -550.0f, 920.0f, -150.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_8012156C[2] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_77), - 0x4242, - 1, - 0, - 65.0f, - 1.0f, - { 60.0f, 30.0f, 0.0f }, - { 50.0f, 20.0f, 150.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - -1, - 0, - 65.0f, - 1.0f, - { -50.0f, 60.0f, 0.0f }, - { -60.0f, 40.0f, 150.0f }, - }, -}; - -static OnePointCsFull D_801215BC[1] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 5, - 0, - 65.0f, - 1.0f, - { -1185.0f, 655.0f, 1185.0f }, - { -1255.0f, 735.0f, 1255.0f }, - }, -}; - -static OnePointCsFull D_801215E4[10] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0x4141, - 20, - 0, - 30.0f, - 1.0f, - { 0.0f, 120.0f, 0.0f }, - { -10.0f, 140.0f, -90.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0101, - 1, - 4, - 75.0f, - 1.0f, - { -1360.0f, -940.0f, -3343.0f }, - { -1060.0f, -980.0f, -3325.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4141, - 129, - 0, - 75.0f, - 0.5f, - { 0.0f, 50.0f, 0.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0303, - 30, - 0, - 70.0f, - 0.05f, - { 0.0f, 80.0f, 0.0f }, - { -10.0f, 120.0f, 10.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_9), - 0x0101, - 40, - -5, - 70.0f, - 1.0f, - { -973.0f, -924.0f, -3263.0f }, - { -1190.0f, -1010.0f, -3365.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0101, - 1, - 0, - 75.0f, - 1.0f, - { -1355.0f, -700.0f, -3340.0f }, - { -1040.0f, -940.0f, -3345.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 60, - 0, - 45.0f, - 0.8f, - { -1370.0f, -875.0f, -3345.0f }, - { -1230.0f, -885.0f, -3345.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 10, - 0, - 70.0f, - 1.0f, - { -1370.0f, -875.0f, -3345.0f }, - { -1210.0f, -900.0f, -3420.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 20, - 0, - 70.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80121774[4] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0x0101, - 1, - -2, - 75.0f, - 1.0f, - { -1340.0f, -860.0f, -3345.0f }, - { -1415.0f, -940.0f, -3520.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0142, - 39, - 2, - 70.0f, - 1.0f, - { 0.0f, -20.0f, 10.0f }, - { -1140.0f, -1010.0f, -3560.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_5), - 0x0121, - 20, - 0, - 60.0f, - 1.0f, - { 0.0f, -20.0f, 20.0f }, - { -1220.0f, -1005.0f, -3660.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80121814[4] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_76), - 0x0101, - 5, - 0, - 40.0f, - 1.0f, - { -1400.0f, -540.0f, -3327.0f }, - { -1254.0f, -20.0f, -3357.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 70, - 0, - 75.0f, - 0.75f, - { -1327.0f, 100.0f, -3342.0f }, - { -1320.0f, 350.0f, -3540.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2121, - 10, - 0, - 60.0f, - 0.75f, - { 0.0f, 10.0f, 0.0f }, - { 0.0f, 20.0f, -150.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_801218B4[2] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 60, - 0, - 65.0f, - 1.0f, - { 0.0f, 350.0f, -1520.0f }, - { 0.0f, 715.0f, -885.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 100, - 0, - 70.0f, - 0.02f, - { 0.0f, 75.0f, -1335.0f }, - { 0.0f, 20.0f, -1190.0f }, - }, -}; - -static OnePointCsFull D_80121904[2] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 50, - 10, - 65.0f, - 1.0f, - { 165.0f, 85.0f, -920.0f }, - { 65.0f, -30.0f, -720.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80121954[3][2] = { - { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 20, - 5, - 60.0f, - 1.0f, - { -700.0f, 940.0f, 300.0f }, - { -765.0f, 1000.0f, 335.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 80, - -10, - 70.0f, - 0.1f, - { -540.0f, 875.0f, 245.0f }, - { -585.0f, 900.0f, 335.0f }, - }, - }, - { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 40, - -30, - 70.0f, - 1.0f, - { -80.0f, 115.0f, -180.0f }, - { -5.0f, 240.0f, -190.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 60, - 20, - 70.0f, - 0.1f, - { -100.0f, 350.0f, -175.0f }, - { -5.0f, 240.0f, -190.0f }, - }, - }, - { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 80, - 5, - 70.0f, - 0.2f, - { 960.0f, 900.0f, 260.0f }, - { 970.0f, 950.0f, 250.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 20, - 5, - 70.0f, - 1.0f, - { 960.0f, 900.0f, 260.0f }, - { 970.0f, 950.0f, 250.0f }, - }, - }, -}; - -static OnePointCsFull D_80121A44[12] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_5), - 0x2121, - 10, - 0, - 60.0f, - 1.0f, - { 0.0f, -5.0f, 0.0f }, - { 0.0f, 0.0f, -80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, true, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x4242, - 30, - 0, - 50.0f, - 1.0f, - { 0.0f, 45.0f, 0.0f }, - { 0.0f, 45.0f, 50.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, true, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_5), - 0x2222, - 40, - 5, - 50.0f, - 1.0f, - { 0.0f, 50.0f, 0.0f }, - { 0.0f, 50.0f, 50.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x4242, - 40, - 5, - 60.0f, - 1.0f, - { 30.0f, 30.0f, 15.0f }, - { 70.0f, 30.0f, -40.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, true, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 30, - -5, - 50.0f, - 1.0f, - { 20.0f, 30.0f, -5.0f }, - { 0.0f, 70.0f, 70.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, true, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x2242, - 40, - 0, - 45.0f, - 1.0f, - { 0.0f, 30.0f, 30.0f }, - { 25.0f, 60.0f, -60.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x22C2, - 140, - 0, - 60.0f, - 0.04f, - { 0.0f, 0.0f, 30.0f }, - { 25.0f, 60.0f, -60.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_9, true, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2222, - 20, - 0, - 60.0f, - 0.8f, - { 0.0f, 50.0f, 0.0f }, - { 0.0f, 60.0f, -60.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80121C24[7] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_5), - 0x0101, - 1, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 89, - 0, - 50.0f, - 0.4f, - { 125.0f, 320.0f, -1500.0f }, - { 125.0f, 500.0f, -1150.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0x0101, - 40, - 4, - 55.0f, - 1.0f, - { 0.0f, 375.0f, -1440.0f }, - { 5.0f, 365.0f, -1315.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 40, - -4, - 55.0f, - 1.0f, - { 250.0f, 375.0f, -1440.0f }, - { 235.0f, 365.0f, -1315.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 100, - 0, - 95.0f, - 1.0f, - { 125.0f, 345.0f, -1500.0f }, - { 125.0f, 255.0f, -1350.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 100, - 0, - 60.0f, - 1.0f, - { 125.0f, 325.0f, -1500.0f }, - { 125.0f, 480.0f, -1000.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80121D3C[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 1, - 0, - 60.0f, - 1.0f, - { 1023.0f, 738.0f, -2628.0f }, - { 993.0f, 770.0f, -2740.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 4, - 0, - 50.0f, - 1.0f, - { 1255.0f, 350.0f, -1870.0f }, - { 1240.0f, 575.0f, -2100.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - -1, - 0, - 75.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80121DB4[9] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 40, - 0, - 70.0f, - 1.0f, - { 4290.0f, -1332.0f, -1900.0f }, - { 4155.0f, -1360.0f, -1840.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 60, - 0, - 70.0f, - 1.0f, - { 4215.0f, -975.0f, -2095.0f }, - { 4070.0f, -1000.0f, -2025.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 5, - 0, - 70.0f, - 1.0f, - { 4215.0f, -975.0f, -2095.0f }, - { 4070.0f, -1000.0f, -2025.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 80, - 8, - 75.0f, - 1.0f, - { 4010.0f, -1152.0f, -1728.0f }, - { 3997.0f, -1194.0f, -1629.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_57), - 0x2121, - 1, - 8, - 75.0f, - 1.0f, - { 20.0f, 20.0f, 0.0f }, - { 50.0f, 30.0f, 200.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2121, - 99, - 2, - 70.0f, - 0.02f, - { -20.0f, 0.0f, 20.0f }, - { 300.0f, 50.0f, -500.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_9, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_56), - 0x2121, - 149, - -20, - 70.0f, - 0.1f, - { 100.0f, 50.0f, -100.0f }, - { 5000.0f, 1055.0f, -2250.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2121, - 1, - 0, - 60.0f, - 1.0f, - { 0.0f, -20.0f, 0.0f }, - { 0.0f, 20.0f, -150.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80121F1C[4] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0x0101, - 10, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2121, - 10, - 0, - 50.0f, - 0.5f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 150.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_2), - 0x2121, - 23, - 0, - 50.0f, - 0.5f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 150.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80121FBC[4] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 5, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 10, - 0, - 30.0f, - 1.0f, - { -2130.0f, 2885.0f, -1055.0f }, - { -2085.0f, 2875.0f, -1145.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 30, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_8012205C[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x42C2, - 1, - 0, - 50.0f, - 1.0f, - { 0.0f, 220.0f, 0.0f }, - { 0.0f, 220.0f, 240.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0080, - 29, - 0, - 50.0f, - 1.0f, - { 0.0f, 220.0f, 0.0f }, - { 0.0f, 220.0f, 240.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x21A1, - 10, - 0, - 60.0f, - 1.0f, - { 0.0f, -10.0f, 0.0f }, - { 0.0f, 10.0f, -200.0f }, - }, -}; - -static OnePointCsFull D_801220D4[5] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0101, - 5, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4141, - 10, - 5, - 55.0f, - 0.75f, - { 400.0f, -50.0f, 800.0f }, - { 600.0f, -60.0f, 800.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4141, - 15, - 10, - 40.0f, - 0.75f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 10.0f, 200.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 25, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_8012219C[7] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2121, - 5, - 0, - 60.0f, - 1.0f, - { 0.0f, -5.0f, 0.0f }, - { 0.0f, 0.0f, -80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 15, - 0, - 40.0f, - 0.4f, - { 0.0f, 60.0f, -20.0f }, - { 0.0f, 60.0f, 100.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 20, - 0, - 40.0f, - 1.0f, - { 0.0f, 60.0f, -20.0f }, - { 0.0f, 60.0f, 100.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 20, - 0, - 60.0f, - 1.0f, - { 20.0f, 60.0f, 20.0f }, - { 40.0f, 60.0f, -80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 90, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_801222B4[5] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 20, - 10, - 45.0f, - 1.0f, - { -1200.0f, 730.0f, -860.0f }, - { -1100.0f, 500.0f, -1025.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 20, - 10, - 45.0f, - 0.1f, - { -880.0f, 480.0f, -860.0f }, - { -1100.0f, 500.0f, -1025.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - ONEPOINT_CS_INIT_FIELD_ACTORCAT(ACTORCAT_BG), - 0x0101, - 20, - 10, - 45.0f, - 0.1f, - { -880.0f, 500.0f, -860.0f }, - { -1100.0f, 500.0f, -1025.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - ONEPOINT_CS_INIT_FIELD_ACTORCAT(ACTORCAT_DOOR), - 0x0101, - 5, - 10, - 45.0f, - 0.1f, - { -880.0f, 500.0f, -860.0f }, - { -1100.0f, 500.0f, -1025.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_8012237C[2] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 20, - -2, - 65.0f, - 1.0f, - { -625.0f, 185.0f, -685.0f }, - { -692.0f, 226.0f, -515.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_801223CC[6] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 20, - 0, - 55.0f, - 1.0f, - { 60.0f, 1130.0f, -1430.0f }, - { 60.0f, 1130.0f, -1190.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 18, - -13, - 68.0f, - 1.0f, - { 60.0f, 1130.0f, -1445.0f }, - { 180.0f, 1170.0f, -1240.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 16, - 18, - 75.0f, - 1.0f, - { 42.0f, 1040.0f, -1400.0f }, - { -20.0f, 940.0f, -1280.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 4, - 0, - 60.0f, - 1.0f, - { 60.0f, 1100.0f, -1465.0f }, - { 60.0f, 1100.0f, -1180.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 32, - 0, - 70.0f, - 1.0f, - { 60.0f, 1100.0f, -1030.0f }, - { 60.0f, 1150.0f, -740.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_801224BC[7] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 5, - 0, - 70.0f, - 1.0f, - { 60.0f, 1800.0f, -920.0f }, - { 60.0f, 1860.0f, -800.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 20, - 0, - 70.0f, - 0.1f, - { 60.0f, 1720.0f, -920.0f }, - { 60.0f, 1780.0f, -800.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0142, - 1, - 0, - 75.0f, - 1.0f, - { 0.0f, 70.0f, 0.0f }, - { 60.0f, 990.0f, -690.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0142, - 119, - 0, - 75.0f, - 0.05f, - { 0.0f, 70.0f, 0.0f }, - { 60.0f, 990.0f, -690.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 20, - 0, - 60.0f, - 0.1f, - { 0.0f, 70.0f, 0.0f }, - { 0.0f, 100.0f, 200.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_801225D4[5] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0x0101, - 1, - 0, - 50.0f, - 1.0f, - { 4100.0f, 1200.0f, -1400.0f }, - { 3900.0f, 1100.0f, -1400.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_59), - 0x0101, - 60, - 4, - 50.0f, - 0.94f, - { 4100.0f, 965.0f, -1385.0f }, - { 3790.0f, 825.0f, -1325.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 90, - -5, - 130.0f, - 0.02f, - { 4100.0f, 975.0f, -1375.0f }, - { 3735.0f, 715.0f, -1325.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0x2323, - 2, - 0, - 60.0f, - 1.0f, - { 0.0f, 60.0f, 0.0f }, - { -10.0f, 15.0f, -200.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_8012269C[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 20, - 2, - 45.0f, - 1.0f, - { 975.0f, 225.0f, -1195.0f }, - { 918.0f, 228.0f, -1228.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80122714[4] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 20, - 0, - 45.0f, - 1.0f, - { -915.0f, -2185.0f, 6335.0f }, - { -915.0f, -2290.0f, 6165.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - -1, - 0, - 80.0f, - 0.8f, - { -920.0f, -2270.0f, 6140.0f }, - { -920.0f, -2280.0f, 6070.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 20, - 0, - 80.0f, - 0.9f, - { -920.0f, -2300.0f, 6140.0f }, - { -920.0f, -2300.0f, 6070.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_801227B4[6] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 30, - 0, - 60.0f, - 1.0f, - { 1400.0f, 100.0f, -170.0f }, - { 1250.0f, 100.0f, -170.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 130, - 0, - 60.0f, - 0.2f, - { 0.0f, -5.0f, 0.0f }, - { -150.0f, -5.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0303, - 69, - 0, - 85.0f, - 1.0f, - { -40.0f, 0.0f, 0.0f }, - { -40.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0303, - 20, - 0, - 60.0f, - 1.0f, - { 10.0f, 0.0f, 0.0f }, - { 10.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_801228A4[5] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0101, - 20, - 5, - 30.0f, - 1.0f, - { 800.0f, -40.0f, 2170.0f }, - { 512.0f, 142.0f, 2020.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 20, - -2, - 70.0f, - 0.8f, - { 800.0f, -40.0f, 2170.0f }, - { 512.0f, 142.0f, 2020.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_8), - 0x0101, - 90, - 2, - 62.0f, - 1.0f, - { 1140.0f, 125.0f, 1920.0f }, - { 1255.0f, 150.0f, 1785.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2121, - 10, - 0, - 60.0f, - 1.0f, - { 0.0f, 10.0f, 0.0f }, - { 30.0f, 10.0f, -80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_8012296C[4] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 20, - -10, - 70.0f, - 1.0f, - { -930.0f, 765.0f, -3075.0f }, - { -700.0f, 700.0f, -3075.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 80, - -10, - 70.0f, - 0.05f, - { -930.0f, 205.0f, -3075.0f }, - { -700.0f, 140.0f, -3075.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 120, - 0, - 70.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80122A0C[2] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 60, - 4, - 50.0f, - 1.0f, - { 0.0f, 400.0f, -1000.0f }, - { -200.0f, 500.0f, -850.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 50.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80122A5C[8] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 1, - -15, - 70.0f, - 1.0f, - { 230.0f, 3675.0f, -4230.0f }, - { -45.0f, 3650.0f, -4415.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 1, - 0, - 60.0f, - 1.0f, - { -120.0f, 2187.0f, -3286.0f }, - { -110.0f, 2162.0f, -3262.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 55, - 0, - 60.0f, - 1.0f, - { -38.0f, 1467.0f, -1102.0f }, - { 64.0f, 1423.0f, -1188.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 1, - -15, - 70.0f, - 1.0f, - { 230.0f, 3675.0f, -4230.0f }, - { -20.0f, 3650.0f, -4400.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80122B9C[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 60, - 0, - 65.0f, - 1.0f, - { 1095.0f, 2890.0f, -2980.0f }, - { 1166.0f, 2695.0f, -2710.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 60, - 15, - 65.0f, - 1.0f, - { 566.0f, 4654.0f, -4550.0f }, - { 606.0f, 5160.0f, -4740.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80122C14[1] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 999, - 0, - 85.0f, - 1.0f, - { -15.0f, 185.0f, 160.0f }, - { -15.0f, 210.0f, 250.0f }, - }, -}; - -static OnePointCsFull D_80122C3C[1] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 999, - -2, - 70.0f, - 1.0f, - { -62.0f, 60.0f, -315.0f }, - { -115.0f, 30.0f, -445.0f }, - }, -}; - -static OnePointCsFull D_80122C64[1] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 999, - 3, - 70.0f, - 1.0f, - { -40.0f, 80.0f, 375.0f }, - { -85.0f, 45.0f, 485.0f }, - }, -}; - -static OnePointCsFull D_80122C8C[1] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 999, - 5, - 60.0f, - 1.0f, - { -70.0f, 140.0f, 25.0f }, - { 10.0f, 180.0f, 195.0f }, - }, -}; - -static OnePointCsFull D_80122CB4[2] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 5, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, 1000.0f }, - { 0.0f, 0.0f, 1100.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - -1, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, -100.0f }, - { 0.0f, 0.0f, 0.0f }, - }, -}; - -static OnePointCsFull D_80122D04[2] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 10, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, -100.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - -1, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, 1000.0f }, - { 0.0f, 0.0f, 1100.0f }, - }, -}; - -static OnePointCsFull D_80122D54[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 1, - -4, - 50.0f, - 1.0f, - { 230.0f, 65.0f, 300.0f }, - { 50.0f, 50.0f, 225.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80122DCC[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 1, - 0, - 50.0f, - 1.0f, - { 0.0f, 5.0f, -145.0f }, - { 0.0f, 55.0f, 55.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80122E44[2][7] = { - { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2222, - 10, - 5, - 90.0f, - 0.2f, - { 50.0f, 100.0f, 140.0f }, - { -30.0f, 10.0f, -20.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 20, - 0, - 90.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4343, - 30, - -5, - 50.0f, - 0.2f, - { -10.0f, 80.0f, 10.0f }, - { 20.0f, 20.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -5, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x4343, - 160, - 10, - 80.0f, - 0.005f, - { -50.0f, 60.0f, 0.0f }, - { -100.0f, 20.0f, 50.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0501, - 50, - 0, - 60.0f, - 1.0f, - { 0.0f, -10.0f, 0.0f }, - { 0.0f, 10.0f, 80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_19, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - }, - { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2222, - 10, - -5, - 90.0f, - 0.2f, - { -50.0f, 100.0f, 140.0f }, - { 30.0f, 10.0f, -20.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 20, - 0, - 90.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4343, - 30, - 5, - 50.0f, - 0.2f, - { 10.0f, 80.0f, 10.0f }, - { -20.0f, 20.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 5, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x4343, - 160, - -10, - 80.0f, - 0.005f, - { 50.0f, 60.0f, 0.0f }, - { 100.0f, 20.0f, 50.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0501, - 50, - 0, - 60.0f, - 1.0f, - { 0.0f, -10.0f, 0.0f }, - { 0.0f, 10.0f, 80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_19, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - -1, - -1.0f, - -1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - }, -}; - -static OnePointCsFull D_80123074[5] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0xA2A2, - 2, - 8, - 70.0f, - 1.0f, - { -27.0f, -96.0f, 25.0f }, - { 37.0f, -5.0f, 100.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0xA2A2, - 38, - 4, - 60.0f, - 1.0f, - { 64.0f, -109.0f, 55.0f }, - { 37.0f, 150.0f, 155.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0xA2A2, - 2, - 8, - 70.0f, - 1.0f, - { 45.0f, 123.0f, 45.0f }, - { 70.0f, 5.0f, 125.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0xA2A2, - 58, - 4, - 60.0f, - 0.9f, - { 82.0f, 95.0f, 55.0f }, - { 25.0f, -175.0f, 180.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_8012313C[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0xA2A2, - 20, - 8, - 70.0f, - 1.0f, - { 65.0f, -150.0f, 50.0f }, - { 30.0f, 10.0f, 90.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0xA2A2, - 100, - 0, - 60.0f, - 1.0f, - { 70.0f, -160.0f, 50.0f }, - { 25.0f, 180.0f, 180.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_801231B4[4] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), - 0x4343, - 1, - 0, - 50.0f, - 1.0f, - { 0.0f, 20.0f, 0.0f }, - { 0.0f, 5.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), - 0x4343, - 48, - 0, - 50.0f, - 0.75f, - { 0.0f, 80.0f, 0.0f }, - { 0.0f, 15.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), - 0x4343, - 1, - 5, - 45.0f, - 1.0f, - { 0.0f, 0.0f, 30.0f }, - { 30.0f, 120.0f, 60.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), - 0x4343, - -1, - 0, - -1.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80123254[2] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 1, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), - 0x0101, - 49, - 0, - 50.0f, - 0.05f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, -}; - -static OnePointCsFull D_801232A4[1] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_69), - 0x0101, - 9999, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, -}; - -static OnePointCsFull D_801232CC[5] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 45, - -3, - 65.0f, - 1.0f, - { -52.0f, 84.0f, -846.0f }, - { -159.0f, 33.0f, -729.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 10, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2121, - 15, - 0, - 60.0f, - 1.0f, - { 10.0f, -5.0f, 0.0f }, - { 0.0f, 0.0f, -150.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80123394[5] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 45, - 3, - 65.0f, - 1.0f, - { -16.0f, 87.0f, -829.0f }, - { 98.0f, 24.0f, -714.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 10, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2121, - 15, - 0, - 60.0f, - 1.0f, - { 10.0f, -5.0f, 0.0f }, - { 0.0f, 0.0f, -150.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_8012345C[4] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x4242, - 40, - 0, - 40.0f, - 1.0f, - { 0.0f, 50.0f, -40.0f }, - { 0.0f, 60.0f, -160.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_77), - 0x4242, - 40, - 0, - 60.0f, - 0.3f, - { 0.0f, 90.0f, -40.0f }, - { 0.0f, 60.0f, -160.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x2121, - 10, - 0, - 60.0f, - 0.2f, - { 0.0f, -10.0f, 10.0f }, - { 0.0f, 10.0f, -80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_801234FC[5] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_5), - 0x0441, - 10, - 0, - 70.0f, - 1.0f, - { 0.0f, -10.0f, 20.0f }, - { 0.0f, 0.0f, 120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4141, - 30, - 0, - 50.0f, - 0.1f, - { 0.0f, -10.0f, 20.0f }, - { 0.0f, 10.0f, 80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2121, - 10, - 0, - 60.0f, - 0.9f, - { 0.0f, -10.0f, 0.0f }, - { 0.0f, 10.0f, -80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_801235C4[5] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSACTION_1), - 0x4141, - 1, - 0, - 50.0f, - 1.0f, - { 0.0f, -10.0f, 20.0f }, - { 0.0f, 10.0f, 60.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0441, - 39, - 0, - 70.0f, - 0.1f, - { 0.0f, -10.0f, 20.0f }, - { 0.0f, 0.0f, 100.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x2121, - 15, - 0, - 60.0f, - 0.9f, - { 0.0f, -10.0f, 0.0f }, - { 0.0f, 10.0f, -80.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_8012368C[4] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 10, - 0, - 60.0f, - 1.0f, - { -1110.0f, -180.0f, -840.0f }, - { -985.0f, -220.0f, -840.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 70, - -45, - 75.0f, - 1.0f, - { -1060.0f, -160.0f, -840.0f }, - { -1005.0f, -230.0f, -840.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 10, - -45, - 75.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 180, - 9, - 80.0f, - 1.0f, - { -1205.0f, -175.0f, -840.0f }, - { -1305.0f, -230.0f, -828.0f }, - }, -}; - -static OnePointCsFull D_8012372C[4] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0142, - 10, - 0, - 70.0f, - 1.0f, - { 0.0f, 80.0f, 0.0f }, - { -1650.0f, 200.0f, -2920.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0142, - 110, - -2, - 50.0f, - 0.5f, - { 0.0f, 150.0f, 0.0f }, - { -1320.0f, 170.0f, -2900.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 100, - 2, - 70.0f, - 0.1f, - { 0.0f, 150.0f, 50.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 60, - 2, - 45.0f, - 0.01f, - { 0.0f, 150.0f, 50.0f }, - { 0.0f, 200.0f, -80.0f }, - }, -}; - -static OnePointCsFull D_801237CC[5] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 20, - 0, - 50.0f, - 1.0f, - { 0.0f, 50.0f, -10.0f }, - { 0.0f, 0.0f, 100.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_10, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 80, - 0, - 75.0f, - 1.0f, - { 2900.0f, 1300.0f, 530.0f }, - { 2800.0f, 1190.0f, 540.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 10, - 0, - 75.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 55, - 0, - 75.0f, - 1.0f, - { 2900.0f, 1300.0f, 530.0f }, - { 1500.0f, 1415.0f, 650.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 100, - -45, - 75.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; - -static OnePointCsFull D_80123894[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 60, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 30, - 0, - 50.0f, - 1.0f, - { 0.0f, 28.0f, 0.0f }, - { 0.0f, 20.0f, 40.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_13, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 120, - 0, - 180.0f, - 0.4f, - { 0.0f, -5.0f, 0.0f }, - { 0.0f, 2.0f, 40.0f }, - }, -}; - -static OnePointCsFull D_8012390C[2] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 30, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 180, - 0, - 60.0f, - 1.0f, - { 0.0f, 78.0f, 0.0f }, - { 0.0f, 78.0f, 200.0f }, - }, -}; - -static OnePointCsFull D_8012395C[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0101, - 60, - 0, - 60.0f, - 1.0f, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 30, - 0, - 50.0f, - 1.0f, - { 0.0f, 28.0f, 0.0f }, - { 0.0f, 20.0f, -45.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_13, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 120, - 0, - 180.0f, - 0.4f, - { 0.0f, -5.0f, 0.0f }, - { 0.0f, 2.0f, 45.0f }, - }, -}; - -static OnePointCsFull D_801239D4[3] = { - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 5, - 0, - 60.0f, - 1.0f, - { 0.0f, 20.0f, 0.0f }, - { 0.0f, 40.0f, -120.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_9, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x4242, - 0, - 0, - 60.0f, - 1.0f, - { 0.0f, 20.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - }, - { - ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - ONEPOINT_CS_INIT_FIELD_NONE, - 0x0000, - 1, - 0, - 60.0f, - 1.0f, - { -1.0f, -1.0f, -1.0f }, - { -1.0f, -1.0f, -1.0f }, - }, -}; diff --git a/src/code/z_play.c b/src/code/z_play.c index 8c7baeb18f..264d7b6b58 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -10,9 +10,12 @@ TransitionTile sTransitionTile; s32 gTransitionTileState; VisMono sPlayVisMono; Color_RGBA8_u32 gVisMonoColor; + +#if OOT_DEBUG FaultClient D_801614B8; +#endif + s16 sTransitionFillTimer; -u64 sDebugCutsceneScriptBuf[0xA00]; void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn); @@ -451,7 +454,10 @@ void Play_Init(GameState* thisx) { AnimationContext_Update(this, &this->animationCtx); gSaveContext.respawnFlag = 0; - if (OOT_DEBUG && R_USE_DEBUG_CUTSCENE) { +#if OOT_DEBUG + if (R_USE_DEBUG_CUTSCENE) { + static u64 sDebugCutsceneScriptBuf[0xA00]; + gDebugCutsceneScript = sDebugCutsceneScriptBuf; 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. DmaMgr_DmaRomToRam(0x03FEB000, gDebugCutsceneScript, sizeof(sDebugCutsceneScriptBuf)); } +#endif } void Play_Update(PlayState* this) { diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 4be3f6735c..42dfa4e9bc 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -152,6 +152,7 @@ void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton, } (*mtx)++; } else if (limbDList != NULL) { + if (1) {} MATRIX_TO_MTX(*mtx, "../z_skelanime.c", 954); (*mtx)++; } @@ -366,6 +367,7 @@ void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, gSPDisplayList(POLY_OPA_DISP++, newDList); (*limbMatrices)++; } else if (limbDList != NULL) { + if (1) {} MATRIX_TO_MTX(*limbMatrices, "../z_skelanime.c", 1249); (*limbMatrices)++; } @@ -467,7 +469,7 @@ void SkelAnime_GetFrameData(AnimationHeader* animation, s32 frame, s32 limbCount u16 staticIndexMax = animHeader->staticIndexMax; s32 i; - for (i = 0; i < limbCount; i++, frameTable++, jointIndices++) { + for (i = 0; i < limbCount; i++) { if ((frameTable == NULL) || (jointIndices == NULL) || (dynamicData == NULL) || (staticData == NULL)) { LOG_ADDRESS("out", frameTable, "../z_skelanime.c", 1392); LOG_ADDRESS("ref_tbl", jointIndices, "../z_skelanime.c", 1393); @@ -481,6 +483,8 @@ void SkelAnime_GetFrameData(AnimationHeader* animation, s32 frame, s32 limbCount (jointIndices->y >= staticIndexMax) ? dynamicData[jointIndices->y] : staticData[jointIndices->y]; frameTable->z = (jointIndices->z >= staticIndexMax) ? dynamicData[jointIndices->z] : staticData[jointIndices->z]; + jointIndices++; + frameTable++; } } @@ -1024,10 +1028,11 @@ void AnimationContext_Update(PlayState* play, AnimationContext* animationCtx) { AnimationContext_LoadFrame, AnimationContext_CopyAll, AnimationContext_Interp, AnimationContext_CopyTrue, AnimationContext_CopyFalse, AnimationContext_MoveActor, }; - AnimationEntry* entry; + AnimationEntry* entry = animationCtx->entries; - for (entry = animationCtx->entries; animationCtx->animationCount != 0; entry++, animationCtx->animationCount--) { + for (; animationCtx->animationCount != 0; animationCtx->animationCount--) { animFuncs[entry->type](play, &entry->data); + entry++; } sAnimQueueFlags = 1; diff --git a/src/code/z_sram.c b/src/code/z_sram.c index d5d72a664e..b5da4691c9 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -511,8 +511,7 @@ void Sram_WriteSave(SramContext* sramCtx) { gSaveContext.save.info.checksum = 0; ptr = (u16*)&gSaveContext; - checksum = 0; - j = 0; + checksum = j = 0; for (offset = 0; offset < CHECKSUM_SIZE; offset++) { if (++j == 0x20) { @@ -612,12 +611,15 @@ void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCt bzero(&gSaveContext.save.entranceIndex, sizeof(s32)); bzero(&gSaveContext.save.linkAge, sizeof(s32)); bzero(&gSaveContext.save.cutsceneIndex, sizeof(s32)); - // note that gSaveContext.save.dayTime is not actually the sizeof(s32) + //! @bug gSaveContext.save.dayTime is a u16 but is cleared as a 32-bit value. This is harmless as-is + //! since it is followed by nightFlag which is also reset here, but can become an issue if the save + //! layout is changed. bzero(&gSaveContext.save.dayTime, sizeof(s32)); bzero(&gSaveContext.save.nightFlag, sizeof(s32)); bzero(&gSaveContext.save.totalDays, sizeof(s32)); bzero(&gSaveContext.save.bgsDayCount, sizeof(s32)); +#if OOT_DEBUG if (!slotNum) { Sram_InitDebugSave(); gSaveContext.save.info.playerData.newf[0] = 'Z'; @@ -633,6 +635,9 @@ void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCt } else { Sram_InitNewSave(); } +#else + Sram_InitNewSave(); +#endif ptr = (u16*)&gSaveContext; PRINTF("\n--------------------------------------------------------------\n"); @@ -718,20 +723,26 @@ void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx) { u16* ptr; u16 checksum; +#if OOT_DEBUG if (fileSelect->buttonIndex != 0) { Sram_InitNewSave(); } else { Sram_InitDebugSave(); } +#else + Sram_InitNewSave(); +#endif gSaveContext.save.entranceIndex = ENTR_LINKS_HOUSE_0; gSaveContext.save.linkAge = LINK_AGE_CHILD; gSaveContext.save.dayTime = CLOCK_TIME(10, 0); gSaveContext.save.cutsceneIndex = 0xFFF1; +#if OOT_DEBUG if (fileSelect->buttonIndex == 0) { gSaveContext.save.cutsceneIndex = 0; } +#endif for (offset = 0; offset < 8; offset++) { gSaveContext.save.info.playerData.playerName[offset] = fileSelect->fileNames[fileSelect->buttonIndex][offset]; @@ -753,10 +764,8 @@ void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx) { PRINTF("\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n"); ptr = (u16*)&gSaveContext; - j = 0; - checksum = 0; - for (offset = 0; offset < CHECKSUM_SIZE; offset++) { + for (j = 0, checksum = 0, offset = 0; offset < CHECKSUM_SIZE; offset++) { PRINTF("%x ", *ptr); checksum += *ptr++; if (++j == 0x20) { @@ -893,6 +902,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) { Sram_WriteSramHeader(sramCtx); } +#if OOT_DEBUG if (CHECK_BTN_ANY(gameState->input[2].cur.button, BTN_DRIGHT)) { bzero(sramCtx->readBuff, SRAM_SIZE); for (i = 0; i < CHECKSUM_SIZE; i++) { @@ -901,6 +911,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) { SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, SRAM_SIZE, OS_WRITE); PRINTF("SRAM破壊!!!!!!\n"); // "SRAM destruction! ! ! ! ! !" } +#endif // "GOOD! GOOD! Size = %d + %d = %d" PRINTF("GOOD!GOOD! サイズ=%d + %d = %d\n", sizeof(SaveInfo), 4, sizeof(SaveInfo) + 4); diff --git a/src/code/z_ss_sram.c b/src/code/z_ss_sram.c index 8feef8ad1d..75c61539a2 100644 --- a/src/code/z_ss_sram.c +++ b/src/code/z_ss_sram.c @@ -9,7 +9,7 @@ typedef struct { SsSramContext sSsSramContext = { 0 }; -void SsSram_Init(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize, u8 handleRelDuration, +void SsSram_Init(s32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize, u8 handleRelDuration, u8 handlePulse, u32 handleSpeed) { u32 prevInt; OSPiHandle* handle = &sSsSramContext.piHandle; @@ -49,7 +49,7 @@ void SsSram_Dma(void* dramAddr, size_t size, s32 direction) { osInvalDCache(dramAddr, size); } -void SsSram_ReadWrite(u32 addr, void* dramAddr, size_t size, s32 direction) { +void SsSram_ReadWrite(s32 addr, void* dramAddr, size_t size, s32 direction) { PRINTF("ssSRAMReadWrite:%08x %08x %08x %d\n", addr, dramAddr, size, direction); SsSram_Init(addr, DEVICE_TYPE_SRAM, PI_DOMAIN2, 5, 0xD, 2, 0xC, 0); SsSram_Dma(dramAddr, size, direction); diff --git a/src/code/z_viszbuf.c b/src/code/z_viszbuf.c index 90080b79cf..3e9f15eb52 100644 --- a/src/code/z_viszbuf.c +++ b/src/code/z_viszbuf.c @@ -47,14 +47,18 @@ extern u16 D_0E000000[]; void VisZBuf_Init(VisZBuf* this) { this->vis.type = VIS_ZBUF_TYPE_IA; this->vis.scissorType = VIS_NO_SETSCISSOR; + this->vis.primColor.r = 255; this->vis.primColor.g = 255; this->vis.primColor.b = 255; this->vis.primColor.a = 255; + + // clang-format off + this->vis.envColor.r = 0; \ + this->vis.envColor.g = 0; \ + this->vis.envColor.b = 0; \ this->vis.envColor.a = 255; - this->vis.envColor.r = 0; - this->vis.envColor.g = 0; - this->vis.envColor.b = 0; + // clang-format on } void VisZBuf_Destroy(VisZBuf* this) { diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 5b1e963064..d085142969 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -139,25 +139,6 @@ void ArmsHook_AttachHookToActor(ArmsHook* this, Actor* actor) { void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { Player* player = GET_PLAYER(play); - Actor* touchedActor; - Actor* grabbed; - Vec3f bodyDistDiffVec; - Vec3f newPos; - f32 bodyDistDiff; - f32 phi_f16; - DynaPolyActor* dynaPolyActor; - f32 curGrabbedDist; - f32 grabbedDist; - s32 pad; - CollisionPoly* poly; - s32 bgId; - Vec3f intersectPos; - Vec3f prevFrameDiff; - Vec3f sp60; - f32 polyNormalX; - f32 polyNormalZ; - f32 velocity; - s32 pad1; if ((this->actor.parent == NULL) || (!Player_HoldsHookshot(player))) { ArmsHook_DetachHookFromActor(this); @@ -170,7 +151,8 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { if ((this->timer != 0) && (this->collider.base.atFlags & AT_HIT) && (this->collider.elem.atHitElem->elemType != ELEMTYPE_UNK4)) { - touchedActor = this->collider.base.at; + Actor* touchedActor = this->collider.base.at; + if ((touchedActor->update != NULL) && (touchedActor->flags & (ACTOR_FLAG_9 | ACTOR_FLAG_10))) { if (this->collider.elem.atHitElem->bumperFlags & BUMP_HOOKABLE) { ArmsHook_AttachHookToActor(this, touchedActor); @@ -182,7 +164,20 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { this->timer = 0; Audio_PlaySfxGeneral(NA_SE_IT_ARROW_STICK_CRE, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - } else if (DECR(this->timer) == 0) { + return; + } + + if (DECR(this->timer) == 0) { + Actor* grabbed; + Vec3f bodyDistDiffVec; + Vec3f newPos; + f32 bodyDistDiff; + f32 phi_f16; + s32 pad1; + f32 curGrabbedDist; + f32 grabbedDist; + f32 velocity; + grabbed = this->grabbed; if (grabbed != NULL) { if ((grabbed->update == NULL) || !CHECK_FLAG_ALL(grabbed->flags, ACTOR_FLAG_13)) { @@ -250,6 +245,12 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { } } } else { + CollisionPoly* poly; + s32 bgId; + Vec3f intersectPos; + Vec3f prevFrameDiff; + Vec3f sp60; + Actor_MoveXZGravity(&this->actor); Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &prevFrameDiff); Math_Vec3f_Sum(&this->unk_1E8, &prevFrameDiff, &this->unk_1E8); @@ -260,13 +261,17 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { if (BgCheck_EntityLineTest1(&play->colCtx, &sp60, &this->unk_1E8, &intersectPos, &poly, true, true, true, true, &bgId) && !func_8002F9EC(play, &this->actor, poly, bgId, &intersectPos)) { - polyNormalX = COLPOLY_GET_NORMAL(poly->normal.x); - polyNormalZ = COLPOLY_GET_NORMAL(poly->normal.z); + f32 polyNormalX = COLPOLY_GET_NORMAL(poly->normal.x); + f32 polyNormalZ = COLPOLY_GET_NORMAL(poly->normal.z); + s32 pad; + Math_Vec3f_Copy(&this->actor.world.pos, &intersectPos); this->actor.world.pos.x += 10.0f * polyNormalX; this->actor.world.pos.z += 10.0f * polyNormalZ; this->timer = 0; if (SurfaceType_CanHookshot(&play->colCtx, poly, bgId)) { + DynaPolyActor* dynaPolyActor; + if (bgId != BGCHECK_SCENE) { dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId); if (dynaPolyActor != NULL) { @@ -308,6 +313,8 @@ void ArmsHook_Draw(Actor* thisx, PlayState* play) { if ((player->actor.draw != NULL) && (player->rightHandType == PLAYER_MODELTYPE_RH_HOOKSHOT)) { OPEN_DISPS(play->state.gfxCtx, "../z_arms_hook.c", 850); + if (1) {} + if ((ArmsHook_Shoot != this->actionFunc) || (this->timer <= 0)) { Matrix_MultVec3f(&D_80865B70, &this->unk_1E8); Matrix_MultVec3f(&D_80865B88, &hookNewTip); diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index 2220e8f546..d754036fb5 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -90,17 +90,21 @@ static InitChainEntry sInitChain[] = { static Vec3f D_8086E0E0 = { 0.0f, 140.0f, 0.0f }; void BgBdanSwitch_InitDynaPoly(BgBdanSwitch* this, PlayState* play, CollisionHeader* collision, s32 flag) { - s16 pad1; + s32 pad; CollisionHeader* colHeader = NULL; - s16 pad2; DynaPolyActor_Init(&this->dyna, flag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_bdan_switch.c", 325, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgBdanSwitch_InitCollision(BgBdanSwitch* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index f2779f3c61..4187b34023 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -252,7 +252,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) { } if (givingReward) { - if (!IS_CUTSCENE_LAYER) { + if (!IS_CUTSCENE_LAYER || !OOT_DEBUG) { if (play->sceneId != SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC) { switch (this->fountainType) { case FAIRY_SPELL_FARORES_WIND: diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c index 95f18f4b7c..7cf14989c1 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c @@ -97,12 +97,11 @@ void BgGanonOtyuka_Destroy(Actor* thisx, PlayState* play2) { void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, PlayState* play) { Actor* thisx = &this->dyna.actor; Actor* prop; - BgGanonOtyuka* platform; + s16 i; f32 dx; f32 dy; f32 dz; Vec3f center; - s16 i; if (this->isFalling || ((play->actorCtx.unk_02 != 0) && (this->dyna.actor.xyzDistToPlayerSq < SQ(70.0f)))) { PRINTF("OTC O 1\n"); @@ -113,20 +112,19 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, PlayState* play) { if ((prop == thisx) || (prop->id != ACTOR_BG_GANON_OTYUKA)) { prop = prop->next; continue; - } - - platform = (BgGanonOtyuka*)prop; - - dx = platform->dyna.actor.world.pos.x - this->dyna.actor.world.pos.x + D_80876A68[i].x; - dy = platform->dyna.actor.world.pos.y - this->dyna.actor.world.pos.y; - dz = platform->dyna.actor.world.pos.z - this->dyna.actor.world.pos.z + D_80876A68[i].z; - - if ((fabsf(dx) < 10.0f) && (fabsf(dy) < 10.0f) && (fabsf(dz) < 10.0f)) { - platform->visibleSides |= sSides[i]; - break; } else { - prop = prop->next; + BgGanonOtyuka* platform = (BgGanonOtyuka*)prop; + + dx = platform->dyna.actor.world.pos.x - this->dyna.actor.world.pos.x + D_80876A68[i].x; + dy = platform->dyna.actor.world.pos.y - this->dyna.actor.world.pos.y; + dz = platform->dyna.actor.world.pos.z - this->dyna.actor.world.pos.z + D_80876A68[i].z; + + if ((fabsf(dx) < 10.0f) && (fabsf(dy) < 10.0f) && (fabsf(dz) < 10.0f)) { + platform->visibleSides |= sSides[i]; + break; + } } + prop = prop->next; } } diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index e7ea4f3655..e717fcc356 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -125,15 +125,18 @@ void func_8087AF38(BgGndSoulmeiro* this, PlayState* play) { } else if ((this->unk_198 % 6) == 0) { s32 i; s16 temp_2 = Rand_ZeroOne() * (10922.0f); // This should be: 0x10000 / 6.0f + s16 temp_1; + f32 temp_3; + f32 temp_4; + f32 distXZ; vecA.y = 0.0f; vecB.y = thisx->world.pos.y; for (i = 0; i < 6; i++) { - s16 temp_1 = Rand_CenteredFloat(0x2800) + temp_2; - f32 temp_3 = Math_SinS(temp_1); - f32 temp_4 = Math_CosS(temp_1); - f32 distXZ; + temp_1 = Rand_CenteredFloat(0x2800) + temp_2; + temp_3 = Math_SinS(temp_1); + temp_4 = Math_CosS(temp_1); vecB.x = thisx->world.pos.x + (120.0f * temp_3); vecB.z = thisx->world.pos.z + (120.0f * temp_4); diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index 8e129ae40e..ed45e2cfc8 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -315,8 +315,6 @@ void BgHakaGate_DrawFlame(BgHakaGate* this, PlayState* play) { if (this->vFlameScale > 0) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_haka_gate.c", 716); - if (1) {} - Gfx_SetupDL_25Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x40, 1, 0, @@ -327,6 +325,9 @@ void BgHakaGate_DrawFlame(BgHakaGate* this, PlayState* play) { Matrix_Translate(thisx->world.pos.x, thisx->world.pos.y + 15.0f, thisx->world.pos.z, MTXMODE_NEW); Matrix_RotateY(BINANG_TO_RAD(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play))), MTXMODE_APPLY); scale = this->vFlameScale * 0.00001f; + + if (1) {} + Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka_gate.c", 744), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c index 8caf50d340..b7d3248962 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c @@ -85,14 +85,14 @@ void BgHakaMegane_Destroy(Actor* thisx, PlayState* play) { } void func_8087DB24(BgHakaMegane* this, PlayState* play) { - CollisionHeader* colHeader; - CollisionHeader* collision; - if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { this->dyna.actor.objectSlot = this->requiredObjectSlot; this->dyna.actor.draw = BgHakaMegane_Draw; Actor_SetObjectDependency(play, &this->dyna.actor); if (play->roomCtx.curRoom.lensMode != LENS_MODE_HIDE_ACTORS) { + CollisionHeader* colHeader; + CollisionHeader* collision; + this->actionFunc = func_8087DBF0; collision = sCollisionHeaders[this->dyna.actor.params]; if (collision != NULL) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index 4bd23fcaac..19e7e18a74 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -199,7 +199,11 @@ void BgHakaShip_Draw(Actor* thisx, PlayState* play) { f32 angleTemp; OPEN_DISPS(play->state.gfxCtx, "../z_bg_haka_ship.c", 528); + Gfx_SetupDL_25Opa(play->state.gfxCtx); + + if (1) {} + if (this->dyna.actor.params == 0) { gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_haka_ship.c", 534), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -220,7 +224,9 @@ void BgHakaShip_Draw(Actor* thisx, PlayState* play) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, object_haka_objects_DL_00E910); } + CLOSE_DISPS(play->state.gfxCtx, "../z_bg_haka_ship.c", 568); + if (this->actionFunc == BgHakaShip_CutsceneStationary || this->actionFunc == BgHakaShip_Move) { s32 pad; Vec3f sp2C; diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c index 1e205a090f..5c0a4fc067 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c @@ -352,6 +352,7 @@ void func_808806BC(BgHakaTrap* this, PlayState* play) { f32 floorHeight; f32 yIntersect; s32 i; + s32 bgId; this->dyna.actor.velocity.y *= 1.6f; @@ -366,8 +367,6 @@ void func_808806BC(BgHakaTrap* this, PlayState* play) { floorHeight = this->dyna.actor.floorHeight; for (i = 0; i < 3; i++) { - s32 bgId; - yIntersect = BgCheck_EntityRaycastDown4(&play->colCtx, &this->dyna.actor.floorPoly, &bgId, &this->dyna.actor, &vector) - 25.0f; diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index c868ca72a1..85549a63d7 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -490,6 +490,8 @@ void BgHeavyBlock_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_heavy_block.c", 904); + if (1) {} + if (BgHeavyBlock_LiftedUp == this->actionFunc) { Matrix_SetTranslateRotateYXZ(player->leftHandPos.x, player->leftHandPos.y, player->leftHandPos.z, &thisx->shape.rot); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c index e7ec041a3e..536a8abcdd 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c @@ -86,11 +86,12 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) { this->treasureFlag = (thisx->params >> 6) & 0x3F; thisx->params &= 0x3F; - if ((this->actor.params < 0) || (this->actor.params > 0x3F)) { + if (OOT_DEBUG && ((this->actor.params < 0) || (this->actor.params > 0x3F))) { // "Save bit is not set" PRINTF("Warning : object のセーブビットが設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_curtain.c", 373, this->actor.params); } + Actor_SetScale(&this->actor, hcParams->scale); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index 441fe805f1..52f904432f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -58,8 +58,7 @@ static CollisionCheckInfoInit sColChkInfoInit = { 1, 80, 100, MASS_IMMOVABLE }; void BgHidanFirewall_Init(Actor* thisx, PlayState* play) { BgHidanFirewall* this = (BgHidanFirewall*)thisx; - this->actor.scale.x = 0.12f; - this->actor.scale.z = 0.12f; + this->actor.scale.x = this->actor.scale.z = 0.12f; this->actor.scale.y = 0.01f; this->unk_150 = 0; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index b20e9f1c12..cc078dc8bf 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -347,11 +347,13 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { Actor_MoveXZGravity(&this->dyna.actor); func_80888694(this, (BgHidanHamstep*)this->dyna.actor.parent); +#if OOT_DEBUG if (((this->dyna.actor.params & 0xFF) <= 0) || ((this->dyna.actor.params & 0xFF) >= 6)) { // "[Hammer Step] arg_data strange (arg_data = %d)" PRINTF("【ハンマーステップ】 arg_data おかしい (arg_data = %d)", this->dyna.actor.params); PRINTF("%s %d\n", "../z_bg_hidan_hamstep.c", 696); } +#endif if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) <= sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1]) && diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c index 0d476066de..ce8149375f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c @@ -82,6 +82,7 @@ void BgHidanHrock_Init(Actor* thisx, PlayState* play) { s32 i; s32 j; CollisionHeader* collisionHeader = NULL; + Vec3f* vtx; Actor_ProcessInitChain(thisx, sInitChain); this->unk_16A = thisx->params & 0x3F; @@ -103,7 +104,7 @@ void BgHidanHrock_Init(Actor* thisx, PlayState* play) { if (1) { 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].y = vtx->y + thisx->home.pos.y; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index 4bcee5a11a..c7890ace87 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -73,9 +73,12 @@ void BgHidanKousi_Init(Actor* thisx, PlayState* play) { ((s32)thisx->params >> 8) & 0xFF); Actor_ProcessInitChain(thisx, sInitChain); + +#if OOT_DEBUG if (((thisx->params & 0xFF) < 0) || ((thisx->params & 0xFF) >= 3)) { PRINTF("arg_data おかしい 【格子】\n"); } +#endif CollisionHeader_GetVirtual(sMetalFencesCollisions[thisx->params & 0xFF], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c index 0e0f1f6062..9cba8f54de 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c @@ -130,9 +130,10 @@ void func_8088CEC0(BgHidanSekizou* this, s32 arg1, s16 arg2) { s32 end = start + 3; f32 sp30 = Math_SinS(arg2); f32 sp2C = Math_CosS(arg2); + ColliderJntSphElement* element; 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) + (sp30 * element->dim.modelSphere.center.z); @@ -301,8 +302,8 @@ Gfx* func_8088D9F4(PlayState* play, BgHidanSekizou* this, s16 arg2, MtxF* arg3, f32 phi_f12; arg6 = (((arg6 + arg2) % 8) * 7) * (1 / 7.0f); - arg2++; gSPSegment(arg7++, 9, SEGMENTED_TO_VIRTUAL(sFireballsTexs[arg6])); + arg2++; if (arg2 != 4) { phi_f12 = arg2 + ((4 - this->unk_170) / 4.0f); } else { diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index 2a862c4631..a3c81e8292 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -115,17 +115,20 @@ void BgIceShelter_InitColliders(BgIceShelter* this, PlayState* play) { void BgIceShelter_InitDynaPoly(BgIceShelter* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG registration failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_ice_shelter.c", 362, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgIceShelter_RotateY(Vec3f* dest, Vec3f* src, s16 angle) { @@ -144,7 +147,6 @@ static InitChainEntry sInitChain[] = { }; void BgIceShelter_Init(Actor* thisx, PlayState* play) { - static Vec3f kzIceScale = { 0.18f, 0.27f, 0.24f }; BgIceShelter* this = (BgIceShelter*)thisx; s16 type = BGICESHELTER_GET_TYPE(&this->dyna.actor); @@ -158,7 +160,9 @@ void BgIceShelter_Init(Actor* thisx, PlayState* play) { } if (type == RED_ICE_KING_ZORA) { - Math_Vec3f_Copy(&this->dyna.actor.scale, &kzIceScale); + static Vec3f sKingZoraRedIceScale = { 0.18f, 0.27f, 0.24f }; + + Math_Vec3f_Copy(&this->dyna.actor.scale, &sKingZoraRedIceScale); } else { Actor_SetScale(&this->dyna.actor, sRedIceScales[type]); } diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c index 343b1250c0..0d8f5a34d2 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c @@ -49,7 +49,6 @@ void BgIceShutter_Init(Actor* thisx, PlayState* play) { f32 sp24; CollisionHeader* colHeader; s32 sp28; - f32 temp_f6; colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -78,7 +77,8 @@ void BgIceShutter_Init(Actor* thisx, PlayState* play) { } 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 = (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; diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index e9632360db..fa7d9a9dc5 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -69,17 +69,20 @@ static InitChainEntry sInitChain[] = { void BgJya1flift_InitDynapoly(BgJya1flift* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG login failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_1flift.c", 179, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgJya1flift_InitCollision(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c index 4df5b39ed3..87cb2807dc 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c +++ b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c @@ -45,15 +45,19 @@ static InitChainEntry sInitChain[] = { void BgJyaAmishutter_InitDynaPoly(BgJyaAmishutter* this, PlayState* play, CollisionHeader* collision, s32 flag) { s32 pad1; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_amishutter.c", 129, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgJyaAmishutter_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c index a66909bd6c..a8e3c1ad7e 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c @@ -74,10 +74,12 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, PlayState* play) { this->puzzleFlags &= ~cobraPuzzleFlags[i]; } +#if OOT_DEBUG if (curCobraInfo->cobra->dyna.actor.update == NULL) { // "Cobra deleted" PRINTF("Error : コブラ削除された (%s %d)\n", "../z_bg_jya_bigmirror.c", 203); } +#endif } else { curCobraInfo->cobra = (BgJyaCobra*)Actor_SpawnAsChild( &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[0] = NULL; } else { - puzzleSolved = !!(this->puzzleFlags & (BIGMIR_PUZZLE_IN_STATUE_ROOM | BIGMIR_PUZZLE_IN_1ST_TOP_ROOM)); - - if (puzzleSolved) { - puzzleSolved = !!(this->puzzleFlags & BIGMIR_PUZZLE_COBRA2_SOLVED); - - if (puzzleSolved) { - puzzleSolved = !!(this->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED); - } - } - lightBeamToggles[0] = puzzleSolved; // Only spawn if puzzle solved - if (1) {} + // Only spawn if puzzle solved + lightBeamToggles[0] = (this->puzzleFlags & (BIGMIR_PUZZLE_IN_STATUE_ROOM | BIGMIR_PUZZLE_IN_1ST_TOP_ROOM)) && + (this->puzzleFlags & BIGMIR_PUZZLE_COBRA2_SOLVED) && + (this->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED); lightBeamToggles[1] = lightBeamToggles[2] = 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, sMirRayPositions[i].z, 0, 0, 0, sMirRayParamsVals[i]); +#if OOT_DEBUG if (this->lightBeams[i] == NULL) { // "Mir Ray generation failed" PRINTF("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_bigmirror.c", 310); } +#endif } } else { if (this->lightBeams[i] != NULL) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index b03f841e3c..c8dfb31195 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -63,19 +63,22 @@ static InitChainEntry sInitChain[] = { }; void BgJyaBombiwa_SetupDynaPoly(BgJyaBombiwa* this, PlayState* play, CollisionHeader* collision, s32 flag) { - s16 pad1; + s32 pad1; CollisionHeader* colHeader = NULL; - s16 pad2; DynaPolyActor_Init(&this->dyna, flag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; // "Warning: move BG registration failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_bombiwa.c", 174, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgJyaBombiwa_InitCollider(BgJyaBombiwa* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 02b42c4ce8..78f5a1f5e4 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -118,27 +118,34 @@ void func_808958F0(Vec3f* dest, Vec3f* src, f32 arg2, f32 arg3) { void BgJyaCobra_InitDynapoly(BgJyaCobra* this, PlayState* play, CollisionHeader* collision, s32 flags) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flags); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG Registration Failure" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_cobra.c", 247, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgJyaCobra_SpawnRay(BgJyaCobra* this, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_MIR_RAY, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + 57.0f, this->dyna.actor.world.pos.z, 0, 0, 0, 6); + +#if OOT_DEBUG if (this->dyna.actor.child == NULL) { PRINTF(VT_FGCOL(RED)); // "Error : Mir Ray occurrence failure" PRINTF("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_cobra.c", 270); PRINTF(VT_RST); } +#endif } void func_80895A70(BgJyaCobra* this) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c index af9ced88f4..6ef2ddd84c 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c @@ -106,10 +106,13 @@ void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, PlayState* play, EnIk f32 sins; s32 pad[2]; +#if OOT_DEBUG if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) { PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 233, enIk->unk_2FF); return; } +#endif + PRINTF("¢ attack_type(%d)\n", enIk->unk_2FF); 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; s32 pad[2]; +#if OOT_DEBUG if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) { PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 362, enIk->unk_2FF); return; } +#endif + PRINTF("¢ attack_type(%d)\n", enIk->unk_2FF); rotY = Actor_WorldYawTowardActor(&this->dyna.actor, &enIk->actor) + D_808994D8[enIk->unk_2FF - 1]; for (i = 0; i < 8; i++) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index f8ef9d42de..4a56ed44e8 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -43,15 +43,19 @@ static InitChainEntry sInitChain[] = { void BgJyaKanaami_InitDynaPoly(BgJyaKanaami* this, PlayState* play, CollisionHeader* collision, s32 flag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_kanaami.c", 145, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgJyaKanaami_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index 788f16adff..4acd8fbf03 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -217,10 +217,11 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, PlayState* play) { void BgJyaMegami_SetupExplode(BgJyaMegami* this) { u32 i; + Vec3f* pos = &this->dyna.actor.world.pos; this->actionFunc = BgJyaMegami_Explode; 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->explosionTimer = 0; diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c index 2a4181eefd..378116f72a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c @@ -62,15 +62,19 @@ static InitChainEntry sInitChain[] = { void BgJyaZurerukabe_InitDynaPoly(BgJyaZurerukabe* this, PlayState* play, CollisionHeader* collision, s32 flag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_zurerukabe.c", 194, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void func_8089B4C8(BgJyaZurerukabe* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index 0ab3facdac..f829706fc5 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -182,7 +182,14 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); 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)) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; @@ -194,12 +201,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { this->dyna.actor.params); Actor_Kill(&this->dyna.actor); } else { - f32 sin = Math_SinS(this->dyna.actor.shape.rot.y); - f32 cos = Math_CosS(this->dyna.actor.shape.rot.y); - s32 i; - s32 j; - Vec3f offset; - Vec3f vtx[3]; + sin = Math_SinS(this->dyna.actor.shape.rot.y); + cos = Math_CosS(this->dyna.actor.shape.rot.y); for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (j = 0; j < 3; j++) { @@ -217,7 +220,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } } 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)) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; @@ -229,12 +240,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { this->dyna.actor.params); Actor_Kill(&this->dyna.actor); } else { - f32 sin = Math_SinS(this->dyna.actor.shape.rot.y); - f32 cos = Math_CosS(this->dyna.actor.shape.rot.y); - s32 i; - s32 j; - Vec3f offset; - Vec3f vtx[3]; + sin = Math_SinS(this->dyna.actor.shape.rot.y); + cos = Math_CosS(this->dyna.actor.shape.rot.y); for (i = 0; i < ARRAY_COUNT(sTrisElementInitRutoWall); i++) { for (j = 0; j < 3; j++) { @@ -252,7 +259,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } } 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)) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; @@ -264,12 +279,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { this->dyna.actor.params); Actor_Kill(&this->dyna.actor); } else { - f32 sin = Math_SinS(this->dyna.actor.shape.rot.y); - f32 cos = Math_CosS(this->dyna.actor.shape.rot.y); - s32 i; - s32 j; - Vec3f offset; - Vec3f vtx[3]; + sin = Math_SinS(this->dyna.actor.shape.rot.y); + cos = Math_CosS(this->dyna.actor.shape.rot.y); for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (j = 0; j < 3; j++) { @@ -289,7 +300,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } } 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)) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; @@ -302,12 +321,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { this->dyna.actor.params); Actor_Kill(&this->dyna.actor); } else { - f32 sin = Math_SinS(this->dyna.actor.shape.rot.y); - f32 cos = Math_CosS(this->dyna.actor.shape.rot.y); - s32 i; - s32 j; - Vec3f offset; - Vec3f vtx[3]; + sin = Math_SinS(this->dyna.actor.shape.rot.y); + cos = Math_CosS(this->dyna.actor.shape.rot.y); for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (j = 0; j < 3; j++) { @@ -327,7 +342,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } } 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)) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; @@ -340,12 +363,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { this->dyna.actor.params); Actor_Kill(&this->dyna.actor); } else { - f32 sin = Math_SinS(this->dyna.actor.shape.rot.y); - f32 cos = Math_CosS(this->dyna.actor.shape.rot.y); - s32 i; - s32 j; - Vec3f offset; - Vec3f vtx[3]; + sin = Math_SinS(this->dyna.actor.shape.rot.y); + cos = Math_CosS(this->dyna.actor.shape.rot.y); for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (j = 0; j < 3; j++) { @@ -365,6 +384,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } } break; + } } } @@ -377,9 +397,8 @@ void BgMizuBwall_Destroy(Actor* thisx, PlayState* play) { } void BgMizuBwall_SetAlpha(BgMizuBwall* this, PlayState* play) { - f32 waterLevel = play->colCtx.colHeader->waterBoxes[2].ySurface; - - if (play->colCtx.colHeader->waterBoxes) {} + WaterBox* waterBoxes = play->colCtx.colHeader->waterBoxes; + f32 waterLevel = waterBoxes[2].ySurface; if (waterLevel < WATER_TEMPLE_WATER_F1_Y) { this->scrollAlpha1 = 255; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c index 050f850aaa..c0071bed5c 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c @@ -53,6 +53,7 @@ static InitChainEntry sInitChain[] = { u32 BgMizuWater_GetWaterLevelActionIndex(s16 switchFlag, PlayState* play) { u32 ret; +#if OOT_DEBUG if (bREG(0) != 0) { switch (bREG(1)) { case 0: @@ -67,6 +68,8 @@ u32 BgMizuWater_GetWaterLevelActionIndex(s16 switchFlag, PlayState* play) { } bREG(0) = 0; } +#endif + if (Flags_GetSwitch(play, WATER_TEMPLE_WATER_F1_FLAG) && (switchFlag != WATER_TEMPLE_WATER_F1_FLAG)) { ret = 3; } 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 pad; +#if OOT_DEBUG if (bREG(15) == 0) { 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)); } +#endif + if (this->type == 0) { posY = this->actor.world.pos.y; unk0 = 0; diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index 18e1eaaafd..9cb6034bc2 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -53,17 +53,20 @@ void BgMoriBigst_SetupAction(BgMoriBigst* this, BgMoriBigstActionFunc actionFunc void BgMoriBigst_InitDynapoly(BgMoriBigst* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG login failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_mori_bigst.c", 190, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgMoriBigst_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index 12072ce5ff..8b50d4b5dd 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -88,27 +88,31 @@ void BgMoriElevator_Init(Actor* thisx, PlayState* play) { this->unk_172 = sIsSpawned; this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX); + +#if OOT_DEBUG if (this->moriTexObjectSlot < 0) { Actor_Kill(thisx); // "Forest Temple obj elevator Bank Danger!" PRINTF("Error : 森の神殿 obj elevator バンク危険!(%s %d)\n", "../z_bg_mori_elevator.c", 277); - } else { - switch (sIsSpawned) { - case false: - // "Forest Temple elevator CT" - PRINTF("森の神殿 elevator CT\n"); - sIsSpawned = true; - this->dyna.actor.room = -1; - Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - CollisionHeader_GetVirtual(&gMoriElevatorCol, &colHeader); - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - BgMoriElevator_SetupWaitAfterInit(this); - break; - case true: - Actor_Kill(thisx); - break; - } + return; + } +#endif + + switch (sIsSpawned) { + case false: + // "Forest Temple elevator CT" + PRINTF("森の神殿 elevator CT\n"); + sIsSpawned = true; + this->dyna.actor.room = -1; + Actor_ProcessInitChain(&this->dyna.actor, sInitChain); + DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); + CollisionHeader_GetVirtual(&gMoriElevatorCol, &colHeader); + this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); + BgMoriElevator_SetupWaitAfterInit(this); + break; + case true: + Actor_Kill(thisx); + break; } } diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c index e4be790154..a31345545c 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c @@ -78,19 +78,21 @@ static InitChainEntry sInitChainLadder[] = { void BgMoriHashigo_InitDynapoly(BgMoriHashigo* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; - CollisionHeader* colHeader; - s32 pad2; + CollisionHeader* colHeader = NULL; - colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG login failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_mori_hashigo.c", 164, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgMoriHashigo_InitCollider(BgMoriHashigo* this, PlayState* play) { @@ -260,9 +262,9 @@ void BgMoriHashigo_LadderFall(BgMoriHashigo* this, PlayState* play) { } void BgMoriHashigo_SetupLadderRest(BgMoriHashigo* this) { - this->actionFunc = NULL; this->dyna.actor.gravity = 0.0f; this->dyna.actor.velocity.y = 0.0f; + this->actionFunc = NULL; this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; } diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c index e4b2a1217f..5f5af22350 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c @@ -50,19 +50,21 @@ void BgMoriHashira4_SetupAction(BgMoriHashira4* this, BgMoriHashira4ActionFunc a void BgMoriHashira4_InitDynaPoly(BgMoriHashira4* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; - CollisionHeader* colHeader; - s32 pad2; + CollisionHeader* colHeader = NULL; - colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG login failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_mori_hashira4.c", 155, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgMoriHashira4_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c index 74d4621487..cab9eed7d5 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c @@ -12,7 +12,7 @@ void BgMoriRakkatenjo_Init(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_SetupWaitForMoriTex(BgMoriRakkatenjo* this); @@ -52,6 +52,8 @@ void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); + +#if OOT_DEBUG // "Forest Temple obj. Falling Ceiling" PRINTF("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.home.pos.y); 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." PRINTF("Warning : セット Angle が変更されています。プログラムを修正しましょう。\n"); } +#endif + this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX); if (this->moriTexObjectSlot < 0) { // "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) { - s32 pad; +void BgMoriRakkatenjo_Update(Actor* thisx, PlayState* play2) { + PlayState* play = (PlayState*)play2; BgMoriRakkatenjo* this = (BgMoriRakkatenjo*)thisx; if (this->timer > 0) { diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c index 3a8815ea2f..1fafea47cd 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c @@ -197,8 +197,9 @@ void BgSpot00Hanebasi_SetTorchLightInfo(BgSpot00Hanebasi* this, PlayState* play) } void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) { - BgSpot00Hanebasi* this = (BgSpot00Hanebasi*)thisx; s32 pad; + BgSpot00Hanebasi* this = (BgSpot00Hanebasi*)thisx; + Player* player; this->actionFunc(this, play); @@ -206,7 +207,7 @@ void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) { if (play->sceneId == SCENE_HYRULE_FIELD) { 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) { - Player* player = GET_PLAYER(play); + player = GET_PLAYER(play); 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) && diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c index 513b8c20b3..a8e6ce6559 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c @@ -117,10 +117,11 @@ void func_808AAE6C(BgSpot01Idohashira* this, PlayState* play) { void func_808AAF34(BgSpot01Idohashira* this, PlayState* play) { s32 pad[2]; - Vec3f dest; - Vec3f src; if (this->unk_170 != 0) { + Vec3f dest; + Vec3f src; + src.x = kREG(20) + 1300.0f; src.y = kREG(21) + 200.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 temp_f12; f32 regFloat; - f32 diff23; - f32 diff43; + f32 diff23 = arg2 - arg3; + f32 diff43 = arg4 - arg3; - diff23 = arg2 - arg3; if (diff23 != 0.0f) { regFloat = kREG(9) + 30.0f; - diff43 = arg4 - arg3; temp_f12 = regFloat * diff43; return (((((arg1 - arg0) - temp_f12) / SQ(diff23)) * diff43) * diff43) + temp_f12; } diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index a652df6420..1f1f9da166 100644 --- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -13,8 +13,8 @@ void BgSpot02Objects_Init(Actor* thisx, PlayState* play); void BgSpot02Objects_Destroy(Actor* thisx, PlayState* play); void BgSpot02Objects_Update(Actor* thisx, PlayState* play); void BgSpot02Objects_Draw(Actor* thisx, PlayState* play); -void func_808ACCB8(Actor* thisx, PlayState* play); -void func_808AD450(Actor* thisx, PlayState* play); +void func_808ACCB8(Actor* thisx, PlayState* play2); +void func_808AD450(Actor* thisx, PlayState* play2); void func_808AC8FC(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; + PlayState* play = (PlayState*)play2; f32 rate; - s32 pad; u8 redPrim; u8 greenPrim; u8 bluePrim; @@ -225,6 +225,8 @@ void func_808ACCB8(Actor* thisx, PlayState* play) { 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 (this->unk_16A < 5) { 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; - s32 pad; + PlayState* play = (PlayState*)play2; f32 lerp; OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot02_objects.c", 736); diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c index ff24dcc5ca..78d1e3d376 100644 --- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c @@ -147,6 +147,8 @@ void BgSpot03Taki_Draw(Actor* thisx, PlayState* play) { gSPDisplayList(POLY_XLU_DISP++, object_spot03_object_DL_001580); + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_bg_spot03_taki.c", 358); this->bufferIndex = this->bufferIndex == 0; diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index 8784b28e24..1729cc935c 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -111,11 +111,12 @@ void BgSpot06Objects_Init(Actor* thisx, PlayState* play) { if (LINK_IS_ADULT && Flags_GetSwitch(play, this->switchFlag)) { thisx->world.pos.y = thisx->home.pos.y + 120.0f; this->actionFunc = BgSpot06Objects_DoNothing; - } else { this->actionFunc = BgSpot06Objects_GateWaitForSwitch; } + if (1) {} + break; case LHO_WATER_TEMPLE_ENTRANCE_LOCK: Actor_ProcessInitChain(thisx, sInitChain); diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c index f5ced0b3f6..3ad8321f17 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c @@ -41,16 +41,20 @@ void BgSpot08Iceblock_SetupAction(BgSpot08Iceblock* this, BgSpot08IceblockAction void BgSpot08Iceblock_InitDynaPoly(BgSpot08Iceblock* this, PlayState* play, CollisionHeader* collision, s32 flags) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flags); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning: move BG registration failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_spot08_iceblock.c", 0xD9, this->dyna.actor.id, this->dyna.actor.params); } +#endif } // Sets params to 0x10 (medium, nonrotating) if not in the cases listed. diff --git a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c index c65737af97..ff7c8e28ba 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c @@ -125,7 +125,6 @@ void BgSpot11Oasis_Update(Actor* thisx, PlayState* play) { BgSpot11Oasis* this = (BgSpot11Oasis*)thisx; s32 pad; u32 gameplayFrames; - Vec3f sp30; this->actionFunc(this, play); 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)) { gameplayFrames = play->gameplayFrames; if (gameplayFrames & 4) { + Vec3f 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); if (Rand_ZeroOne() < 0.3f) { diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c index e261a35239..2a62445f48 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c @@ -46,15 +46,19 @@ static InitChainEntry sInitChain[] = { void BgSpot12Gate_InitDynaPoly(BgSpot12Gate* this, PlayState* play, CollisionHeader* collision, s32 flags) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flags); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_spot12_gate.c", 145, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgSpot12Gate_Init(Actor* thisx, PlayState* play) { @@ -105,17 +109,19 @@ void func_808B317C(BgSpot12Gate* this) { void func_808B318C(BgSpot12Gate* this, PlayState* play) { s32 pad; - s32 quakeIndex; Math_StepToF(&this->dyna.actor.velocity.y, 1.6f, 0.03f); if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 200.0f, this->dyna.actor.velocity.y)) { func_808B3274(this); - quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); - Quake_SetSpeed(quakeIndex, -0x3CB0); - Quake_SetPerturbations(quakeIndex, 3, 0, 0, 0); - Quake_SetDuration(quakeIndex, 12); + { + s32 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); + + Quake_SetSpeed(quakeIndex, -0x3CB0); + Quake_SetPerturbations(quakeIndex, 3, 0, 0, 0); + Quake_SetDuration(quakeIndex, 12); + } Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); } else { diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 9700367f4b..360464957c 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -43,15 +43,19 @@ static InitChainEntry sInitChain[] = { void func_808B3420(BgSpot12Saku* this, PlayState* play, CollisionHeader* collision, s32 flags) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flags); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_spot12_saku.c", 140, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgSpot12Saku_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index a2ce895d76..5a8560df82 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -58,17 +58,19 @@ static Vec3f sBoxGroundCheckPoints[] = { void func_808B3960(BgSpot15Rrbox* this, PlayState* play, CollisionHeader* collision, s32 flags) { s32 pad; CollisionHeader* colHeader = NULL; - u32 pad2; DynaPolyActor_Init(&this->dyna, flags); CollisionHeader_GetVirtual(collision, &colHeader); - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_spot15_rrbox.c", 171, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgSpot15Rrbox_RotatePoint(Vec3f* outPos, Vec3f* pos, f32 arg2, f32 arg3) { @@ -224,11 +226,9 @@ s32 func_808B4010(BgSpot15Rrbox* this, PlayState* play) { } void func_808B4084(BgSpot15Rrbox* this, PlayState* play) { - this->actionFunc = func_808B40AC; this->dyna.actor.gravity = 0.0f; - this->dyna.actor.velocity.x = 0.0f; - this->dyna.actor.velocity.y = 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->actionFunc = func_808B40AC; } void func_808B40AC(BgSpot15Rrbox* this, PlayState* play) { @@ -301,9 +301,7 @@ void func_808B4194(BgSpot15Rrbox* this, PlayState* play) { } void func_808B4380(BgSpot15Rrbox* this, PlayState* play) { - this->dyna.actor.velocity.x = 0.0f; - this->dyna.actor.velocity.y = 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.gravity = -1.0f; this->dyna.actor.floorHeight = BgSpot15Rrbox_GetFloorHeight(this, play); this->actionFunc = func_808B43D0; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index 7a7a485617..c147daa300 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -230,8 +230,8 @@ s32 func_808B4E58(BgSpot16Bombstone* this, PlayState* play) { } void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play) { + s16 shouldLive = true; BgSpot16Bombstone* this = (BgSpot16Bombstone*)thisx; - s16 shouldLive; func_808B4C30(this); @@ -240,6 +240,7 @@ void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play) { // The boulder is intact shouldLive = func_808B4D9C(this, play); break; + case 0: case 1: case 2: @@ -249,11 +250,14 @@ void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play) { // The boulder is debris shouldLive = func_808B4E58(this, play); break; + +#if OOT_DEBUG default: PRINTF("Error : arg_data おかしいな(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot16_bombstone.c", 668, this->actor.params); shouldLive = false; break; +#endif } if (!shouldLive) { @@ -451,12 +455,14 @@ void func_808B5950(BgSpot16Bombstone* this, PlayState* play) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base); } +#if OOT_DEBUG if (mREG(64) == 1) { func_808B561C(this, play); mREG(64) = -10; } else if (mREG(64) < 0) { mREG(64)++; } +#endif } void func_808B5A78(BgSpot16Bombstone* this) { diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index 84ca72ef57..6eae47eb98 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -91,33 +91,33 @@ void func_808B7770(BgSpot18Basket* this, PlayState* play, f32 arg2) { s32 i; f32 randomValue; f32 sinValue; - s32 count; - for (i = 0, count = 2; i != count; i++) { - if (play) {} - if (!(arg2 < Rand_ZeroOne())) { - D_808B85D0 += 0x7530; - - sinValue = Math_SinS(D_808B85D0); - cosValue = Math_CosS(D_808B85D0); - - randomValue = (Rand_ZeroOne() * 35.0f) + 35.0f; - - position.x = (randomValue * sinValue) + this->dyna.actor.world.pos.x; - position.y = this->dyna.actor.world.pos.y + 10.0f; - position.z = (randomValue * cosValue) + this->dyna.actor.world.pos.z; - - velocity.x = sinValue; - velocity.y = 0.0f; - velocity.z = cosValue; - - acceleration.x = 0.0f; - acceleration.y = 0.5f; - acceleration.z = 0.0f; - - func_800286CC(play, &position, &velocity, &acceleration, ((Rand_ZeroOne() * 16) + 80), - ((Rand_ZeroOne() * 30) + 80)); + for (i = 0; i != 2; i++) { + if (arg2 < Rand_ZeroOne()) { + continue; } + + D_808B85D0 += 0x7530; + + sinValue = Math_SinS(D_808B85D0); + cosValue = Math_CosS(D_808B85D0); + + randomValue = (Rand_ZeroOne() * 35.0f) + 35.0f; + + position.x = (randomValue * sinValue) + this->dyna.actor.world.pos.x; + position.y = this->dyna.actor.world.pos.y + 10.0f; + position.z = (randomValue * cosValue) + this->dyna.actor.world.pos.z; + + velocity.x = sinValue; + velocity.y = 0.0f; + velocity.z = cosValue; + + acceleration.x = 0.0f; + acceleration.y = 0.5f; + acceleration.z = 0.0f; + + func_800286CC(play, &position, &velocity, &acceleration, ((Rand_ZeroOne() * 16) + 80), + ((Rand_ZeroOne() * 30) + 80)); } } @@ -240,9 +240,6 @@ void func_808B7D38(BgSpot18Basket* this) { } void func_808B7D50(BgSpot18Basket* this, PlayState* play) { - f32 tempValue2; - f32 tempValue; - if (this->unk_216 > 120) { Math_StepToS(&this->unk_210, 0x3E8, 0x32); } else { @@ -281,11 +278,12 @@ void func_808B7D50(BgSpot18Basket* this, PlayState* play) { func_808B7770(this, play, 0.8f); } - tempValue2 = (this->unk_210 - 500) * 0.0006f; + { + f32 tempValue2 = (this->unk_210 - 500) * 0.0006f; + f32 tempValue = CLAMP(tempValue2, 0.0f, 1.5f); - 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) { @@ -308,9 +306,7 @@ void func_808B7F74(BgSpot18Basket* this) { void func_808B7FC0(BgSpot18Basket* this, PlayState* play) { s32 pad; s32 tempUnk214; - f32 tempUnk210; s16 arrayValue; - f32 clampedTempUnk210; this->unk_212 += 0xBB8; @@ -343,11 +339,12 @@ void func_808B7FC0(BgSpot18Basket* this, PlayState* play) { func_808B7770(this, play, 0.3f); } - tempUnk210 = (this->unk_210 - 500) * 0.0006f; + { + f32 tempUnk210 = (this->unk_210 - 500) * 0.0006f; + f32 clampedTempUnk210 = CLAMP(tempUnk210, 0.0f, 1.5f); - 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) { diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index 6b3d8095a8..4c284b9b15 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -111,7 +111,7 @@ s32 func_808B8910(BgSpot18Obj* this, PlayState* play) { case 2: PRINTF("Error : Obj出現判定が設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 202, this->dyna.actor.params); - break; + return 0; default: PRINTF("Error : Obj出現判定失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 210, this->dyna.actor.params); @@ -235,11 +235,9 @@ void func_808B8E7C(BgSpot18Obj* this, PlayState* play) { void func_808B8EE0(BgSpot18Obj* this) { this->actionFunc = func_808B8F08; - this->dyna.actor.world.rot.y = 0; this->dyna.actor.speed = 0.0f; - this->dyna.actor.velocity.z = 0.0f; - this->dyna.actor.velocity.y = 0.0f; - this->dyna.actor.velocity.x = 0.0f; + this->dyna.actor.velocity.x = this->dyna.actor.velocity.y = this->dyna.actor.velocity.z = 0.0f; + this->dyna.actor.world.rot.y = 0; } void func_808B8F08(BgSpot18Obj* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c index 706cbdee06..0b32afe5ee 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c @@ -171,10 +171,10 @@ void BgYdanHasi_Update(Actor* thisx, PlayState* play) { void BgYdanHasi_Draw(Actor* thisx, PlayState* play) { 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) { - Gfx_DrawDListOpa(play, dLists[this->dyna.actor.params]); + if (params == HASI_WATER_BLOCK || params == HASI_THREE_BLOCKS) { + Gfx_DrawDListOpa(play, dLists[params]); } else { OPEN_DISPS(play->state.gfxCtx, "../z_bg_ydan_hasi.c", 577); diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index 03114d1627..5441cae92f 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -417,6 +417,9 @@ void BgYdanSp_Draw(Actor* thisx, PlayState* play) { MtxF mtxF; OPEN_DISPS(play->state.gfxCtx, "../z_bg_ydan_sp.c", 781); + + if (1) {} + Gfx_SetupDL_25Xlu(play->state.gfxCtx); if (thisx->params == WEB_WALL) { gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ydan_sp.c", 787), diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 248357509c..3b7d2ee86c 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -1293,8 +1293,8 @@ void BossGanondrof_Update(Actor* thisx, PlayState* play) { s32 pad2; s16 i; s32 pad; - BossGanondrof* this = (BossGanondrof*)thisx; EnfHG* horse; + BossGanondrof* this = (BossGanondrof*)thisx; PRINTF("MOVE START %d\n", this->actor.params); this->actor.flags &= ~ACTOR_FLAG_10; @@ -1303,8 +1303,8 @@ void BossGanondrof_Update(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); return; } - this->work[GND_VARIANCE_TIMER]++; horse = (EnfHG*)this->actor.child; + this->work[GND_VARIANCE_TIMER]++; PRINTF("MOVE START EEEEEEEEEEEEEEEEEEEEEE%d\n", this->actor.params); this->actionFunc(this, play); @@ -1520,6 +1520,7 @@ void BossGanondrof_Draw(Actor* thisx, PlayState* play) { BossGanondrof_PostLimbDraw, this); PRINTF("DRAW 22\n"); POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP); + if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganondrof.c", 3814); PRINTF("DRAW END %d\n", this->actor.params); } diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index cb7f787c62..4de75e45a5 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -672,7 +672,8 @@ void BossGoma_SetupEncounterState4(BossGoma* this, PlayState* play) { void BossGoma_Encounter(BossGoma* this, PlayState* play) { Camera* mainCam; Player* player = GET_PLAYER(play); - s32 pad[2]; + f32 s; + s32 pad; Math_ApproachZeroF(&this->actor.speed, 0.5f, 2.0f); @@ -761,7 +762,8 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) { } if (this->frameCount >= 228) { - mainCam = Play_GetCamera(play, CAM_ID_MAIN); + Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); + mainCam->eye = this->subCamEye; mainCam->eyeNext = this->subCamEye; mainCam->at = this->subCamAt; @@ -909,8 +911,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) { this->subCamAt.z = this->actor.world.pos.z; 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; } else { 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 }; Vec3f childPos; Vec3s childRot; - EnGoma* babyGohma; BossGoma* this = (BossGoma*)thisx; - s32 pad; + s32 pad[2]; MtxF mtx; 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) { + EnGoma* babyGohma; + this->deadLimbsState[limbIndex] = 2; Matrix_MultVec3f(&zero, &childPos); Matrix_Get(&mtx); diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 99447a19bb..eeedcb4e24 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -407,51 +407,14 @@ void BossMo_SetupTentacle(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; - Camera* mainCam1; - Camera* mainCam2; - 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; + s16 sp1B4 = 0; + Player* player = GET_PLAYER(play); f32 tempf1; f32 tempf2; f32 sin; f32 cos; - f32 temp; - 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; + BossMo* otherTent = (BossMo*)this->otherTent; if (this->work[MO_TENT_ACTION_STATE] <= MO_TENT_DEATH_3) { 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_RETREAT) || (this->work[MO_TENT_ACTION_STATE] == MO_TENT_SWING) || (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 (sMorphaCore->csState != MO_BATTLE) { maxSwingRateX = 2000.0f; @@ -570,25 +542,33 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { this->timers[0] = 60; } } - if (this->timers[0] > 50) { - rippleCount = 1; - } else if (this->timers[0] > 40) { - rippleCount = 3; - } else if (this->timers[0] > 30) { - rippleCount = 5; - } else if (this->timers[0] > 20) { - rippleCount = 8; - } else { - rippleCount = 3; - } - for (indS1 = 0; indS1 < rippleCount; indS1++) { - randFloat = Rand_ZeroFloat(50.0f); - randAngle = Rand_ZeroFloat(0x10000); - ripplePos = this->actor.world.pos; - ripplePos.x += sinf(randAngle) * randFloat; - ripplePos.z += cosf(randAngle) * randFloat; - ripplePos.y = MO_WATER_LEVEL(play); - BossMo_SpawnRipple(play->specialEffects, &ripplePos, 40.0f, 110.0f, 80, 290, MO_FX_SMALL_RIPPLE); + if (1) { + s16 rippleCount; + Vec3f ripplePos; + f32 randAngle; + f32 randFloat; + s32 pad; + + if (this->timers[0] > 50) { + rippleCount = 1; + } else if (this->timers[0] > 40) { + rippleCount = 3; + } else if (this->timers[0] > 30) { + rippleCount = 5; + } else if (this->timers[0] > 20) { + rippleCount = 8; + } else { + rippleCount = 3; + } + for (indS1 = 0; indS1 < rippleCount; indS1++) { + randFloat = Rand_ZeroFloat(50.0f); + randAngle = Rand_ZeroFloat(0x10000); + ripplePos = this->actor.world.pos; + ripplePos.x += sinf(randAngle) * randFloat; + ripplePos.z += cosf(randAngle) * randFloat; + ripplePos.y = MO_WATER_LEVEL(play); + BossMo_SpawnRipple(play->specialEffects, &ripplePos, 40.0f, 110.0f, 80, 290, MO_FX_SMALL_RIPPLE); + } } break; case MO_TENT_READY: @@ -634,7 +614,8 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { this->attackAngleMod = Rand_CenteredFloat(0x1000); } } else { - tentXrot = this->tentRot[28].x; + s16 tentXrot = this->tentRot[28].x; + if ((this->timers[0] == 0) && (tentXrot >= 0) && (sp1B4 < 0)) { this->work[MO_TENT_ACTION_STATE] = MO_TENT_ATTACK; 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->tentSpeed, 160.0f, 1.0f, 50.0f); if ((this->timers[0] == 0) || (this->playerHitTimer != 0)) { - dx = this->tentPos[22].x - player->actor.world.pos.x; - dy = this->tentPos[22].y - player->actor.world.pos.y; - dz = this->tentPos[22].z - player->actor.world.pos.z; + f32 dx = this->tentPos[22].x - player->actor.world.pos.x; + f32 dy = this->tentPos[22].y - player->actor.world.pos.y; + 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)) { this->tentMaxAngle = .001f; 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.z, this->grabPosRot.rot.z, 2, 0x7D0); 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->tentMaxAngle = .001f; 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); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE); - this->subCamEye = mainCam1->eye; - this->subCamAt = mainCam1->at; + this->subCamEye = mainCam->eye; + this->subCamAt = mainCam->at; this->subCamYaw = Math_FAtan2F(this->subCamEye.x - this->actor.world.pos.x, this->subCamEye.z - this->actor.world.pos.z); this->subCamYawRate = 0; @@ -798,12 +781,14 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { } Math_ApproachF(&this->waterLevelMod, -5.0f, 0.1f, 0.4f); sp1B4 = this->tentRot[15].x; - buttons = play->state.input[0].press.button; - if (CHECK_BTN_ALL(buttons, BTN_A) || CHECK_BTN_ALL(buttons, BTN_B)) { + if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_A) || + CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B)) { this->mashCounter++; } for (indS1 = 0; indS1 < 41; indS1++) { if (indS1 < 20) { + f32 temp; + 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); 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->tentPulse, 0.3f, 0.5f, 0.03f); if ((this->mashCounter >= 40) || (this->timers[0] == 0)) { - tentXrot = this->tentRot[15].x; + s16 tentXrot = this->tentRot[15].x; + if ((tentXrot < 0) && (sp1B4 >= 0)) { this->work[MO_TENT_ACTION_STATE] = MO_TENT_RETREAT; 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) { + Vec3f sp138; + Vec3f sp12C; + sp138.x = 0; sp138.y = 100.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); if (this->meltIndex < 41) { + Vec3f sp120; + s16 indS0; + s32 pad118; + s32 pad114; + s32 pad110; + for (indS0 = 0; indS0 < 10; indS0++) { sp120 = this->tentPos[this->meltIndex]; 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); Play_SetCameraAtEye(play, this->subCamId, &this->subCamAt, &this->subCamEye); if (player->actor.world.pos.y <= 42.0f) { - mainCam2 = Play_GetCamera(play, CAM_ID_MAIN); - mainCam2->eye = this->subCamEye; - mainCam2->eyeNext = this->subCamEye; - mainCam2->at = this->subCamAt; + Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); + + mainCam->eye = this->subCamEye; + mainCam->eyeNext = this->subCamEye; + mainCam->at = this->subCamAt; Play_ReturnToMainCam(play, this->subCamId, 0); this->subCamId = SUB_CAM_ID_DONE; 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->tentSpeed, 320.0f, 1.0f, 50.0f); if (this->timers[0] == 0) { + s16 indS0; + Vec3f spFC; + Vec3f spF0; + this->actor.flags &= ~ACTOR_FLAG_0; Math_ApproachF(&this->baseAlpha, 0.0, 1.0f, 5.0f); for (indS1 = 0; indS1 < 40; indS1++) { - indT5 = Rand_ZeroFloat(20.9f); - indS0 = sTentSpawnIndex[indT5]; + indS0 = sTentSpawnIndex[(s16)Rand_ZeroFloat(20.9f)]; spFC.x = 0; spFC.y = 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); this->actor.velocity.y = 0.0; } else { + f32 padEC; + 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; 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; Sfx_PlaySfxAtPos(&this->tentTipPos, NA_SE_EN_MOFER_CORE_JUMP); for (indS1 = 0; indS1 < 300; indS1++) { + Vec3f spE0; + Vec3f spD4; + Vec3f spC8; + spC8.x = 0.0; spC8.y = 0.0; spC8.z = indS1 * 0.03f; @@ -1137,11 +1142,11 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { void BossMo_TentCollisionCheck(BossMo* this, PlayState* play) { s16 i1; + s16 i2; + ColliderElement* acHitElem; for (i1 = 0; i1 < ARRAY_COUNT(this->tentElements); i1++) { if (this->tentCollider.elements[i1].base.bumperFlags & BUMP_HIT) { - s16 i2; - ColliderElement* acHitElem; for (i2 = 0; i2 < 19; i2++) { 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->actor.flags &= ~ACTOR_FLAG_0; sMorphaTent1->actor.flags |= ACTOR_FLAG_0; - } else { - sMorphaTent1->xSwing = 0xCEC; - sMorphaTent1->fwork[MO_TENT_SWING_RATE_X] = 0.0f; - sMorphaTent1->fwork[MO_TENT_SWING_LAG_X] = 1000.0f; - sMorphaTent1->fwork[MO_TENT_SWING_SIZE_X] = 2500.0f; - break; + goto intro_reveal; } + sMorphaTent1->xSwing = 0xCEC; + sMorphaTent1->fwork[MO_TENT_SWING_RATE_X] = 0.0f; + sMorphaTent1->fwork[MO_TENT_SWING_LAG_X] = 1000.0f; + sMorphaTent1->fwork[MO_TENT_SWING_SIZE_X] = 2500.0f; + break; + intro_reveal: case MO_INTRO_REVEAL: if (this->timers[2] >= 160) { this->subCamEye.x = 150.0f; @@ -1858,13 +1864,6 @@ void BossMo_Core(BossMo* this, PlayState* play) { s16 index; // not on stack f32 sp88; s32 pad84; - f32 sp80; - f32 sp7C; - Vec3f sp70; - Vec3f sp64; - f32 sp60; - f32 sp5C; - f32 sp58; this->waterTex1x += -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.speed, 30.0f, 1.0f, 1.0f); } else { + f32 sp80; + f32 sp7C; + Vec3f sp70; + Vec3f sp64; + switch (this->work[MO_TENT_ACTION_STATE]) { case MO_CORE_MOVE: sp80 = Math_SinS(this->work[MO_TENT_VAR_TIMER] * 0x800) * 100.0f; @@ -2165,6 +2169,9 @@ void BossMo_Core(BossMo* this, PlayState* play) { } else { this->timers[3] = 8; for (i = 0; i < 10; i++) { + f32 sp60; + f32 sp5C; + sp5C = Rand_ZeroFloat(3.14f); sp60 = Rand_ZeroFloat(0.6f) + 1.6f; 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)) { for (i = 0; i < 3; i++) { + f32 sp58; + effectAccel.x = effectAccel.z = 0.0f; effectVelocity.x = effectVelocity.y = effectVelocity.z = 0.0f; if (this->work[MO_TENT_ACTION_STATE] >= MO_CORE_ATTACK) { @@ -2725,7 +2734,6 @@ void BossMo_DrawTent(Actor* thisx, PlayState* play) { u16 texCoordScale; OPEN_DISPS(play->state.gfxCtx, "../z_boss_mo.c", 6958); - if (1) {} Gfx_SetupDL_25Opa(play->state.gfxCtx); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, (s8)(this->baseAlpha * 1.5f)); gDPSetEnvColor(POLY_OPA_DISP++, 150, 150, 150, 0); @@ -2743,6 +2751,7 @@ void BossMo_DrawTent(Actor* thisx, PlayState* play) { if (this->drawActor) { BossMo_DrawTentacle(this, play); } + if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_boss_mo.c", 7023); } diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index df893e790e..b36c58bd7e 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -363,10 +363,11 @@ void BossSst_HeadSetupIntro(BossSst* this, PlayState* play) { player->actor.world.pos.x = sRoomCenter.x; player->actor.world.pos.y = ROOM_CENTER_Y + 1000.0f; 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->zTargetYaw = -0x8000; player->yaw = -0x8000; + player->actor.velocity.y = 0.0f; player->fallStartHeight = 0; player->stateFlags1 |= PLAYER_STATE1_5; @@ -654,8 +655,10 @@ void BossSst_HeadNeutral(BossSst* this, PlayState* play) { } if (this->timer == 0) { - if ((GET_PLAYER(play)->actor.world.pos.y > -50.0f) && - !(GET_PLAYER(play)->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14))) { + Player* player = GET_PLAYER(play); + + 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; BossSst_HeadSetupWait(this); } else { @@ -825,9 +828,8 @@ void BossSst_HeadSetupStunned(BossSst* this) { } void BossSst_HeadStunned(BossSst* this, PlayState* play) { - f32 bounce; - s32 animFinish; f32 currentFrame; + s32 animFinish; Math_StepToF(&sHandOffsets[LEFT].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); currentFrame = this->skelAnime.curFrame; 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) { this->actor.world.pos.y = bounce; } @@ -1565,7 +1568,6 @@ void BossSst_HandSetupSweep(BossSst* this) { void BossSst_HandSweep(BossSst* this, PlayState* play) { Player* player = GET_PLAYER(play); - s16 newTargetYaw; SkelAnime_Update(&this->skelAnime); this->handAngSpeed += 0x60; @@ -1575,6 +1577,8 @@ void BossSst_HandSweep(BossSst* this, PlayState* play) { this->colliderJntSph.base.ocFlags1 &= ~OC1_NO_PUSH; BossSst_HandSetupRetreat(this); } else if (this->colliderJntSph.base.atFlags & AT_HIT) { + s16 newTargetYaw; + this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); this->ready = true; 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, Gfx** gfx) { 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) { *dList = NULL; } 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)) { - - shakeMod = sinf(this->timer * (M_PI / 5)); - rot->x += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * shakeMod; - - shakeMod = sinf((this->timer % 5) * (M_PI / 5)); - rot->z -= ((0x800 * Rand_ZeroOne() + 0x1000) / 0x10) * shakeAmp * shakeMod + 0x1000; + rot->x += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * sinf(this->timer * (M_PI / 5)); + rot->z -= + ((0x800 * Rand_ZeroOne() + 0x1000) / 0x10) * shakeAmp * sinf((this->timer % 5) * (M_PI / 5)) + 0x1000; if (limbIndex == 3) { - - shakeMod = sinf(this->timer * (M_PI / 5)); - rot->y += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * shakeMod; + rot->y += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * sinf(this->timer * (M_PI / 5)); } } else if ((limbIndex == 5) || (limbIndex == 6)) { - - shakeMod = sinf((this->timer % 5) * (M_PI / 5)); - rot->z -= ((0x280 * Rand_ZeroOne() + 0x500) / 0x10) * shakeAmp * shakeMod + 0x500; + rot->z -= + ((0x280 * Rand_ZeroOne() + 0x500) / 0x10) * shakeAmp * sinf((this->timer % 5) * (M_PI / 5)) + 0x500; if (limbIndex == 5) { - - shakeMod = 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; + rot->x += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * sinf(this->timer * (M_PI / 5)); + rot->y += ((0x500 * Rand_ZeroOne() + 0xA00) / 0x10) * shakeAmp * sinf(this->timer * (M_PI / 5)); } } else if (limbIndex == 2) { - shakeMod = sinf(this->timer * (M_PI / 5)); - rot->x += ((0x200 * Rand_ZeroOne() + 0x400) / 0x10) * shakeAmp * shakeMod; - - shakeMod = sinf(this->timer * (M_PI / 5)); - 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; + rot->x += ((0x200 * Rand_ZeroOne() + 0x400) / 0x10) * shakeAmp * sinf(this->timer * (M_PI / 5)); + rot->y += ((0x200 * Rand_ZeroOne() + 0x400) / 0x10) * shakeAmp * sinf(this->timer * (M_PI / 5)); + rot->z -= + ((0x100 * Rand_ZeroOne() + 0x200) / 0x10) * shakeAmp * sinf((this->timer % 5) * (M_PI / 5)) + 0x200; } } else if (this->actionFunc == BossSst_HeadDeath) { + s32 timer12; + if (this->timer > 48) { timer12 = this->timer - 36; } else { - pad = ((this->timer > 6) ? 6 : this->timer); - timer12 = pad * 2; + timer12 = ((this->timer > 6) ? 6 : this->timer) * 2; } if ((limbIndex == 3) || (limbIndex == 39) || (limbIndex == 42)) { @@ -2947,14 +2935,16 @@ void BossSst_SpawnHeadShadow(BossSst* this) { s32 i; f32 sn; f32 cs; + BossSstEffect* shadow; + Vec3f* offset; this->effectMode = BONGO_SHADOW; sn = Math_SinS(this->actor.shape.rot.y); cs = Math_CosS(this->actor.shape.rot.y); for (i = 0; i < 3; i++) { - BossSstEffect* shadow = &this->effects[i]; - Vec3f* offset = &shadowOffset[i]; + shadow = &this->effects[i]; + offset = &shadowOffset[i]; shadow->pos.x = this->actor.world.pos.x + (sn * offset->z) + (cs * offset->x); shadow->pos.y = 0.0f; @@ -2983,12 +2973,13 @@ void BossSst_SpawnShockwave(BossSst* this) { s32 i; s32 scale = 120; s32 alpha = 250; + BossSstEffect* shockwave; Actor_PlaySfx(&this->actor, NA_SE_EN_SHADEST_HAND_WAVE); this->effectMode = BONGO_SHOCKWAVE; for (i = 0; i < 3; i++) { - BossSstEffect* shockwave = &this->effects[i]; + shockwave = &this->effects[i]; Math_Vec3f_Copy(&shockwave->pos, &this->actor.world.pos); shockwave->move = (i + 9) * 2; @@ -3049,6 +3040,7 @@ void BossSst_SpawnIceShard(BossSst* this) { s32 i; Vec3f spawnPos; f32 offXZ; + BossSstEffect* ice; this->effectMode = BONGO_ICE; 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; for (i = 0; i < 18; i++) { - BossSstEffect* ice = &this->effects[i]; + ice = &this->effects[i]; Math_Vec3f_Copy(&ice->pos, &spawnPos); ice->status = 1; @@ -3120,9 +3112,12 @@ void BossSst_UpdateEffects(Actor* thisx, PlayState* play) { this->effectMode = BONGO_NULL; } } else if (this->effectMode == BONGO_SHOCKWAVE) { + BossSstEffect* effect2; + s32 scale; + for (i = 0; i < 3; i++) { - BossSstEffect* effect2 = &this->effects[i]; - s32 scale = effect2->move * 2; + effect2 = &this->effects[i]; + scale = effect2->move * 2; effect2->scale += CLAMP_MAX(scale, 20) + i; if (effect2->move != 0) { diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index c01a1b590e..abf3fc96e5 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -790,7 +790,6 @@ s32 BossTw_BeamHitPlayerCheck(BossTw* this, PlayState* play) { Vec3f offset; Vec3f beamDistFromPlayer; Player* player = GET_PLAYER(play); - s16 i; offset.x = player->actor.world.pos.x - this->beamOrigin.x; offset.y = player->actor.world.pos.y - this->beamOrigin.y; @@ -812,6 +811,8 @@ s32 BossTw_BeamHitPlayerCheck(BossTw* this, PlayState* play) { sFreezeState = 1; } } else if (!player->bodyIsBurning) { + s16 i; + for (i = 0; i < PLAYER_BODYPART_MAX; i++) { 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)); Matrix_Pop(); + if (1) {} + 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) { + Vec3f diff; + if (this->workf[UNK_F9] > 0.0f) { if (this->workf[UNK_F11] > 0.0f) { - Vec3f diff; diff.x = this->groundBlastPos2.x - player->actor.world.pos.x; diff.y = this->groundBlastPos2.y - player->actor.world.pos.y; 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); } @@ -4077,7 +4083,7 @@ void BossTw_BlastFire(BossTw* this, PlayState* play) { break; } - { + if (1) { f32 sp4C = sGroundBlastType == 2 ? 3.0f : 1.0f; 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: if (this->timers[0] != 0) { + s32 pad; + if (this->timers[0] == 1) { sEnvType = 0; } @@ -4242,7 +4250,6 @@ void BossTw_BlastIce(BossTw* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); if (this->timers[0] > (sTwinrovaPtr->actionFunc == BossTw_Wait ? 70 : 20)) { - s32 pad; Vec3f pos; Vec3f velocity; Vec3f accel; @@ -4320,12 +4327,13 @@ void BossTw_BlastIce(BossTw* this, PlayState* play) { s32 BossTw_BlastShieldCheck(BossTw* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 ret = false; - ColliderElement* acHitElem; if (1) {} if (this->csState1 == 1) { if (this->collider.base.acFlags & AC_HIT) { + ColliderElement* acHitElem; + this->collider.base.acFlags &= ~AC_HIT; this->collider.base.atFlags &= ~AT_HIT; acHitElem = this->collider.elem.acHitElem; @@ -4565,17 +4573,6 @@ void BossTw_UpdateEffects(PlayState* play) { s16 j; s16 colorIdx; 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++) { if (eff->type != TWEFF_NONE) { @@ -4654,6 +4651,10 @@ void BossTw_UpdateEffects(PlayState* play) { off.z = sTwinrovaPtr->actor.world.pos.z - eff->pos.z; if (sTwinrovaPtr->actionFunc != BossTw_TwinrovaStun) { + Vec3f spF4; + Vec3f spE8; + Vec3f spDC; + if ((SQ(off.x) + SQ(off.y) + SQ(off.z)) < SQ(60.0f)) { for (j = 0; j < 50; j++) { 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); if (eff->work[EFF_UNKS1] >= 0x10) { if ((eff->work[EFF_UNKS1] == 16) && (sp113 == 0)) { + Vec3f spD0; + sp113 = 1; spD0 = eff->pos; if (eff->pos.y > 40.0f) { @@ -4722,8 +4725,7 @@ void BossTw_UpdateEffects(PlayState* play) { } else { spD0.y = -50.0f; } - sTwinrovaPtr->groundBlastPos.y = phi_f0 = BossTw_GetFloorY(&spD0); - if (phi_f0 >= 0.0f) { + if ((sTwinrovaPtr->groundBlastPos.y = BossTw_GetFloorY(&spD0)) >= 0.0f) { if (sTwinrovaPtr->groundBlastPos.y != 35.0f) { sTwinrovaPtr->groundBlastPos.x = eff->pos.x; sTwinrovaPtr->groundBlastPos.z = eff->pos.z; @@ -4790,7 +4792,7 @@ void BossTw_UpdateEffects(PlayState* play) { } } else if (eff->type == TWEFF_PLYR_FRZ) { if (eff->work[EFF_ARGS] < eff->frame) { - phi_f0 = 1.0f; + f32 phi_f0 = 1.0f; if (eff->target != NULL || sGroundBlastType == 1) { phi_f0 *= 3.0f; @@ -4834,7 +4836,11 @@ void BossTw_UpdateEffects(PlayState* play) { } 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) { 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); phi_f22 = 10.0f; } else { - unk44 = eff->target; + Actor* unk44 = eff->target; + spC0.x = unk44->world.pos.x + Rand_CenteredFloat(40.0f); spC0.y = unk44->world.pos.y + 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; Player* player = GET_PLAYER(play); s16 phi_s4; - BossTwEffect* currentEffect = play->specialEffects; + BossTwEffect* currentEffect; BossTwEffect* effectHead; GraphicsContext* gfxCtx = play->state.gfxCtx; + currentEffect = play->specialEffects; effectHead = currentEffect; OPEN_DISPS(gfxCtx, "../z_boss_tw.c", 9592); @@ -5028,10 +5036,10 @@ void BossTw_DrawEffects(PlayState* play) { currentEffect = effectHead; for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) { - Actor* actor; - Vec3f off; - if (currentEffect->type == TWEFF_PLYR_FRZ) { + Actor* actor; + Vec3f off; + if (materialFlag == 0) { gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceSurroundingPlayerMaterialDL)); 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; - { + if (1) { Vec3f velocity = { 0.0f, 0.0f, 0.0f }; Vec3f accel = { 0.0f, 0.0f, 0.0f }; diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 554c45e5ae..7b189e8754 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -1121,7 +1121,6 @@ void BossVa_SetupBodyPhase2(BossVa* this, PlayState* play) { void BossVa_BodyPhase2(BossVa* this, PlayState* play) { Player* player = GET_PLAYER(play); - Vec3f sp48; if (this->actor.colorFilterTimer == 0) { sPhase2Timer++; @@ -1166,7 +1165,8 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) { } 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.x += -10.0f; sp48.z += 220.0f; @@ -1918,19 +1918,6 @@ void BossVa_ZapperAttack(BossVa* this, PlayState* play) { u32 sp88; Vec3f sp7C; s32 pad3; - f32 sp74; - s32 i; - s16 sp6E; - s16 sp6C; - f32 sp68; - f32 sp64; - f32 sp60; - f32 sp5C; - s16 sp5A; - s16 sp58; - s16 sp56; - s16 sp54; - f32 sp50; boomerang = BossVa_FindBoomerang(play); @@ -1939,6 +1926,20 @@ void BossVa_ZapperAttack(BossVa* this, PlayState* play) { sp7C.y += 10.0f; sp8E = 0x3E80; } else { + f32 sp74; + s32 i; + s16 sp6E; + s16 sp6C; + f32 sp68; + f32 sp64; + f32 sp60; + f32 sp5C; + s16 sp5A; + s16 sp58; + s16 sp56; + s16 sp54; + f32 sp50; + sp74 = R_UPDATE_RATE * 0.5f; sp8E = 0x4650; @@ -3148,6 +3149,8 @@ void BossVa_BariPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* gSPDisplayList(POLY_XLU_DISP++, *dList); } + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_boss_va.c", 4517); } @@ -3279,10 +3282,6 @@ void BossVa_UpdateEffects(PlayState* play) { s16 spB6; s16 i; f32 spB0; - f32 spAC; - s16 pitch; - BossVa* refActor2; - BossVa* refActor; for (i = 0; i < BOSS_VA_EFFECT_COUNT; i++, effect++) { if (effect->type == VA_NONE) { @@ -3300,15 +3299,16 @@ void BossVa_UpdateEffects(PlayState* play) { effect->velocity.z += effect->accel.z; 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.y += (s16)(Rand_ZeroOne() * 0x2710) + 0x2000; 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); - spAC = Math_SinS(refActor->actor.world.rot.y); - effect->pos.x = refActor->actor.world.pos.x - (effect->offset.x * spAC); + s16 pitch = effect->rot.x - Math_Vec3f_Pitch(&refActor->actor.world.pos, &GET_BODY(refActor)->unk_1D8); + + 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); effect->pos.z = refActor->actor.world.pos.z - (effect->offset.x * spB0); spB0 = Math_CosS(-pitch); @@ -3347,13 +3347,13 @@ void BossVa_UpdateEffects(PlayState* play) { } if (effect->type == VA_SPARK_BALL) { - refActor2 = effect->parent; + BossVa* refActor = effect->parent; 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 = - refActor2->actor.world.pos.y + 310.0f + (refActor2->actor.shape.yOffset * refActor2->actor.scale.y); - effect->pos.z = effect->offset.z + refActor2->actor.world.pos.z; + refActor->actor.world.pos.y + 310.0f + (refActor->actor.shape.yOffset * refActor->actor.scale.y); + effect->pos.z = effect->offset.z + refActor->actor.world.pos.z; effect->mode = (effect->mode + 1) & 7; if (effect->timer < 100) { @@ -3378,9 +3378,9 @@ void BossVa_UpdateEffects(PlayState* play) { if (effect->type == VA_BLOOD) { if (effect->mode < BLOOD_SPOT) { + f32 floorY; Vec3f checkPos; CollisionPoly* groundPoly; - f32 floorY; checkPos = effect->pos; checkPos.y -= effect->velocity.y + 4.0f; @@ -3415,9 +3415,9 @@ void BossVa_UpdateEffects(PlayState* play) { if (effect->type == VA_GORE) { if (effect->mode == GORE_PERMANENT) { + f32 floorY; Vec3f checkPos; CollisionPoly* groundPoly; - f32 floorY; checkPos = effect->pos; checkPos.y -= effect->velocity.y + 4.0f; @@ -3452,10 +3452,9 @@ void BossVa_UpdateEffects(PlayState* play) { } if (effect->type == VA_TUMOR) { + BossVa* refActor = effect->parent; s16 yaw; - refActor = effect->parent; - effect->rot.z += 0x157C; effect->envColor[3] = (s16)(Math_SinS(effect->rot.z) * 50.0f) + 80; 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); - for (i = 0; i < 8; i++, segAngle -= M_PI / 4) { + for (i = 0; i < 8; i++) { Matrix_Put(&doorMtx); Matrix_RotateZ(segAngle, 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), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, doorPieceDispList[i]); + segAngle -= M_PI / 4; } CLOSE_DISPS(play->state.gfxCtx, "../z_boss_va.c", 5629); diff --git a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index 1a8b35ee4a..c2b949c27c 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -775,8 +775,6 @@ void func_80968FB0(Actor* thisx, PlayState* play) { f32 scaleFactor; s32 pad; - if (1) {} - OPEN_DISPS(play->state.gfxCtx, "../z_demo_6k.c", 1386); 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); gSPSegment(POLY_XLU_DISP++, 0x08, displayList); gDPPipeSync(displayList++); + if (displayList) {} gDPSetPrimColor(displayList++, 0, 0x80, 255, 255, 255, this->unk_293); gDPSetRenderMode(displayList++, G_RM_PASS, G_RM_ZB_CLD_SURF2); gSPEndDisplayList(displayList++); diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c index d5ff49ceb5..6be44f199a 100644 --- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -68,6 +68,7 @@ void DemoDu_SetMouthTexIndex(DemoDu* this, s16 mouthTexIndex) { this->mouthTexIndex = mouthTexIndex; } +#if OOT_DEBUG // Resets all the values used in this cutscene. void DemoDu_CsAfterGanon_Reset(DemoDu* this) { this->updateIndex = CS_CHAMBERAFTERGANON_SUBSCENE(0); @@ -87,12 +88,12 @@ void DemoDu_CsAfterGanon_CheckIfShouldReset(DemoDu* this, PlayState* play) { DemoDu_CsAfterGanon_Reset(this); } D_8096CE94 = false; - return; } } else if (!D_8096CE94) { D_8096CE94 = true; } } +#endif s32 DemoDu_UpdateSkelAnime(DemoDu* this) { return SkelAnime_Update(&this->skelAnime); @@ -104,8 +105,11 @@ void DemoDu_UpdateBgCheckInfo(DemoDu* this, PlayState* play) { CsCmdActorCue* DemoDu_GetCue(PlayState* play, s32 cueChannel) { if (play->csCtx.state != CS_STATE_IDLE) { - return play->csCtx.actorCues[cueChannel]; + CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel]; + + return cue; } + return NULL; } @@ -774,7 +778,9 @@ void DemoDu_CsAfterGanon_BackTo01(DemoDu* this, PlayState* play) { void DemoDu_UpdateCs_AG_00(DemoDu* this, PlayState* play) { DemoDu_CsAfterGanon_AdvanceTo01(this, play); +#if OOT_DEBUG DemoDu_CsAfterGanon_CheckIfShouldReset(this, play); +#endif } 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_UpdateEyes(this); DemoDu_CsAfterGanon_AdvanceTo02(this, play); +#if OOT_DEBUG DemoDu_CsAfterGanon_CheckIfShouldReset(this, play); +#endif } 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_UpdateEyes(this); DemoDu_CsAfterGanon_BackTo01(this, play); +#if OOT_DEBUG 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. diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c index 91dc9bf45b..fa4879e26c 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c @@ -334,10 +334,12 @@ void DemoEc_UseAnimationObject(DemoEc* this, PlayState* play) { CsCmdActorCue* DemoEc_GetCue(PlayState* play, s32 cueChannel) { if (play->csCtx.state != CS_STATE_IDLE) { - return play->csCtx.actorCues[cueChannel]; - } else { - return NULL; + CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel]; + + return cue; } + + return NULL; } void DemoEc_SetStartPosRotFromCue(DemoEc* this, PlayState* play, s32 cueChannel) { diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 7a7c8be056..e5db2e88a0 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -1808,21 +1808,21 @@ void DemoEffect_DrawGodLgt(Actor* thisx, PlayState* play) { void DemoEffect_DrawLightEffect(Actor* thisx, PlayState* play) { DemoEffect* this = (DemoEffect*)thisx; - u8* alpha; - Gfx* disp; + uintptr_t flashDList = (uintptr_t)gEffFlash1DL; + s32 pad2; OPEN_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2842); if (!DemoEffect_CheckForCue(this, play, 1)) { - if (this->light.flicker == 0) { this->light.flicker = 1; } else { - disp = (Gfx*)(uintptr_t)gEffFlash1DL; // necessary to match but probably fake - alpha = &this->light.alpha; 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], - this->primXluColor[2], *alpha); + this->primXluColor[2], (*this).light.alpha); 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, ((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); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_effect.c", 2866), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); - if (disp) {}; - gSPDisplayList(POLY_XLU_DISP++, disp); + gSPDisplayList(POLY_XLU_DISP++, flashDList); Matrix_Pop(); Matrix_Mult(&play->billboardMtxF, 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), 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) { - DemoEffect* this = (DemoEffect*)thisx; GraphicsContext* gfxCtx = play->state.gfxCtx; + DemoEffect* this = (DemoEffect*)thisx; u8 effectType = (this->actor.params & 0x00FF); if (effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL || diff --git a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c index 1189fd3bc1..b80f419979 100644 --- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c +++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c @@ -52,7 +52,9 @@ void DemoExt_PlayVortexSFX(DemoExt* this) { CsCmdActorCue* DemoExt_GetCue(PlayState* play, s32 cueChannel) { if (play->csCtx.state != CS_STATE_IDLE) { - return play->csCtx.actorCues[cueChannel]; + CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel]; + + return cue; } return NULL; diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c index 7bbd6c7ea4..ee75d038d7 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c @@ -165,7 +165,9 @@ void func_809782A0(DemoGeff* this, PlayState* play) { void func_80978308(DemoGeff* this, PlayState* play) { func_809781FC(this, play); func_809782A0(this, play); +#if OOT_DEBUG func_80978030(this, play); +#endif } void func_80978344(DemoGeff* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index 867bd9aeb5..3df0db29d0 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -263,7 +263,7 @@ s32 DemoGj_InitSetIndices(DemoGj* this, PlayState* play, s32 updateMode, s32 dra } void DemoGj_DrawCommon(DemoGj* this, PlayState* play, Gfx* displayList) { - if (kREG(0) == 0) { + if (!OOT_DEBUG || kREG(0) == 0) { GraphicsContext* gfxCtx = play->state.gfxCtx; 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) { Actor* actor = &this->dyna.actor; - Player* player; + s32 pad; Vec3f* pos = &actor->world.pos; Vec3s* unk_172; f32 xDistance; @@ -544,7 +544,8 @@ void DemoGj_SetupMovement(DemoGj* this, PlayState* play) { } if (xDistance == 0.0f && zDistance == 0.0f) { - player = GET_PLAYER(play); + Player* player = GET_PLAYER(play); + xDistance = player->actor.world.pos.x - pos->x; 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); } +#if OOT_DEBUG void DemoGj_DoNothing1(DemoGj* this, PlayState* play) { } +#endif /* * Moves the ColliderCylinder's relative to the actor's position. @@ -1092,7 +1095,9 @@ void DemoGj_Update15(DemoGj* this, PlayState* play) { // func_8097B370 void DemoGj_Update18(DemoGj* this, PlayState* play) { func_8097B22C(this, play); +#if OOT_DEBUG DemoGj_DoNothing1(this, play); +#endif } 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); } +#if OOT_DEBUG void DemoGj_DoNothing2(DemoGj* this, PlayState* play) { } +#endif // Moves the ColliderCylinder's relative to the actor's position. void func_8097B450(DemoGj* this, PlayState* play) { @@ -1223,7 +1230,9 @@ void DemoGj_Update16(DemoGj* this, PlayState* play) { // func_8097B894 void DemoGj_Update19(DemoGj* this, PlayState* play) { func_8097B750(this, play); +#if OOT_DEBUG DemoGj_DoNothing2(this, play); +#endif } 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); } +#if OOT_DEBUG void DemoGj_DoNothing3(DemoGj* this, PlayState* play) { } +#endif void DemoGj_DirectedDoubleExplosion(DemoGj* this, PlayState* play, Vec3f* direction) { Vec3f pos; @@ -1308,7 +1319,9 @@ void DemoGj_Update17(DemoGj* this, PlayState* play) { // func_8097BBA8 void DemoGj_Update20(DemoGj* this, PlayState* play) { func_8097BA48(this, play); +#if OOT_DEBUG DemoGj_DoNothing3(this, play); +#endif } void DemoGj_DemoGj_InitDestructableRubbleTall(DemoGj* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c index 730b63d49c..432b8ce63d 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -209,9 +209,12 @@ s32 func_8097CDB0(DemoGo* this, PlayState* play, u16 cueId) { CutsceneContext* csCtx = &play->csCtx; s32 cueChannel = DemoGo_GetCueChannel(this); - if ((csCtx->state != CS_STATE_IDLE) && (csCtx->actorCues[cueChannel] != NULL) && - (csCtx->actorCues[cueChannel]->id == cueId)) { - return true; + if (csCtx->state != CS_STATE_IDLE) { + CsCmdActorCue* cue = csCtx->actorCues[cueChannel]; + + if (cue != NULL && cue->id == cueId) { + return true; + } } return false; @@ -341,13 +344,13 @@ void func_8097D29C(DemoGo* this, PlayState* play) { s16 eyeTexIdx = this->unk_190; SkelAnime* skelAnime = &this->skelAnime; void* eyeTexture = sEyeTextures[eyeTexIdx]; - void* mouthTexture = gGoronCsMouthSmileTex; + s32 pad2; OPEN_DISPS(play->state.gfxCtx, "../z_demo_go.c", 732); Gfx_SetupDL_25Opa(play->state.gfxCtx); 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); diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c index 5190d79c69..c3ce4fa67a 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c @@ -265,7 +265,6 @@ void func_8097E454(PlayState* play, Vec3f* spawnerPos, Vec3f* velocity, Vec3f* a s16 phi_s0; s16 dustScaleStep = 15.0f * scale; f32 dustScale = 300.0f * scale; - Vec3f pos; if ((!FrameAdvance_IsEnabled(play)) && (arg7 > 0) && (arg6 > 0)) { frames = (ABS((s32)play->gameplayFrames) % arg7); @@ -273,6 +272,7 @@ void func_8097E454(PlayState* play, Vec3f* spawnerPos, Vec3f* velocity, Vec3f* a increment = 0x10000 / arg6; for (i = frames; i < arg6; i += arg7) { + Vec3f pos; pos.x = (Math_SinS(phi_s0) * arg4) + spawnerPos->x; pos.y = spawnerPos->y; @@ -437,7 +437,7 @@ void func_8097ED64(DemoGt* this, PlayState* play, s32 cueChannel) { } u8 DemoGt_IsCutsceneLayer(void) { - if (kREG(2) != 0) { + if (OOT_DEBUG && (kREG(2) != 0)) { return true; } else if (!IS_CUTSCENE_LAYER) { return false; @@ -503,7 +503,7 @@ void func_8097EF40(DemoGt* this, PlayState* play) { Vec3f* pos = &this->dyna.actor.world.pos; s32 pad; - if ((kREG(1) == 20) || (csCurFrame == 220)) { + if ((OOT_DEBUG && (kREG(1) == 20)) || (csCurFrame == 220)) { dustPos.x = pos->x + 256.0f; dustPos.y = pos->y + 679.0f; dustPos.z = pos->z + 82.0f; @@ -526,7 +526,12 @@ void func_8097F0AC(DemoGt* this, PlayState* play) { u16 csCurFrame = play->csCtx.curFrame; 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.y = this->dyna.actor.world.pos.y + 340.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* unk188 = this->unk_188; s32* unk198 = this->unk_198; - f32 temp_f0; if (play->csCtx.curFrame < 160) { unk178[0] = 100; @@ -576,7 +580,7 @@ void func_8097F280(DemoGt* this, PlayState* play) { unk198[0]++; unk198[1]--; } 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[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) { - static Actor* cloudRing = NULL; s32 pad[4]; Vec3f pos; Actor* actor; 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.y = this->dyna.actor.world.pos.y + 612.0f; 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 }; 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.y = pos->y + 360.0f; dustPos.z = pos->z - 377.0f; @@ -739,19 +744,20 @@ void func_8097FA1C(DemoGt* this, PlayState* play) { } void func_8097FAFC(DemoGt* this, PlayState* play) { - static Vec3f velocity = { 0.0f, 1.0f, 0.0f }; - static Vec3f accel = { 0.0f, 0.0f, 0.0f }; - static f32 arg4 = 280.0f; - static f32 scale = 8.0f; - static s32 arg6 = 11; - static s32 arg7 = 1; - 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)) { + if (((csCurFrame > 582) && (csCurFrame < 683)) || (OOT_DEBUG && (kREG(1) == 6))) { + static Vec3f velocity = { 0.0f, 1.0f, 0.0f }; + static Vec3f accel = { 0.0f, 0.0f, 0.0f }; + static f32 arg4 = 280.0f; + static f32 scale = 8.0f; + static s32 arg6 = 11; + static s32 arg7 = 1; + static s16 life = 3; + pos = this->dyna.actor.world.pos; pos.y += 680.0f; @@ -773,7 +779,7 @@ void func_8097FC1C(DemoGt* this, PlayState* play) { Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; s32 pad1[3]; - if (csCurFrame > 682 || kREG(1) == 7) { + if (csCurFrame > 682 || (OOT_DEBUG && (kREG(1) == 7))) { dustPos.x = pos->x + 260.0f; dustPos.y = pos->y + 360.0f; dustPos.z = pos->z + 260.0f; @@ -786,7 +792,12 @@ void func_8097FCE4(DemoGt* this, PlayState* play) { Vec3f vec; 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.y = this->dyna.actor.world.pos.y + 560.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) { - static Actor* cloudRing = NULL; s32 pad[4]; Vec3f pos; Actor* actor; if ((play->csCtx.curFrame > 1027) && (play->csCtx.curFrame < 1031)) { + static Actor* cloudRing = NULL; + pos.x = this->dyna.actor.world.pos.x; pos.y = this->dyna.actor.world.pos.y + 247.0f; 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) { - static Actor* cloudRing = NULL; s32 pad[4]; Vec3f pos; Actor* actor; if ((play->csCtx.curFrame > 997) && (play->csCtx.curFrame < 1001)) { + static Actor* cloudRing = NULL; + pos.x = this->dyna.actor.home.pos.x; pos.y = this->dyna.actor.home.pos.y + 38.0f; 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 }; s32 pad1[3]; - if (csCurFrame > 709 || kREG(1) == 8) { + if (csCurFrame > 709 || (OOT_DEBUG && (kREG(1) == 8))) { dustPos.x = pos->x + 760.0f; dustPos.y = pos->y - 40.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 }; s32 pad1[3]; - if ((csCurFrame > 704) || kREG(1) == 9) { + if ((csCurFrame > 704) || (OOT_DEBUG && (kREG(1) == 9))) { dustPos.x = pos->x + 830.0f; dustPos.y = pos->y + 60.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 }; 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.y = homePos->y - 110.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 }; s32 pad1[3]; - if ((csCurFrame > 964) || (kREG(1) == 12)) { + if ((csCurFrame > 964) || (OOT_DEBUG && (kREG(1) == 12))) { dustPos.x = pos->x + 460.0f; dustPos.y = pos->y + 60.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 }; s32 pad1[3]; - if ((csCurFrame > 939) || (kREG(1) == 14)) { + if ((csCurFrame > 939) || (OOT_DEBUG && (kREG(1) == 14))) { dustPos.x = pos->x + 360.0f; dustPos.y = pos->y + 70.0f; dustPos.z = pos->z - 640.0f; @@ -1042,7 +1055,7 @@ void func_8098085C(DemoGt* this, PlayState* play) { u16 csCurFrame = play->csCtx.curFrame; 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.y = pos->y - 50.0f; sp28.z = pos->z + 93.0f; @@ -1068,7 +1081,7 @@ void func_809809C0(DemoGt* this, PlayState* play2) { Vec3f sp54; 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 sp34 = { 0.0f, 0.0f, 0.0f }; s16 pad2[3]; @@ -1088,7 +1101,7 @@ void func_80980AD4(DemoGt* this, PlayState* play) { Vec3f pos; 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.y = this->dyna.actor.world.pos.y + 60.0f; pos.z = this->dyna.actor.world.pos.z + 23.0f; @@ -1103,7 +1116,7 @@ void func_80980B68(DemoGt* this, PlayState* play) { Vec3f pos; 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.y = this->dyna.actor.world.pos.y + 410.0f; pos.z = this->dyna.actor.world.pos.z - 177.0f; @@ -1117,7 +1130,7 @@ void func_80980BFC(DemoGt* this, PlayState* play) { Vec3f pos; 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.y = this->dyna.actor.world.pos.y + 60.0f; pos.z = this->dyna.actor.world.pos.z + 23.0f; @@ -1322,7 +1335,7 @@ void func_80981458(DemoGt* this, PlayState* play) { Vec3f dustPos; 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 }; s32 pad1[3]; diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c index dd1d7e3cc5..199fb04f7e 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -36,8 +36,11 @@ s32 DemoIk_UpdateSkelAnime(DemoIk* this) { CsCmdActorCue* DemoIk_GetCue(PlayState* play, s32 cueChannel) { if (play->csCtx.state != CS_STATE_IDLE) { - return play->csCtx.actorCues[cueChannel]; + CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel]; + + return cue; } + 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) { - DemoIk* this = (DemoIk*)thisx; GraphicsContext* gfxCtx = play->state.gfxCtx; + DemoIk* this = (DemoIk*)thisx; OPEN_DISPS(gfxCtx, "../z_demo_ik_inArmer.c", 385); if (limbIndex == 1) { diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 71e2ee06ef..eac76aa693 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -118,6 +118,7 @@ void func_80984BE0(DemoIm* this) { } } +#if OOT_DEBUG void func_80984C68(DemoIm* this) { this->action = 7; this->drawConfig = 0; @@ -143,6 +144,7 @@ void func_80984C8C(DemoIm* this, PlayState* play) { } } } +#endif void DemoIm_InitCollider(Actor* thisx, PlayState* play) { DemoIm* this = (DemoIm*)thisx; @@ -497,7 +499,9 @@ void func_80985B34(DemoIm* this, PlayState* play) { void func_80985C10(DemoIm* this, PlayState* play) { func_80985948(this, play); +#if OOT_DEBUG func_80984C8C(this, play); +#endif } void func_80985C40(DemoIm* this, PlayState* play) { @@ -505,7 +509,9 @@ void func_80985C40(DemoIm* this, PlayState* play) { DemoIm_UpdateSkelAnime(this); func_80984BE0(this); func_809859E0(this, play); +#if OOT_DEBUG func_80984C8C(this, play); +#endif } void func_80985C94(DemoIm* this, PlayState* play) { @@ -513,7 +519,9 @@ void func_80985C94(DemoIm* this, PlayState* play) { DemoIm_UpdateSkelAnime(this); func_80984BE0(this); func_80985B34(this, play); +#if OOT_DEBUG func_80984C8C(this, play); +#endif } 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) { if (func_80986A5C(this, play)) { + s32 pad; + play->csCtx.script = SEGMENTED_TO_VIRTUAL(gZeldasCourtyardLullabyCs); gSaveContext.cutsceneTrigger = 1; SET_EVENTCHKINF(EVENTCHKINF_59); @@ -924,10 +934,15 @@ void func_80986CFC(DemoIm* this, PlayState* play) { } void func_80986D40(DemoIm* this, PlayState* play) { +#if OOT_DEBUG if (gSaveContext.sceneLayer == 6) { this->action = 19; this->drawConfig = 1; - } else if (GET_EVENTCHKINF(EVENTCHKINF_80)) { + return; + } +#endif + + if (GET_EVENTCHKINF(EVENTCHKINF_80)) { Actor_Kill(&this->actor); } else if (!GET_EVENTCHKINF(EVENTCHKINF_59)) { this->action = 23; diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index 103ddcb3ce..f2f1941750 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -277,7 +277,6 @@ void DemoKankyo_Destroy(Actor* thisx, PlayState* play) { void DemoKankyo_SetupType(DemoKankyo* this, PlayState* play) { Player* player = GET_PLAYER(play); - f32 temp; if (this->actor.objectSlot == this->requiredObjectSlot) { switch (this->actor.params) { @@ -302,12 +301,14 @@ void DemoKankyo_SetupType(DemoKankyo* this, PlayState* play) { play->envCtx.screenFillColor[2] = 0xFF; play->envCtx.fillScreen = false; 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.screenFillColor[3] = 255 - 255 * temp; } 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.screenFillColor[3] = 255 * temp; } diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c index d67bab473c..0827ae7122 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -127,6 +127,7 @@ void DemoSa_SetMouthIndex(DemoSa* this, s16 mouthIndex) { this->mouthIndex = mouthIndex; } +#if OOT_DEBUG void func_8098E530(DemoSa* this) { this->action = 7; this->drawConfig = 0; @@ -150,6 +151,7 @@ void func_8098E554(DemoSa* this, PlayState* play) { *something = 1; } } +#endif void func_8098E5C8(DemoSa* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); @@ -161,7 +163,9 @@ s32 DemoSa_UpdateSkelAnime(DemoSa* this) { CsCmdActorCue* DemoSa_GetCue(PlayState* play, s32 cueChannel) { if (play->csCtx.state != CS_STATE_IDLE) { - return play->csCtx.actorCues[cueChannel]; + CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel]; + + return cue; } return NULL; @@ -439,7 +443,9 @@ void func_8098F050(DemoSa* this, PlayState* play) { void func_8098F0E8(DemoSa* this, PlayState* play) { func_8098EEA8(this, play); +#if OOT_DEBUG func_8098E554(this, play); +#endif } void func_8098F118(DemoSa* this, PlayState* play) { @@ -447,7 +453,9 @@ void func_8098F118(DemoSa* this, PlayState* play) { DemoSa_UpdateSkelAnime(this); func_8098E480(this); func_8098EEFC(this, play); +#if OOT_DEBUG func_8098E554(this, play); +#endif } void func_8098F16C(DemoSa* this, PlayState* play) { @@ -455,7 +463,9 @@ void func_8098F16C(DemoSa* this, PlayState* play) { DemoSa_UpdateSkelAnime(this); func_8098EDB0(this); func_8098F050(this, play); +#if OOT_DEBUG func_8098E554(this, play); +#endif } void DemoSa_DrawXlu(DemoSa* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c index ec53977501..19272d5042 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c @@ -58,12 +58,10 @@ void func_80991298(DemoShd* this, PlayState* play) { } if (play->csCtx.state != CS_STATE_IDLE) { - CsCmdActorCue* cue = play->csCtx.actorCues[0]; - - if (cue != NULL) { - if (cue->id == 2) { + if (play->csCtx.actorCues[0] != NULL) { + if (play->csCtx.actorCues[0]->id == 2) { if (!(this->unk_14C & 1)) { - this->unk_14E = cue->startPos.x; + this->unk_14E = play->csCtx.actorCues[0]->startPos.x; } this->unk_14C |= 1; } else { @@ -73,12 +71,10 @@ void func_80991298(DemoShd* this, PlayState* play) { } if (play->csCtx.state != CS_STATE_IDLE) { - CsCmdActorCue* cue = play->csCtx.actorCues[1]; - - if (cue != NULL) { - if (cue->id == 2) { + if (play->csCtx.actorCues[1] != NULL) { + if (play->csCtx.actorCues[1]->id == 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; } else { @@ -101,8 +97,6 @@ void DemoShd_Draw(Actor* thisx, PlayState* play) { s32 pad; 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); Gfx_SetupDL_25Xlu(play->state.gfxCtx); @@ -123,5 +117,7 @@ void DemoShd_Draw(Actor* thisx, PlayState* play) { gSPDisplayList(POLY_XLU_DISP++, D_809934B8); } + if (1) {} // Necessary to match + CLOSE_DISPS(play->state.gfxCtx, "../z_demo_shd.c", 762); } diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 52c111c58a..dbddf17995 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -456,12 +456,10 @@ s32 DoorWarp1_PlayerInRange(DoorWarp1* this, PlayState* play) { } void DoorWarp1_ChildWarpIdle(DoorWarp1* this, PlayState* play) { - Player* player; - Actor_PlaySfx(&this->actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); 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, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -830,12 +828,10 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) { } void DoorWarp1_Destination(DoorWarp1* this, PlayState* play) { - f32 alphaFrac; + f32 alphaFrac = 1.0f; - this->warpTimer++; this->unk_194 = 5.0f; - - alphaFrac = 1.0f; + this->warpTimer++; if (this->warpTimer < 20) { alphaFrac = this->warpTimer / 20.f; } else if (this->warpTimer >= 60) { diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c index 1c07031a0c..893360582f 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -273,31 +273,32 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, PlayState* play2) { Gfx_SetupDL_25Opa(gfxCtx); 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; 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); - for (i = 0; i < 64; i++, initialPositions++, distanceTraveled++) { - if (!(*distanceTraveled < 1.0f)) { - continue; + for (i = 0; i < 64; i++) { + if (*distanceTraveled < 1.0f) { + aux = 1.0f - SQ(*distanceTraveled); + 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.z + (initialPositions->z * ((this->dz * aux) + (1.0f - this->dz))), + MTXMODE_NEW); + + Matrix_Scale(this->scalingFactor, this->scalingFactor, this->scalingFactor, MTXMODE_APPLY); + Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); + + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_dust.c", 449), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL)); } - aux = 1.0f - SQ(*distanceTraveled); - 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.z + (initialPositions->z * ((this->dz * aux) + (1.0f - this->dz))), - MTXMODE_NEW); - - Matrix_Scale(this->scalingFactor, this->scalingFactor, this->scalingFactor, MTXMODE_APPLY); - Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); - - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_dust.c", 449), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL)); + initialPositions++; + distanceTraveled++; } CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 458); @@ -318,6 +319,10 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2) { Gfx_SetupDL_25Opa(gfxCtx); gDPPipeSync(POLY_XLU_DISP++); + + initialPositions = this->initialPositions; + distanceTraveled = this->distanceTraveled; + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255); if (player->unk_858 >= 0.85f) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); @@ -325,34 +330,32 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2) { gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 0); } - initialPositions = this->initialPositions; - distanceTraveled = this->distanceTraveled; - gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL); - for (i = 0; i < 64; i++, initialPositions++, distanceTraveled++) { - if (!(*distanceTraveled < 1.0f)) { - continue; + for (i = 0; i < 64; i++) { + if (*distanceTraveled < 1.0f) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, *distanceTraveled * 255); + + aux = 1.0f - SQ(*distanceTraveled); + + Matrix_Mult(&player->mf_9E0, MTXMODE_NEW); + + Matrix_Translate(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)), + initialPositions->y * (1.0f - *distanceTraveled) + 320.0f, + initialPositions->z * (1.0f - *distanceTraveled) + -20.0f, MTXMODE_APPLY); + + Matrix_Scale(*distanceTraveled * this->scalingFactor, *distanceTraveled * this->scalingFactor, + *distanceTraveled * this->scalingFactor, MTXMODE_APPLY); + + Matrix_ReplaceRotation(&play->billboardMtxF); + + gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_dust.c", 506), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL)); } - gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, *distanceTraveled * 255); - - aux = 1.0f - SQ(*distanceTraveled); - - Matrix_Mult(&player->mf_9E0, MTXMODE_NEW); - - Matrix_Translate(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)), - initialPositions->y * (1.0f - *distanceTraveled) + 320.0f, - initialPositions->z * (1.0f - *distanceTraveled) + -20.0f, MTXMODE_APPLY); - - Matrix_Scale(*distanceTraveled * this->scalingFactor, *distanceTraveled * this->scalingFactor, - *distanceTraveled * this->scalingFactor, MTXMODE_APPLY); - - Matrix_ReplaceRotation(&play->billboardMtxF); - - gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_eff_dust.c", 506), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL)); + initialPositions++; + distanceTraveled++; } CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 515); diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index dfa44b0cd4..d326f93b5c 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -13,7 +13,9 @@ void ElfMsg_Init(Actor* thisx, PlayState* play); void ElfMsg_Destroy(Actor* thisx, PlayState* play); void ElfMsg_Update(Actor* thisx, PlayState* play); +#if OOT_DEBUG void ElfMsg_Draw(Actor* thisx, PlayState* play); +#endif void ElfMsg_CallNaviCuboid(ElfMsg* this, PlayState* play); void ElfMsg_CallNaviCylinder(ElfMsg* this, PlayState* play); @@ -27,7 +29,11 @@ ActorInit Elf_Msg_InitVars = { /**/ ElfMsg_Init, /**/ ElfMsg_Destroy, /**/ ElfMsg_Update, +#if OOT_DEBUG /**/ ElfMsg_Draw, +#else + /**/ NULL, +#endif }; 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" 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); } +#endif diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index d36f9813cb..0e94e73927 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -12,7 +12,9 @@ void ElfMsg2_Init(Actor* thisx, PlayState* play); void ElfMsg2_Destroy(Actor* thisx, PlayState* play); void ElfMsg2_Update(Actor* thisx, PlayState* play); +#if OOT_DEBUG void ElfMsg2_Draw(Actor* thisx, PlayState* play); +#endif s32 ElfMsg2_GetMessageId(ElfMsg2* this); void ElfMsg2_WaitUntilActivated(ElfMsg2* this, PlayState* play); @@ -27,7 +29,11 @@ ActorInit Elf_Msg2_InitVars = { /**/ ElfMsg2_Init, /**/ ElfMsg2_Destroy, /**/ ElfMsg2_Update, +#if OOT_DEBUG /**/ ElfMsg2_Draw, +#else + /**/ NULL, +#endif }; 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" 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); } +#endif diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 932308eb20..de26bf1140 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -782,7 +782,6 @@ void EnAm_TransformSwordHitbox(Actor* thisx, PlayState* play) { void EnAm_UpdateDamage(EnAm* this, PlayState* play) { s32 pad; - Vec3f sparkPos; if (this->deathTimer == 0) { if (this->blockCollider.base.acFlags & AC_BOUNCED) { @@ -810,7 +809,8 @@ void EnAm_UpdateDamage(EnAm* this, PlayState* play) { this->dyna.actor.colChkInfo.health = 0; } } 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; CollisionCheck_SpawnShieldParticlesMetal(play, &sparkPos); } @@ -836,8 +836,6 @@ void EnAm_Update(Actor* thisx, PlayState* play) { EnBom* bomb; Vec3f dustPos; s32 i; - f32 dustPosScale; - s32 pad1; if (this->dyna.actor.params != ARMOS_STATUE) { EnAm_UpdateDamage(this, play); @@ -854,7 +852,8 @@ void EnAm_Update(Actor* thisx, PlayState* play) { this->deathTimer--; if (this->deathTimer == 0) { - dustPosScale = play->gameplayFrames * 10; + f32 dustPosScale = play->gameplayFrames * 10; + s32 pad1; EnAm_SpawnEffects(this, play); bomb = @@ -943,9 +942,9 @@ static Vec3f sIcePosOffsets[] = { }; void EnAm_Draw(Actor* thisx, PlayState* play) { - s32 pad; - Vec3f sp68; EnAm* this = (EnAm*)thisx; + Vec3f sp68; + s32 index; OPEN_DISPS(play->state.gfxCtx, "../z_en_am.c", 1580); @@ -959,7 +958,6 @@ void EnAm_Draw(Actor* thisx, PlayState* play) { this->iceTimer--; if ((this->iceTimer % 4) == 0) { - s32 index; index = this->iceTimer >> 2; diff --git a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c index 772b1c1372..d2e69c344b 100644 --- a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c +++ b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c @@ -99,7 +99,7 @@ void EnAnubiceTag_Update(Actor* thisx, PlayState* play) { void EnAnubiceTag_Draw(Actor* thisx, PlayState* play) { EnAnubiceTag* this = (EnAnubiceTag*)thisx; - if (BREG(0) != 0) { + if (OOT_DEBUG && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index 84a05c3b16..39b86fc6b3 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -246,8 +246,6 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) { s32 atTouched; u16 sfxId; Actor* hitActor; - Vec3f sp60; - Vec3f sp54; if (DECR(this->timer) == 0) { Actor_Kill(&this->actor); @@ -342,6 +340,9 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) { if (this->hitActor != NULL) { if (this->hitActor->update != NULL) { + Vec3f sp60; + Vec3f sp54; + Math_Vec3f_Sum(&this->unk_210, &this->unk_250, &sp60); Math_Vec3f_Sum(&this->actor.world.pos, &this->unk_250, &sp54); diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index c5c4392382..f42593a57e 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -297,8 +297,6 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) { EnAttackNiw* this = (EnAttackNiw*)thisx; EnNiw* cucco; Player* player = GET_PLAYER(play); - s32 pad; - Vec3f sp30; PlayState* play2 = play; this->unk_28C++; @@ -343,6 +341,9 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) { } if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actionFunc != func_809B5C18)) { + Vec3f sp30; + s32 pad; + Math_Vec3f_Copy(&sp30, &this->actor.world.pos); sp30.y += this->actor.yDistToWater; EffectSsGSplash_Spawn(play, &sp30, NULL, NULL, 0, 0x190); diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 965df7954f..03528ef5e3 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -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_Scale(this->unk_200[i].x, this->unk_200[i].y, this->unk_200[i].z, MTXMODE_APPLY); if ((i == 6) || (i == 13)) { + if (mtx) {} switch (i) { case 13: Collider_UpdateSpheres(i, &this->collider); diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index b6bca7f72f..7ff5296e23 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -291,9 +291,10 @@ void EnBb_SpawnFlameTrail(PlayState* play, EnBb* this, s16 startAtZero) { void EnBb_KillFlameTrail(EnBb* this) { Actor* actor = &this->actor; + Actor* nextActor; while (actor->child != NULL) { - Actor* nextActor = actor->child; + nextActor = actor->child; if (nextActor->id == ACTOR_EN_BB) { nextActor->parent = NULL; @@ -408,10 +409,10 @@ void EnBb_Destroy(Actor* thisx, PlayState* play) { void EnBb_SetupFlameTrail(EnBb* this) { this->action = BB_FLAME_TRAIL; this->moveMode = BBMOVE_NOCLIP; - this->actor.flags &= ~ACTOR_FLAG_0; this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; this->actor.speed = 0.0f; + this->actor.flags &= ~ACTOR_FLAG_0; EnBb_SetupAction(this, EnBb_FlameTrail); } diff --git a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c index 1febc79760..ba1920a321 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c @@ -121,9 +121,7 @@ void func_809BC2A4(EnBdfire* this, PlayState* play) { void func_809BC598(EnBdfire* this, PlayState* play) { s16 quarterTurn; Player* player = GET_PLAYER(play); - f32 distToBurn; BossDodongo* bossDodongo; - s16 i; bossDodongo = ((BossDodongo*)this->actor.parent); this->unk_158 = bossDodongo->unk_1A2; @@ -164,8 +162,11 @@ void func_809BC598(EnBdfire* this, PlayState* play) { return; } } 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)) { + s16 i; + for (i = 0; i < 18; i++) { player->bodyFlameTimers[i] = Rand_S16Offset(0, 200); } diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index e58bd6b2a4..b982fa7ddb 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -837,6 +837,7 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, temp_f0, temp_f0, temp_f0, 255); + if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_en_bigokuta.c", 1945); } } else if (limbIndex == 10) { @@ -848,7 +849,7 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec } gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, intensity, intensity, intensity, intensity); - + if (1) {} CLOSE_DISPS(play->state.gfxCtx, "../z_en_bigokuta.c", 1972); } else if (limbIndex == 17 && this->actionFunc == func_809BE26C) { if (this->unk_198 < 5) { diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index de0a12eebf..6410634593 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -143,12 +143,12 @@ void EnBili_SetupFloatIdle(EnBili* this) { this->actor.speed = 0.7f; this->collider.elem.bumper.effect = 1; // Shock? 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.gravity = 0.0f; this->actor.velocity.y = 0.0f; + this->collider.base.atFlags |= AT_ON; + this->collider.base.acFlags |= AC_ON; + this->actionFunc = EnBili_FloatIdle; } /** diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index 6d0ecbc276..d091fbe3a0 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -474,7 +474,7 @@ Gfx* EnBombf_NewMtxDList(GraphicsContext* gfxCtx, PlayState* play) { Matrix_ReplaceRotation(&play->billboardMtxF); gSPMatrix(displayListHead++, MATRIX_NEW(gfxCtx, "../z_en_bombf.c", 1021), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPEndDisplayList(displayListHead); + gSPEndDisplayList(displayListHead++); return displayList; } @@ -482,8 +482,6 @@ void EnBombf_Draw(Actor* thisx, PlayState* play) { s32 pad; EnBombf* this = (EnBombf*)thisx; - if (1) {} - OPEN_DISPS(play->state.gfxCtx, "../z_en_bombf.c", 1034); if (thisx->params <= BOMBFLOWER_BODY) { @@ -510,5 +508,7 @@ void EnBombf_Draw(Actor* thisx, PlayState* play) { Collider_UpdateSpheres(0, &this->explosionCollider); } + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_bombf.c", 1063); } diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index 579cc5920b..a92aa86d5e 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -272,5 +272,7 @@ void EnBoom_Draw(Actor* thisx, PlayState* play) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gBoomerangRefDL); + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_boom.c", 604); } diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 23f49a4625..d8082a7973 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -425,6 +425,8 @@ void EnBubble_Draw(Actor* thisx, PlayState* play) { gSPDisplayList(POLY_XLU_DISP++, gBubbleDL); } + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_bubble.c", 1226); if (this->actionFunc != EnBubble_Disappear) { diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 4a5b89f85c..1516d57d55 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -859,7 +859,7 @@ void EnBw_Draw(Actor* thisx, PlayState* play2) { POLY_OPA_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnBw_OverrideLimbDraw, NULL, this, POLY_OPA_DISP); } else { - Gfx_SetupDL_25Xlu(play->state.gfxCtx); + Gfx_SetupDL_25Xlu(play2->state.gfxCtx); gDPPipeSync(POLY_XLU_DISP++); 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); @@ -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); } } + + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_bw.c", 1521); } diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.c b/src/overlays/actors/ovl_En_Bx/z_en_bx.c index 0e6b72e037..35f1565912 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -205,6 +205,7 @@ void EnBx_Draw(Actor* thisx, PlayState* play) { s32 pad; Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, 4 * sizeof(Mtx)); s16 i; + s16 off; 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; 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_1B4[i].x = thisx->shape.rot.x; diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.c b/src/overlays/actors/ovl_En_Changer/z_en_changer.c index cf5e1efe3e..d548a7a887 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.c +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.c @@ -282,7 +282,7 @@ void EnChanger_Update(Actor* thisx, PlayState* play) { this->timer--; } - if (BREG(0)) { + if (OOT_DEBUG && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 255, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index f415f0f100..f13b19221f 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -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. */ 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 (this->actor.floorPoly != NULL) { - f32 x = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.x); - f32 y = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y); - f32 z = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z); + x = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.x); + y = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y); + z = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z); this->floorTangent.x = -Math_FAtan2F(-z * y, 1.0f); this->floorTangent.z = Math_FAtan2F(-x * y, 1.0f); diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index caa64d3009..3cd26ef460 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -285,8 +285,6 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) { void EnCrow_DiveAttack(EnCrow* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 facingPlayer; - Vec3f pos; - s16 target; SkelAnime_Update(&this->skelAnime); if (this->timer != 0) { @@ -296,6 +294,9 @@ void EnCrow_DiveAttack(EnCrow* this, PlayState* play) { facingPlayer = Actor_IsFacingPlayer(&this->actor, 0x2800); if (facingPlayer) { + Vec3f pos; + s16 target; + pos.x = player->actor.world.pos.x; pos.y = player->actor.world.pos.y + 20.0f; pos.z = player->actor.world.pos.z; diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c index 14c454455f..f5694d2bf0 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -296,8 +296,6 @@ void EnDh_SetupAttack(EnDh* this) { } void EnDh_Attack(EnDh* this, PlayState* play) { - s32 pad; - if (SkelAnime_Update(&this->skelAnime)) { this->actionState++; } 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; case 3: 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_GetLastFrame(&object_dh_Anim_004658), ANIMMODE_ONCE, -6.0f); this->actionState = 0; diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index df3e4ceab4..6e33517bf3 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -125,6 +125,8 @@ void EnDivingGame_SpawnRuppy(EnDivingGame* this, PlayState* play) { } s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) { + s32 rupeesNeeded; + if ((gSaveContext.timerState == TIMER_STATE_STOP) && !Play_InCsMode(play)) { // Failed. gSaveContext.timerState = TIMER_STATE_OFF; @@ -138,7 +140,7 @@ s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) { this->actionFunc = func_809EE048; return true; } else { - s32 rupeesNeeded = 5; + rupeesNeeded = 5; if (GET_EVENTCHKINF(EVENTCHKINF_38)) { rupeesNeeded = 10; diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 233d17d613..4268bc2ba2 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -77,6 +77,7 @@ static u16 sStartingTextIds[] = { 0x10A0, 0x10A1, 0x10A2, 0x10CA, 0x10CB, 0x10CC, 0x10CD, 0x10CE, 0x10CF, 0x10DC, 0x10DD, }; +#if OOT_DEBUG static char* sItemDebugTxt[] = { "デクの実売り ", // "Deku Nuts" "デクの棒売り ", // "Deku Sticks" @@ -90,6 +91,7 @@ static char* sItemDebugTxt[] = { "デクの棒持てる数を増やす", // "Deku Stick Upgrade" "デクの実持てる数を増やす", // "Deku Nut Upgrade" }; +#endif 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 }; diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index 4add13e11e..9e0c0f6e42 100644 --- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -185,8 +185,8 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) { case PLAYER_MASK_ZORA: case PLAYER_MASK_GERUDO: rand9 = Rand_ZeroFloat(8.99f); - maskIdx = Player_GetMask(play); - maskIdx--; + // fake match, possible alternative is `maskIdx = Player_GetMask(play); maskIdx--;` on one line + maskIdx = (s16)Player_GetMask(play) - 1; if (rand9 == 8) { ignore = true; delay = 8; @@ -265,6 +265,9 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) { void EnDntDemo_Results(EnDntDemo* this, PlayState* play) { s32 i; + s16 offsetAngle; + Vec3f leaderPos; + f32 offsetDist; if (this->leaderSignal != DNT_SIGNAL_NONE) { for (i = 0; i < 9; i++) { @@ -284,9 +287,8 @@ void EnDntDemo_Results(EnDntDemo* this, PlayState* play) { this->actionFunc = EnDntDemo_Prize; } else if (this->prize == DNT_PRIZE_STICK) { for (i = 0; i < 9; i++) { - s16 offsetAngle = -this->leader->actor.shape.rot.y; - Vec3f leaderPos = this->leader->actor.world.pos; - f32 offsetDist; + offsetAngle = -this->leader->actor.shape.rot.y; + leaderPos = this->leader->actor.world.pos; if (!(i & 1)) { offsetAngle -= 0x59D8; @@ -324,7 +326,8 @@ void EnDntDemo_Update(Actor* thisx, PlayState* play) { this->unkTimer1--; } this->actionFunc(this, play); - if (BREG(0)) { + + if (OOT_DEBUG && BREG(0) != 0) { if (this->debugArrowTimer != 0) { if (!(this->debugArrowTimer & 1)) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index f1fefedd8b..4de5e81918 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -216,16 +216,23 @@ void EnDntNomal_TargetWait(EnDntNomal* this, PlayState* play) { f32 dz; Vec3f scoreAccel = { 0.0f, 0.0f, 0.0f }; Vec3f scoreVel = { 0.0f, 0.0f, 0.0f }; + s32 pad; - this->targetVtx[0].x = this->targetVtx[1].x = this->targetVtx[2].x = this->targetVtx[3].x = targetX; + this->targetVtx[0].x = targetX; + this->targetVtx[0].y = targetY - 24.0f; + this->targetVtx[0].z = targetZ + 24.0f; - this->targetVtx[1].y = this->targetVtx[0].y = targetY - 24.0f; + this->targetVtx[1].x = targetX; + this->targetVtx[1].y = targetY - 24.0f; + this->targetVtx[1].z = targetZ - 24.0f; - this->targetVtx[2].z = this->targetVtx[0].z = targetZ + 24.0f; + this->targetVtx[2].x = targetX; + this->targetVtx[2].y = targetY + 24.0f; + this->targetVtx[2].z = targetZ + 24.0f; - this->targetVtx[3].z = this->targetVtx[1].z = targetZ - 24.0f; - - this->targetVtx[3].y = this->targetVtx[2].y = targetY + 24.0f; + this->targetVtx[3].x = targetX; + this->targetVtx[3].y = targetY + 24.0f; + this->targetVtx[3].z = targetZ - 24.0f; SkelAnime_Update(&this->skelAnime); if ((this->targetQuad.base.acFlags & AC_HIT) || BREG(0)) { diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 05c4c1a783..3d8e0e57ce 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -215,6 +215,8 @@ void EnDs_Wait(EnDs* this, PlayState* play) { player->actor.textId = 0x500C; this->actionFunc = EnDs_OfferBluePotion; } else { + s16 pad; + if (INV_CONTENT(ITEM_ODD_MUSHROOM) == ITEM_ODD_MUSHROOM) { player->actor.textId = 0x5049; } else { diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c index ea124d0436..56ec047023 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -362,13 +362,15 @@ void func_809FE4A4(EnDu* this, PlayState* play) { void func_809FE638(EnDu* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & PLAYER_STATE1_29)) { - OnePointCutscene_Init(play, 3330, -99, &this->actor, CAM_ID_MAIN); - player->actor.shape.rot.y = player->actor.world.rot.y = this->actor.world.rot.y + 0x7FFF; - Audio_PlayFanfare(NA_BGM_APPEAR); - EnDu_SetupAction(this, func_809FE6CC); - this->unk_1E2 = 0x32; + if (player->stateFlags1 & PLAYER_STATE1_29) { + return; } + + OnePointCutscene_Init(play, 3330, -99, &this->actor, CAM_ID_MAIN); + player->actor.shape.rot.y = player->actor.world.rot.y = this->actor.world.rot.y + 0x7FFF; + Audio_PlayFanfare(NA_BGM_APPEAR); + EnDu_SetupAction(this, func_809FE6CC); + this->unk_1E2 = 0x32; } void func_809FE6CC(EnDu* this, PlayState* play) { @@ -527,11 +529,13 @@ void func_809FEC14(EnDu* this, PlayState* play) { } void func_809FEC70(EnDu* this, PlayState* play) { + f32 xzRange; + if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; EnDu_SetupAction(this, func_809FECE4); } else { - f32 xzRange = this->actor.xzDistToPlayer + 1.0f; + xzRange = this->actor.xzDistToPlayer + 1.0f; Actor_OfferGetItem(&this->actor, play, GI_GORONS_BRACELET, xzRange, fabsf(this->actor.yDistToPlayer) + 1.0f); } diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index 1896074334..0f9fb333e9 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -93,8 +93,8 @@ void EnDyExtra_Draw(Actor* thisx, PlayState* play) { static u8 D_809FFC50[] = { 0x02, 0x01, 0x01, 0x02, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x01, 0x02, 0x00 }; EnDyExtra* this = (EnDyExtra*)thisx; - s32 pad; GraphicsContext* gfxCtx = play->state.gfxCtx; + s32 pad; Vtx* vertices = SEGMENTED_TO_VIRTUAL(gGreatFairySpiralBeamVtx); s32 i; u8 unk[3]; diff --git a/src/overlays/actors/ovl_En_Eg/z_en_eg.c b/src/overlays/actors/ovl_En_Eg/z_en_eg.c index c53100adae..7b3940994d 100644 --- a/src/overlays/actors/ovl_En_Eg/z_en_eg.c +++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.c @@ -48,7 +48,8 @@ void EnEg_Init(Actor* thisx, PlayState* play) { } void func_809FFDC8(EnEg* this, PlayState* play) { - if (!sVoided && (gSaveContext.subTimerSeconds <= 0) && Flags_GetSwitch(play, 0x36) && (kREG(0) == 0)) { + if (!sVoided && (gSaveContext.subTimerSeconds <= 0) && Flags_GetSwitch(play, 0x36) && + (!OOT_DEBUG || kREG(0) == 0)) { // Void the player out Play_TriggerRespawn(play); gSaveContext.respawnFlag = -2; diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 6b4a7a860b..099dc5b29a 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -304,9 +304,9 @@ void EnEiyer_SetupDie(EnEiyer* this) { } void EnEiyer_SetupDead(EnEiyer* this) { - this->actor.colorFilterParams |= 0x2000; this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; + this->actor.colorFilterParams |= 0x2000; this->actionFunc = EnEiyer_Dead; } diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index fb9d118719..6de4a0c58b 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -808,7 +808,6 @@ void func_80A03AB0(EnElf* this, PlayState* play) { void EnElf_UpdateLights(EnElf* this, PlayState* play) { s16 glowLightRadius; - Player* player; glowLightRadius = 100; @@ -817,7 +816,8 @@ void EnElf_UpdateLights(EnElf* this, PlayState* play) { } if (this->fairyFlags & 0x20) { - player = GET_PLAYER(play); + Player* player = GET_PLAYER(play); + Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, player->actor.world.pos.x, (s16)(player->actor.world.pos.y) + 60.0f, player->actor.world.pos.z, 255, 255, 255, 200); @@ -1379,9 +1379,15 @@ void func_80A053F0(Actor* thisx, PlayState* play) { if (player->naviTextId == 0) { if (player->unk_664 == NULL) { +#if OOT_DEBUG if (((gSaveContext.save.info.playerData.naviTimer >= 600) && (gSaveContext.save.info.playerData.naviTimer <= 3000)) || - (nREG(89) != 0)) { + (nREG(89) != 0)) +#else + if ((gSaveContext.save.info.playerData.naviTimer >= 600) && + (gSaveContext.save.info.playerData.naviTimer <= 3000)) +#endif + { player->naviTextId = QuestHint_GetNaviTextId(play); if (player->naviTextId == 0x15F) { @@ -1417,6 +1423,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) { this->actionFunc(this, play); thisx->shape.rot.y = this->unk_2BC; +#if OOT_DEBUG // `gSaveContext.save.info.sceneFlags[127].chest` (like in the debug string) instead of `HIGH_SCORE(HS_HBA)` // matches too, but, with how the `SaveContext` struct is currently defined, it is an out-of-bounds read in the // `sceneFlags` array. It is theorized the original `room_inf` (currently `sceneFlags`) was an array of length @@ -1426,6 +1433,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) { if ((nREG(81) != 0) && (HIGH_SCORE(HS_HBA) != 0)) { LOG_NUM("z_common_data.memory.information.room_inf[127][ 0 ]", HIGH_SCORE(HS_HBA), "../z_en_elf.c", 2595); } +#endif if (!Play_InCsMode(play)) { if (gSaveContext.save.info.playerData.naviTimer < 25800) { @@ -1535,7 +1543,7 @@ void EnElf_Draw(Actor* thisx, PlayState* play) { gDPSetRenderMode(dListHead++, G_RM_PASS, G_RM_ZB_CLD_SURF2); } - gSPEndDisplayList(dListHead++); + gSPEndDisplayList(dListHead); gDPSetEnvColor(POLY_XLU_DISP++, (u8)this->outerColor.r, (u8)this->outerColor.g, (u8)this->outerColor.b, (u8)(envAlpha * alphaScale)); POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable, diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index d942e56c7c..cca866a47b 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -51,6 +51,8 @@ void EnEncount1_Init(Actor* thisx, PlayState* play) { spawnRange = 120.0f + (40.0f * this->actor.world.rot.z); this->spawnRange = spawnRange; + if (1) {} + PRINTF("\n\n"); // "It's an enemy spawner!" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 敵発生ゾーンでた! ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); @@ -322,7 +324,7 @@ void EnEncount1_Update(Actor* thisx, PlayState* play) { this->updateFunc(this, play); - if (BREG(0) != 0) { + if (OOT_DEBUG && BREG(0) != 0) { if (this->outOfRangeTimer != 0) { if ((this->outOfRangeTimer & 1) == 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index 7efa5a09a6..cab41eec90 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -338,9 +338,9 @@ void EnEncount2_UpdateEffects(EnEncount2* this, PlayState* play) { } void EnEncount2_DrawEffects(Actor* thisx, PlayState* play) { + GraphicsContext* gfxCtx = play->state.gfxCtx; EnEncount2* this = (EnEncount2*)thisx; EnEncount2Effect* effect = this->effects; - GraphicsContext* gfxCtx = play->state.gfxCtx; s16 i; s32 objectSlot; diff --git a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c index 3417ca1444..f36ea32563 100644 --- a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c +++ b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c @@ -315,6 +315,7 @@ void EnExRuppy_WaitToBlowUp(EnExRuppy* this, PlayState* play) { f32 distToBlowUp = 50.0f; s16 explosionScale; s16 explosionScaleStep; + s32 pad; if (this->type == 2) { distToBlowUp = 30.0f; diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c index 2b7f6bedde..886680a57f 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -773,11 +773,11 @@ void EnFd_Draw(Actor* thisx, PlayState* play) { if (this->actionFunc != EnFd_Reappear && !(this->fadeAlpha < 0.9f)) { if (1) {} Gfx_SetupDL_25Xlu(play->state.gfxCtx); - clampedHealth = CLAMP(thisx->colChkInfo.health - 1, 0, 23); - gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, primColors[clampedHealth / 8].r, primColors[clampedHealth / 8].g, - primColors[clampedHealth / 8].b, (u8)this->fadeAlpha); - gDPSetEnvColor(POLY_XLU_DISP++, envColors[clampedHealth / 8].r, envColors[clampedHealth / 8].g, - envColors[clampedHealth / 8].b, (u8)this->fadeAlpha); + clampedHealth = CLAMP(thisx->colChkInfo.health - 1, 0, 23) / 8; + gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, primColors[clampedHealth].r, primColors[clampedHealth].g, + primColors[clampedHealth].b, (u8)this->fadeAlpha); + gDPSetEnvColor(POLY_XLU_DISP++, envColors[clampedHealth].r, envColors[clampedHealth].g, + envColors[clampedHealth].b, (u8)this->fadeAlpha); gSPSegment(POLY_XLU_DISP++, 0x8, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x40, 1, 0, 0xFF - (u8)(frames * 6), 8, 0x40)); @@ -875,9 +875,10 @@ void EnFd_DrawEffectsFlames(EnFd* this, PlayState* play) { static void* dustTextures[] = { gDust8Tex, gDust7Tex, gDust6Tex, gDust5Tex, gDust4Tex, gDust3Tex, gDust2Tex, gDust1Tex, }; - s32 materialFlag; s16 i; s16 idx; + s16 pad; + s16 materialFlag; EnFdEffect* eff = this->effects; OPEN_DISPS(play->state.gfxCtx, "../z_en_fd.c", 1969); diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index f483481622..e079c8194e 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -283,7 +283,6 @@ void EnFhgFire_LightningTrail(EnFhgFire* this, PlayState* play) { void EnFhgFire_LightningShock(EnFhgFire* this, PlayState* play) { Player* player = GET_PLAYER(play); - Vec3f pos; if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; @@ -291,7 +290,8 @@ void EnFhgFire_LightningShock(EnFhgFire* this, PlayState* play) { } if (Rand_ZeroOne() < 0.5f) { - pos = this->actor.world.pos; + Vec3f pos = this->actor.world.pos; + pos.y -= 20.0f; EffectSsFhgFlash_SpawnShock(play, &this->actor, &pos, 200, FHGFLASH_SHOCK_NO_ACTOR); } @@ -447,7 +447,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { Actor_SetScale(&this->actor, 5.25f); } this->actor.shape.rot.z += (s16)(Rand_ZeroOne() * 0x4E20) + 0x4000; - { + if (1) { u8 lightBallColor1 = FHGFLASH_LIGHTBALL_GREEN; s16 i1; Vec3f spD4; @@ -527,7 +527,9 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { &gSfxDefaultReverb); Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100); } - } else if (sqrtf(SQ(dxL) + SQ(dyL) + SQ(dzL)) <= 25.0f) { + break; + } + if (sqrtf(SQ(dxL) + SQ(dyL) + SQ(dzL)) <= 25.0f) { killMode = BALL_BURST; Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_HIT_THUNDER); if ((bossGnd->flyMode >= GND_FLY_VOLLEY) && (this->work[FHGFIRE_RETURN_COUNT] >= 2)) { @@ -642,7 +644,6 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { void EnFhgFire_PhantomWarp(EnFhgFire* this, PlayState* play) { EnfHG* horse = (EnfHG*)this->actor.parent; - f32 scrollDirection; this->fwork[FHGFIRE_WARP_TEX_1_X] += 25.0f * this->fwork[FHGFIRE_WARP_TEX_SPEED]; this->fwork[FHGFIRE_WARP_TEX_1_Y] -= 40.0f * this->fwork[FHGFIRE_WARP_TEX_SPEED]; @@ -662,7 +663,8 @@ void EnFhgFire_PhantomWarp(EnFhgFire* this, PlayState* play) { } if (this->work[FHGFIRE_TIMER] > 50) { - scrollDirection = 1.0f; + f32 scrollDirection = 1.0f; + if (this->actor.params > FHGFIRE_WARP_EMERGE) { scrollDirection = -1.0f; } diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index 5a92f9128b..a065a4c040 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -283,7 +283,8 @@ void FireRock_WaitSpawnRocksFromCeiling(EnFireRock* this, PlayState* play) { } else { this->playerNearby = 0; } - if (BREG(0) != 0) { + + if (OOT_DEBUG && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 255, 0, 255, 4, play->state.gfxCtx); @@ -309,6 +310,7 @@ void EnFireRock_Update(Actor* thisx, PlayState* play) { s16 setCollision; Player* player = GET_PLAYER(play); Actor* playerActor = &GET_PLAYER(play)->actor; + f32 temp; if (this->timer2 != 0) { this->timer2--; @@ -319,8 +321,6 @@ void EnFireRock_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->type != FIRE_ROCK_CEILING_SPOT_SPAWNER) { - f32 temp; - this->rockRotation.x += this->angularVelocity.x; this->rockRotation.y += this->angularVelocity.y; this->rockRotation.z += this->angularVelocity.z; diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index d48103610b..5fe572eb0b 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -287,8 +287,8 @@ void EnFirefly_SetupDisturbDiveAttack(EnFirefly* this) { this->skelAnime.playSpeed = 3.0f; this->actor.shape.rot.x = 0x1554; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; - this->actor.speed = 3.0f; this->timer = 50; + this->actor.speed = 3.0f; this->actionFunc = EnFirefly_DisturbDiveAttack; } diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 051e5e1cb8..1ebc39c90a 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -472,11 +472,11 @@ void EnFish_Dropped_FlopOnGround(EnFish* this, PlayState* play) { void EnFish_Dropped_SetupSwimAway(EnFish* this) { this->actor.home.pos = this->actor.world.pos; - this->actor.flags |= ACTOR_FLAG_4; - this->timer = 200; this->actor.gravity = 0.0f; this->actor.minVelocityY = 0.0f; this->actor.shape.yOffset = 0.0f; + this->actor.flags |= ACTOR_FLAG_4; + this->timer = 200; EnFish_SetInWaterAnimation(this); this->actionFunc = EnFish_Dropped_SwimAway; this->unk_250 = UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2; @@ -624,6 +624,8 @@ void EnFish_UpdateCutscene(EnFish* this, PlayState* play) { f32 lerp; s32 bgId; + if (play) {} + if (cue == NULL) { // "Warning : DEMO ended without dousa (action) 3 termination being called" PRINTF("Warning : dousa 3 消滅 が呼ばれずにデモが終了した(%s %d)(arg_data 0x%04x)\n", "../z_en_sakana.c", 1169, diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index c6d57d2385..955cc02db3 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -723,20 +723,17 @@ void EnFr_ListeningToOcarinaNotes(EnFr* this, PlayState* play) { } void EnFr_ChildSong(EnFr* this, PlayState* play) { - EnFr* frog; - u8 songIndex; - if (this->jumpCounter < 48) { if (this->jumpCounter % 4 == 0) { EnFr_SetupJumpingUp(this, sJumpOrder[(this->jumpCounter >> 2) & 7]); } } else { - songIndex = this->songIndex; - if (songIndex == FROG_STORMS) { + if (this->songIndex == FROG_STORMS) { this->actor.textId = 0x40AA; EnFr_SetupReward(this, play, false); - } else if (!FROG_HAS_SONG_BEEN_PLAYED(songIndex)) { - frog = sEnFrPointers.frogs[sSongToFrog[songIndex]]; + } else if (!FROG_HAS_SONG_BEEN_PLAYED(this->songIndex)) { + EnFr* frog = sEnFrPointers.frogs[sSongToFrog[this->songIndex]]; + Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); if (frog->actionFunc == EnFr_ChooseJumpFromLogSpot) { frog->isJumpingUp = true; @@ -800,10 +797,10 @@ void EnFr_CheckOcarinaInputFrogSong(u8 ocarinaNote) { void EnFr_DeactivateButterfly(void) { s32 frogIndex; - EnFr* frog; for (frogIndex = 0; frogIndex < ARRAY_COUNT(sEnFrPointers.frogs); frogIndex++) { - frog = sEnFrPointers.frogs[frogIndex]; + EnFr* frog = sEnFrPointers.frogs[frogIndex]; + frog->isButterflyDrawn = false; } } @@ -863,21 +860,18 @@ void EnFr_OcarinaMistake(EnFr* this, PlayState* play) { } void EnFr_ContinueFrogSong(EnFr* this, PlayState* play) { - s32 counter; - EnFr* frog; - s32 i; - if (this->frogSongTimer == 0) { EnFr_OcarinaMistake(this, play); } else { this->frogSongTimer--; if (play->msgCtx.msgMode == MSGMODE_FROGS_PLAYING) { - counter = 0; + s32 counter = 0; + s32 i; + for (i = 0; i < ARRAY_COUNT(sEnFrPointers.frogs); i++) { - frog = sEnFrPointers.frogs[i]; - if (frog != NULL && frog->actionFunc == EnFr_ChooseJumpFromLogSpot) { - continue; - } else { + EnFr* frog = sEnFrPointers.frogs[i]; + + if (frog == NULL || frog->actionFunc != EnFr_ChooseJumpFromLogSpot) { counter++; } } @@ -971,8 +965,6 @@ void EnFr_SetReward(EnFr* this, PlayState* play) { } void EnFr_Deactivate(EnFr* this, PlayState* play) { - EnFr* frogLoop1; - EnFr* frogLoop2; s32 frogIndex; // Originally was going to have separate butterfly actor @@ -983,28 +975,30 @@ void EnFr_Deactivate(EnFr* this, PlayState* play) { } for (frogIndex = 0; frogIndex < ARRAY_COUNT(sEnFrPointers.frogs); frogIndex++) { - frogLoop1 = sEnFrPointers.frogs[frogIndex]; - if (frogLoop1 == NULL) { + EnFr* frog = sEnFrPointers.frogs[frogIndex]; + + if (frog == NULL) { PRINTF(VT_COL(RED, WHITE)); // "There are no frogs!?" PRINTF("%s[%d]カエルがいない!?\n", "../z_en_fr.c", 1604); PRINTF(VT_RST); return; - } else if (frogLoop1->isDeactivating != true) { + } else if (frog->isDeactivating != true) { return; } } for (frogIndex = 0; frogIndex < ARRAY_COUNT(sEnFrPointers.frogs); frogIndex++) { - frogLoop2 = sEnFrPointers.frogs[frogIndex]; - if (frogLoop2 == NULL) { + EnFr* frog = sEnFrPointers.frogs[frogIndex]; + + if (frog == NULL) { PRINTF(VT_COL(RED, WHITE)); // "There are no frogs!?" PRINTF("%s[%d]カエルがいない!?\n", "../z_en_fr.c", 1618); PRINTF(VT_RST); return; } - frogLoop2->isDeactivating = false; + frog->isDeactivating = false; } play->msgCtx.ocarinaMode = OCARINA_MODE_04; @@ -1035,11 +1029,12 @@ void EnFr_SetIdle(EnFr* this, PlayState* play) { void EnFr_UpdateIdle(Actor* thisx, PlayState* play) { EnFr* this = (EnFr*)thisx; - if (BREG(0)) { + if (OOT_DEBUG && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx); } + this->jumpCounter++; this->actionFunc(this, play); } diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index 8a67e84b55..64ae25bba1 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -256,6 +256,8 @@ void EnFz_Damaged(EnFz* this, PlayState* play, Vec3f* vec, s32 numEffects, f32 u f32 scale; s32 life; + accel.x = accel.z = 0.0f; + accel.y = -1.0f; primColor.r = 155; primColor.g = 255; primColor.b = 255; @@ -263,8 +265,6 @@ void EnFz_Damaged(EnFz* this, PlayState* play, Vec3f* vec, s32 numEffects, f32 u envColor.r = 200; envColor.g = 200; envColor.b = 200; - accel.x = accel.z = 0.0f; - accel.y = -1.0f; for (i = 0; i < numEffects; i++) { scale = Rand_CenteredFloat(0.3f) + 0.6f; @@ -476,10 +476,10 @@ void EnFz_MoveTowardsPlayer(EnFz* this, PlayState* play) { void EnFz_SetupAimForFreeze(EnFz* this) { this->state = 1; - this->timer = 40; - this->actionFunc = EnFz_AimForFreeze; this->speedXZ = 0.0f; this->actor.speed = 0.0f; + this->timer = 40; + this->actionFunc = EnFz_AimForFreeze; } void EnFz_AimForFreeze(EnFz* this, PlayState* play) { @@ -547,16 +547,16 @@ void EnFz_BlowSmoke(EnFz* this, PlayState* play) { void EnFz_SetupDespawn(EnFz* this, PlayState* play) { this->state = 0; + this->speedXZ = 0.0f; + this->actor.gravity = 0.0f; + this->actor.velocity.y = 0.0f; + this->actor.speed = 0.0f; this->updateBgInfo = true; this->isFreezing = false; this->isDespawning = true; this->actor.flags &= ~ACTOR_FLAG_0; this->isActive = false; this->timer = 60; - this->speedXZ = 0.0f; - this->actor.gravity = 0.0f; - this->actor.velocity.y = 0.0f; - this->actor.speed = 0.0f; Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x60); this->actionFunc = EnFz_Despawn; @@ -573,9 +573,9 @@ void EnFz_SetupMelt(EnFz* this) { this->isFreezing = false; this->isDespawning = true; this->actor.flags &= ~ACTOR_FLAG_0; - this->actionFunc = EnFz_Melt; this->actor.speed = 0.0f; this->speedXZ = 0.0f; + this->actionFunc = EnFz_Melt; } void EnFz_Melt(EnFz* this, PlayState* play) { @@ -859,10 +859,10 @@ void EnFz_UpdateIceSmoke(EnFz* this, PlayState* play) { } void EnFz_DrawEffects(EnFz* this, PlayState* play) { - EnFzEffect* effect = this->effects; s16 i; GraphicsContext* gfxCtx = play->state.gfxCtx; u8 materialFlag = 0; + EnFzEffect* effect = this->effects; OPEN_DISPS(gfxCtx, "../z_en_fz.c", 1384); @@ -872,7 +872,7 @@ void EnFz_DrawEffects(EnFz* this, PlayState* play) { if (effect->type > 0) { gDPPipeSync(POLY_XLU_DISP++); - if (!materialFlag) { + if (materialFlag == 0) { gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gFreezardSteamStartDL)); materialFlag++; } diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index 48ddb587d0..50e69b64ec 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -80,6 +80,8 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { s32 pad; EnGSwitch* this = (EnGSwitch*)thisx; + if (play) {} + this->type = (this->actor.params >> 0xC) & 0xF; this->switchFlag = this->actor.params & 0x3F; this->numEffects = EN_GSWITCH_EFFECT_COUNT; @@ -443,7 +445,8 @@ void EnGSwitch_Update(Actor* thisx, PlayState* play) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } } - if (BREG(0) && (this->type == ENGSWITCH_SILVER_TRACKER)) { + + if (OOT_DEBUG && BREG(0) != 0 && (this->type == ENGSWITCH_SILVER_TRACKER)) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx); @@ -456,6 +459,9 @@ void EnGSwitch_DrawPot(Actor* thisx, PlayState* play) { if (!this->broken) { OPEN_DISPS(play->state.gfxCtx, "../z_en_g_switch.c", 918); + + if (1) {} + Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_g_switch.c", 925), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -491,12 +497,12 @@ void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) { void EnGSwitch_SpawnEffects(EnGSwitch* this, Vec3f* pos, s16 scale, s16 colorIdx) { EnGSwitchEffect* effect = this->effects; s16 i; + Vec3f baseVel; + f32 pitch; + f32 yaw; for (i = 0; i < this->numEffects; i++, effect++) { if (!effect->flag) { - Vec3f baseVel; - f32 pitch; - f32 yaw; effect->pos = *pos; effect->scale = scale; diff --git a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c index 0aea936670..2ccb862d62 100644 --- a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c +++ b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c @@ -391,14 +391,14 @@ void EnGanonMant_Draw(Actor* thisx, PlayState* play) { f32 diffHalfDist; f32 yDiff; f32 yaw; - Vec3f* rightPos; - Vec3f* leftPos; - s16 strandIdx; - Vec3f midpoint; - s16 nextStrandIdx; if (this->updateHasRun) { // Only run this if update has run since last draw + Vec3f* rightPos; + Vec3f* leftPos; + s16 strandIdx; + Vec3f midpoint; + s16 nextStrandIdx; // Choose endpoints if (this->attachRightArmTimer != 0.0f) { diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/src/overlays/actors/ovl_En_Gb/z_en_gb.c index 4ee2521ae9..aafcf0d06c 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -183,6 +183,8 @@ void EnGb_Init(Actor* thisx, PlayState* play) { this->actionTimer = (s16)Rand_ZeroFloat(100.0f) + 100; for (i = 0; i < ARRAY_COUNT(sCagedSoulPositions); i++) { + s32 pad; + this->cagedSouls[i].infoIdx = (s32)Rand_ZeroFloat(30.0f) % 3; this->cagedSouls[i].unk_14.x = this->cagedSouls[i].translation.x = sCagedSoulPositions[i].x + this->dyna.actor.world.pos.x; @@ -280,6 +282,8 @@ void func_80A2F83C(EnGb* this, PlayState* play) { } } if (Actor_TalkOfferAccepted(&this->dyna.actor, play)) { + s32 pad; + switch (func_8002F368(play)) { case EXCH_ITEM_NONE: func_80A2F180(this); @@ -294,9 +298,7 @@ void func_80A2F83C(EnGb* this, PlayState* play) { this->actionFunc = func_80A2FA50; break; } - return; - } - if (this->dyna.actor.xzDistToPlayer < 100.0f) { + } else if (this->dyna.actor.xzDistToPlayer < 100.0f) { Actor_OfferTalkExchangeEquiCylinder(&this->dyna.actor, play, 100.0f, EXCH_ITEM_BOTTLE_POE); } } @@ -440,7 +442,6 @@ void EnGb_Draw(Actor* thisx, PlayState* play) { void EnGb_UpdateCagedSouls(EnGb* this, PlayState* play) { f32 temp_f20; - s16 rot; s32 i; for (i = 0; i < 4; i++) { @@ -499,12 +500,14 @@ void EnGb_UpdateCagedSouls(EnGb* this, PlayState* play) { this->cagedSouls[i].translation.y = this->cagedSouls[i].unk_14.y + temp_f20; this->cagedSouls[i].translation.z = this->cagedSouls[i].unk_14.z; } else if (i == 1) { - rot = this->dyna.actor.world.rot.y - 0x4000; + s16 rot = this->dyna.actor.world.rot.y - 0x4000; + this->cagedSouls[i].translation.x = this->cagedSouls[i].unk_14.x + Math_SinS(rot) * temp_f20; this->cagedSouls[i].translation.z = this->cagedSouls[i].unk_14.z + Math_CosS(rot) * temp_f20; this->cagedSouls[i].translation.y = this->cagedSouls[i].unk_14.y; } else { - rot = this->dyna.actor.world.rot.y + 0x4000; + s16 rot = this->dyna.actor.world.rot.y + 0x4000; + this->cagedSouls[i].translation.x = this->cagedSouls[i].unk_14.x + Math_SinS(rot) * temp_f20; this->cagedSouls[i].translation.z = this->cagedSouls[i].unk_14.z + Math_CosS(rot) * temp_f20; this->cagedSouls[i].translation.y = this->cagedSouls[i].unk_14.y; diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 705faf6041..e1317e5ba9 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -112,8 +112,8 @@ void EnGe2_ChangeAction(EnGe2* this, s32 i) { } void EnGe2_Init(Actor* thisx, PlayState* play) { - s32 pad; EnGe2* this = (EnGe2*)thisx; + s16 params = this->actor.params; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoPurpleSkel, NULL, this->jointTable, this->morphTable, 22); @@ -133,7 +133,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { this->actor.world.rot.z = 0; this->actor.shape.rot.z = 0; - switch (this->actor.params & 0xFF) { + switch (thisx->params & 0xFF) { case GE2_TYPE_PATROLLING: EnGe2_ChangeAction(this, GE2_ACTION_WALK); if (EnGe2_CheckCarpentersFreed()) { @@ -156,6 +156,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { break; default: ASSERT(0, "0", "../z_en_ge2.c", 418); + break; } this->stateFlags = 0; @@ -165,7 +166,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { this->actor.minVelocityY = -4.0f; this->actor.gravity = -1.0f; this->walkDirection = this->actor.world.rot.y; - this->walkDuration = ((this->actor.params & 0xFF00) >> 8) * 10; + this->walkDuration = ((thisx->params & 0xFF00) >> 8) * 10; } void EnGe2_Destroy(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index ea9772ca03..ba58e9dbdd 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -274,7 +274,6 @@ s32 EnGeldB_ReactToPlayer(PlayState* play, EnGeldB* this, s16 arg2) { Actor* thisx = &this->actor; s16 angleToWall; s16 angleToLink; - Actor* bomb; angleToWall = thisx->wallYaw - thisx->shape.rot.y; angleToWall = ABS(angleToWall); @@ -306,22 +305,29 @@ s32 EnGeldB_ReactToPlayer(PlayState* play, EnGeldB* this, s16 arg2) { EnGeldB_SetupRollBack(this); return true; } - } else if ((bomb = Actor_FindNearby(play, thisx, -1, ACTORCAT_EXPLOSIVE, 80.0f)) != NULL) { - thisx->shape.rot.y = thisx->world.rot.y = thisx->yawTowardsPlayer; - if (((thisx->bgCheckFlags & BGCHECKFLAG_WALL) && (angleToWall < 0x2EE0)) || (bomb->id == ACTOR_EN_BOM_CHU)) { - if ((bomb->id == ACTOR_EN_BOM_CHU) && (Actor_WorldDistXYZToActor(thisx, bomb) < 80.0f) && - ((s16)(thisx->shape.rot.y - (bomb->world.rot.y - 0x8000)) < 0x3E80)) { - EnGeldB_SetupJump(this); - return true; + } else { + Actor* bomb = Actor_FindNearby(play, thisx, -1, ACTORCAT_EXPLOSIVE, 80.0f); + + if (bomb != NULL) { + thisx->shape.rot.y = thisx->world.rot.y = thisx->yawTowardsPlayer; + if (((thisx->bgCheckFlags & BGCHECKFLAG_WALL) && (angleToWall < 0x2EE0)) || + (bomb->id == ACTOR_EN_BOM_CHU)) { + if ((bomb->id == ACTOR_EN_BOM_CHU) && (Actor_WorldDistXYZToActor(thisx, bomb) < 80.0f) && + ((s16)(thisx->shape.rot.y - (bomb->world.rot.y - 0x8000)) < 0x3E80)) { + EnGeldB_SetupJump(this); + return true; + } else { + EnGeldB_SetupSidestep(this, play); + return true; + } } else { - EnGeldB_SetupSidestep(this, play); + EnGeldB_SetupRollBack(this); return true; } - } else { - EnGeldB_SetupRollBack(this); - return true; } - } else if (arg2) { + } + + if (arg2) { if (angleToLink >= 0x1B58) { EnGeldB_SetupSidestep(this, play); return true; diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index e05caa58fa..0f6569d869 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -79,6 +79,7 @@ ActorInit En_GirlA_InitVars = { /**/ NULL, }; +#if OOT_DEBUG static char* sShopItemDescriptions[] = { "デクの実×5 ", // "Deku nut x5" "矢×30 ", // "Arrow x30" @@ -131,6 +132,7 @@ static char* sShopItemDescriptions[] = { "赤クスリ ", // "Red medicine" "赤クスリ " // "Red medicine" }; +#endif static s16 sMaskShopItems[8] = { ITEM_MASK_KEATON, ITEM_MASK_SPOOKY, ITEM_MASK_SKULL, ITEM_MASK_BUNNY_HOOD, @@ -895,12 +897,11 @@ void EnGirlA_Noop(EnGirlA* this, PlayState* play) { void EnGirlA_SetItemDescription(PlayState* play, EnGirlA* this) { ShopItemEntry* tmp = &shopItemEntries[this->actor.params]; s32 params = this->actor.params; - s32 maskId; - s32 isMaskFreeToBorrow; if ((this->actor.params >= SI_KEATON_MASK) && (this->actor.params <= SI_MASK_OF_TRUTH)) { - maskId = this->actor.params - SI_KEATON_MASK; - isMaskFreeToBorrow = false; + s32 maskId = this->actor.params - SI_KEATON_MASK; + s32 isMaskFreeToBorrow = false; + switch (this->actor.params) { case SI_KEATON_MASK: if (GET_ITEMGETINF(ITEMGETINF_38)) { diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index a281827ae4..14a22e3408 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -397,13 +397,13 @@ void EnGoma_SetupDead(EnGoma* this) { } void EnGoma_Dead(EnGoma* this, PlayState* play) { - Vec3f accel; - Vec3f pos; - SkelAnime_Update(&this->skelanime); Math_ApproachZeroF(&this->actor.speed, 1.0f, 2.0f); if (this->actionTimer == 2) { + Vec3f accel; + Vec3f pos; + pos.x = this->actor.world.pos.x; pos.y = (this->actor.world.pos.y + 5.0f) - 10.0f; pos.z = this->actor.world.pos.z; @@ -604,7 +604,6 @@ void EnGoma_LookAtPlayer(EnGoma* this, PlayState* play) { } void EnGoma_UpdateHit(EnGoma* this, PlayState* play) { - static Vec3f sShieldKnockbackVel = { 0.0f, 0.0f, 20.0f }; Player* player = GET_PLAYER(play); if (this->hurtTimer != 0) { @@ -632,6 +631,8 @@ void EnGoma_UpdateHit(EnGoma* this, PlayState* play) { this->actor.velocity.y = 0.0f; this->actor.speed = -5.0f; } else { + static Vec3f sShieldKnockbackVel = { 0.0f, 0.0f, 20.0f }; + Matrix_RotateY(BINANG_TO_RAD_ALT(player->actor.shape.rot.y), MTXMODE_NEW); Matrix_MultVec3f(&sShieldKnockbackVel, &this->shieldKnockbackVel); this->invincibilityTimer = 5; diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 7742d2f572..59068e93d6 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -84,7 +84,13 @@ static ColliderJntSphInit sJntSphInit = { static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_HEAVY }; -static f32 sUnused[] = { 10.0f, 9.2f }; +static f32 sSpeeds[] = { 10.0f, 9.2f }; + +#if OOT_DEBUG +#define EN_GOROIWA_SPEED(this) (R_EN_GOROIWA_SPEED * 0.01f) +#else +#define EN_GOROIWA_SPEED(this) sSpeeds[(this)->isInKokiri] +#endif void EnGoroiwa_UpdateCollider(EnGoroiwa* this) { static f32 yOffsets[] = { 0.0f, 59.5f }; @@ -129,10 +135,14 @@ s32 EnGoroiwa_Vec3fNormalize(Vec3f* ret, Vec3f* a) { void EnGoroiwa_SetSpeed(EnGoroiwa* this, PlayState* play) { if (play->sceneId == SCENE_KOKIRI_FOREST) { this->isInKokiri = true; +#if OOT_DEBUG R_EN_GOROIWA_SPEED = 920; +#endif } else { this->isInKokiri = false; +#if OOT_DEBUG R_EN_GOROIWA_SPEED = 1000; +#endif } } @@ -242,11 +252,13 @@ s32 EnGoroiwa_GetAscendDirection(EnGoroiwa* this, PlayState* play) { Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint; if (nextPointPos->x == currentPointPos->x && nextPointPos->z == currentPointPos->z) { +#if OOT_DEBUG if (nextPointPos->y == currentPointPos->y) { // "Error: Invalid path data (points overlap)" PRINTF("Error : レールデータ不正(点が重なっている)"); PRINTF("(%s %d)(arg_data 0x%04x)\n", "../z_en_gr.c", 559, this->actor.params); } +#endif if (nextPointPos->y > currentPointPos->y) { return 1; @@ -299,7 +311,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) { s32 pad; Vec3s* nextPointPos; - Math_StepToF(&this->actor.speed, R_EN_GOROIWA_SPEED * 0.01f, 0.3f); + Math_StepToF(&this->actor.speed, EN_GOROIWA_SPEED(this), 0.3f); Actor_UpdateVelocityXZGravity(&this->actor); path = &play->pathList[this->actor.params & 0xFF]; nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; @@ -322,7 +334,7 @@ s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) { nextPointPosF.x = nextPointPos->x; nextPointPosF.y = nextPointPos->y; nextPointPosF.z = nextPointPos->z; - Math_StepToF(&this->actor.speed, R_EN_GOROIWA_SPEED * 0.01f, 0.3f); + Math_StepToF(&this->actor.speed, EN_GOROIWA_SPEED(this), 0.3f); if (Math3D_Vec3fDistSq(&nextPointPosF, &this->actor.world.pos) < SQ(5.0f)) { Math_Vec3f_Diff(&nextPointPosF, &this->actor.world.pos, &posDiff); } else { @@ -346,7 +358,7 @@ s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) { Path* path = &play->pathList[this->actor.params & 0xFF]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; - Math_StepToF(&this->actor.velocity.y, (R_EN_GOROIWA_SPEED * 0.01f) * 0.5f, 0.18f); + Math_StepToF(&this->actor.velocity.y, EN_GOROIWA_SPEED(this) * 0.5f, 0.18f); this->actor.world.pos.x = nextPointPos->x; this->actor.world.pos.z = nextPointPos->z; return Math_StepToF(&this->actor.world.pos.y, nextPointPos->y, fabsf(this->actor.velocity.y)); @@ -435,7 +447,6 @@ void EnGoroiwa_UpdateRotation(EnGoroiwa* this, PlayState* play) { Vec3f rollAxis; Vec3f unitRollAxis; MtxF mtx; - Vec3f unusedDiff; if (this->stateFlags & ENGOROIWA_RETAIN_ROT_SPEED) { rollAngleDiff = this->prevRollAngleDiff; @@ -446,6 +457,8 @@ void EnGoroiwa_UpdateRotation(EnGoroiwa* this, PlayState* play) { rollAngleDiff *= this->rollRotSpeed; rollAxisPtr = &rollAxis; if (this->stateFlags & ENGOROIWA_RETAIN_ROT_SPEED) { + Vec3f unusedDiff; + /* * EnGoroiwa_GetPrevWaypointDiff has no side effects and its result goes unused, * its result was probably meant to be used instead of the actor's velocity in the diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 2563fd6bac..3964881ebe 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -139,9 +139,15 @@ s32 func_80A4E3EC(EnGs* this, PlayState* play) { void func_80A4E470(EnGs* this, PlayState* play) { Player* player = GET_PLAYER(play); +#if OOT_DEBUG bREG(15) = 0; +#endif + if (this->actor.xzDistToPlayer <= 100.0f) { +#if OOT_DEBUG bREG(15) = 1; +#endif + if (this->unk_19D == 0) { player->stateFlags2 |= PLAYER_STATE2_23; if (player->stateFlags2 & PLAYER_STATE2_24) { @@ -285,19 +291,6 @@ void func_80A4EB3C(EnGs* this, PlayState* play) { } void func_80A4ED34(EnGs* this, PlayState* play) { - static Color_RGBA8 flashRed = { 255, 50, 50, 0 }; - static Color_RGBA8 flashBlue = { 50, 50, 255, 0 }; - static Color_RGBA8 baseWhite = { 255, 255, 255, 0 }; - static Vec3f dustAccel = { 0.0f, -0.3f, 0.0f }; - static Color_RGBA8 dustPrim = { 200, 200, 200, 128 }; - static Color_RGBA8 dustEnv = { 100, 100, 100, 0 }; - static Vec3f bomb2Velocity = { 0.0f, 0.0f, 0.0f }; - static Vec3f bomb2Accel = { 0.0f, 0.0f, 0.0f }; - u8 i; - Vec3f dustPos; - Vec3f dustVelocity; - Vec3f bomb2Pos; - if (this->unk_19F == 0) { this->unk_200 = 40; this->unk_19F++; @@ -312,6 +305,10 @@ void func_80A4ED34(EnGs* this, PlayState* play) { } if (this->unk_19F == 2) { + static Color_RGBA8 flashRed = { 255, 50, 50, 0 }; + static Color_RGBA8 flashBlue = { 50, 50, 255, 0 }; + static Color_RGBA8 baseWhite = { 255, 255, 255, 0 }; + this->unk_200--; Color_RGBA8_Copy(&this->flashColor, &baseWhite); if ((this->unk_200 < 80) && ((this->unk_200 % 20) < 8)) { @@ -337,7 +334,15 @@ void func_80A4ED34(EnGs* this, PlayState* play) { } if (this->unk_19F == 3) { + u8 i; + for (i = 0; i < 3; i++) { + static Vec3f dustAccel = { 0.0f, -0.3f, 0.0f }; + static Color_RGBA8 dustPrim = { 200, 200, 200, 128 }; + static Color_RGBA8 dustEnv = { 100, 100, 100, 0 }; + Vec3f dustPos; + Vec3f dustVelocity; + dustVelocity.x = Rand_CenteredFloat(15.0f); dustVelocity.y = Rand_ZeroFloat(-1.0f); dustVelocity.z = Rand_CenteredFloat(15.0f); @@ -362,6 +367,10 @@ void func_80A4ED34(EnGs* this, PlayState* play) { if (this->unk_19F == 4) { Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1); if (this->actor.bgCheckFlags & (BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING)) { + static Vec3f bomb2Velocity = { 0.0f, 0.0f, 0.0f }; + static Vec3f bomb2Accel = { 0.0f, 0.0f, 0.0f }; + Vec3f bomb2Pos; + bomb2Pos.x = this->actor.world.pos.x; bomb2Pos.y = this->actor.world.pos.y; bomb2Pos.z = this->actor.world.pos.z; diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 905c1213c7..8fd6c9d6ff 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -10,7 +10,7 @@ #define FLAGS ACTOR_FLAG_4 -void EnHeishi1_Init(Actor* thisx, PlayState* play); +void EnHeishi1_Init(Actor* thisx, PlayState* play2); void EnHeishi1_Destroy(Actor* thisx, PlayState* play); void EnHeishi1_Update(Actor* thisx, PlayState* play); void EnHeishi1_Draw(Actor* thisx, PlayState* play); @@ -63,8 +63,8 @@ static s32 sBgCamIndices[] = { static s16 sWaypoints[] = { 0, 4, 1, 5, 2, 6, 3, 7 }; -void EnHeishi1_Init(Actor* thisx, PlayState* play) { - s32 pad; +void EnHeishi1_Init(Actor* thisx, PlayState* play2) { + PlayState* play = play2; EnHeishi1* this = (EnHeishi1*)thisx; Vec3f rupeePos; s32 i; @@ -182,7 +182,7 @@ void EnHeishi1_Walk(EnHeishi1* this, PlayState* play) { Math_ApproachF(&this->headAngle, this->headAngleTarget, this->headTurnSpeedScale, this->headTurnSpeedMax); - if ((this->path == BREG(1)) && (BREG(0) != 0)) { + if (OOT_DEBUG && (this->path == BREG(1)) && (BREG(0) != 0)) { PRINTF(VT_FGCOL(RED) " 種類 %d\n" VT_RST, this->path); PRINTF(VT_FGCOL(RED) " ぱす %d\n" VT_RST, this->waypoint); PRINTF(VT_FGCOL(RED) " 反転 %d\n" VT_RST, this->bodyTurnSpeed); @@ -300,7 +300,7 @@ void EnHeishi1_Wait(EnHeishi1* this, PlayState* play) { Math_ApproachF(&this->headAngle, this->headAngleTarget, this->headTurnSpeedScale, this->headTurnSpeedMax + this->headTurnSpeedMax); - if ((this->path == BREG(1)) && (BREG(0) != 0)) { + if (OOT_DEBUG && (this->path == BREG(1)) && (BREG(0) != 0)) { PRINTF(VT_FGCOL(GREEN) " 種類 %d\n" VT_RST, this->path); PRINTF(VT_FGCOL(GREEN) " ぱす %d\n" VT_RST, this->waypoint); PRINTF(VT_FGCOL(GREEN) " 反転 %d\n" VT_RST, this->bodyTurnSpeed); @@ -490,7 +490,7 @@ void EnHeishi1_Draw(Actor* thisx, PlayState* play) { this); func_80033C30(&this->actor.world.pos, &matrixScale, 0xFF, play); - if ((this->path == BREG(1)) && (BREG(0) != 0)) { + if (OOT_DEBUG && (this->path == BREG(1)) && (BREG(0) != 0)) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y + 100.0f, this->actor.world.pos.z, 17000, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index c7e05bc863..7255fba4aa 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -17,7 +17,7 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play); void EnHeishi2_Destroy(Actor* thisx, PlayState* play); void EnHeishi2_Update(Actor* thisx, PlayState* play); -void EnHeishi2_Draw(Actor* thisx, PlayState* play); +void EnHeishi2_Draw(Actor* thisx, PlayState* play2); void EnHeishi2_DrawKingGuard(Actor* thisx, PlayState* play); void EnHeishi2_DoNothing1(EnHeishi2* this, PlayState* play); @@ -389,7 +389,6 @@ void func_80A5399C(EnHeishi2* this, PlayState* play) { void func_80A53AD4(EnHeishi2* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 exchangeItemId; s16 yawDiffTemp; s16 yawDiff; @@ -400,8 +399,10 @@ void func_80A53AD4(EnHeishi2* this, PlayState* play) { this->actor.textId = 0x200E; } this->unk_300 = TEXT_STATE_DONE; + if (Actor_TalkOfferAccepted(&this->actor, play)) { - exchangeItemId = func_8002F368(play); + s32 exchangeItemId = func_8002F368(play); + if (exchangeItemId == EXCH_ITEM_ZELDAS_LETTER) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); player->actor.textId = 0x2010; @@ -410,12 +411,14 @@ void func_80A53AD4(EnHeishi2* this, PlayState* play) { } else if (exchangeItemId != EXCH_ITEM_NONE) { player->actor.textId = 0x200F; } - } else { - yawDiffTemp = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; - yawDiff = ABS(yawDiffTemp); - if (!(120.0f < this->actor.xzDistToPlayer) && (yawDiff < 0x4300)) { - Actor_OfferTalkExchangeEquiCylinder(&this->actor, play, 100.0f, EXCH_ITEM_ZELDAS_LETTER); - } + return; + } + + yawDiffTemp = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + yawDiff = ABS(yawDiffTemp); + + if (!(120.0f < this->actor.xzDistToPlayer) && (yawDiff < 0x4300)) { + Actor_OfferTalkExchangeEquiCylinder(&this->actor, play, 100.0f, EXCH_ITEM_ZELDAS_LETTER); } } @@ -834,9 +837,9 @@ void EnHeishi2_DrawKingGuard(Actor* thisx, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_en_heishi2.c", 1777); } -void EnHeishi2_Draw(Actor* thisx, PlayState* play) { +void EnHeishi2_Draw(Actor* thisx, PlayState* play2) { + PlayState* play = (PlayState*)play2; EnHeishi2* this = (EnHeishi2*)thisx; - Mtx* mtx; s32 linkChildObjectSlot; OPEN_DISPS(play->state.gfxCtx, "../z_en_heishi2.c", 1792); @@ -848,6 +851,8 @@ void EnHeishi2_Draw(Actor* thisx, PlayState* play) { if ((this->type == 5) && GET_INFTABLE(INFTABLE_77)) { linkChildObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_LINK_CHILD); if (linkChildObjectSlot >= 0) { + Mtx* mtx; + Matrix_Put(&this->mtxf_330); Matrix_Translate(-570.0f, 0.0f, 0.0f, MTXMODE_APPLY); Matrix_RotateZ(DEG_TO_RAD(70), MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index b0a853b023..691f0bb641 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -211,6 +211,8 @@ void func_80A56614(EnHeishi4* this, PlayState* play) { } void func_80A5673C(EnHeishi4* this, PlayState* play) { + f32 frames; + if (GET_EVENTCHKINF(EVENTCHKINF_45)) { PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ マスターソード祝入手! ☆☆☆☆☆ \n" VT_RST); Actor_Kill(&this->actor); @@ -219,7 +221,7 @@ void func_80A5673C(EnHeishi4* this, PlayState* play) { this->unk_284 = 0; if (GET_EVENTCHKINF(EVENTCHKINF_80)) { if (!GET_INFTABLE(INFTABLE_6C)) { - f32 frames = Animation_GetLastFrame(&gEnHeishiDyingGuardAnim_00C444); + frames = Animation_GetLastFrame(&gEnHeishiDyingGuardAnim_00C444); Animation_Change(&this->skelAnime, &gEnHeishiDyingGuardAnim_00C444, 1.0f, 0.0f, (s16)frames, ANIMMODE_LOOP, -10.0f); this->actor.textId = 0x7007; diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 351b29267a..20324e670a 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -529,14 +529,13 @@ void EnHorse_RotateToPoint(EnHorse* this, PlayState* play, Vec3f* pos, s16 turnA void EnHorse_UpdateIngoRaceInfo(EnHorse* this, PlayState* play, RaceInfo* raceInfo) { Vec3f curWaypointPos; Vec3f prevWaypointPos; - f32 playerDist; + s32 prevWaypoint; f32 sp50; s16 relPlayerYaw; f32 px; f32 pz; f32 d; f32 distSq; - s32 prevWaypoint; EnHorse_RaceWaypointPos(raceInfo->waypoints, this->curRaceWaypoint, &curWaypointPos); Math3D_RotateXZPlane(&curWaypointPos, raceInfo->waypoints[this->curRaceWaypoint].angle, &px, &pz, &d); @@ -559,14 +558,15 @@ void EnHorse_UpdateIngoRaceInfo(EnHorse* this, PlayState* play, RaceInfo* raceIn EnHorse_RotateToPoint(this, play, &curWaypointPos, 400); if (distSq < SQ(300.0f)) { - playerDist = this->actor.xzDistToPlayer; - if (playerDist < 130.0f || this->jntSph.elements[0].base.ocElemFlags & OCELEM_HIT) { + if (this->actor.xzDistToPlayer < 130.0f || this->jntSph.elements[0].base.ocElemFlags & OCELEM_HIT) { + s32 pad; + if (Math_SinS(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0.0f) { this->actor.world.rot.y -= 280; } else { this->actor.world.rot.y += 280; } - } else if (playerDist < 300.0f) { + } else if (this->actor.xzDistToPlayer < 300.0f) { if (Math_SinS(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0.0f) { this->actor.world.rot.y += 280; } else { @@ -1320,8 +1320,7 @@ void EnHorse_MountedTrot(EnHorse* this, PlayState* play) { } void EnHorse_StartGallopingInterruptable(EnHorse* this) { - this->noInputTimerMax = 0; - this->noInputTimer = 0; + this->noInputTimerMax = this->noInputTimer = 0; EnHorse_StartGalloping(this); } @@ -1334,8 +1333,7 @@ void EnHorse_StartGalloping(EnHorse* this) { } void EnHorse_MountedGallopReset(EnHorse* this) { - this->noInputTimerMax = 0; - this->noInputTimer = 0; + this->noInputTimerMax = this->noInputTimer = 0; this->action = ENHORSE_ACT_MOUNTED_GALLOP; this->animationIdx = ENHORSE_ANIM_GALLOP; this->unk_234 = 0; @@ -1498,8 +1496,7 @@ void EnHorse_Stopping(EnHorse* this, PlayState* play) { } void EnHorse_StartReversingInterruptable(EnHorse* this) { - this->noInputTimerMax = 0; - this->noInputTimer = 0; + this->noInputTimerMax = this->noInputTimer = 0; EnHorse_StartReversing(this); } @@ -1906,7 +1903,6 @@ void EnHorse_SetFollowAnimation(EnHorse* this, PlayState* play) { void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { f32 distToPlayer; - f32 angleDiff; R_EPONAS_SONG_PLAYED = false; distToPlayer = Actor_WorldDistXZToActor(&this->actor, &GET_PLAYER(play)->actor); @@ -1914,6 +1910,8 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { // First rotate if the player is behind if ((this->playerDir == PLAYER_DIR_BACK_R || this->playerDir == PLAYER_DIR_BACK_L) && (distToPlayer > 300.0f && !(this->stateFlags & ENHORSE_TURNING_TO_PLAYER))) { + f32 angleDiff; + this->animationIdx = ENHORSE_ANIM_REARING; this->stateFlags |= ENHORSE_TURNING_TO_PLAYER; this->angleToPlayer = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor); @@ -2182,6 +2180,8 @@ void EnHorse_CsJumpInit(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { f32 temp_f2; + Vec3s* jointTable; + f32 y; if (this->cutsceneFlags & 1) { EnHorse_CsMoveToPoint(this, play, cue); @@ -2210,9 +2210,6 @@ void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { } if (SkelAnime_Update(&this->skin.skelAnime) || (temp_f2 > 19.0f && this->actor.world.pos.y < (this->actor.floorHeight - this->actor.velocity.y) + 80.0f)) { - Vec3s* jointTable; - f32 y; - this->cutsceneFlags |= 1; Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -3411,8 +3408,9 @@ void EnHorse_UpdatePlayerDir(EnHorse* this, PlayState* play) { s16 angle; f32 s; f32 c; + Player* player = GET_PLAYER(play); - angle = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y; + angle = Actor_WorldYawTowardActor(&this->actor, &player->actor) - this->actor.world.rot.y; s = Math_SinS(angle); c = Math_CosS(angle); if (s > 0.8660254f) { // sin(60 degrees) diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index ed63cd139b..53c09dc472 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -136,12 +136,14 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play) Player* player = GET_PLAYER(play); s32 i; EnHorse* ingoHorse; - EnHorse* horse; + Player* player2 = player; if ((this->startTimer > 50) && !(this->startFlags & INGORACE_SET_TIMER)) { this->startFlags |= INGORACE_SET_TIMER; Interface_SetTimer(0); } else if ((this->startTimer > 80) && (player->rideActor != NULL) && !(this->startFlags & INGORACE_PLAYER_MOVE)) { + EnHorse* horse; + this->startFlags |= INGORACE_PLAYER_MOVE; horse = (EnHorse*)player->rideActor; horse->inRace = 1; @@ -175,8 +177,6 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play) } if (this->result == INGORACE_NO_RESULT) { - Player* player2 = player; - if ((player2->rideActor != NULL) && (this->playerCheck[2] == 1) && AT_FINISH_LINE(player2->rideActor)) { this->playerFinish++; if (this->playerFinish > 0) { @@ -319,6 +319,8 @@ s32 EnHorseGameCheck_UpdateMalonRace(EnHorseGameCheckBase* base, PlayState* play s32 i; Player* player = GET_PLAYER(play); EnHorse* horse; + Player* player2 = player; + f32 dist; if (!(this->raceFlags & MALONRACE_PLAYER_ON_MARK) && AT_FINISH_LINE(player->rideActor)) { this->raceFlags |= MALONRACE_PLAYER_ON_MARK; @@ -330,10 +332,12 @@ s32 EnHorseGameCheck_UpdateMalonRace(EnHorseGameCheckBase* base, PlayState* play this->raceFlags |= MALONRACE_SET_TIMER; Interface_SetTimer(0); } else if ((this->startTimer > 80) && (player->rideActor != NULL) && !(this->raceFlags & MALONRACE_PLAYER_MOVE)) { - this->raceFlags |= MALONRACE_PLAYER_MOVE; - horse = (EnHorse*)player->rideActor; + EnHorse* rideHorse; - horse->inRace = 1; + this->raceFlags |= MALONRACE_PLAYER_MOVE; + rideHorse = (EnHorse*)player->rideActor; + + rideHorse->inRace = 1; } else if ((this->startTimer > 81) && !(this->raceFlags & MALONRACE_START_SFX)) { this->raceFlags |= MALONRACE_START_SFX; Audio_PlaySfxGeneral(NA_SE_SY_START_SHOT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -342,9 +346,6 @@ s32 EnHorseGameCheck_UpdateMalonRace(EnHorseGameCheckBase* base, PlayState* play this->startTimer++; if (this->result == MALONRACE_NO_RESULT) { - Player* player2 = player; - f32 dist; - for (i = 0; i < 16; i++) { if ((this->lapCount == 0) && (i >= 8)) { break; diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index 8c50ffc8de..2eedfd0b65 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -344,8 +344,6 @@ void func_80A6A068(EnHorseLinkChild* this, PlayState* play) { f32 distFromLink; s32 animationEnded; s32 newAnimationIdx; - f32 distFromHome; - f32 distLinkFromHome; func_80A69F5C(this, play); player = GET_PLAYER(play); @@ -369,8 +367,9 @@ void func_80A6A068(EnHorseLinkChild* this, PlayState* play) { animationEnded = SkelAnime_Update(&this->skin.skelAnime); if (animationEnded || (this->animationIdx == 1) || (this->animationIdx == 0)) { if (GET_EVENTCHKINF(EVENTCHKINF_TALKED_TO_CHILD_MALON_AT_RANCH)) { - distFromHome = Math3D_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.home.pos); - distLinkFromHome = Math3D_Vec3f_DistXYZ(&player->actor.world.pos, &this->actor.home.pos); + f32 distFromHome = Math3D_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.home.pos); + f32 distLinkFromHome = Math3D_Vec3f_DistXYZ(&player->actor.world.pos, &this->actor.home.pos); + if (distLinkFromHome > 250.0f) { if (distFromHome >= 300.0f) { newAnimationIdx = 4; diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index 01a1ebc249..5b8aebc28b 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -31,7 +31,7 @@ typedef enum { void EnHorseNormal_Init(Actor* thisx, PlayState* play); void EnHorseNormal_Destroy(Actor* thisx, PlayState* play); void EnHorseNormal_Update(Actor* thisx, PlayState* play); -void EnHorseNormal_Draw(Actor* thisx, PlayState* play); +void EnHorseNormal_Draw(Actor* thisx, PlayState* play2); void func_80A6B91C(EnHorseNormal* this, PlayState* play); void func_80A6BC48(EnHorseNormal* this); @@ -333,10 +333,10 @@ void EnHorseNormal_CycleAnimations(EnHorseNormal* this, PlayState* play) { void func_80A6BC48(EnHorseNormal* this) { this->action = HORSE_WANDER; this->animationIdx = 0; - this->unk_21C = 0; - this->unk_21E = 0; this->actor.speed = 0.0f; this->unk_218 = 0.0f; + this->unk_21C = 0; + this->unk_21E = 0; Animation_Change(&this->skin.skelAnime, sAnimations[this->animationIdx], func_80A6B30C(this), 0.0f, Animation_GetLastFrame(sAnimations[this->animationIdx]), ANIMMODE_ONCE, 0.0f); } @@ -484,10 +484,10 @@ void EnHorseNormal_Wander(EnHorseNormal* this, PlayState* play) { void func_80A6C4CC(EnHorseNormal* this) { this->action = HORSE_WAIT; this->animationIdx = 0; - this->unk_21C = 0; - this->unk_21E = 0; this->actor.speed = 0.0f; this->unk_218 = 0.0f; + this->unk_21C = 0; + this->unk_21E = 0; Animation_Change(&this->skin.skelAnime, sAnimations[this->animationIdx], func_80A6B30C(this), 0.0f, Animation_GetLastFrame(sAnimations[this->animationIdx]), ANIMMODE_ONCE, 0.0f); } @@ -516,11 +516,11 @@ void EnHorseNormal_Wait(EnHorseNormal* this, PlayState* play) { void func_80A6C6B0(EnHorseNormal* this) { this->action = HORSE_WAIT_CLONE; this->animationIdx = 0; + this->actor.speed = 0.0f; + this->unk_218 = 0.0f; this->unk_21C = 0; this->unk_21E = 0; this->actor.flags |= ACTOR_FLAG_4 | ACTOR_FLAG_5; - this->actor.speed = 0.0f; - this->unk_218 = 0.0f; Animation_Change(&this->skin.skelAnime, sAnimations[this->animationIdx], func_80A6B30C(this), 0.0f, Animation_GetLastFrame(sAnimations[this->animationIdx]), ANIMMODE_ONCE, 0.0f); } @@ -648,9 +648,9 @@ void func_80A6CC88(PlayState* play, EnHorseNormal* this, Vec3f* arg2) { } } -void EnHorseNormal_Draw(Actor* thisx, PlayState* play) { +void EnHorseNormal_Draw(Actor* thisx, PlayState* play2) { EnHorseNormal* this = (EnHorseNormal*)thisx; - Mtx* mtx2; + PlayState* play = (PlayState*)play2; OPEN_DISPS(play->state.gfxCtx, "../z_en_horse_normal.c", 2224); @@ -662,7 +662,7 @@ void EnHorseNormal_Draw(Actor* thisx, PlayState* play) { if (this->action == HORSE_WAIT_CLONE) { MtxF skinMtx; - Mtx* mtx1; + Mtx* mtx; Vec3f clonePos = { 0.0f, 0.0f, 0.0f }; s16 cloneRotY; f32 distFromGround = this->actor.world.pos.y - this->actor.floorHeight; @@ -702,12 +702,12 @@ void EnHorseNormal_Draw(Actor* thisx, PlayState* play) { this->actor.shape.rot.x, cloneRotY, this->actor.shape.rot.z, clonePos.x, (this->actor.shape.yOffset * this->actor.scale.y) + clonePos.y, clonePos.z); - mtx1 = SkinMatrix_MtxFToNewMtx(play->state.gfxCtx, &skinMtx); - if (mtx1 == NULL) { + mtx = SkinMatrix_MtxFToNewMtx(play->state.gfxCtx, &skinMtx); + if (mtx == NULL) { return; } gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPMatrix(POLY_OPA_DISP++, mtx1, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); func_800A63CC(&this->actor, play, &this->skin, NULL, NULL, true, 0, SKIN_DRAW_FLAG_CUSTOM_TRANSFORMS | SKIN_DRAW_FLAG_CUSTOM_MATRIX); this->cloneCollider.dim.pos.x = clonePos.x; @@ -720,9 +720,9 @@ void EnHorseNormal_Draw(Actor* thisx, PlayState* play) { temp_f0_4 = (1.0f - (distFromGround * 0.01f)) * this->actor.shape.shadowScale; Matrix_Scale(this->actor.scale.x * temp_f0_4, 1.0f, this->actor.scale.z * temp_f0_4, MTXMODE_APPLY); Matrix_RotateY(BINANG_TO_RAD(cloneRotY), MTXMODE_APPLY); - mtx2 = MATRIX_NEW(play->state.gfxCtx, "../z_en_horse_normal.c", 2329); - if (mtx2 != NULL) { - gSPMatrix(POLY_XLU_DISP++, mtx2, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + mtx = MATRIX_NEW(play->state.gfxCtx, "../z_en_horse_normal.c", 2329); + if (mtx != NULL) { + gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gHorseShadowDL); } } diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index b0ae4a2353..7394b7c5d4 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -1106,8 +1106,6 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po u8 i; void* ptr; - if (1) {} - OPEN_DISPS(play->state.gfxCtx, "../z_en_hy.c", 2170); if (limbIndex == 15) { @@ -1143,6 +1141,8 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po rot->z += Math_CosS(this->unk_23C[limbIndex]) * 200.0f; } + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_hy.c", 2228); return false; diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c index 10d4addaeb..1528f2b20e 100644 --- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c +++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c @@ -356,9 +356,13 @@ void EnIceHono_Update(Actor* thisx, PlayState* play) { sin156 = Math_SinS(this->unk_156); sin154 = Math_SinS(this->unk_154); intensity = (Rand_ZeroOne() * 0.05f) + ((sin154 * 0.125f) + (sin156 * 0.1f)) + 0.425f; + +#if OOT_DEBUG if ((intensity > 0.7f) || (intensity < 0.2f)) { PRINTF("ありえない値(ratio = %f)\n", intensity); // "impossible value(ratio = %f)" } +#endif + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, (s16)this->actor.world.pos.y + 10, this->actor.world.pos.z, (s32)(155.0f * intensity), (s32)(210.0f * intensity), (s32)(255.0f * intensity), 1400); diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 618aaddfac..cc8dabe251 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -708,18 +708,13 @@ void EnIk_Die(EnIk* this, PlayState* play) { } void EnIk_UpdateDamage(EnIk* this, PlayState* play) { - f32 frames; - s16 pad; - u8 prevHealth; - s32 damageEffect; - Vec3f sparksPos; if ((this->unk_2F8 == 3) || (this->unk_2F8 == 2)) { return; } if (this->shieldCollider.base.acFlags & AC_BOUNCED) { - frames = Animation_GetLastFrame(&gIronKnuckleBlockAnim) - 2.0f; + f32 frames = Animation_GetLastFrame(&gIronKnuckleBlockAnim) - 2.0f; if (this->skelAnime.curFrame < frames) { this->skelAnime.curFrame = frames; @@ -728,7 +723,11 @@ void EnIk_UpdateDamage(EnIk* this, PlayState* play) { this->shieldCollider.base.acFlags &= ~AC_BOUNCED; this->bodyCollider.base.acFlags &= ~AC_HIT; } else if (this->bodyCollider.base.acFlags & AC_HIT) { - sparksPos = this->actor.world.pos; + s16 pad; + u8 prevHealth; + s32 damageEffect; + Vec3f sparksPos = this->actor.world.pos; + sparksPos.y += 50.0f; Actor_SetDropFlag(&this->actor, &this->bodyCollider.elem, true); @@ -1120,10 +1119,12 @@ s32 EnIk_UpdateSkelAnime(EnIk* this) { CsCmdActorCue* EnIk_GetCue(PlayState* play, s32 cueChannel) { if (play->csCtx.state != CS_STATE_IDLE) { - return play->csCtx.actorCues[cueChannel]; - } else { - return NULL; + CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel]; + + return cue; } + + return NULL; } void EnIk_SetStartPosRotFromCue(EnIk* this, PlayState* play, s32 cueChannel) { diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c index f8895308c9..f6fcd43c62 100644 --- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c +++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c @@ -88,8 +88,8 @@ void func_80A89A6C(EnJsjutan* this, PlayState* play) { Vtx* phi_s0_2; Vec3f sp108; Vec3f spFC; - Actor* actorProfessor; - Actor* actorBeanGuy; + f32 rotX; + f32 rotZ; f32 dxVtx; f32 dyVtx; f32 dzVtx; @@ -148,6 +148,9 @@ void func_80A89A6C(EnJsjutan* this, PlayState* play) { // Credits scene. The magic carpet man is friends with the bean guy and the lakeside professor. if ((gSaveContext.save.entranceIndex == ENTR_LON_LON_RANCH_0) && (gSaveContext.sceneLayer == 8)) { + Actor* actorProfessor; + Actor* actorBeanGuy; + isInCreditsScene = true; actorProfessor = play->actorCtx.actorLists[ACTORCAT_NPC].head; @@ -320,10 +323,6 @@ void func_80A89A6C(EnJsjutan* this, PlayState* play) { // Fancy math to smooth each part of the wave considering its neighborhood. for (i = 0; i < ARRAY_COUNT(sCarpetOddVtx); i++, carpetVtx++) { - f32 rotX; - f32 rotZ; - s32 pad; - // Carpet size is 12x12. if ((i % 12) == 11) { // Last column. j = i - 1; diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index c24e366fe7..5d6e3416a8 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -116,7 +116,7 @@ void func_80A90264(EnKakasi2* this, PlayState* play) { this->unk_194++; - if ((BREG(1) != 0) && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && + if (OOT_DEBUG && (BREG(1) != 0) && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y)) { this->actor.draw = func_80A90948; @@ -213,7 +213,8 @@ void EnKakasi2_Update(Actor* thisx, PlayState* play2) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } - if (BREG(0) != 0) { + + if (OOT_DEBUG && BREG(0) != 0) { if (BREG(5) != 0) { PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ this->actor.player_distance ☆☆☆☆☆ %f\n" VT_RST, this->actor.xzDistToPlayer); PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ this->hosei.x ☆☆☆☆☆ %f\n" VT_RST, this->maxSpawnDistance.x); diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index d14687b630..bd5edc270c 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -194,10 +194,14 @@ static u16 sCutFlags[] = { }; void EnKanban_SetFloorRot(EnKanban* this) { + f32 nx; + f32 ny; + f32 nz; + if (this->actor.floorPoly != NULL) { - f32 nx = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.x); - f32 ny = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y); - f32 nz = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z); + nx = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.x); + ny = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y); + nz = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z); this->floorRot.x = -Math_FAtan2F(-nz * ny, 1.0f); this->floorRot.z = Math_FAtan2F(-nx * ny, 1.0f); @@ -437,7 +441,6 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { f32 tempY; f32 tempZ; f32 tempYDistToWater; - u8 onGround; Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 30.0f, 50.0f, @@ -460,107 +463,112 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { this->actor.yDistToWater = tempYDistToWater; PRINTF(VT_RST); - onGround = (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND); - if (this->spinXFlag) { - this->spinRot.x += this->spinVel.x; - this->spinVel.x -= 0x800; - if ((this->spinRot.x <= 0) && onGround) { - this->spinRot.x = 0; - this->spinVel.x = 0; + + if (1) { + u8 onGround = (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND); + + if (this->spinXFlag) { + this->spinRot.x += this->spinVel.x; + this->spinVel.x -= 0x800; + if ((this->spinRot.x <= 0) && onGround) { + this->spinRot.x = 0; + this->spinVel.x = 0; + } + } else { + this->spinRot.x -= this->spinVel.x; + this->spinVel.x -= 0x800; + if ((this->spinRot.x >= 0) && onGround) { + this->spinRot.x = 0; + this->spinVel.x = 0; + } } - } else { - this->spinRot.x -= this->spinVel.x; - this->spinVel.x -= 0x800; - if ((this->spinRot.x >= 0) && onGround) { - this->spinRot.x = 0; - this->spinVel.x = 0; + if (this->spinVel.x < -0xC00) { + this->spinVel.x = -0xC00; } - } - if (this->spinVel.x < -0xC00) { - this->spinVel.x = -0xC00; - } - if (this->spinZFlag) { - this->spinRot.z += this->spinVel.z; - this->spinVel.z -= 0x800; - if ((this->spinRot.z <= 0) && onGround) { - this->spinRot.z = 0; - this->spinVel.z = 0; + if (this->spinZFlag) { + this->spinRot.z += this->spinVel.z; + this->spinVel.z -= 0x800; + if ((this->spinRot.z <= 0) && onGround) { + this->spinRot.z = 0; + this->spinVel.z = 0; + } + } else { + this->spinRot.z -= this->spinVel.z; + this->spinVel.z -= 0x800; + if ((this->spinRot.z >= 0) && onGround) { + this->spinRot.z = 0; + this->spinVel.z = 0; + } } - } else { - this->spinRot.z -= this->spinVel.z; - this->spinVel.z -= 0x800; - if ((this->spinRot.z >= 0) && onGround) { - this->spinRot.z = 0; - this->spinVel.z = 0; + if (this->spinVel.z < -0xC00) { + this->spinVel.z = -0xC00; + } + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { + this->actor.speed *= -0.5f; + Actor_PlaySfx(&this->actor, NA_SE_EV_WOODPLATE_BOUND); + } + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { + this->actionState = ENKANBAN_WATER; + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER); + this->bounceX = this->bounceZ = 0; + this->actor.world.pos.y += this->actor.yDistToWater; + EffectSsGSplash_Spawn(play, &this->actor.world.pos, NULL, NULL, 0, (this->partCount * 20) + 300); + EffectSsGRipple_Spawn(play, &this->actor.world.pos, 150, 650, 0); + EffectSsGRipple_Spawn(play, &this->actor.world.pos, 300, 800, 5); + this->actor.velocity.y = 0.0f; + this->actor.gravity = 0.0f; + PRINTF(" WAT Y = %f\n", this->actor.yDistToWater); + PRINTF(" POS Y = %f\n", this->actor.world.pos.y); + PRINTF(" GROUND Y = %f\n", this->actor.floorHeight); + break; + } + + if (onGround) { + if (this->bounceCount <= 0) { + this->bounceCount++; + this->actor.velocity.y *= -0.3f; + this->actor.world.rot.y += (s16)Rand_CenteredFloat(16384.0f); + } else { + this->actor.velocity.y = 0.0f; + } + this->actor.speed *= 0.7f; + if ((this->spinRot.x == 0) && (this->bounceX != 0)) { + this->spinVel.x = this->bounceX * 0x200; + if (this->bounceX != 0) { + this->bounceX -= 5; + if (this->bounceX <= 0) { + this->bounceX = 0; + } + } + if (Rand_ZeroOne() < 0.5f) { + this->spinXFlag = true; + } else { + this->spinXFlag = false; + } + bounced = true; + } + if ((this->spinRot.z == 0) && (this->bounceZ != 0)) { + this->spinVel.z = this->bounceZ * 0x200; + if (this->bounceZ != 0) { + this->bounceZ -= 5; + if (this->bounceZ <= 0) { + this->bounceZ = 0; + } + } + if (Rand_ZeroOne() < 0.5f) { + this->spinZFlag = true; + } else { + this->spinZFlag = false; + } + bounced = true; + } + Math_ApproachS(&this->actor.shape.rot.x, this->direction * 0x4000, 1, 0x2000); + } else { + this->actor.shape.rot.y += this->spinVel.y; + this->actor.shape.rot.x += this->direction * 0x7D0; } - } - if (this->spinVel.z < -0xC00) { - this->spinVel.z = -0xC00; - } - if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { - this->actor.speed *= -0.5f; - Actor_PlaySfx(&this->actor, NA_SE_EV_WOODPLATE_BOUND); - } - if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { - this->actionState = ENKANBAN_WATER; - Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER); - this->bounceX = this->bounceZ = 0; - this->actor.world.pos.y += this->actor.yDistToWater; - EffectSsGSplash_Spawn(play, &this->actor.world.pos, NULL, NULL, 0, (this->partCount * 20) + 300); - EffectSsGRipple_Spawn(play, &this->actor.world.pos, 150, 650, 0); - EffectSsGRipple_Spawn(play, &this->actor.world.pos, 300, 800, 5); - this->actor.velocity.y = 0.0f; - this->actor.gravity = 0.0f; - PRINTF(" WAT Y = %f\n", this->actor.yDistToWater); - PRINTF(" POS Y = %f\n", this->actor.world.pos.y); - PRINTF(" GROUND Y = %f\n", this->actor.floorHeight); - break; } - if (onGround) { - if (this->bounceCount <= 0) { - this->bounceCount++; - this->actor.velocity.y *= -0.3f; - this->actor.world.rot.y += (s16)Rand_CenteredFloat(16384.0f); - } else { - this->actor.velocity.y = 0.0f; - } - this->actor.speed *= 0.7f; - if ((this->spinRot.x == 0) && (this->bounceX != 0)) { - this->spinVel.x = this->bounceX * 0x200; - if (this->bounceX != 0) { - this->bounceX -= 5; - if (this->bounceX <= 0) { - this->bounceX = 0; - } - } - if (Rand_ZeroOne() < 0.5f) { - this->spinXFlag = true; - } else { - this->spinXFlag = false; - } - bounced = true; - } - if ((this->spinRot.z == 0) && (this->bounceZ != 0)) { - this->spinVel.z = this->bounceZ * 0x200; - if (this->bounceZ != 0) { - this->bounceZ -= 5; - if (this->bounceZ <= 0) { - this->bounceZ = 0; - } - } - if (Rand_ZeroOne() < 0.5f) { - this->spinZFlag = true; - } else { - this->spinZFlag = false; - } - bounced = true; - } - Math_ApproachS(&this->actor.shape.rot.x, this->direction * 0x4000, 1, 0x2000); - } else { - this->actor.shape.rot.y += this->spinVel.y; - this->actor.shape.rot.x += this->direction * 0x7D0; - } if (bounced) { s16 dustCount; s16 j; diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 4b20f4018c..e1e6068017 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -47,13 +47,6 @@ static ColliderCylinderInit D_80AA0420 = { static u32 D_80AA044C[] = { DMG_SPIN_MASTER, DMG_SPIN_KOKIRI, DMG_SPIN_GIANT }; static u32 D_80AA0458[] = { DMG_JUMP_MASTER, DMG_JUMP_KOKIRI, DMG_JUMP_GIANT }; -static u16 sSfxIds[] = { - NA_SE_IT_ROLLING_CUT_LV2, - NA_SE_IT_ROLLING_CUT_LV1, - NA_SE_IT_ROLLING_CUT_LV2, - NA_SE_IT_ROLLING_CUT_LV1, -}; - // Setup action void func_80A9EFE0(EnMThunder* this, EnMThunderActionFunc actionFunc) { this->actionFunc = actionFunc; @@ -207,8 +200,19 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { func_80A9EFE0(this, func_80A9F9B4); this->unk_1C4 = 8; - Audio_PlaySfxGeneral(sSfxIds[this->unk_1C6], &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + + { + static u16 sSfxIds[] = { + NA_SE_IT_ROLLING_CUT_LV2, + NA_SE_IT_ROLLING_CUT_LV1, + NA_SE_IT_ROLLING_CUT_LV2, + NA_SE_IT_ROLLING_CUT_LV1, + }; + + Audio_PlaySfxGeneral(sSfxIds[this->unk_1C6], &player->actor.projectedPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + } + this->unk_1AC = 1.0f; return; } diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index 6265291986..99622ab6b9 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -264,8 +264,8 @@ void func_80AA204C(EnMa2* this, PlayState* play) { Player* player = GET_PLAYER(play); if (player->stateFlags2 & PLAYER_STATE2_24) { - player->unk_6A8 = &this->actor; player->stateFlags2 |= PLAYER_STATE2_25; + player->unk_6A8 = &this->actor; Message_StartOcarina(play, OCARINA_ACTION_CHECK_EPONA); this->actionFunc = func_80AA20E4; } else if (this->actor.xzDistToPlayer < 30.0f + this->collider.dim.radius) { diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 44f1e64336..621d2e4a95 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -1052,13 +1052,13 @@ void EnMb_ClubDamaged(EnMb* this, PlayState* play) { } void EnMb_ClubDamagedWhileKneeling(EnMb* this, PlayState* play) { - s32 pad; - if (SkelAnime_Update(&this->skelAnime)) { if (this->timer3 != 0) { this->timer3--; if (this->timer3 == 0) { if (this->timer1 == 0) { + s32 pad; + Animation_Change(&this->skelAnime, &gEnMbClubStandUpAnim, 3.0f, 0.0f, Animation_GetLastFrame(&gEnMbClubStandUpAnim), ANIMMODE_ONCE_INTERP, 0.0f); this->timer1 = 1; diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index 6ad429adbb..28202269f9 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -512,8 +512,6 @@ void EnMm_Draw(Actor* thisx, PlayState* play) { s32 pad; EnMm* this = (EnMm*)thisx; - if (0) {} - OPEN_DISPS(play->state.gfxCtx, "../z_en_mm.c", 1065); Gfx_SetupDL_25Opa(play->state.gfxCtx); @@ -560,6 +558,8 @@ void EnMm_Draw(Actor* thisx, PlayState* play) { } } + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_mm.c", 1141); } diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index ba8d1da1fb..3a5f4c187f 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -193,6 +193,7 @@ void EnNb_UpdateEyes(EnNb* this) { } } +#if OOT_DEBUG void func_80AB11EC(EnNb* this) { this->action = NB_ACTION_7; this->drawMode = NB_DRAW_NOTHING; @@ -220,6 +221,7 @@ void func_80AB1210(EnNb* this, PlayState* play) { } } } +#endif void func_80AB1284(EnNb* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_2); @@ -231,7 +233,9 @@ s32 EnNb_UpdateSkelAnime(EnNb* this) { CsCmdActorCue* EnNb_GetCue(PlayState* play, s32 cueChannel) { if (play->csCtx.state != CS_STATE_IDLE) { - return play->csCtx.actorCues[cueChannel]; + CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel]; + + return cue; } return NULL; @@ -528,7 +532,9 @@ void EnNb_SetupLightOrb(EnNb* this, PlayState* play) { void EnNb_Hide(EnNb* this, PlayState* play) { EnNb_SetupHide(this, play); +#if OOT_DEBUG func_80AB1210(this, play); +#endif } void EnNb_Fade(EnNb* this, PlayState* play) { @@ -536,7 +542,9 @@ void EnNb_Fade(EnNb* this, PlayState* play) { EnNb_UpdateSkelAnime(this); EnNb_UpdateEyes(this); EnNb_CheckToFade(this, play); +#if OOT_DEBUG func_80AB1210(this, play); +#endif } void EnNb_CreateLightOrb(EnNb* this, PlayState* play) { @@ -544,7 +552,9 @@ void EnNb_CreateLightOrb(EnNb* this, PlayState* play) { EnNb_UpdateSkelAnime(this); EnNb_UpdateEyes(this); EnNb_SetupLightOrb(this, play); +#if OOT_DEBUG func_80AB1210(this, play); +#endif } void EnNb_DrawTransparency(EnNb* this, PlayState* play) { @@ -1119,6 +1129,8 @@ void EnNb_CrawlspaceSpawnCheck(EnNb* this, PlayState* play) { this->action = NB_CROUCH_CRAWLSPACE; this->drawMode = NB_DRAW_DEFAULT; } else { + s32 pad; + EnNb_SetCurrentAnim(this, &gNabooruStandingHandsOnHipsAnim, 0, 0.0f, 0); this->headTurnFlag = 1; this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; @@ -1208,6 +1220,8 @@ void EnNb_SetupIdleCrawlspace(EnNb* this, s32 animFinished) { void func_80AB3838(EnNb* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { + s32 pad; + this->action = NB_IN_DIALOG; } else { this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; @@ -1300,6 +1314,8 @@ void func_80AB3A7C(EnNb* this, PlayState* play, s32 animFinished) { void func_80AB3B04(EnNb* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { + s32 pad; + this->action = NB_ACTION_30; } else { this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; @@ -1470,6 +1486,8 @@ s32 EnNb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po if (this->headTurnFlag != 0) { if (limbIndex == NB_LIMB_TORSO) { + s32 pad; + rot->x += interactInfo->torsoRot.y; rot->y -= interactInfo->torsoRot.x; ret = false; diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 847710b580..b48616a46d 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -11,7 +11,7 @@ void EnNiwLady_Destroy(Actor* thisx, PlayState* play); void EnNiwLady_Update(Actor* thisx, PlayState* play); void func_80AB9F24(EnNiwLady* this, PlayState* play); -void EnNiwLady_Draw(Actor* thisx, PlayState* play); +void EnNiwLady_Draw(Actor* thisx, PlayState* play2); void func_80ABA21C(EnNiwLady* this, PlayState* play); void func_80ABAD38(EnNiwLady* this, PlayState* play); void func_80ABA778(EnNiwLady* this, PlayState* play); @@ -199,6 +199,7 @@ void func_80ABA21C(EnNiwLady* this, PlayState* play) { void func_80ABA244(EnNiwLady* this, PlayState* play) { EnNiw* currentCucco; + s32 pad[2]; s32 phi_s1; this->cuccosInPen = 0; @@ -223,7 +224,7 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { } currentCucco = (EnNiw*)currentCucco->actor.next; } - if (BREG(7) != 0) { + if (OOT_DEBUG && BREG(7) != 0) { this->cuccosInPen = BREG(7) - 1; } phi_s1 = this->cuccosInPen; @@ -358,13 +359,13 @@ void func_80ABA778(EnNiwLady* this, PlayState* play) { void func_80ABA878(EnNiwLady* this, PlayState* play) { Player* player = GET_PLAYER(play); - s8 playerExchangeItemId; if ((Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) || (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE)) { this->unk_26E = 11; } if (Actor_TalkOfferAccepted(&this->actor, play)) { - playerExchangeItemId = func_8002F368(play); + s8 playerExchangeItemId = func_8002F368(play); + if ((playerExchangeItemId == EXCH_ITEM_POCKET_CUCCO) && GET_EVENTCHKINF(EVENTCHKINF_TALON_WOKEN_IN_KAKARIKO)) { Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); player->actor.textId = sTradeItemTextIds[5]; @@ -379,9 +380,10 @@ void func_80ABA878(EnNiwLady* this, PlayState* play) { this->unk_26E = this->unk_27A + 21; this->actionFunc = !this->unk_273 ? func_80ABA778 : func_80ABA9B8; } - } else { - Actor_OfferTalkExchangeEquiCylinder(&this->actor, play, 50.0f, EXCH_ITEM_POCKET_CUCCO); + return; } + + Actor_OfferTalkExchangeEquiCylinder(&this->actor, play, 50.0f, EXCH_ITEM_POCKET_CUCCO); } void func_80ABA9B8(EnNiwLady* this, PlayState* play) { @@ -573,10 +575,10 @@ s32 EnNiwLady_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 return false; } -void EnNiwLady_Draw(Actor* thisx, PlayState* play) { +void EnNiwLady_Draw(Actor* thisx, PlayState* play2) { static void* sEyeTextures[] = { gCuccoLadyEyeOpenTex, gCuccoLadyEyeHalfTex, gCuccoLadyEyeClosedTex }; EnNiwLady* this = (EnNiwLady*)thisx; - s32 pad; + PlayState* play = (PlayState*)play2; OPEN_DISPS(play->state.gfxCtx, "../z_en_niw_lady.c", 1347); if (this->unk_27E != 0) { diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/src/overlays/actors/ovl_En_Ny/z_en_ny.c index 0ec08037fe..126a99728a 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -139,8 +139,8 @@ void EnNy_Init(Actor* thisx, PlayState* play) { PRINTF("ダミーニュウ イニシャル[ %d ] !!\n", this->actor.params); PRINTF("En_Ny_actor_move2[ %x ] !!\n", EnNy_UpdateUnused); this->actor.colChkInfo.mass = 0xFF; - this->collider.base.colType = COLTYPE_METAL; this->actor.update = EnNy_UpdateUnused; + this->collider.base.colType = COLTYPE_METAL; } } @@ -368,7 +368,6 @@ void EnNy_Update(Actor* thisx, PlayState* play) { EnNy* this = (EnNy*)thisx; f32 temp_f20; f32 temp_f22; - s32 i; this->timer++; temp_f20 = this->unk_1E0 - 0.25f; @@ -391,6 +390,8 @@ void EnNy_Update(Actor* thisx, PlayState* play) { this->unk_1F0 = temp_f22; this->actor.world.pos.y += temp_f22; if (EnNy_CollisionCheck(this, play) != 0) { + s32 i; + for (i = 0; i < 8; i++) { this->unk_1F8[i].x = (Rand_CenteredFloat(20.0f) + this->actor.world.pos.x); this->unk_1F8[i].y = (Rand_CenteredFloat(20.0f) + this->actor.world.pos.y); diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index d898af9d8e..8dd65a769b 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -115,7 +115,8 @@ void EnOkarinaEffect_Update(Actor* thisx, PlayState* play) { EnOkarinaEffect* this = (EnOkarinaEffect*)thisx; this->actionFunc(this, play); - if (BREG(0) != 0) { + + if (OOT_DEBUG && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0xFF, 0, 0xFF, 0xFF, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index 70c2d33c60..a258f84c1b 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -318,7 +318,8 @@ void EnOkarinaTag_Update(Actor* thisx, PlayState* play) { EnOkarinaTag* this = (EnOkarinaTag*)thisx; this->actionFunc(this, play); - if (BREG(0) != 0) { + + if (OOT_DEBUG && BREG(0) != 0) { if (this->unk_15A != 0) { if (!(this->unk_15A & 1)) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 61d2ea57a2..d89c860924 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -679,10 +679,11 @@ s32 EnOkuta_GetSnoutScale(EnOkuta* this, f32 curFrame, Vec3f* scale) { s32 EnOkuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnOkuta* this = (EnOkuta*)thisx; - f32 curFrame = this->skelAnime.curFrame; + f32 curFrame; Vec3f scale; s32 doScale = false; + curFrame = this->skelAnime.curFrame; if (this->actionFunc == EnOkuta_Die) { curFrame += this->timer; } diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 1f8d80e66d..070944d501 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -141,6 +141,7 @@ static s16 sItemShelfRot[] = { 0xEAAC, 0xEAAC, 0xEAAC, 0xEAAC, 0x1554, 0x1554, 0 // unused values? static s16 D_80AC8904[] = { 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025 }; +#if OOT_DEBUG static char* sShopkeeperPrintName[] = { "コキリの店 ", // "Kokiri Shop" "薬屋 ", // "Potion Shop" @@ -154,6 +155,7 @@ static char* sShopkeeperPrintName[] = { "インゴーの店", // "Ingo Store" "お面屋 ", // "Mask Shop" }; +#endif typedef struct { /* 0x00 */ s16 objId; @@ -888,6 +890,8 @@ void EnOssan_State_StartConversation(EnOssan* this, PlayState* play, Player* pla if (this->actor.params == OSSAN_TYPE_MASK && dialogState == TEXT_STATE_CHOICE) { if (!EnOssan_TestEndInteraction(this, play, &play->state.input[0]) && Message_ShouldAdvance(play)) { + s32 pad; + switch (play->msgCtx.choiceIndex) { case 0: EnOssan_StartShopping(play, this); @@ -1691,6 +1695,8 @@ void EnOssan_State_ContinueShoppingPrompt(EnOssan* this, PlayState* play, Player selectedItem = this->shelfSlots[this->cursorIndex]; selectedItem->updateStockedItemFunc(play, selectedItem); if (!EnOssan_TestEndInteraction(this, play, &play->state.input[0])) { + s32 pad; + switch (play->msgCtx.choiceIndex) { case 0: PRINTF(VT_FGCOL(YELLOW) "★★★ 続けるよ!! ★★★" VT_RST "\n"); @@ -2275,15 +2281,17 @@ void EnOssan_DrawTextRec(PlayState* play, s32 r, s32 g, s32 b, s32 a, f32 x, f32 gDPSetPrimColor(OVERLAY_DISP++, 0, 0, r, g, b, a); w = 8.0f * z; + ulx = (x - w) * 4.0f; + lrx = (x + w) * 4.0f; + h = 12.0f * z; + uly = (y - h) * 4.0f; + lry = (y + h) * 4.0f; + texCoordScale = (1.0f / z) * 1024; dsdx = texCoordScale * dx; dtdy = dy * texCoordScale; - ulx = (x - w) * 4.0f; - uly = (y - h) * 4.0f; - lrx = (x + w) * 4.0f; - lry = (y + h) * 4.0f; gSPTextureRectangle(OVERLAY_DISP++, ulx, uly, lrx, lry, G_TX_RENDERTILE, s, t, dsdx, dtdy); CLOSE_DISPS(play->state.gfxCtx, "../z_en_oB1.c", 4242); } diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index e0789d8148..c2cbe4b9d4 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -1368,6 +1368,7 @@ void func_80ACD2CC(EnOwl* this, PlayState* play) { Vec3f pos; s32 angle; f32 t = func_80ACD1C4(play, 7); + f32 phi_f2; pos.x = play->csCtx.actorCues[7]->startPos.x; pos.y = play->csCtx.actorCues[7]->startPos.y; @@ -1379,8 +1380,7 @@ void func_80ACD2CC(EnOwl* this, PlayState* play) { angle = (s16)((t * angle) + this->actor.world.rot.z); angle = (u16)angle; if (this->actionFlags & 4) { - f32 phi_f2 = play->csCtx.actorCues[7]->rot.x; - + phi_f2 = play->csCtx.actorCues[7]->rot.x; phi_f2 *= 10.0f * (360.0f / 0x10000); if (phi_f2 < 0.0f) { phi_f2 += 360.0f; diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 973b02717c..5aa146fc51 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -416,6 +416,8 @@ void EnPeehat_Ground_SetStateRise(EnPeehat* this) { } void EnPeehat_Ground_StateRise(EnPeehat* this, PlayState* play) { + Vec3f pos; + Math_SmoothStepToF(&this->actor.shape.yOffset, 0.0f, 1.0f, 50.0f, 0.0f); if (Math_SmoothStepToS(&this->bladeRotVel, 4000, 1, 800, 0) == 0) { if (this->animTimer != 0) { @@ -433,7 +435,7 @@ void EnPeehat_Ground_StateRise(EnPeehat* this, PlayState* play) { this->actor.world.pos.y += 6.5f; } if (this->actor.world.pos.y - this->actor.floorHeight < 80.0f) { - Vec3f pos = this->actor.world.pos; + pos = this->actor.world.pos; pos.y = this->actor.floorHeight; func_80033480(play, &pos, 90.0f, 1, 0x96, 100, 1); } @@ -457,6 +459,8 @@ void EnPeehat_Flying_SetStateRise(EnPeehat* this) { } void EnPeehat_Flying_StateRise(EnPeehat* this, PlayState* play) { + Vec3f pos; + Math_SmoothStepToF(&this->actor.shape.yOffset, 0.0f, 1.0f, 50.0f, 0.0f); if (Math_SmoothStepToS(&this->bladeRotVel, 4000, 1, 800, 0) == 0) { if (this->animTimer != 0) { @@ -476,7 +480,7 @@ void EnPeehat_Flying_StateRise(EnPeehat* this, PlayState* play) { this->actor.world.pos.y += 18.0f; } if (this->actor.world.pos.y - this->actor.floorHeight < 80.0f) { - Vec3f pos = this->actor.world.pos; + pos = this->actor.world.pos; pos.y = this->actor.floorHeight; func_80033480(play, &pos, 90.0f, 1, 0x96, 100, 1); } @@ -854,12 +858,11 @@ void EnPeehat_SetStateExplode(EnPeehat* this) { } void EnPeehat_StateExplode(EnPeehat* this, PlayState* play) { - EnBom* bomb; s32 pad[2]; if (this->animTimer == 5) { - bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0x602, 0); + EnBom* bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0x602, 0); if (bomb != NULL) { bomb->timer = 0; } @@ -919,6 +922,10 @@ void EnPeehat_Update(Actor* thisx, PlayState* play) { EnPeehat* this = (EnPeehat*)thisx; s32 i; Player* player = GET_PLAYER(play); + Vec3f posResult; + CollisionPoly* poly; + s32 bgId; + Vec3f* posB; // If Adult Peahat if (thisx->params <= 0) { @@ -978,10 +985,8 @@ void EnPeehat_Update(Actor* thisx, PlayState* play) { // if PEAHAT_TYPE_GROUNDED if (thisx->params < 0 && (thisx->flags & ACTOR_FLAG_6)) { for (i = 1; i >= 0; i--) { - Vec3f posResult; - CollisionPoly* poly = NULL; - s32 bgId; - Vec3f* posB = &this->bladeTip[i]; + poly = NULL; + posB = &this->bladeTip[i]; if (BgCheck_EntityLineTest1(&play->colCtx, &thisx->world.pos, posB, &posResult, &poly, true, true, false, true, &bgId) == true) { diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index 9c2de64682..ef39e231ea 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -795,6 +795,9 @@ void EnPoField_DrawFlame(EnPoField* this, PlayState* play) { gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_po_field.c", 1709), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); + + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_po_field.c", 1712); } } @@ -996,6 +999,9 @@ void EnPoField_DrawSoul(Actor* thisx, PlayState* play) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gPoeFieldSoulDL); } + + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_po_field.c", 2149); EnPoField_DrawFlame(this, play); } diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index f526e0508d..bca1a872d5 100644 --- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -290,8 +290,6 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, PlayState* play) { Vec3f vec; f32 multiplier; s32 pad; - Vec3f sp60; - s32 pad1; this->actionTimer++; if (this->actionTimer < 8) { @@ -323,6 +321,9 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, PlayState* play) { } if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.001f) != 0) { if (this->hookshotSlotFull != 0) { + Vec3f sp60; + s32 pad1; + sp60.x = this->actor.world.pos.x; sp60.y = this->actor.floorHeight; sp60.z = this->actor.world.pos.z; diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 21a4869bbe..bb18687afd 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -466,10 +466,12 @@ void EnRd_SetupWalkToParent(EnRd* this) { * fade away. */ void EnRd_WalkToParent(EnRd* this, PlayState* play) { + s32 pad; + s16 targetY; + Vec3f parentPos; + if (this->actor.parent != NULL) { - s32 pad; - s16 targetY; - Vec3f parentPos = this->actor.parent->world.pos; + parentPos = this->actor.parent->world.pos; targetY = Actor_WorldYawTowardPoint(&this->actor, &parentPos); @@ -992,5 +994,7 @@ void EnRd_Draw(Actor* thisx, PlayState* play) { func_80033C30(&thisPos, &sShadowScale, this->alpha, play); } + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_rd.c", 1735); } diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index 609d9087ea..f91e619875 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -126,9 +126,9 @@ void EnReeba_Init(Actor* thisx, PlayState* play) { this->scale = 0.04f; if (this->type != LEEVER_TYPE_SMALL) { + this->scale *= 1.5f; this->collider.dim.radius = 35; this->collider.dim.height = 45; - this->scale *= 1.5f; // "Reeba Boss Appears %f" PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ リーバぼす登場 ☆☆☆☆☆ %f\n" VT_RST, this->scale); this->actor.colChkInfo.health = 20; @@ -399,17 +399,18 @@ void EnReeba_SetupStunned(EnReeba* this, PlayState* play) { } void EnReeba_Stunned(EnReeba* this, PlayState* play) { - Vec3f pos; - f32 scale; - if (this->waitTimer != 0) { if (this->actor.speed < 0.0f) { this->actor.speed += 1.0f; } + return; } else { this->actor.speed = 0.0f; if ((this->stunType == LEEVER_STUN_OTHER) || (this->actor.colChkInfo.health != 0)) { + Vec3f pos; + f32 scale; + if (this->stunType == LEEVER_STUN_ICE) { pos.x = this->actor.world.pos.x + Rand_CenteredFloat(20.0f); pos.y = this->actor.world.pos.y + Rand_CenteredFloat(20.0f); @@ -425,10 +426,11 @@ void EnReeba_Stunned(EnReeba* this, PlayState* play) { this->waitTimer = 66; this->actionfunc = EnReeba_StunRecover; - } else { - this->waitTimer = 30; - this->actionfunc = EnReeba_StunDie; + return; } + + this->waitTimer = 30; + this->actionfunc = EnReeba_StunDie; } } @@ -693,7 +695,7 @@ void EnReeba_Draw(Actor* thisx, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_en_reeba.c", 1088); - if (BREG(0)) { + if (OOT_DEBUG && BREG(0) != 0) { Vec3f debugPos; debugPos.x = (Math_SinS(this->actor.world.rot.y) * 30.0f) + this->actor.world.pos.x; diff --git a/src/overlays/actors/ovl_En_Rl/z_en_rl.c b/src/overlays/actors/ovl_En_Rl/z_en_rl.c index 068bd64b64..d3c74b7908 100644 --- a/src/overlays/actors/ovl_En_Rl/z_en_rl.c +++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.c @@ -50,6 +50,7 @@ void func_80AE72D0(EnRl* this) { } } +#if OOT_DEBUG void func_80AE7358(EnRl* this) { Animation_Change(&this->skelAnime, &object_rl_Anim_000A3C, 1.0f, 0.0f, Animation_GetLastFrame(&object_rl_Anim_000A3C), ANIMMODE_LOOP, 0.0f); @@ -75,6 +76,7 @@ void func_80AE73D8(EnRl* this, PlayState* play) { D_80AE81AC = 1; } } +#endif void func_80AE744C(EnRl* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); @@ -243,8 +245,9 @@ void func_80AE79A4(EnRl* this, PlayState* play) { void func_80AE7AF8(EnRl* this, PlayState* play) { if (func_80AE74B4(this, play, 3, 0)) { - Animation_Change(&this->skelAnime, &object_rl_Anim_00040C, 1.0f, 0.0f, - Animation_GetLastFrame(&object_rl_Anim_00040C), ANIMMODE_ONCE, -8.0f); + f32 frame = Animation_GetLastFrame(&object_rl_Anim_00040C); + + Animation_Change(&this->skelAnime, &object_rl_Anim_00040C, 1.0f, 0.0f, frame, ANIMMODE_ONCE, -8.0f); this->action = 6; } else if (func_80AE74FC(this, play, 4, 0)) { this->action = 5; @@ -269,7 +272,9 @@ void func_80AE7BF8(EnRl* this, s32 arg1) { void func_80AE7C64(EnRl* this, PlayState* play) { func_80AE7954(this, play); +#if OOT_DEBUG func_80AE73D8(this, play); +#endif } void func_80AE7C94(EnRl* this, PlayState* play) { @@ -277,7 +282,9 @@ void func_80AE7C94(EnRl* this, PlayState* play) { func_80AE7494(this); func_80AE72D0(this); func_80AE79A4(this, play); +#if OOT_DEBUG func_80AE73D8(this, play); +#endif } void func_80AE7CE8(EnRl* this, PlayState* play) { @@ -287,7 +294,9 @@ void func_80AE7CE8(EnRl* this, PlayState* play) { temp = func_80AE7494(this); func_80AE72D0(this); func_80AE7BF8(this, temp); +#if OOT_DEBUG func_80AE73D8(this, play); +#endif } void func_80AE7D40(EnRl* this, PlayState* play) { @@ -295,7 +304,9 @@ void func_80AE7D40(EnRl* this, PlayState* play) { func_80AE7494(this); func_80AE72D0(this); func_80AE7AF8(this, play); +#if OOT_DEBUG func_80AE73D8(this, play); +#endif } void func_80AE7D94(EnRl* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index b2bf3132bd..018420cef0 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -76,10 +76,12 @@ ActorInit En_Rr_InitVars = { /**/ EnRr_Draw, }; +#if OOT_DEBUG static char* sDropNames[] = { // "type 7", "small magic jar", "arrow", "fairy", "20 rupees", "50 rupees" "タイプ7 ", "魔法の壷小", "矢 ", "妖精 ", "20ルピー ", "50ルピー ", }; +#endif static ColliderCylinderInitType1 sCylinderInit1 = { { @@ -337,8 +339,8 @@ void EnRr_SetupDamage(EnRr* this) { s32 i; this->reachState = 0; - this->actionTimer = 20; this->segMoveRate = 0.0f; + this->actionTimer = 20; this->segPhaseVelTarget = 2500.0f; this->pulseSizeTarget = 0.0f; this->wobbleSizeTarget = 0.0f; diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 0fbbdb75d6..d390bba550 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -341,6 +341,7 @@ s32 func_80AEB1B4(PlayState* play) { return Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING; } +#if OOT_DEBUG void func_80AEB1D8(EnRu1* this) { this->action = 36; this->drawConfig = 0; @@ -358,6 +359,7 @@ void func_80AEB220(EnRu1* this, PlayState* play) { func_80AEB1D8(this); } } +#endif void func_80AEB264(EnRu1* this, AnimationHeader* animation, u8 arg2, f32 morphFrames, s32 arg4) { s32 pad[2]; @@ -634,10 +636,10 @@ void func_80AEBD94(EnRu1* this, PlayState* play) { void func_80AEBE3C(EnRu1* this, PlayState* play, s32 arg2) { s32 pad[2]; - f32 frameCount; if (arg2 != 0) { - frameCount = Animation_GetLastFrame(&gRutoChildTreadWaterAnim); + f32 frameCount = Animation_GetLastFrame(&gRutoChildTreadWaterAnim); + func_80AEB7D0(this); Animation_Change(&this->skelAnime, &gRutoChildTreadWaterAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, -8.0f); this->action = 3; @@ -661,6 +663,8 @@ void func_80AEBEC8(EnRu1* this, PlayState* play) { void func_80AEBF60(EnRu1* this, PlayState* play) { if (func_80AEB480(play, 6)) { + s32 pad; + func_80AEB7D0(this); this->action = 5; this->unk_364 = this->actor.world.pos; @@ -759,14 +763,14 @@ void func_80AEC2C0(EnRu1* this, PlayState* play) { } void func_80AEC320(EnRu1* this, PlayState* play) { - s8 actorRoom; - if (!GET_INFTABLE(INFTABLE_141)) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); this->action = 7; EnRu1_SetMouthIndex(this, 1); } else if (GET_INFTABLE(INFTABLE_147) && !GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_145)) { if (!func_80AEB020(this, play)) { + s8 actorRoom; + func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); actorRoom = this->actor.room; this->action = 22; @@ -911,6 +915,8 @@ void func_80AEC9C4(EnRu1* this) { void func_80AECA18(EnRu1* this) { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { + s32 pad; + this->action = 13; this->unk_26C = 0.0f; this->actor.velocity.y = 0.0f; @@ -1168,11 +1174,11 @@ void func_80AED414(EnRu1* this, PlayState* play) { } void func_80AED44C(EnRu1* this, PlayState* play) { - s8 actorRoom; - if (GET_INFTABLE(INFTABLE_141) && !GET_INFTABLE(INFTABLE_145) && !GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_147)) { if (!func_80AEB020(this, play)) { + s8 actorRoom; + func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); actorRoom = this->actor.room; this->action = 22; @@ -1253,12 +1259,13 @@ void func_80AED6F8(PlayState* play) { } void func_80AED738(EnRu1* this, PlayState* play) { - u32 temp_v0; - if (func_80AED624(this, play)) { + s32 pad; + this->unk_2A4 += 1.0f; if (this->unk_2A4 < 20.0f) { - temp_v0 = ((20.0f - this->unk_2A4) * 255.0f) / 20.0f; + u32 temp_v0 = ((20.0f - this->unk_2A4) * 255.0f) / 20.0f; + this->alpha = temp_v0; this->actor.shape.shadowAlpha = temp_v0; } else { @@ -1321,17 +1328,13 @@ void func_80AEDAE0(EnRu1* this, PlayState* play) { } void func_80AEDB30(EnRu1* this, PlayState* play) { - DynaPolyActor* dynaPolyActor; f32* velocityY; f32* speedXZ; f32* gravity; - s16 wallYaw; - s16 rotY; - s32 temp_a1_2; - s32 temp_a0; - s32 phi_v1; if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { + DynaPolyActor* dynaPolyActor; + velocityY = &this->actor.velocity.y; dynaPolyActor = DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId); if (*velocityY <= 0.0f) { @@ -1368,6 +1371,8 @@ void func_80AEDB30(EnRu1* this, PlayState* play) { } } if (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) { + s32 pad; + speedXZ = &this->actor.speed; velocityY = &this->actor.velocity.y; if (*speedXZ >= (kREG(27) * 0.01f) + 3.0f) { @@ -1383,6 +1388,12 @@ void func_80AEDB30(EnRu1* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { speedXZ = &this->actor.speed; if (*speedXZ != 0.0f) { + s16 wallYaw; + s16 rotY; + s32 temp_a1_2; + s32 temp_a0; + s32 phi_v1; + rotY = this->actor.world.rot.y; wallYaw = this->actor.wallYaw; temp_a0 = (wallYaw * 2) - rotY; @@ -1443,7 +1454,6 @@ void func_80AEE050(EnRu1* this) { s32 pad; f32 sp28; f32 sp24; - f32 temp_f10; EnRu1* thisx = this; // necessary to match if (this->unk_350 == 0) { @@ -1476,6 +1486,8 @@ void func_80AEE050(EnRu1* this) { this->unk_350 = 2; this->unk_360 = 0.0f; } else { + f32 temp_f10; + sp28 = this->unk_358; sp24 = this->unk_354; temp_f10 = Math_CosS(this->unk_35C) * -sp28; @@ -1561,6 +1573,8 @@ void func_80AEE488(EnRu1* this, PlayState* play) { this->action = 31; func_80AED520(this, play); } else if (!func_80AEE394(this, play) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { + s32 pad; + this->actor.minVelocityY = -((kREG(24) * 0.01f) + 6.8f); this->actor.gravity = -((kREG(23) * 0.01f) + 1.3f); this->action = 28; @@ -1571,11 +1585,16 @@ void func_80AEE568(EnRu1* this, PlayState* play) { if (!func_80AEE394(this, play)) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed == 0.0f) && (this->actor.minVelocityY == 0.0f)) { + s32 pad; + func_80AEE02C(this); Actor_OfferCarry(&this->actor, play); this->action = 27; func_80AEADD8(this); - } else if (this->actor.yDistToWater > 0.0f) { + return; + } + + if (this->actor.yDistToWater > 0.0f) { this->action = 29; this->unk_350 = 0; } @@ -1617,13 +1636,13 @@ s32 func_80AEE6D0(EnRu1* this, PlayState* play) { } void func_80AEE7C4(EnRu1* this, PlayState* play) { - f32 frameCount; - s32 pad[13]; + s32 pad[9]; Player* player; f32* unk_370 = &this->unk_370; if (Actor_HasNoParent(&this->actor, play)) { - frameCount = Animation_GetLastFrame(&gRutoChildSittingAnim); + f32 frameCount = Animation_GetLastFrame(&gRutoChildSittingAnim); + Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, -8.0f); func_80AED6DC(this, play); this->actor.speed *= (kREG(25) * 0.01f) + 1.0f; @@ -1633,45 +1652,49 @@ void func_80AEE7C4(EnRu1* this, PlayState* play) { func_80AED57C(this); this->action = 28; *unk_370 = 0.0f; - return; - } + } else if (func_80AEE6D0(this, play)) { + s32 pad; - if (func_80AEE6D0(this, play)) { *unk_370 = 0.0f; - return; - } + } else { + player = GET_PLAYER(play); + if (player->stateFlags2 & PLAYER_STATE2_28) { + this->unk_370 += 1.0f; + if (this->action != 32) { + if (*unk_370 > 30.0f) { + if (Rand_S16Offset(0, 3) == 0) { + f32 frameCount = Animation_GetLastFrame(&gRutoChildSquirmAnim); - player = GET_PLAYER(play); - if (player->stateFlags2 & PLAYER_STATE2_28) { - this->unk_370 += 1.0f; - if (this->action != 32) { - if (*unk_370 > 30.0f) { - if (Rand_S16Offset(0, 3) == 0) { - frameCount = Animation_GetLastFrame(&gRutoChildSquirmAnim); - Animation_Change(&this->skelAnime, &gRutoChildSquirmAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, - -8.0f); - func_80AED5DC(this); - this->action = 32; + Animation_Change(&this->skelAnime, &gRutoChildSquirmAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, + -8.0f); + func_80AED5DC(this); + this->action = 32; + } + *unk_370 = 0.0f; + } + } else { + if (*unk_370 > 50.0f) { + f32 frameCount = Animation_GetLastFrame(&gRutoChildSittingAnim); + + Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, + -8.0f); + this->action = 31; + *unk_370 = 0.0f; } - *unk_370 = 0.0f; } } else { - if (*unk_370 > 50.0f) { - frameCount = Animation_GetLastFrame(&gRutoChildSittingAnim); - Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, -8.0f); - this->action = 31; - *unk_370 = 0.0f; - } + f32 frameCount = Animation_GetLastFrame(&gRutoChildSittingAnim); + + Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, -8.0f); + *unk_370 = 0.0f; } - } else { - frameCount = Animation_GetLastFrame(&gRutoChildSittingAnim); - Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, -8.0f); - *unk_370 = 0.0f; } } s32 func_80AEEAC8(EnRu1* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { + s32 pad; + func_80AEE02C(this); Actor_OfferCarry(&this->actor, play); this->action = 27; @@ -1809,10 +1832,9 @@ void func_80AEF080(EnRu1* this) { } s32 func_80AEF0BC(EnRu1* this, PlayState* play) { - s32 frameCount; - if (GET_INFTABLE(INFTABLE_142)) { - frameCount = Animation_GetLastFrame(&gRutoChildSitAnim); + f32 frameCount = Animation_GetLastFrame(&gRutoChildSitAnim); + Animation_Change(&this->skelAnime, &gRutoChildSitAnim, 1.0f, 0, frameCount, ANIMMODE_ONCE, -8.0f); play->msgCtx.msgMode = MSGMODE_PAUSED; this->action = 26; @@ -2001,7 +2023,7 @@ void func_80AEF890(EnRu1* this, PlayState* play) { s32 pad[2]; s8 curRoomNum; - if (!IS_CUTSCENE_LAYER && (EnRu1_IsCsStateIdle(play))) { + if (!(OOT_DEBUG && IS_CUTSCENE_LAYER) && EnRu1_IsCsStateIdle(play)) { curRoomNum = play->roomCtx.curRoom.num; SET_INFTABLE(INFTABLE_145); Flags_SetSwitch(play, func_80AEADE0(this)); @@ -2034,7 +2056,9 @@ void func_80AEF9D8(EnRu1* this, PlayState* play) { EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); func_80AEF624(this, play); +#if OOT_DEBUG func_80AEB220(this, play); +#endif } void func_80AEFA2C(EnRu1* this, PlayState* play) { @@ -2048,7 +2072,9 @@ void func_80AEFA2C(EnRu1* this, PlayState* play) { func_80AEF5B8(this); func_80AEF40C(this); func_80AEF728(this, something); +#if OOT_DEBUG func_80AEB220(this, play); +#endif } void func_80AEFAAC(EnRu1* this, PlayState* play) { @@ -2056,7 +2082,9 @@ void func_80AEFAAC(EnRu1* this, PlayState* play) { func_80AEAECC(this, play); EnRu1_UpdateSkelAnime(this); func_80AEF79C(this, play); +#if OOT_DEBUG func_80AEB220(this, play); +#endif } void func_80AEFB04(EnRu1* this, PlayState* play) { @@ -2067,7 +2095,9 @@ void func_80AEFB04(EnRu1* this, PlayState* play) { something = EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); func_80AEF820(this, something); +#if OOT_DEBUG func_80AEB220(this, play); +#endif } void func_80AEFB68(EnRu1* this, PlayState* play) { @@ -2076,7 +2106,9 @@ void func_80AEFB68(EnRu1* this, PlayState* play) { EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); func_80AEF890(this, play); +#if OOT_DEBUG func_80AEB220(this, play); +#endif } void func_80AEFBC8(EnRu1* this, PlayState* play) { @@ -2095,6 +2127,8 @@ void func_80AEFC24(EnRu1* this, PlayState* play) { void func_80AEFC54(EnRu1* this, PlayState* play) { if (GET_INFTABLE(INFTABLE_145) && !GET_INFTABLE(INFTABLE_146)) { + s32 pad; + func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); this->action = 41; this->unk_28C = EnRu1_FindSwitch(play); @@ -2197,6 +2231,7 @@ void func_80AEFF94(EnRu1* this, PlayState* play) { } } +#if OOT_DEBUG void func_80AF0050(EnRu1* this, PlayState* play) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); this->action = 36; @@ -2204,6 +2239,7 @@ void func_80AF0050(EnRu1* this, PlayState* play) { this->unk_28C = EnRu1_FindSwitch(play); this->actor.room = -1; } +#endif void EnRu1_Update(Actor* thisx, PlayState* play) { EnRu1* this = (EnRu1*)thisx; @@ -2246,9 +2282,11 @@ void EnRu1_Init(Actor* thisx, PlayState* play) { case 6: func_80AEFF94(this, play); break; +#if OOT_DEBUG case 10: func_80AF0050(this, play); break; +#endif default: Actor_Kill(&this->actor); // "Relevant arge_data = %d unacceptable" @@ -2288,10 +2326,11 @@ s32 EnRu1_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p void EnRu1_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfx) { EnRu1* this = (EnRu1*)thisx; - Vec3f vec1; - Vec3f vec2; if (limbIndex == RUTO_CHILD_HEAD) { + Vec3f vec1; + Vec3f vec2; + vec1 = sMultVec; Matrix_MultVec3f(&vec1, &vec2); this->actor.focus.pos.x = vec2.x; diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index b86112f534..68f67b8f68 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -137,6 +137,7 @@ s32 func_80AF26A0(EnRu2* this) { return params & 0xFF; } +#if OOT_DEBUG void func_80AF26AC(EnRu2* this) { this->action = 7; this->drawConfig = 0; @@ -164,6 +165,7 @@ void func_80AF26D0(EnRu2* this, PlayState* play) { } } } +#endif void func_80AF2744(EnRu2* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_2); @@ -175,8 +177,11 @@ s32 EnRu2_UpdateSkelAnime(EnRu2* this) { CsCmdActorCue* EnRu2_GetCue(PlayState* play, s32 cueChannel) { if (play->csCtx.state != CS_STATE_IDLE) { - return play->csCtx.actorCues[cueChannel]; + CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel]; + + return cue; } + return NULL; } @@ -447,7 +452,9 @@ void func_80AF30AC(EnRu2* this, PlayState* play) { void func_80AF3144(EnRu2* this, PlayState* play) { func_80AF2F04(this, play); +#if OOT_DEBUG func_80AF26D0(this, play); +#endif } void func_80AF3174(EnRu2* this, PlayState* play) { @@ -455,7 +462,9 @@ void func_80AF3174(EnRu2* this, PlayState* play) { EnRu2_UpdateSkelAnime(this); func_80AF2608(this); func_80AF2F58(this, play); +#if OOT_DEBUG func_80AF26D0(this, play); +#endif } void func_80AF31C8(EnRu2* this, PlayState* play) { @@ -463,7 +472,9 @@ void func_80AF31C8(EnRu2* this, PlayState* play) { EnRu2_UpdateSkelAnime(this); func_80AF2608(this); func_80AF30AC(this, play); +#if OOT_DEBUG func_80AF26D0(this, play); +#endif } void func_80AF321C(EnRu2* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 2994a7a7fb..a055e7ea84 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -613,10 +613,12 @@ void func_80AF6448(EnSa* this, PlayState* play) { } void func_80AF67D0(EnSa* this, PlayState* play) { - if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { - Animation_Change(&this->skelAnime, &gSariaStopPlayingOcarinaAnim, 0.0f, 10.0f, 0.0f, ANIMMODE_ONCE, -10.0f); - this->actionFunc = func_80AF6448; + if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { + return; } + + Animation_Change(&this->skelAnime, &gSariaStopPlayingOcarinaAnim, 0.0f, 10.0f, 0.0f, ANIMMODE_ONCE, -10.0f); + this->actionFunc = func_80AF6448; } void func_80AF683C(EnSa* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c index 79a4ba9d9f..0d28bea18f 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -118,8 +118,6 @@ void func_80AFBE8C(EnSiofuki* this, PlayState* play) { f32 dZ; s16 angle; s16 dAngle; - f32 dist2d; - f32 speedScale; dX = player->actor.world.pos.x - this->dyna.actor.world.pos.x; dY = player->actor.world.pos.y - this->dyna.actor.world.pos.y; @@ -139,7 +137,8 @@ void func_80AFBE8C(EnSiofuki* this, PlayState* play) { this->appliedSpeed = 0.0f; this->targetAppliedSpeed = 0.0f; } else { - dist2d = sqrtf(SQ(dX) + SQ(dZ)); + f32 dist2d = sqrtf(SQ(dX) + SQ(dZ)); + this->applySpeed = true; this->splashTimer = 0; angle = RAD_TO_BINANG(Math_FAtan2F(dX, dZ)); @@ -149,6 +148,8 @@ void func_80AFBE8C(EnSiofuki* this, PlayState* play) { Math_SmoothStepToF(&player->actor.world.pos.y, this->dyna.actor.world.pos.y, 0.5f, 4.0f, 1.0f); if ((dAngle < 0x4000) && (dAngle > -0x4000)) { + f32 speedScale; + this->appliedYaw = player->actor.world.rot.y ^ 0x8000; speedScale = dist2d / (this->dyna.actor.scale.x * 40.0f * 10.0f); speedScale = CLAMP_MIN(speedScale, 0.0f); @@ -292,6 +293,9 @@ void EnSiofuki_Draw(Actor* thisx, PlayState* play) { gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, x, y, 64, 64, 1, x, y, 64, 64)); gSPDisplayList(POLY_XLU_DISP++, object_siofuki_DL_000B70); + + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_siofuki.c", 674); if (this->sfxFlags & 1) { diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 3fd564e7ab..b2e08703d9 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -531,10 +531,10 @@ void EnSkb_Update(Actor* thisx, PlayState* play) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } -s32 EnSkb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { +s32 EnSkb_OverrideLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnSkb* this = (EnSkb*)thisx; + PlayState* play = (PlayState*)play2; s16 color; - s16 pad[2]; if (limbIndex == 11) { if ((this->breakFlags & 2) == 0) { // head limb, head is still attached diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index ab0ab2a230..758a2649a1 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -364,7 +364,6 @@ void EnSkj_Init(Actor* thisx, PlayState* play2) { EnSkj* this = (EnSkj*)thisx; PlayState* play = play2; s32 pad; - Player* player; Actor_ProcessInitChain(thisx, sInitChain); switch (type) { @@ -445,13 +444,18 @@ void EnSkj_Init(Actor* thisx, PlayState* play2) { this->actor.gravity = -1.0f; EnSkj_CalculateCenter(this); - player = GET_PLAYER(play); - PRINTF("Player_X : %f\n", player->actor.world.pos.x); - PRINTF("Player_Z : %f\n", player->actor.world.pos.z); - PRINTF("World_X : %f\n", this->actor.world.pos.x); - PRINTF("World_Z : %f\n", this->actor.world.pos.z); - PRINTF("Center_X : %f\n", this->center.x); - PRINTF("Center_Z : %f\n\n", this->center.z); +#if OOT_DEBUG + { + Player* player = GET_PLAYER(play); + + PRINTF("Player_X : %f\n", player->actor.world.pos.x); + PRINTF("Player_Z : %f\n", player->actor.world.pos.z); + PRINTF("World_X : %f\n", this->actor.world.pos.x); + PRINTF("World_Z : %f\n", this->actor.world.pos.z); + PRINTF("Center_X : %f\n", this->center.x); + PRINTF("Center_Z : %f\n\n", this->center.z); + } +#endif break; } @@ -1345,7 +1349,7 @@ void EnSkj_SariasSongShortStumpUpdate(Actor* thisx, PlayState* play) { D_80B01EA0 = Actor_TalkOfferAccepted(&this->actor, play); - if (BREG(0) != 0) { + if (OOT_DEBUG && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx); @@ -1502,15 +1506,15 @@ void EnSkj_OfferNextRound(EnSkj* this, PlayState* play) { } void EnSkj_WaitForOfferResponse(EnSkj* this, PlayState* play) { - Player* player; - if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { switch (play->msgCtx.choiceIndex) { - case 0: // yes - player = GET_PLAYER(play); + case 0: { // yes + Player* player = GET_PLAYER(play); + player->stateFlags3 |= PLAYER_STATE3_5; // makes player take ocarina out right away after closing box this->actionFunc = EnSkj_SetupWaitForOcarina; break; + } case 1: // no this->actionFunc = EnSkj_CleanupOcarinaGame; break; @@ -1587,11 +1591,13 @@ void EnSkj_OcarinaMinigameShortStumpUpdate(Actor* thisx, PlayState* play) { this->actor.focus.pos.y = -90.0f; this->actor.focus.pos.z = 450.0f; +#if OOT_DEBUG if (BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx); } +#endif this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c index b40a57038f..9719fd651a 100644 --- a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c +++ b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c @@ -342,7 +342,8 @@ void EnSyatekiItm_Update(Actor* thisx, PlayState* play) { if (this->unkTimer != 0) { this->unkTimer--; } - if (BREG(0)) { + + if (OOT_DEBUG && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 4aa759f569..90c72cf991 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -40,7 +40,9 @@ void EnSyatekiMan_RestartGame(EnSyatekiMan* this, PlayState* play); void EnSyatekiMan_BlinkWait(EnSyatekiMan* this); void EnSyatekiMan_Blink(EnSyatekiMan* this); +#if OOT_DEBUG void EnSyatekiMan_SetBgm(void); +#endif ActorInit En_Syateki_Man_InitVars = { /**/ ACTOR_EN_SYATEKI_MAN, @@ -54,6 +56,7 @@ ActorInit En_Syateki_Man_InitVars = { /**/ EnSyatekiMan_Draw, }; +#if OOT_DEBUG static u16 sBgmList[] = { NA_BGM_GENERAL_SFX, NA_BGM_NATURE_AMBIENCE, @@ -144,6 +147,7 @@ static u16 sBgmList[] = { NA_BGM_GANON_BOSS, NA_BGM_END_DEMO, }; +#endif static s16 sTextIds[] = { 0x2B, 0x2E, 0xC8, 0x2D }; @@ -468,7 +472,11 @@ void EnSyatekiMan_Update(Actor* thisx, PlayState* play) { this->timer--; } this->actionFunc(this, play); + +#if OOT_DEBUG EnSyatekiMan_SetBgm(); +#endif + this->blinkFunc(this); this->actor.focus.pos.y = 70.0f; Actor_SetFocus(&this->actor, 70.0f); @@ -503,9 +511,11 @@ void EnSyatekiMan_Draw(Actor* thisx, PlayState* play) { EnSyatekiMan_OverrideLimbDraw, NULL, this); } +#if OOT_DEBUG void EnSyatekiMan_SetBgm(void) { if (BREG(80)) { BREG(80) = false; SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, sBgmList[BREG(81)]); } } +#endif diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index 5d306488a6..d5918f9363 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -760,9 +760,11 @@ void EnSyatekiNiw_UpdateEffects(EnSyatekiNiw* this, PlayState* play) { void EnSyatekiNiw_DrawEffects(EnSyatekiNiw* this, PlayState* play) { GraphicsContext* gfxCtx = play->state.gfxCtx; s16 i; - EnSyatekiNiwEffect* effect = &this->effects[0]; + EnSyatekiNiwEffect* effect; u8 materialFlag = 0; + effect = &this->effects[0]; + OPEN_DISPS(gfxCtx, "../z_en_syateki_niw.c", 1234); Gfx_SetupDL_25Xlu(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Tana/z_en_tana.c b/src/overlays/actors/ovl_En_Tana/z_en_tana.c index aa7aeb97f0..a3cf4949c6 100644 --- a/src/overlays/actors/ovl_En_Tana/z_en_tana.c +++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.c @@ -27,6 +27,7 @@ ActorInit En_Tana_InitVars = { /**/ NULL, }; +#if OOT_DEBUG //! @bug A third entry is missing here. When printing the string indexed by `params` for type 2, the //! next data entry will be dereferenced and print garbage, stopping any future printing. //! In a non-matching context, this can cause a crash if the next item isn't a valid pointer. @@ -37,6 +38,7 @@ static const char* sShelfTypes[] = { "", #endif }; +#endif static const ActorFunc sDrawFuncs[] = { EnTana_DrawWoodenShelves, diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index e050fc3321..af9653e9d6 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -568,12 +568,11 @@ void EnTest_SetupWalkAndBlock(EnTest* this) { void EnTest_WalkAndBlock(EnTest* this, PlayState* play) { s32 pad; f32 checkDist = 0.0f; - s32 pad1; + s32 absPlaySpeed; s32 prevFrame; s32 beforeCurFrame; f32 playSpeed; Player* player = GET_PLAYER(play); - s32 absPlaySpeed; s16 yawDiff; if (!EnTest_ReactToProjectile(play, this)) { @@ -601,6 +600,8 @@ void EnTest_WalkAndBlock(EnTest* this, PlayState* play) { } if (ABS(this->actor.speed) < 3.0f) { + s32 pad; + Animation_Change(&this->skelAnime, &gStalfosSlowAdvanceAnim, 0.0f, this->skelAnime.curFrame, Animation_GetLastFrame(&gStalfosSlowAdvanceAnim), 0, -6.0f); playSpeed = this->actor.speed * 10.0f; @@ -1819,9 +1820,9 @@ void EnTest_Update(Actor* thisx, PlayState* play) { } } -s32 EnTest_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { +s32 EnTest_OverrideLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { EnTest* this = (EnTest*)thisx; - s32 pad; + PlayState* play = (PlayState*)play2; if (limbIndex == STALFOS_LIMB_HEAD_ROOT) { rot->x += this->headRot.y; diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index cdd8d34020..e543158d06 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -265,7 +265,6 @@ void EnTite_SetupAttack(EnTite* this) { void EnTite_Attack(EnTite* this, PlayState* play) { s16 angleToPlayer; s32 attackState; - Vec3f ripplePos; if (SkelAnime_Update(&this->skelAnime)) { attackState = this->vAttackState; // for deciding whether to change animation @@ -303,7 +302,8 @@ void EnTite_Attack(EnTite* this, PlayState* play) { } else { this->actor.gravity = 0.0f; if (this->actor.velocity.y < -8.0f) { - ripplePos = this->actor.world.pos; + Vec3f ripplePos = this->actor.world.pos; + ripplePos.y += this->actor.yDistToWater; this->vAttackState++; // TEKTITE_SUBMERGED this->actor.velocity.y *= 0.75f; diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 24eef2901e..32df4ef157 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -202,15 +202,10 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { Input* input = &sInput; Camera* mainCam; s16 sp66; - u8 staggerThreshold; s8 stickY; - s32 pad60; + u32 pad54; Actor* attackItem; s16 sp5A; - s16 pad58; - u32 pad54; - f32 sp50; - s16 sp4E; sp5A = player->actor.shape.rot.y - this->actor.shape.rot.y; input->cur.button = 0; @@ -410,44 +405,47 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { // Handles movement and attacks when not reacting to Link's actions sStickAngle = thisx->yawTowardsPlayer; - sp50 = 0.0f; if ((90.0f >= this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 70.0f) && (ABS(sp5A) >= 0x7800) && (this->actor.isTargeted || !(player->stateFlags1 & PLAYER_STATE1_22))) { EnTorch2_SwingSword(play, input, this); - } else if (((this->actor.xzDistToPlayer <= 70.0f) || - ((this->actor.xzDistToPlayer <= 80.0f + sp50) && - (player->meleeWeaponState != 0))) && - (this->meleeWeaponState == 0)) { - if (!EnTorch2_SwingSword(play, input, this) && (this->meleeWeaponState == 0) && - (sCounterState == 0)) { - EnTorch2_Backflip(this, input, &this->actor); - } - } else if (this->actor.xzDistToPlayer <= 50 + sp50) { - sStickTilt = 127.0f; - sStickAngle = this->actor.yawTowardsPlayer; - if (!this->actor.isTargeted) { - Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); - } - } else if (this->actor.xzDistToPlayer > 100.0f + sp50) { - if ((player->meleeWeaponState == 0) || - !((player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H) && - (player->meleeWeaponAnimation <= PLAYER_MWA_BIG_SPIN_2H)) || - (this->actor.xzDistToPlayer >= 280.0f)) { + } else { + f32 sp50 = 0.0f; + + if (((this->actor.xzDistToPlayer <= 70.0f) || + ((this->actor.xzDistToPlayer <= 80.0f + sp50) && (player->meleeWeaponState != 0))) && + (this->meleeWeaponState == 0)) { + if (!EnTorch2_SwingSword(play, input, this) && (this->meleeWeaponState == 0) && + (sCounterState == 0)) { + EnTorch2_Backflip(this, input, &this->actor); + } + } else if (this->actor.xzDistToPlayer <= 50 + sp50) { sStickTilt = 127.0f; sStickAngle = this->actor.yawTowardsPlayer; if (!this->actor.isTargeted) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } - } else { - EnTorch2_Backflip(this, input, &this->actor); - } - } else if (((ABS(sp5A) < 0x7800) && (ABS(sp5A) >= 0x3000)) || - !EnTorch2_SwingSword(play, input, this)) { - sStickAngle = this->actor.yawTowardsPlayer; - sStickTilt = 127.0f; - if (!this->actor.isTargeted) { - Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); + } else if (this->actor.xzDistToPlayer > 100.0f + sp50) { + if ((player->meleeWeaponState == 0) || + !((player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H) && + (player->meleeWeaponAnimation <= PLAYER_MWA_BIG_SPIN_2H)) || + (this->actor.xzDistToPlayer >= 280.0f)) { + sStickTilt = 127.0f; + sStickAngle = this->actor.yawTowardsPlayer; + if (!this->actor.isTargeted) { + Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, + 0); + } + } else { + EnTorch2_Backflip(this, input, &this->actor); + } + } else if (((ABS(sp5A) < 0x7800) && (ABS(sp5A) >= 0x3000)) || + !EnTorch2_SwingSword(play, input, this)) { + sStickAngle = this->actor.yawTowardsPlayer; + sStickTilt = 127.0f; + if (!this->actor.isTargeted) { + Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); + } } } } @@ -495,8 +493,9 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { this->actor.world.pos.x = (Math_SinS(player->actor.shape.rot.y) * -120.0f) + player->actor.world.pos.x; this->actor.world.pos.z = (Math_CosS(player->actor.shape.rot.y) * -120.0f) + player->actor.world.pos.z; if (Actor_WorldDistXYZToPoint(&this->actor, &sSpawnPoint) > 800.0f) { - sp50 = Rand_ZeroOne() * 20.0f; - sp4E = Rand_CenteredFloat(4000.0f); + f32 sp50 = Rand_ZeroOne() * 20.0f; + s16 sp4E = Rand_CenteredFloat(4000.0f); + this->actor.shape.rot.y = this->actor.world.rot.y = Math_Vec3f_Yaw(&sSpawnPoint, &player->actor.world.pos); this->actor.world.pos.x = @@ -640,7 +639,8 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { * if he's had to counter with enough different sword animations in a row. */ if (this->speedXZ == -18.0f) { - staggerThreshold = (u32)Rand_CenteredFloat(2.0f) + 6; + u8 staggerThreshold = (u32)Rand_CenteredFloat(2.0f) + 6; + if (gSaveContext.save.info.playerData.health < 0x50) { staggerThreshold = (u32)Rand_CenteredFloat(2.0f) + 3; } diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/src/overlays/actors/ovl_En_Tr/z_en_tr.c index e1f05e02ce..fa9a5fca8e 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -241,6 +241,8 @@ void func_80B23254(EnTr* this, PlayState* play, s32 arg2, f32 arg3, f32 scale) { } void EnTr_ShrinkVanish(EnTr* this, PlayState* play) { + s32 temp_hi; + if (this->timer >= 17) { this->actor.shape.rot.y = (this->actor.shape.rot.y - (this->timer * 0x28F)) + 0x3D68; } else { @@ -248,7 +250,7 @@ void EnTr_ShrinkVanish(EnTr* this, PlayState* play) { Actor_SetScale(&this->actor, this->actor.scale.x * 0.9f); this->actor.shape.rot.y = (this->actor.shape.rot.y - (this->timer * 0x28F)) + 0x3D68; } else if (this->timer > 0) { - s32 temp_hi = (this->timer * 2) % 7; + temp_hi = (this->timer * 2) % 7; func_80B23254(this, play, temp_hi, 5.0f, 0.2f); func_80B23254(this, play, (temp_hi + 1) % 7, 5.0f, 0.2f); diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.c b/src/overlays/actors/ovl_En_Trap/z_en_trap.c index 8bdcea0032..c675e84d33 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -135,7 +135,6 @@ void EnTrap_Update(Actor* thisx, PlayState* play) { Vec3f colPoint; // unused return value from function CollisionPoly* colPoly; // unused return value from function s32 bgId; // unused return value from function - f32 temp_cond; touchingActor = false; blockedOnReturn = false; @@ -209,7 +208,8 @@ void EnTrap_Update(Actor* thisx, PlayState* play) { Actor_PlaySfx(thisx, NA_SE_EV_SPINE_TRAP_MOVE); } } else if (thisx->params & SPIKETRAP_MODE_CIRCULAR) { - temp_cond = Math_SinS(this->vAngularPos); + f32 temp_cond = Math_SinS(this->vAngularPos); + this->vAngularPos += this->vAngularVel; // Every full circle make a sound: if ((temp_cond < 0.0f) && (Math_SinS(this->vAngularPos) >= 0.0f)) { diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index 2af941834e..30ab7d6afb 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -572,10 +572,10 @@ void EnVali_Update(Actor* thisx, PlayState* play) { void EnVali_PulseOutside(EnVali* this, f32 curFrame, Vec3f* scale) { f32 scaleChange; + s32 scalePhase; if (this->actionFunc == EnVali_Attacked) { - s32 scalePhase = 20 - (this->lightningTimer % 20); - + scalePhase = 20 - (this->lightningTimer % 20); if (scalePhase >= 10) { scalePhase -= 10; } @@ -607,10 +607,10 @@ void EnVali_PulseOutside(EnVali* this, f32 curFrame, Vec3f* scale) { void EnVali_PulseInsides(EnVali* this, f32 curFrame, Vec3f* scale) { f32 scaleChange; + s32 scalePhase; if (this->actionFunc == EnVali_Attacked) { - s32 scalePhase = 20 - (this->lightningTimer % 20); - + scalePhase = 20 - (this->lightningTimer % 20); if (scalePhase >= 10) { scalePhase -= 10; } diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index d10ebe4539..e9cdcddabf 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -368,15 +368,13 @@ void EnVm_SetupDie(EnVm* this) { } void EnVm_Die(EnVm* this, PlayState* play) { - EnBom* bomb; - this->beamRot.x += 0x5DC; this->headRotY += 0x9C4; Actor_MoveXZGravity(&this->actor); if (--this->timer == 0) { - bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0x6FF, BOMB_BODY); + EnBom* bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0x6FF, BOMB_BODY); if (bomb != NULL) { bomb->timer = 0; diff --git a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c index d865c5e48e..2728e4b0d3 100644 --- a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c +++ b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c @@ -147,7 +147,7 @@ void EnWallTubo_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if (BREG(0)) { + if (OOT_DEBUG && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 0, 255, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 11e0c9b11a..6793ae1cef 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -609,6 +609,8 @@ void EnWallmas_DrawXlu(EnWallmas* this, PlayState* play) { gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_wallmas.c", 1421), G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, gCircleShadowDL); + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_en_wallmas.c", 1426); } diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 3c89d4bf42..1259de2781 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -326,7 +326,8 @@ void EnWeatherTag_Update(Actor* thisx, PlayState* play) { EnWeatherTag* this = (EnWeatherTag*)thisx; this->actionFunc(this, play); - if (BREG(0) != 0) { + + if (OOT_DEBUG && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 255, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index d5e321ff50..9ff20a2e51 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -199,9 +199,9 @@ void func_80B32724(EnWeiyer* this) { } void func_80B327B0(EnWeiyer* this) { - this->actor.colorFilterParams |= 0x2000; this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; + this->actor.colorFilterParams |= 0x2000; this->actionFunc = func_80B33338; } diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 27d1641141..9863713a19 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -285,7 +285,6 @@ s32 EnWf_ChangeAction(PlayState* play, EnWf* this, s16 mustChoose) { s32 pad; s16 wallYawDiff; s16 playerYawDiff; - Actor* explosive; wallYawDiff = this->actor.wallYaw - this->actor.shape.rot.y; wallYawDiff = ABS(wallYawDiff); @@ -321,26 +320,27 @@ s32 EnWf_ChangeAction(PlayState* play, EnWf* this, s16 mustChoose) { EnWf_SetupBackflipAway(this); return true; } - } + } else { + Actor* explosive = Actor_FindNearby(play, &this->actor, -1, ACTORCAT_EXPLOSIVE, 80.0f); - explosive = Actor_FindNearby(play, &this->actor, -1, ACTORCAT_EXPLOSIVE, 80.0f); + if (explosive != NULL) { + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if (explosive != NULL) { - this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; - - if (((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (wallYawDiff < 0x2EE0)) || - (explosive->id == ACTOR_EN_BOM_CHU)) { - if ((explosive->id == ACTOR_EN_BOM_CHU) && (Actor_WorldDistXYZToActor(&this->actor, explosive) < 80.0f) && - (s16)((this->actor.shape.rot.y - explosive->world.rot.y) + 0x8000) < 0x3E80) { - EnWf_SetupSomersaultAndAttack(this); - return true; + if (((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (wallYawDiff < 0x2EE0)) || + (explosive->id == ACTOR_EN_BOM_CHU)) { + if ((explosive->id == ACTOR_EN_BOM_CHU) && + (Actor_WorldDistXYZToActor(&this->actor, explosive) < 80.0f) && + (s16)((this->actor.shape.rot.y - explosive->world.rot.y) + 0x8000) < 0x3E80) { + EnWf_SetupSomersaultAndAttack(this); + return true; + } else { + EnWf_SetupSidestep(this, play); + return true; + } } else { - EnWf_SetupSidestep(this, play); + EnWf_SetupBackflipAway(this); return true; } - } else { - EnWf_SetupBackflipAway(this); - return true; } } diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c index 5f4d3f5462..28d894bed0 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c @@ -206,15 +206,18 @@ void EnWonderItem_Init(Actor* thisx, PlayState* play) { void EnWonderItem_MultitagFree(EnWonderItem* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 prevTagFlags = this->tagFlags; + s16 prevTagFlags = this->tagFlags; s32 i; s32 mask; + f32 dx; + f32 dy; + f32 dz; for (i = 0, mask = 1; i < this->numTagPoints; i++, mask <<= 1) { if (!(prevTagFlags & mask)) { - f32 dx = player->actor.world.pos.x - sTagPointsFree[i].x; - f32 dy = player->actor.world.pos.y - sTagPointsFree[i].y; - f32 dz = player->actor.world.pos.z - sTagPointsFree[i].z; + dx = player->actor.world.pos.x - sTagPointsFree[i].x; + dy = player->actor.world.pos.y - sTagPointsFree[i].y; + dz = player->actor.world.pos.z - sTagPointsFree[i].z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 50.0f) { this->tagFlags |= mask; @@ -222,11 +225,14 @@ void EnWonderItem_MultitagFree(EnWonderItem* this, PlayState* play) { this->timer = this->timerMod + 81; return; } + +#if OOT_DEBUG if (BREG(0) != 0) { DebugDisplay_AddObject(sTagPointsFree[i].x, sTagPointsFree[i].y, sTagPointsFree[i].z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 255, 0, 255, 4, play->state.gfxCtx); } +#endif } } if (this->timer == 1) { @@ -269,15 +275,18 @@ void EnWonderItem_ProximitySwitch(EnWonderItem* this, PlayState* play) { void EnWonderItem_MultitagOrdered(EnWonderItem* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 prevTagFlags = this->tagFlags; + s16 prevTagFlags = this->tagFlags; s32 i; s32 mask; + f32 dx; + f32 dy; + f32 dz; for (i = 0, mask = 1; i < this->numTagPoints; i++, mask <<= 1) { if (!(prevTagFlags & mask)) { - f32 dx = player->actor.world.pos.x - sTagPointsOrdered[i].x; - f32 dy = player->actor.world.pos.y - sTagPointsOrdered[i].y; - f32 dz = player->actor.world.pos.z - sTagPointsOrdered[i].z; + dx = player->actor.world.pos.x - sTagPointsOrdered[i].x; + dy = player->actor.world.pos.y - sTagPointsOrdered[i].y; + dz = player->actor.world.pos.z - sTagPointsOrdered[i].z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 50.0f) { if (prevTagFlags & mask) { @@ -292,11 +301,15 @@ void EnWonderItem_MultitagOrdered(EnWonderItem* this, PlayState* play) { Actor_Kill(&this->actor); return; } - } else if (BREG(0) != 0) { + } + +#if OOT_DEBUG + if (BREG(0) != 0) { DebugDisplay_AddObject(sTagPointsOrdered[i].x, sTagPointsOrdered[i].y, sTagPointsOrdered[i].z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 0, 255, 255, 4, play->state.gfxCtx); } +#endif } } if (this->timer == 1) { @@ -358,7 +371,8 @@ void EnWonderItem_Update(Actor* thisx, PlayState* play) { if (this->wonderMode > 12) { colorIndex = 0; } - if (BREG(0) != 0) { + + if (OOT_DEBUG && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, debugArrowColors[colorIndex], debugArrowColors[colorIndex + 1], diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h index 398977d116..117b763c63 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h @@ -18,7 +18,7 @@ typedef struct EnWonderItem { /* 0x015A */ s16 dropCount; /* 0x015C */ s16 timer; /* 0x015E */ s16 tagFlags; - /* 0x015A */ s16 tagCount; + /* 0x0160 */ s16 tagCount; /* 0x0162 */ s16 switchFlag; /* 0x0164 */ char unk_164[4]; /* 0x0168 */ s16 nextTag; diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c index ecdd5252db..08dbcbd9fb 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c @@ -85,8 +85,8 @@ void func_80B391CC(EnWonderTalk* this, PlayState* play) { PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 日記帳スタート! ☆☆☆☆☆ \n" VT_RST); this->actor.textId = 0x5002; this->unk_156 = TEXT_STATE_CHOICE; - this->height = 30.0f; this->unk_15C = 40.0f; + this->height = 30.0f; // "Attention coordinates" PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 注目座標\t \t☆☆☆☆☆ %f\n" VT_RST, 30.0f); break; @@ -239,7 +239,7 @@ void EnWonderTalk_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); Actor_SetFocus(&this->actor, this->height); - if (BREG(0) != 0) { + if (OOT_DEBUG && BREG(0) != 0) { if (this->unk_15A != 0) { if ((this->unk_15A & 1) == 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index 77abdf2167..7dd016d496 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -130,7 +130,8 @@ void func_80B3A15C(EnWonderTalk2* this, PlayState* play) { if (!((this->actor.xzDistToPlayer > 40.0f + this->triggerRange) || (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) > 100.0f) || (yawDiff >= 0x4000))) { - if (this->unk_158 >= 2) { + + if (OOT_DEBUG && this->unk_158 >= 2) { PRINTF("\n\n"); // "Transparent Message Kimi Set" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 透明メッセージ君せっと %x\n" VT_RST, this->actor.params); @@ -218,7 +219,8 @@ void func_80B3A4F8(EnWonderTalk2* this, PlayState* play) { if (((this->actor.xzDistToPlayer < (40.0f + this->triggerRange)) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 100.0f)) && !Play_InCsMode(play)) { - if (this->unk_158 >= 2) { + + if (OOT_DEBUG && this->unk_158 >= 2) { PRINTF("\n\n"); // "Transparent Message Kimi Seto" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 透明メッセージ君せっと %x\n" VT_RST, this->actor.params); @@ -249,6 +251,7 @@ void func_80B3A4F8(EnWonderTalk2* this, PlayState* play) { PRINTF("\n\n"); } + this->unk_158 = 0; if (!this->unk_156) { Message_StartTextbox(play, this->actor.textId, NULL); @@ -275,7 +278,7 @@ void EnWonderTalk2_Update(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->actor, this->height); - if (BREG(0) != 0) { + if (OOT_DEBUG && BREG(0) != 0) { if (this->unk_158 != 0) { if ((this->unk_158 & 1) == 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index 6b6267848d..9d2decda7c 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -306,18 +306,13 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { PlayState* play = play2; EnWood02* this = (EnWood02*)thisx; f32 wobbleAmplitude; - u8 new_var; - u8 phi_v0; - s32 pad; - Vec3f dropsSpawnPt; - s32 i; - s32 leavesParams; // Despawn extra trees in a group if out of range if ((this->spawnType == WOOD_SPAWN_SPAWNED) && (this->actor.parent != NULL)) { if (!(this->actor.flags & ACTOR_FLAG_6)) { - new_var = this->unk_14E[0]; - phi_v0 = 0; + u8 new_var = this->unk_14E[0]; + u8 phi_v0 = 0; + s32 pad; if (this->unk_14C < 0) { phi_v0 = 0x80; @@ -338,7 +333,8 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { } if (this->actor.home.rot.y != 0) { - dropsSpawnPt = this->actor.world.pos; + Vec3f dropsSpawnPt = this->actor.world.pos; + dropsSpawnPt.y += 200.0f; if ((this->unk_14C >= 0) && (this->unk_14C < 0x64)) { @@ -355,7 +351,8 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { // Spawn falling leaves if (this->unk_14C >= -1) { - leavesParams = WOOD_LEAF_GREEN; + s32 i; + s32 leavesParams = WOOD_LEAF_GREEN; if ((this->actor.params == WOOD_TREE_OVAL_YELLOW_SPAWNER) || (this->actor.params == WOOD_TREE_OVAL_YELLOW_SPAWNED)) { diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index d6fb2b59b9..3df3e36bfb 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -226,8 +226,9 @@ void func_80B3C7D4(EnXc* this, s32 action1, s32 action2, s32 action3) { } } +#if OOT_DEBUG s32 EnXc_NoCutscenePlaying(PlayState* play) { - if (play->csCtx.state == 0) { + if (play->csCtx.state == CS_STATE_IDLE) { return true; } return false; @@ -244,6 +245,7 @@ void func_80B3C888(EnXc* this, PlayState* play) { func_80B3C820(this); } } +#endif void func_80B3C8CC(EnXc* this, PlayState* play) { SkelAnime* skelAnime = &this->skelAnime; @@ -280,6 +282,8 @@ void func_80B3C9EC(EnXc* this) { void func_80B3CA38(EnXc* this, PlayState* play) { // If Player is adult but hasn't learned Minuet of Forest if (!GET_EVENTCHKINF(EVENTCHKINF_50) && LINK_IS_ADULT) { + s32 pad; + this->action = SHEIK_ACTION_INIT; } else { Actor_Kill(&this->actor); @@ -287,12 +291,17 @@ void func_80B3CA38(EnXc* this, PlayState* play) { } s32 EnXc_MinuetCS(EnXc* this, PlayState* play) { - if (this->actor.params == SHEIK_TYPE_MINUET) { - Player* player = GET_PLAYER(play); - f32 z = player->actor.world.pos.z; + Player* player; + f32 playerPosZ; - if (z < -2225.0f) { + if (this->actor.params == SHEIK_TYPE_MINUET) { + player = GET_PLAYER(play); + playerPosZ = player->actor.world.pos.z; + + if (playerPosZ < -2225.0f) { if (!Play_InCsMode(play)) { + s32 pad; + play->csCtx.script = SEGMENTED_TO_VIRTUAL(gMinuetCs); gSaveContext.cutsceneTrigger = 1; SET_EVENTCHKINF(EVENTCHKINF_50); @@ -308,6 +317,8 @@ s32 EnXc_MinuetCS(EnXc* this, PlayState* play) { void func_80B3CB58(EnXc* this, PlayState* play) { // If hasn't learned Bolero and Player is Adult if (!GET_EVENTCHKINF(EVENTCHKINF_51) && LINK_IS_ADULT) { + s32 pad; + this->action = SHEIK_ACTION_INIT; } else { Actor_Kill(&this->actor); @@ -324,6 +335,8 @@ s32 EnXc_BoleroCS(EnXc* this, PlayState* play) { if ((posRot->pos.x > -784.0f) && (posRot->pos.x < -584.0f) && (posRot->pos.y > 447.0f) && (posRot->pos.y < 647.0f) && (posRot->pos.z > -446.0f) && (posRot->pos.z < -246.0f) && !Play_InCsMode(play)) { + s32 pad; + play->csCtx.script = SEGMENTED_TO_VIRTUAL(gDeathMountainCraterBoleroCs); gSaveContext.cutsceneTrigger = 1; SET_EVENTCHKINF(EVENTCHKINF_51); @@ -336,9 +349,10 @@ s32 EnXc_BoleroCS(EnXc* this, PlayState* play) { } void EnXc_SetupSerenadeAction(EnXc* this, PlayState* play) { - // Player is adult and does not have iron boots and has not learned Serenade - if (!CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) && !GET_EVENTCHKINF(EVENTCHKINF_52) && + if (!(CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) && OOT_DEBUG) && !GET_EVENTCHKINF(EVENTCHKINF_52) && LINK_IS_ADULT) { + s32 pad; + this->action = SHEIK_ACTION_SERENADE; PRINTF("水のセレナーデ シーク誕生!!!!!!!!!!!!!!!!!!\n"); } else { @@ -354,15 +368,18 @@ s32 EnXc_SerenadeCS(EnXc* this, PlayState* play) { if (CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) && !GET_EVENTCHKINF(EVENTCHKINF_52) && !(stateFlags & PLAYER_STATE1_29) && !Play_InCsMode(play)) { + s32 pad; + Cutscene_SetScript(play, gIceCavernSerenadeCs); gSaveContext.cutsceneTrigger = 1; SET_EVENTCHKINF(EVENTCHKINF_52); // Learned Serenade of Water Flag Item_Give(play, ITEM_SONG_SERENADE); PRINTF("ブーツを取った!!!!!!!!!!!!!!!!!!\n"); return true; + } else { + PRINTF("はやくブーツを取るべし!!!!!!!!!!!!!!!!!!\n"); + return false; } - PRINTF("はやくブーツを取るべし!!!!!!!!!!!!!!!!!!\n"); - return false; } return true; } @@ -471,9 +488,10 @@ void EnXc_SetColossusWindSFX(PlayState* play) { if (D_80B41D90 != 0) { f32 speed = Math3D_Vec3f_DistXYZ(&D_80B42DB0, eye) / 7.058922f; +#if OOT_DEBUG sMaxSpeed = CLAMP_MIN(sMaxSpeed, speed); - PRINTF("MAX speed = %f\n", sMaxSpeed); +#endif speed = CLAMP_MAX(speed, 2.0f); func_800F436C(&sPos, NA_SE_EV_FLYING_AIR - SFX_FLAG, 0.6f + (0.4f * speed)); @@ -784,6 +802,8 @@ void EnXc_SetupHarpPutawayAction(EnXc* this, PlayState* play) { curFrame = this->skelAnime.curFrame; animFrameCount = this->skelAnime.endFrame; if (curFrame >= animFrameCount) { + s32 pad; + Animation_Change(&this->skelAnime, &gSheikInitialHarpAnim, -1.0f, Animation_GetLastFrame(&gSheikInitialHarpAnim), 0.0f, ANIMMODE_ONCE, 0.0f); this->action = SHEIK_ACTION_PUT_HARP_AWAY; @@ -873,6 +893,8 @@ void EnXc_SetupDisappear(EnXc* this, PlayState* play) { // Sheik fades away if end of Bolero CS, kill actor otherwise if (sceneId == SCENE_DEATH_MOUNTAIN_CRATER) { + s32 pad; + this->action = SHEIK_ACTION_FADE; this->drawMode = SHEIK_DRAW_NOTHING; this->actor.shape.shadowAlpha = 0; @@ -1666,7 +1688,9 @@ void EnXc_ActionFunc54(EnXc* this, PlayState* play) { EnXc_BgCheck(this, play); EnXc_SetEyePattern(this); EnXc_SetupShowTriforceAction(this, play); +#if OOT_DEBUG func_80B3C888(this, play); +#endif } void EnXc_ShowTriforce(EnXc* this, PlayState* play) { @@ -1677,7 +1701,9 @@ void EnXc_ShowTriforce(EnXc* this, PlayState* play) { EnXc_CalcTriforce(&this->actor, play); func_80B3FAE0(this); EnXc_SetupShowTriforceIdleAction(this, animFinished); +#if OOT_DEBUG func_80B3C888(this, play); +#endif } void EnXc_ShowTriforceIdle(EnXc* this, PlayState* play) { @@ -1814,11 +1840,13 @@ void EnXc_SetupDefenseStance(Actor* thisx) { } void EnXc_SetupContortions(EnXc* this, PlayState* play) { - s32 pad; + s32 pad[2]; SkelAnime* skelAnime = &this->skelAnime; - f32 frameCount = Animation_GetLastFrame(&gSheikIdleAnim); - Animation_Change(skelAnime, &gSheikIdleAnim, 1.0f, 0.0f, frameCount, ANIMMODE_LOOP, 0.0f); +#if OOT_DEBUG + Animation_Change(skelAnime, &gSheikIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gSheikIdleAnim), ANIMMODE_LOOP, + 0.0f); +#endif func_80B3C588(this, play, 4); func_80B3C964(this, play); Animation_Change(skelAnime, &gSheikContortionsAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gSheikContortionsAnim), @@ -2171,6 +2199,8 @@ void EnXc_InitTempleOfTime(EnXc* this, PlayState* play) { void EnXc_SetupDialogueAction(EnXc* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { + s32 pad; + this->action = SHEIK_ACTION_IN_DIALOGUE; } else { this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; @@ -2339,9 +2369,11 @@ void EnXc_Init(Actor* thisx, PlayState* play) { case SHEIK_TYPE_9: EnXc_InitTempleOfTime(this, play); break; +#if OOT_DEBUG case SHEIK_TYPE_0: EnXc_DoNothing(this, play); break; +#endif default: PRINTF(VT_FGCOL(RED) " En_Oa2 の arg_data がおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); EnXc_DoNothing(this, play); @@ -2353,6 +2385,8 @@ s32 EnXc_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po if (this->unk_30C != 0) { if (limbIndex == 9) { + s32 pad; + rot->x += this->interactInfo.torsoRot.y; rot->y -= this->interactInfo.torsoRot.x; } else if (limbIndex == 16) { diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c index 8eeb0e034b..6cf0b7a5e5 100644 --- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c +++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c @@ -194,6 +194,8 @@ void EnYabusameMark_Update(Actor* thisx, PlayState* play) { arrayIndex = this->typeIndex * 4; vertexArray = &sCollisionVertices[arrayIndex]; + if (1) {} + this->vertexA.x = vertexArray[0].x + this->actor.world.pos.x; this->vertexA.y = vertexArray[0].y + this->actor.world.pos.y; this->vertexA.z = vertexArray[0].z + this->actor.world.pos.z; @@ -212,7 +214,8 @@ void EnYabusameMark_Update(Actor* thisx, PlayState* play) { Collider_SetQuadVertices(&this->collider, &this->vertexA, &this->vertexB, &this->vertexC, &this->vertexD); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); - if (BREG(0)) { + + if (OOT_DEBUG && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 0xFF, 0, 0xFF, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 9d1c93926f..ddf9af8e79 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -412,9 +412,12 @@ s16 EnZf_FindNextPlatformAwayFromPlayer(Vec3f* pos, s16 curPlatform, s16 arg2, P s16 curLoopPlatform = PLATFORM_INDEX_DOWNSTAIRS_INNER_MAX; // Will never retreat to the last two s16 minIndex = PLATFORM_INDEX_DOWNSTAIRS_MIN; f32 largeMaxRange = 99999.0f; - s16 altNextPlatform = -1; - s16 nextPlatform = -1; - s16 playerPlatform = EnZf_FindPlatform(&player->actor.world.pos, initialPlatform); + s16 nextPlatform; + s16 altNextPlatform; + s16 playerPlatform; + + altNextPlatform = nextPlatform = -1; + playerPlatform = EnZf_FindPlatform(&player->actor.world.pos, initialPlatform); // Set up search constraints // Upstairs @@ -436,9 +439,12 @@ s16 EnZf_FindNextPlatformAwayFromPlayer(Vec3f* pos, s16 curPlatform, s16 arg2, P if ((curLoopPlatform == initialPlatform) || (curLoopPlatform == playerPlatform)) { continue; } - if ((playerPlatform == -1) && - (Math_Vec3f_DistXYZ(&player->actor.world.pos, &sPlatformPositions[curLoopPlatform]) < playerMaxDist)) { - continue; + if (playerPlatform == -1) { + s16 pad; + + if (Math_Vec3f_DistXYZ(&player->actor.world.pos, &sPlatformPositions[curLoopPlatform]) < playerMaxDist) { + continue; + } } distToCurLoopPlatform = Math_Vec3f_DistXYZ(pos, &sPlatformPositions[curLoopPlatform]); @@ -490,6 +496,7 @@ s16 EnZf_FindNextPlatformTowardsPlayer(Vec3f* pos, s16 curPlatform, s16 arg2, Pl f32 largeMaxRange = 99999.0f; s16 phi_s2 = curPlatform; s16 phi_s3 = arg2; + f32 curPlatformDistToPlayer; // Upstairs if (pos->y > 200.0f) { @@ -503,7 +510,7 @@ s16 EnZf_FindNextPlatformTowardsPlayer(Vec3f* pos, s16 curPlatform, s16 arg2, Pl continue; } if (curLoopPlatform != nextPlatform) { - f32 curPlatformDistToPlayer = + curPlatformDistToPlayer = Math_Vec3f_DistXYZ(&player->actor.world.pos, &sPlatformPositions[curLoopPlatform]); if (curPlatformDistToPlayer < smallMaxRange) { @@ -1783,27 +1790,31 @@ void EnZf_CircleAroundPlayer(EnZf* this, PlayState* play) { if (this->unk_3F8) { this->actor.speed = -this->actor.speed; } - } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || - !Actor_TestFloorInDirection(&this->actor, play, this->actor.speed, this->actor.shape.rot.y + 0x3FFF)) { - if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { - if (this->actor.speed >= 0.0f) { - phi_v0_4 = this->actor.shape.rot.y + 0x3FFF; + } else { + s16 pad; + + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || + !Actor_TestFloorInDirection(&this->actor, play, this->actor.speed, this->actor.shape.rot.y + 0x3FFF)) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { + if (this->actor.speed >= 0.0f) { + phi_v0_4 = this->actor.shape.rot.y + 0x3FFF; + } else { + phi_v0_4 = this->actor.shape.rot.y - 0x3FFF; + } + + phi_v0_4 = this->actor.wallYaw - phi_v0_4; } else { - phi_v0_4 = this->actor.shape.rot.y - 0x3FFF; + this->actor.speed *= -0.8f; + phi_v0_4 = 0; } - phi_v0_4 = this->actor.wallYaw - phi_v0_4; - } else { - this->actor.speed *= -0.8f; - phi_v0_4 = 0; - } - - if (ABS(phi_v0_4) > 0x4000) { - this->actor.speed *= -0.8f; - if (this->actor.speed < 0.0f) { - this->actor.speed -= 0.5f; - } else { - this->actor.speed += 0.5f; + if (ABS(phi_v0_4) > 0x4000) { + this->actor.speed *= -0.8f; + if (this->actor.speed < 0.0f) { + this->actor.speed -= 0.5f; + } else { + this->actor.speed += 0.5f; + } } } } @@ -1873,6 +1884,8 @@ void EnZf_CircleAroundPlayer(EnZf* this, PlayState* play) { } else if ((this->actor.params >= ENZF_TYPE_LIZALFOS_MINIBOSS_A) && (D_80B4A1B4 == this->actor.params)) { EnZf_SetupHopAndTaunt(this); } else { + s16 pad; + this->actor.world.rot.y = this->actor.shape.rot.y; if ((this->actor.xzDistToPlayer <= 100.0f) && ((play->gameplayFrames % 4) == 0) && @@ -1889,10 +1902,8 @@ void EnZf_CircleAroundPlayer(EnZf* this, PlayState* play) { this->unk_3F0--; } if (prevFrame != (s32)this->skelAnime.curFrame) { - s32 afterPrevFrame = absPlaySpeed + prevFrame; - - if (((beforeCurFrame < 14) && (afterPrevFrame >= 16)) || - ((beforeCurFrame < 27) && (afterPrevFrame >= 29))) { + if (((beforeCurFrame < 14) && (absPlaySpeed + prevFrame >= 16)) || + ((beforeCurFrame < 27) && (absPlaySpeed + prevFrame >= 29))) { Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_WALK); } } diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index f0a2d69a21..d518e4da43 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -212,8 +212,11 @@ s32 EnZl2_UpdateSkelAnime(EnZl2* this) { CsCmdActorCue* EnZl2_GetCue(PlayState* play, s32 cueChannel) { if (play->csCtx.state != CS_STATE_IDLE) { - return play->csCtx.actorCues[cueChannel]; + CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel]; + + return cue; } + return NULL; } @@ -334,7 +337,11 @@ void func_80B4EF64(EnZl2* this, s16 arg1, s32 arg2) { } if (arg2 == 2) { + s32 pad; + if ((this->action == 5) || (this->action == 30)) { + s32 temp_t0; + curFrame = this->skelAnime.curFrame; unk_278 = this->unk_278; temp_t0 = (s32)((3500.0f * curFrame) / unk_278) + phi_a0; @@ -343,13 +350,15 @@ void func_80B4EF64(EnZl2* this, s16 arg1, s32 arg2) { phi_v0 /= -2; } } else if ((this->action == 6) || (this->action == 31)) { - temp_t0 = phi_a0 + 0xDAC; + s32 temp_t0 = phi_a0 + 0xDAC; + if (temp_t0 >= temp_v1) { temp_v1 = temp_t0; phi_v0 /= -2; } } else if (this->action == 20) { - temp_t0 = phi_a0 - 0x3E8; + s32 temp_t0 = phi_a0 - 0x3E8; + if (temp_t0 >= temp_v1) { temp_v1 = temp_t0; phi_v0 /= -2; @@ -1563,9 +1572,11 @@ void func_80B52114(EnZl2* this, PlayState* play) { case 4: func_80B51D0C(this, play); break; +#if OOT_DEBUG case 0: func_80B4FD90(this, play); break; +#endif default: PRINTF(VT_FGCOL(RED) " En_Oa2 の arg_data がおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); func_80B4FD90(this, play); @@ -1578,10 +1589,12 @@ void func_80B521A0(EnZl2* this, PlayState* play) { s32 objectSlot = Object_GetSlot(objectCtx, OBJECT_ZL2_ANIME1); s32 pad2; +#if OOT_DEBUG if (objectSlot < 0) { PRINTF(VT_FGCOL(RED) "En_Zl2_main_bankアニメーションのバンクを読めない!!!!!!!!!!!!\n" VT_RST); return; } +#endif if (Object_IsLoaded(objectCtx, objectSlot)) { this->zl2Anime1ObjectSlot = objectSlot; diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index 24e97ebd1d..dc1f5ea812 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -271,7 +271,6 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { s32 temp_a0; s32 phi_v0; s32 phi_v1; - s32 phi_v1_2; if (idx == 2) { phi_a1 = 15000; @@ -315,18 +314,26 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { if (idx == 2 && (action == 5 || action == 24)) { if (phi_v1 != 0) { + s32 pad; + phi_v0 -= (phi_v1 - phi_v0) / 10; } } else if (idx == 2 && action == 22 && skelAnime->mode == 2) { if (phi_v1 != 0) { + s32 pad; + phi_v0 -= (phi_v1 - phi_v0) / 10; } } else if (idx == 2 && (action == 20 || action == 21) && skelAnime->mode == 2) { if (phi_v1 != 0) { + s32 pad; + phi_v0 -= (phi_v1 - phi_v0) / 10; } } else { if (phi_v1 != 0) { + s32 pad; + phi_v0 += (phi_v1 - phi_v0) / 16; } } @@ -352,8 +359,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { if (skelAnime->mode == 2) { f32 curFrame = skelAnime->curFrame; f32 unk_3E0 = this->unk_3E0; + s32 phi_v1_2 = (s32)(((unk_3E0 - curFrame) / unk_3E0) * -2000.0f) + phi_a1; - phi_v1_2 = (s32)(((unk_3E0 - curFrame) / unk_3E0) * -2000.0f) + phi_a1; if (phi_v1_2 >= temp_a0) { temp_a0 = phi_v1_2; if (phi_v0 < 0) { @@ -365,8 +372,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { if (skelAnime->mode == 2) { f32 curFrame = skelAnime->curFrame; f32 unk_3E4 = this->unk_3E4; + s32 phi_v1_2 = (s32)((curFrame / unk_3E4) * -2000.0f) + phi_a1; - phi_v1_2 = (s32)((curFrame / unk_3E4) * -2000.0f) + phi_a1; if (phi_v1_2 >= temp_a0) { temp_a0 = phi_v1_2; if (phi_v0 < 0) { @@ -374,7 +381,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { } } } else { - phi_v1_2 = phi_a1 - 2000; + s32 phi_v1_2 = phi_a1 - 2000; + if (phi_v1_2 >= temp_a0) { temp_a0 = phi_v1_2; if (phi_v0 < 0) { @@ -386,6 +394,7 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { if (skelAnime->mode == 2) { f32 curFrame = skelAnime->curFrame; f32 unk_3F4 = this->unk_3F4; + s32 phi_v1_2; if (curFrame <= 42.0f) { phi_v1_2 = phi_a1 - 2000; @@ -400,7 +409,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { } } } else { - phi_v1_2 = phi_a1 + 4200; + s32 phi_v1_2 = phi_a1 + 4200; + if (phi_v1_2 >= temp_a0) { temp_a0 = phi_v1_2; if (phi_v0 < 0) { @@ -412,8 +422,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { if (skelAnime->mode == 2) { f32 curFrame = skelAnime->curFrame; f32 unk_3EC = this->unk_3EC; + s32 phi_v1_2 = (s32)(((curFrame / unk_3EC) * -5200.0f) + 4200.0f) + phi_a1; - phi_v1_2 = (s32)(((curFrame / unk_3EC) * -5200.0f) + 4200.0f) + phi_a1; if (phi_v1_2 >= temp_a0) { temp_a0 = phi_v1_2; if (phi_v0 < 0) { @@ -421,7 +431,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { } } } else { - phi_v1_2 = phi_a1 - 2000; + s32 phi_v1_2 = phi_a1 - 2000; + if (phi_v1_2 >= temp_a0) { temp_a0 = phi_v1_2; if (phi_v0 < 0) { @@ -433,8 +444,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { if (skelAnime->mode == 2) { f32 curFrame = skelAnime->curFrame; f32 unk_3F0 = this->unk_3F0; + s32 phi_v1_2 = (s32)(((curFrame / unk_3F0) * -7600.0f) + -2000.0f) + phi_a1; - phi_v1_2 = (s32)(((curFrame / unk_3F0) * -7600.0f) + -2000.0f) + phi_a1; if (phi_v1_2 >= temp_a0) { temp_a0 = phi_v1_2; if (phi_v0 < 0) { @@ -442,7 +453,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { } } } else { - phi_v1_2 = phi_a1 - 9600; + s32 phi_v1_2 = phi_a1 - 9600; + if (phi_v1_2 >= temp_a0) { temp_a0 = phi_v1_2; if (phi_v0 < 0) { @@ -454,8 +466,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { if (skelAnime->mode == 2) { f32 curFrame = skelAnime->curFrame; f32 unk_3E8 = this->unk_3E8; + s32 phi_v1_2 = (s32)(((curFrame / unk_3E8) * 21000.0f) + -9600.0f) + phi_a1; - phi_v1_2 = (s32)(((curFrame / unk_3E8) * 21000.0f) + -9600.0f) + phi_a1; if (phi_v1_2 >= temp_a0) { temp_a0 = phi_v1_2; if (phi_v0 < 0) { @@ -463,7 +475,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { } } } else { - phi_v1_2 = phi_a1 + 11400; + s32 phi_v1_2 = phi_a1 + 11400; + if (phi_v1_2 >= temp_a0) { temp_a0 = phi_v1_2; if (phi_v0 < 0) { @@ -477,8 +490,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { if (skelAnime->mode == 2) { f32 curFrame = skelAnime->curFrame; f32 unk_3E0 = this->unk_3E0; + s32 phi_v1_2 = (s32)((curFrame / unk_3E0) * -7000.0f) + phi_a1; - phi_v1_2 = (s32)((curFrame / unk_3E0) * -7000.0f) + phi_a1; if (temp_a0 >= phi_v1_2) { temp_a0 = phi_v1_2; if (phi_v0 > 0) { @@ -486,7 +499,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { } } } else { - phi_v1_2 = phi_a1 - 7000; + s32 phi_v1_2 = phi_a1 - 7000; + if (temp_a0 >= phi_v1_2) { temp_a0 = phi_v1_2; if (phi_v0 > 0) { @@ -498,8 +512,8 @@ void func_80B53B64(EnZl3* this, s16 z, s32 idx) { if (skelAnime->mode == 2) { f32 curFrame = skelAnime->curFrame; f32 unk_3E4 = this->unk_3E4; + s32 phi_v1_2 = (s32)(((unk_3E4 - curFrame) / unk_3E4) * -7000.0f) + phi_a1; - phi_v1_2 = (s32)(((unk_3E4 - curFrame) / unk_3E4) * -7000.0f) + phi_a1; if (temp_a0 >= phi_v1_2) { temp_a0 = phi_v1_2; if (phi_v0 > 0) { @@ -582,17 +596,18 @@ void func_80B54360(EnZl3* this, s16 arg1, s32 arg2) { } s32 func_80B5458C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx, Gfx** gfx) { - s32 pad[3]; + s32 pad[2]; EnZl3* this = (EnZl3*)thisx; - s16* unk_28C = this->unk_28C; - Mtx* sp78; - MtxF sp38; - Vec3s sp30; Vec3s* headRot = &this->interactInfo.headRot; Vec3s* torsoRot = &this->interactInfo.torsoRot; if (limbIndex == 14) { - sp78 = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx) * 7); + Mtx* sp78 = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx) * 7); + MtxF sp38; + Vec3s sp30; + s16* unk_28C = this->unk_28C; + s32 pad2; + rot->x += headRot->y; rot->z += headRot->x; gSPSegment((*gfx)++, 0x0C, sp78); @@ -687,16 +702,16 @@ s32 func_80B5458C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s void EnZl3_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfx) { EnZl3* this = (EnZl3*)thisx; s32 pad; - Vec3f sp34; - s32 pad2; - Vec3f sp24; - Vec3f sp18; if (limbIndex == 13) { - sp34 = D_80B5A46C; + Vec3f sp34 = D_80B5A46C; + s32 pad2; + Matrix_MultVec3f(&sp34, &this->unk_31C); } else if (limbIndex == 14) { - sp24 = D_80B5A478; + Vec3f sp24 = D_80B5A478; + Vec3f sp18; + Matrix_MultVec3f(&sp24, &sp18); this->actor.focus.pos.x = sp18.x; this->actor.focus.pos.y = sp18.y; @@ -796,6 +811,8 @@ void func_80B55054(EnZl3* this) { f32* temp_v0 = &this->unk_2EC; if (*temp_v0 < 19.0f) { + s32 pad; + ((DoorWarp1*)child)->crystalAlpha = (20.0f - *temp_v0) * 12.75f; *temp_v0 += 1.0f; } else { @@ -1777,8 +1794,12 @@ void func_80B5764C(EnZl3* this, PlayState* play) { } s32 func_80B576C8(EnZl3* this, PlayState* play) { - if (func_80B575F0(this, play) && (this->unk_3D8 == 0)) { - return 1; + if (func_80B575F0(this, play)) { + s32 pad; + + if (this->unk_3D8 == 0) { + return 1; + } } return 0; } @@ -1986,6 +2007,8 @@ s32 func_80B57D80(EnZl3* this, PlayState* play) { void func_80B57EAC(EnZl3* this, PlayState* play) { if (func_80B57324(this, play)) { + s32 pad; + this->action = 26; } else { func_80B57350(this, play); @@ -2028,6 +2051,8 @@ void func_80B58014(EnZl3* this, PlayState* play) { this->action = 29; func_80B538B0(this); } else if (func_80B57C8C(this) && func_80B57F84(this, play)) { + s32 pad; + OnePointCutscene_Init(play, 4000, -99, &this->actor, CAM_ID_MAIN); this->unk_3D0 = 0; } else if (func_80B576C8(this, play) && func_80B575B0(this, play) && !Play_InCsMode(play)) { @@ -2129,7 +2154,7 @@ void func_80B584B4(EnZl3* this, PlayState* play) { } void func_80B58624(EnZl3* this, PlayState* play) { - s32 pad[4]; + s32 pad[3]; f32* unk_3CC = &this->unk_3CC; if (*unk_3CC == (kREG(18) + 10.0f)) { @@ -2137,6 +2162,8 @@ void func_80B58624(EnZl3* this, PlayState* play) { func_80B54E14(this, &gZelda2Anime2Anim_008050, 0, -12.0f, 0); func_80B5772C(this, play); } else if (*unk_3CC == kREG(19) + 20.0f) { + s32 pad2; + *unk_3CC += 1.0f; this->actor.textId = 0x71AC; Message_StartTextbox(play, this->actor.textId, NULL); @@ -2508,9 +2535,9 @@ s32 func_80B59768(EnZl3* this, PlayState* play) { } void func_80B59828(EnZl3* this, PlayState* play) { - if (func_80B59698(this, play) || (!func_80B56EE4(this, play) && func_80B57890(this, play))) { - s16 newRotY; + s16 newRotY; + if (func_80B59698(this, play) || (!func_80B56EE4(this, play) && func_80B57890(this, play))) { func_80B54E14(this, &gZelda2Anime2Anim_009FBC, 0, 0.0f, 0); this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; func_80B56F10(this, play); @@ -2616,10 +2643,12 @@ void func_80B59DB8(EnZl3* this, PlayState* play) { s32 objectSlot = Object_GetSlot(objectCtx, OBJECT_ZL2_ANIME2); s32 pad2; +#if OOT_DEBUG if (objectSlot < 0) { PRINTF(VT_FGCOL(RED) "En_Zl3_main_bankアニメーションのバンクを読めない!!!!!!!!!!!!\n" VT_RST); return; } +#endif if (Object_IsLoaded(objectCtx, objectSlot)) { this->zl2Anime2ObjectSlot = objectSlot; diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c index 7a5502c4b0..37771a389c 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -32,7 +32,7 @@ typedef enum { } EnfHGIntroState; void EnfHG_Init(Actor* thisx, PlayState* play2); -void EnfHG_Destroy(Actor* thisx, PlayState* play); +void EnfHG_Destroy(Actor* thisx, PlayState* play2); void EnfHG_Update(Actor* thisx, PlayState* play); void EnfHG_Draw(Actor* thisx, PlayState* play); @@ -89,8 +89,8 @@ void EnfHG_Init(Actor* thisx, PlayState* play2) { } } -void EnfHG_Destroy(Actor* thisx, PlayState* play) { - s32 pad; +void EnfHG_Destroy(Actor* thisx, PlayState* play2) { + PlayState* play = (PlayState*)play2; EnfHG* this = (EnfHG*)thisx; PRINTF("F DT1\n"); @@ -651,6 +651,7 @@ void EnfHG_Retreat(EnfHG* this, PlayState* play) { BossGanondrof* bossGnd = (BossGanondrof*)this->actor.parent; s16 paintingIdxReal; s16 paintingIdxFake; + Actor* child; if (this->actor.params != GND_REAL_BOSS) { this->killActor = true; @@ -664,10 +665,11 @@ void EnfHG_Retreat(EnfHG* this, PlayState* play) { do { paintingIdxFake = Rand_ZeroOne() * 5.99f; } while (paintingIdxFake == paintingIdxReal); - PRINTF("ac1 = %x `````````````````````````````````````````````````\n", - Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_BOSS_GANONDROF, - this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, - 0, paintingIdxFake + GND_FAKE_BOSS)); + + child = Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_BOSS_GANONDROF, + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, + 0, paintingIdxFake + GND_FAKE_BOSS); + PRINTF("ac1 = %x `````````````````````````````````````````````````\n", child); } } } diff --git a/src/overlays/actors/ovl_End_Title/z_end_title.c b/src/overlays/actors/ovl_End_Title/z_end_title.c index f3c2d3a945..a71164cec4 100644 --- a/src/overlays/actors/ovl_End_Title/z_end_title.c +++ b/src/overlays/actors/ovl_End_Title/z_end_title.c @@ -31,9 +31,7 @@ ActorInit End_Title_InitVars = { void EndTitle_Init(Actor* thisx, PlayState* play) { EndTitle* this = (EndTitle*)thisx; - this->endAlpha = 0; - this->tlozAlpha = 0; - this->ootAlpha = 0; + this->endAlpha = this->tlozAlpha = this->ootAlpha = 0; if (this->actor.params == 1) { this->actor.draw = EndTitle_DrawNintendoLogo; } diff --git a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c index 170e0bafce..2d3053bfc0 100644 --- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c +++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c @@ -76,8 +76,6 @@ void MagicDark_DiamondUpdate(Actor* thisx, PlayState* play) { s16 nayrusLoveTimer = gSaveContext.nayrusLoveTimer; s32 msgMode = play->msgCtx.msgMode; - if (1) {} - // See `ACTOROVL_ALLOC_ABSOLUTE` //! @bug This condition is too broad, the actor will also be killed by warp songs. But warp songs do not use an //! actor which uses `ACTOROVL_ALLOC_ABSOLUTE`. There is no reason to kill the actor in this case. @@ -90,6 +88,8 @@ void MagicDark_DiamondUpdate(Actor* thisx, PlayState* play) { } if (nayrusLoveTimer >= 1200) { + if (1) {} + player->invincibilityTimer = 0; gSaveContext.nayrusLoveTimer = 0; Actor_Kill(thisx); diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index 889a9ccaf2..38a50a745b 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -373,8 +373,6 @@ void MirRay_ReflectedBeam(MirRay* this, PlayState* play, MirRayShieldReflection* f32 spE8[3]; f32 polyNormal[3]; MtxF* shieldMtx; - Vec3f vecA; - Vec3f vecC; shieldMtx = &player->shieldMf; @@ -390,75 +388,80 @@ void MirRay_ReflectedBeam(MirRay* this, PlayState* play, MirRayShieldReflection* vecD.y = spE8[1] + vecB.y; vecD.z = spE8[2] + vecB.z; - vecA.x = vecB.x + (shieldMtx->xx * 300.0f); - vecA.y = vecB.y + (shieldMtx->yx * 300.0f); - vecA.z = vecB.z + (shieldMtx->zx * 300.0f); + { + Vec3f vecA; + Vec3f vecC; - vecC.x = vecD.x + (shieldMtx->xx * 300.0f); - vecC.y = vecD.y + (shieldMtx->yx * 300.0f); - vecC.z = vecD.z + (shieldMtx->zx * 300.0f); + vecA.x = vecB.x + (shieldMtx->xx * 300.0f); + vecA.y = vecB.y + (shieldMtx->yx * 300.0f); + vecA.z = vecB.z + (shieldMtx->zx * 300.0f); - Collider_SetQuadVertices(&this->shieldRay, &vecA, &vecB, &vecC, &vecD); + vecC.x = vecD.x + (shieldMtx->xx * 300.0f); + vecC.y = vecD.y + (shieldMtx->yx * 300.0f); + vecC.z = vecD.z + (shieldMtx->zx * 300.0f); - for (i = 0; i < 6; i++) { - if (reflection[i].reflectionPoly != NULL) { - polyNormal[0] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.x); - polyNormal[1] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.y); - polyNormal[2] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.z); + Collider_SetQuadVertices(&this->shieldRay, &vecA, &vecB, &vecC, &vecD); - if (Math3D_LineSegVsPlane(polyNormal[0], polyNormal[1], polyNormal[2], reflection[i].reflectionPoly->dist, - &vecB, &vecD, &sp118, 1)) { + for (i = 0; i < 6; i++) { + if (reflection[i].reflectionPoly != NULL) { + polyNormal[0] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.x); + polyNormal[1] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.y); + polyNormal[2] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.z); - reflection[i].pos.x = sp118.x; - reflection[i].pos.y = sp118.y; - reflection[i].pos.z = sp118.z; + if (Math3D_LineSegVsPlane(polyNormal[0], polyNormal[1], polyNormal[2], + reflection[i].reflectionPoly->dist, &vecB, &vecD, &sp118, 1)) { - temp_f0 = sqrtf(SQ(sp118.x - vecB.x) + SQ(sp118.y - vecB.y) + SQ(sp118.z - vecB.z)); + reflection[i].pos.x = sp118.x; + reflection[i].pos.y = sp118.y; + reflection[i].pos.z = sp118.z; - if (temp_f0 < (this->reflectIntensity * 600.0f)) { - reflection[i].opacity = 200; + temp_f0 = sqrtf(SQ(sp118.x - vecB.x) + SQ(sp118.y - vecB.y) + SQ(sp118.z - vecB.z)); + + if (temp_f0 < (this->reflectIntensity * 600.0f)) { + reflection[i].opacity = 200; + } else { + reflection[i].opacity = (s32)(800.0f - temp_f0); + } + + sp10C.x = (shieldMtx->xx * 100.0f) + vecB.x; + sp10C.y = (shieldMtx->yx * 100.0f) + vecB.y; + sp10C.z = (shieldMtx->zx * 100.0f) + vecB.z; + + sp100.x = (spE8[0] * 4.0f) + sp10C.x; + sp100.y = (spE8[1] * 4.0f) + sp10C.y; + sp100.z = (spE8[2] * 4.0f) + sp10C.z; + + reflection[i].mtx.zw = 0.0f; + + reflection[i].mtx.xx = reflection[i].mtx.yy = reflection[i].mtx.zz = reflection[i].mtx.ww = 1.0f; + reflection[i].mtx.yx = reflection[i].mtx.zx = reflection[i].mtx.wx = reflection[i].mtx.xy = + reflection[i].mtx.zy = reflection[i].mtx.wy = reflection[i].mtx.xz = reflection[i].mtx.yz = + reflection[i].mtx.wz = reflection[i].mtx.xw = reflection[i].mtx.yw = reflection[i].mtx.zw; + + if (Math3D_LineSegVsPlane(polyNormal[0], polyNormal[1], polyNormal[2], + reflection[i].reflectionPoly->dist, &sp10C, &sp100, &intersection, 1)) { + reflection[i].mtx.xx = intersection.x - sp118.x; + reflection[i].mtx.yx = intersection.y - sp118.y; + reflection[i].mtx.zx = intersection.z - sp118.z; + } + + sp10C.x = (shieldMtx->xy * 100.0f) + vecB.x; + sp10C.y = (shieldMtx->yy * 100.0f) + vecB.y; + sp10C.z = (shieldMtx->zy * 100.0f) + vecB.z; + + sp100.x = (spE8[0] * 4.0f) + sp10C.x; + sp100.y = (spE8[1] * 4.0f) + sp10C.y; + sp100.z = (spE8[2] * 4.0f) + sp10C.z; + + if (Math3D_LineSegVsPlane(polyNormal[0], polyNormal[1], polyNormal[2], + reflection[i].reflectionPoly->dist, &sp10C, &sp100, &intersection, 1)) { + reflection[i].mtx.xy = intersection.x - sp118.x; + reflection[i].mtx.yy = intersection.y - sp118.y; + reflection[i].mtx.zy = intersection.z - sp118.z; + } } else { - reflection[i].opacity = (s32)(800.0f - temp_f0); + reflection[i].reflectionPoly = NULL; } - - sp10C.x = (shieldMtx->xx * 100.0f) + vecB.x; - sp10C.y = (shieldMtx->yx * 100.0f) + vecB.y; - sp10C.z = (shieldMtx->zx * 100.0f) + vecB.z; - - sp100.x = (spE8[0] * 4.0f) + sp10C.x; - sp100.y = (spE8[1] * 4.0f) + sp10C.y; - sp100.z = (spE8[2] * 4.0f) + sp10C.z; - - reflection[i].mtx.zw = 0.0f; - - reflection[i].mtx.xx = reflection[i].mtx.yy = reflection[i].mtx.zz = reflection[i].mtx.ww = 1.0f; - reflection[i].mtx.yx = reflection[i].mtx.zx = reflection[i].mtx.wx = reflection[i].mtx.xy = - reflection[i].mtx.zy = reflection[i].mtx.wy = reflection[i].mtx.xz = reflection[i].mtx.yz = - reflection[i].mtx.wz = reflection[i].mtx.xw = reflection[i].mtx.yw = reflection[i].mtx.zw; - - if (Math3D_LineSegVsPlane(polyNormal[0], polyNormal[1], polyNormal[2], - reflection[i].reflectionPoly->dist, &sp10C, &sp100, &intersection, 1)) { - reflection[i].mtx.xx = intersection.x - sp118.x; - reflection[i].mtx.yx = intersection.y - sp118.y; - reflection[i].mtx.zx = intersection.z - sp118.z; - } - - sp10C.x = (shieldMtx->xy * 100.0f) + vecB.x; - sp10C.y = (shieldMtx->yy * 100.0f) + vecB.y; - sp10C.z = (shieldMtx->zy * 100.0f) + vecB.z; - - sp100.x = (spE8[0] * 4.0f) + sp10C.x; - sp100.y = (spE8[1] * 4.0f) + sp10C.y; - sp100.z = (spE8[2] * 4.0f) + sp10C.z; - - if (Math3D_LineSegVsPlane(polyNormal[0], polyNormal[1], polyNormal[2], - reflection[i].reflectionPoly->dist, &sp10C, &sp100, &intersection, 1)) { - reflection[i].mtx.xy = intersection.x - sp118.x; - reflection[i].mtx.yy = intersection.y - sp118.y; - reflection[i].mtx.zy = intersection.z - sp118.z; - } - } else { - reflection[i].reflectionPoly = NULL; } } } diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index 69351a718e..ba2521531d 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -135,19 +135,20 @@ void ObjBean_InitCollider(Actor* thisx, PlayState* play) { void ObjBean_InitDynaPoly(ObjBean* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; - CollisionHeader* colHeader; - s32 pad2; - - colHeader = NULL; + CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_bean.c", 374, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void ObjBean_FindFloor(ObjBean* this, PlayState* play) { @@ -240,14 +241,8 @@ void ObjBean_FollowPath(ObjBean* this, PlayState* play) { Path* path; Vec3f acell; Vec3f pathPointsFloat; - f32 speed; - Vec3s* nextPathPoint; - Vec3s* currentPoint; - Vec3s* sp4C; - Vec3f sp40; - Vec3f sp34; - f32 sp30; f32 mag; + Vec3s* nextPathPoint; Math_StepToF(&this->dyna.actor.speed, sBeanSpeeds[this->unk_1F6].velocity, sBeanSpeeds[this->unk_1F6].accel); path = &play->pathList[(this->dyna.actor.params >> 8) & 0x1F]; @@ -257,8 +252,13 @@ void ObjBean_FollowPath(ObjBean* this, PlayState* play) { Math_Vec3f_Diff(&pathPointsFloat, &this->pathPoints, &acell); mag = Math3D_Vec3fMagnitude(&acell); - speed = CLAMP_MIN(this->dyna.actor.speed, 0.5f); - if (speed > mag) { + if (CLAMP_MIN(this->dyna.actor.speed, 0.5f) > mag) { + Vec3s* currentPoint; + Vec3s* sp4C; + Vec3f sp40; + Vec3f sp34; + f32 sp30; + currentPoint = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->currentPointIndex]; Math_Vec3f_Copy(&this->pathPoints, &pathPointsFloat); diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c index fa22cfaab4..0cd7062bdf 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -46,16 +46,19 @@ void ObjElevator_SetupAction(ObjElevator* this, ObjElevatorActionFunc actionFunc void func_80B92B08(ObjElevator* this, PlayState* play, CollisionHeader* collision, s32 flag) { s16 pad1; CollisionHeader* colHeader = NULL; - s16 pad2; - Actor* thisx = &this->dyna.actor; DynaPolyActor_Init(&this->dyna, flag); CollisionHeader_GetVirtual(collision, &colHeader); - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); + this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { - PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_elevator.c", 136, thisx->id, - thisx->params); + s32 pad2; + + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_elevator.c", 136, + this->dyna.actor.id, this->dyna.actor.params); } +#endif } void ObjElevator_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index f399f017ef..602502f9bb 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -55,15 +55,19 @@ void ObjHsblock_SetupAction(ObjHsblock* this, ObjHsblockActionFunc actionFunc) { void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision, s32 moveFlags) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2[2]; DynaPolyActor_Init(&this->dyna, moveFlags); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_hsblock.c", 163, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void func_80B93BF0(ObjHsblock* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index 63f6635a30..52859a628c 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -64,16 +64,19 @@ void ObjLift_SetupAction(ObjLift* this, ObjLiftActionFunc actionFunc) { void ObjLift_InitDynaPoly(ObjLift* this, PlayState* play, CollisionHeader* collision, s32 flags) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flags); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_lift.c", 188, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void ObjLift_SpawnFragments(ObjLift* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index b8b6fbcf2f..6243acb0bd 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -87,17 +87,20 @@ static Vec2f sFaceDirection[] = { void ObjOshihiki_InitDynapoly(ObjOshihiki* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG registration failure" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_oshihiki.c", 280, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void ObjOshihiki_RotateXZ(Vec3f* out, Vec3f* in, f32 sn, f32 cs) { @@ -242,14 +245,13 @@ void ObjOshihiki_SetTexture(ObjOshihiki* this, PlayState* play) { } } -void ObjOshihiki_SetColor(ObjOshihiki* this, PlayState* play) { - Color_RGB8* src; +void ObjOshihiki_SetColor(ObjOshihiki* this, PlayState* play2) { + PlayState* play = play2; + s16 paramsColorIdx = (this->dyna.actor.params >> 6) & 3; Color_RGB8* color = &this->color; - s16 paramsColorIdx; + Color_RGB8* src; s32 i; - paramsColorIdx = (this->dyna.actor.params >> 6) & 3; - for (i = 0; i < ARRAY_COUNT(sSceneIds); i++) { if (sSceneIds[i] == play->sceneId) { break; @@ -315,14 +317,12 @@ void ObjOshihiki_Destroy(Actor* thisx, PlayState* play) { } void ObjOshihiki_SetFloors(ObjOshihiki* this, PlayState* play) { + s32 pad; + Vec3f colCheckPoint; + Vec3f colCheckOffset; s32 i; for (i = 0; i < 5; i++) { - Vec3f colCheckPoint; - Vec3f colCheckOffset; - CollisionPoly** floorPoly; - s32* floorBgId; - colCheckOffset.x = sColCheckPoints[i].x * (this->dyna.actor.scale.x * 10.0f); colCheckOffset.y = sColCheckPoints[i].y * (this->dyna.actor.scale.y * 10.0f); colCheckOffset.z = sColCheckPoints[i].z * (this->dyna.actor.scale.z * 10.0f); @@ -331,10 +331,8 @@ void ObjOshihiki_SetFloors(ObjOshihiki* this, PlayState* play) { colCheckPoint.y += this->dyna.actor.prevPos.y; colCheckPoint.z += this->dyna.actor.world.pos.z; - floorPoly = &this->floorPolys[i]; - floorBgId = &this->floorBgIds[i]; - this->floorHeights[i] = - BgCheck_EntityRaycastDown6(&play->colCtx, floorPoly, floorBgId, &this->dyna.actor, &colCheckPoint, 0.0f); + this->floorHeights[i] = BgCheck_EntityRaycastDown6(&play->colCtx, &this->floorPolys[i], &this->floorBgIds[i], + &this->dyna.actor, &colCheckPoint, 0.0f); } } @@ -445,9 +443,9 @@ s32 ObjOshihiki_MoveWithBlockUnder(ObjOshihiki* this, PlayState* play) { void ObjOshihiki_SetupOnScene(ObjOshihiki* this, PlayState* play) { this->stateFlags |= PUSHBLOCK_SETUP_ON_SCENE; - this->actionFunc = ObjOshihiki_OnScene; this->dyna.actor.gravity = 0.0f; this->dyna.actor.velocity.x = this->dyna.actor.velocity.y = this->dyna.actor.velocity.z = 0.0f; + this->actionFunc = ObjOshihiki_OnScene; } void ObjOshihiki_OnScene(ObjOshihiki* this, PlayState* play) { @@ -472,9 +470,9 @@ void ObjOshihiki_OnScene(ObjOshihiki* this, PlayState* play) { void ObjOshihiki_SetupOnActor(ObjOshihiki* this, PlayState* play) { this->stateFlags |= PUSHBLOCK_SETUP_ON_ACTOR; - this->actionFunc = ObjOshihiki_OnActor; this->dyna.actor.velocity.x = this->dyna.actor.velocity.y = this->dyna.actor.velocity.z = 0.0f; this->dyna.actor.gravity = -1.0f; + this->actionFunc = ObjOshihiki_OnActor; } void ObjOshihiki_OnActor(ObjOshihiki* this, PlayState* play) { @@ -649,6 +647,7 @@ void ObjOshihiki_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_oshihiki.c", 1308), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); +#if OOT_DEBUG switch (play->sceneId) { case SCENE_DEKU_TREE: case SCENE_DODONGOS_CAVERN: @@ -664,6 +663,9 @@ void ObjOshihiki_Draw(Actor* thisx, PlayState* play) { gDPSetEnvColor(POLY_OPA_DISP++, mREG(13), mREG(14), mREG(15), 255); break; } +#else + gDPSetEnvColor(POLY_OPA_DISP++, this->color.r, this->color.g, this->color.b, 255); +#endif gSPDisplayList(POLY_OPA_DISP++, gPushBlockDL); CLOSE_DISPS(play->state.gfxCtx, "../z_obj_oshihiki.c", 1334); diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index 089c781641..2d513f5c70 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -192,17 +192,20 @@ void ObjSwitch_RotateY(Vec3f* dest, Vec3f* src, s16 rotY) { void ObjSwitch_InitDynaPoly(ObjSwitch* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG registration failure" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_switch.c", 531, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void ObjSwitch_InitJntSphCollider(ObjSwitch* this, PlayState* play, ColliderJntSphInit* colliderJntSphInit) { diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index d6a6677f0f..4c87d44e01 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -179,7 +179,6 @@ void func_80846978(PlayState* play, Player* this); void func_808469BC(PlayState* play, Player* this); void func_80846A68(PlayState* play, Player* this); void Player_UpdateCommon(Player* this, PlayState* play, Input* input); -s32 func_8084FCAC(Player* this, PlayState* play); void func_8084FF7C(Player* this); void Player_UpdateBunnyEars(Player* this); void func_80851008(PlayState* play, Player* this, void* anim); @@ -493,7 +492,7 @@ static PlayerAgeProperties sAgeProperties[] = { }, }; -static u32 D_808535D0 = false; +static u32 sNoclipEnabled = false; static f32 sControlStickMagnitude = 0.0f; static s16 sControlStickAngle = 0; static s16 D_808535DC = 0; @@ -1605,7 +1604,6 @@ static LinkAnimationHeader* D_808543D4[] = { &gPlayerAnim_link_hook_wait, }; -// return type can't be void due to regalloc in func_8084FCAC BAD_RETURN(s32) Player_ZeroSpeedXZ(Player* this) { this->actor.speed = 0.0f; this->speedXZ = 0.0f; @@ -2063,10 +2061,10 @@ LinkAnimationHeader* func_80833338(Player* this) { } s32 func_80833350(Player* this) { - LinkAnimationHeader** entry; - s32 i; - if (func_80833338(this) != this->skelAnime.animation) { + LinkAnimationHeader** entry; + s32 i; + for (i = 0, entry = &D_80853D7C[0][0]; i < 28; i++, entry++) { if (this->skelAnime.animation == *entry) { return i + 1; @@ -4482,9 +4480,6 @@ s32 Player_ActionChange_12(Player* this, PlayState* play) { LinkAnimationHeader* anim; f32 sp34; f32 temp; - f32 wallPolyNormalX; - f32 wallPolyNormalZ; - f32 sp24; if (!(this->stateFlags1 & PLAYER_STATE1_11) && (this->ledgeClimbType >= PLAYER_LEDGE_CLIMB_2) && (!(this->stateFlags1 & PLAYER_STATE1_27) || (this->ageProperties->unk_14 > this->yDistToLedge))) { @@ -4526,9 +4521,9 @@ s32 Player_ActionChange_12(Player* this, PlayState* play) { anim = &gPlayerAnim_link_normal_250jump_start; this->speedXZ = 1.0f; } else { - wallPolyNormalX = COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.x); - wallPolyNormalZ = COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.z); - sp24 = this->distToInteractWall + 0.5f; + f32 wallPolyNormalX = COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.x); + f32 wallPolyNormalZ = COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.z); + f32 sp24 = this->distToInteractWall + 0.5f; this->stateFlags1 |= PLAYER_STATE1_14; @@ -4668,9 +4663,6 @@ u8 sReturnEntranceGroupIndices[] = { s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId) { s32 exitIndex; s32 temp; - s32 sp34; - f32 speedXZ; - s32 yaw; if (this->actor.category == ACTORCAT_PLAYER) { exitIndex = 0; @@ -4679,8 +4671,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol (this->csAction == PLAYER_CSACTION_NONE) && !(this->stateFlags1 & PLAYER_STATE1_0) && (((poly != NULL) && (exitIndex = SurfaceType_GetExitIndex(&play->colCtx, poly, bgId), exitIndex != 0)) || (func_8083816C(sFloorType) && (this->floorProperty == FLOOR_PROPERTY_12)))) { - - sp34 = this->unk_A84 - (s32)this->actor.world.pos.y; + s32 sp34 = this->unk_A84 - (s32)this->actor.world.pos.y; if (!(this->stateFlags1 & (PLAYER_STATE1_23 | PLAYER_STATE1_27 | PLAYER_STATE1_29)) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (sp34 < 100) && (sYDistToFloor > 100.0f)) { @@ -4729,7 +4720,8 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = NATURE_ID_DISABLED; } else { - speedXZ = this->speedXZ; + f32 speedXZ = this->speedXZ; + s32 yaw; if (speedXZ < 0.0f) { this->actor.world.rot.y += 0x8000; @@ -4853,19 +4845,14 @@ s32 Player_PosVsWallLineTest(PlayState* play, Player* this, Vec3f* offset, Colli } s32 Player_ActionChange_1(Player* this, PlayState* play) { - SlidingDoorActorBase* slidingDoor; - DoorActorBase* door; + Actor* attachedActor; + s32 pad3; s32 doorDirection; f32 sp78; f32 sp74; Actor* doorActor; f32 sp6C; - s32 pad3; s32 frontRoom; - Actor* attachedActor; - LinkAnimationHeader* sp5C; - CollisionPoly* groundPoly; - Vec3f checkPos; if ((this->doorType != PLAYER_DOORTYPE_NONE) && (!(this->stateFlags1 & PLAYER_STATE1_11) || @@ -4884,7 +4871,7 @@ s32 Player_ActionChange_1(Player* this, PlayState* play) { sp74 = Math_SinS(doorActor->shape.rot.y); if (this->doorType == PLAYER_DOORTYPE_SLIDING) { - slidingDoor = (SlidingDoorActorBase*)doorActor; + SlidingDoorActorBase* slidingDoor = (SlidingDoorActorBase*)doorActor; this->yaw = slidingDoor->dyna.actor.home.rot.y; if (doorDirection > 0) { @@ -4928,7 +4915,8 @@ s32 Player_ActionChange_1(Player* this, PlayState* play) { } } else { // The door actor can be either EnDoor or DoorKiller. - door = (DoorActorBase*)doorActor; + DoorActorBase* door = (DoorActorBase*)doorActor; + LinkAnimationHeader* sp5C; door->openAnim = (doorDirection < 0.0f) ? (LINK_IS_ADULT ? DOOR_OPEN_ANIM_ADULT_L : DOOR_OPEN_ANIM_CHILD_L) @@ -4985,6 +4973,9 @@ s32 Player_ActionChange_1(Player* this, PlayState* play) { Actor_DisableLens(play); if (ENDOOR_GET_TYPE(doorActor) == DOOR_SCENEEXIT) { + CollisionPoly* groundPoly; + Vec3f checkPos; + checkPos.x = doorActor->world.pos.x - (sp6C * sp74); checkPos.y = doorActor->world.pos.y + 10.0f; checkPos.z = doorActor->world.pos.z - (sp6C * sp78); @@ -5224,16 +5215,16 @@ void func_8083A5C4(PlayState* play, Player* this, CollisionPoly* arg2, f32 arg3, } s32 func_8083A6AC(Player* this, PlayState* play) { - CollisionPoly* sp84; - s32 sp80; - Vec3f sp74; - Vec3f sp68; - f32 temp1; - //! @bug `floorPitch` and `floorPitchAlt` are cleared to 0 before this function is called, because the player //! left the ground. The angles will always be zero and therefore will always pass these checks. //! The intention seems to be to prevent ledge hanging or vine grabbing when walking off of a steep enough slope. if ((this->actor.yDistToWater < -80.0f) && (ABS(this->floorPitch) < 0xAAA) && (ABS(this->floorPitchAlt) < 0xAAA)) { + CollisionPoly* sp84; + s32 sp80; + Vec3f sp74; + Vec3f sp68; + f32 temp1; + sp74.x = this->actor.prevPos.x - this->actor.world.pos.x; sp74.z = this->actor.prevPos.z - this->actor.world.pos.z; @@ -6718,24 +6709,33 @@ void func_8083E4C4(PlayState* play, Player* this, GetItemEntry* giEntry) { Sfx_PlaySfxCentered((this->getItemId < 0) ? NA_SE_SY_GET_BOXITEM : NA_SE_SY_GET_ITEM); } +#if OOT_DEBUG +#define DEBUG_iREG_67 iREG(67) +#else +#define DEBUG_iREG_67 0 +#endif + s32 Player_ActionChange_2(Player* this, PlayState* play) { Actor* interactedActor; - if (iREG(67) || + if (DEBUG_iREG_67 || (((interactedActor = this->interactRangeActor) != NULL) && TitleCard_Clear(play, &play->actorCtx.titleCtx))) { - if (iREG(67) || (this->getItemId > GI_NONE)) { - if (iREG(67)) { + if (DEBUG_iREG_67 || (this->getItemId > GI_NONE)) { + if (DEBUG_iREG_67) { this->getItemId = iREG(68); } if (this->getItemId < GI_MAX) { GetItemEntry* giEntry = &sGetItemTable[this->getItemId - 1]; +#if OOT_DEBUG if ((interactedActor != &this->actor) && !iREG(67)) { interactedActor->parent = &this->actor; } - iREG(67) = false; +#else + interactedActor->parent = &this->actor; +#endif if ((Item_CheckObtainability(giEntry->itemId) == ITEM_NONE) || (play->sceneId == SCENE_BOMBCHU_BOWLING_ALLEY)) { @@ -7784,6 +7784,8 @@ void func_80841138(Player* this, PlayState* play) { f32 temp2; if (this->unk_864 < 1.0f) { + s32 pad; + temp1 = R_UPDATE_RATE * 0.5f; func_8084029C(this, REG(35) / 1000.0f); LinkAnimation_LoadToJoint(play, &this->skelAnime, @@ -7847,7 +7849,6 @@ void Player_Action_808414F8(Player* this, PlayState* play) { f32 speedTarget; s16 yawTarget; s32 sp2C; - s16 sp2A; func_80841138(this, play); @@ -7871,7 +7872,7 @@ void Player_Action_808414F8(Player* this, PlayState* play) { } } } else { - sp2A = yawTarget - this->yaw; + s16 sp2A = yawTarget - this->yaw; Math_AsymStepToF(&this->speedXZ, speedTarget * 1.5f, 1.5f, 2.0f); Math_ScaledStepToS(&this->yaw, yawTarget, sp2A * 0.1f); @@ -7940,8 +7941,6 @@ void Player_Action_8084193C(Player* this, PlayState* play) { f32 speedTarget; s16 yawTarget; s32 temp1; - s16 temp2; - s32 temp3; func_80841860(play, this); @@ -7961,42 +7960,37 @@ void Player_Action_8084193C(Player* this, PlayState* play) { if (temp1 > 0) { func_8083C858(this, play); - return; - } - - if (temp1 < 0) { + } else if (temp1 < 0) { if (func_80833B2C(this)) { func_8083CB2C(this, yawTarget, play); } else { func_8083CBF0(this, yawTarget, play); } - return; - } - - if ((this->speedXZ < 3.6f) && (speedTarget < 4.0f)) { + } else if ((this->speedXZ < 3.6f) && (speedTarget < 4.0f)) { if (!func_8008E9C4(this) && func_80833B2C(this)) { func_8083CB94(this, play); } else { func_80839F90(this, play); } - return; - } + } else { + s16 temp2; + s32 temp3; - func_80840138(this, speedTarget, yawTarget); + func_80840138(this, speedTarget, yawTarget); - temp2 = yawTarget - this->yaw; - temp3 = ABS(temp2); + temp2 = yawTarget - this->yaw; + temp3 = ABS(temp2); - if (temp3 > 0x4000) { - if (Math_StepToF(&this->speedXZ, 0.0f, 3.0f) != 0) { - this->yaw = yawTarget; + if (temp3 > 0x4000) { + if (Math_StepToF(&this->speedXZ, 0.0f, 3.0f) != 0) { + this->yaw = yawTarget; + } + } else { + speedTarget *= 0.9f; + Math_AsymStepToF(&this->speedXZ, speedTarget, 2.0f, 3.0f); + Math_ScaledStepToS(&this->yaw, yawTarget, temp3 * 0.1f); } - return; } - - speedTarget *= 0.9f; - Math_AsymStepToF(&this->speedXZ, speedTarget, 2.0f, 3.0f); - Math_ScaledStepToS(&this->yaw, yawTarget, temp3 * 0.1f); } } @@ -8084,6 +8078,8 @@ void func_80841EE4(Player* this, PlayState* play) { f32 temp2; if (this->unk_864 < 1.0f) { + s32 pad; + temp1 = R_UPDATE_RATE * 0.5f; func_8084029C(this, REG(35) / 1000.0f); @@ -8483,15 +8479,6 @@ s32 func_80842DF4(PlayState* play, Player* this) { } void Player_Action_80843188(Player* this, PlayState* play) { - f32 sp54; - f32 sp50; - s16 sp4E; - s16 sp4C; - s16 sp4A; - s16 sp48; - s16 sp46; - f32 sp40; - if (LinkAnimation_Update(play, &this->skelAnime)) { if (!Player_IsChildWithHylianShield(this)) { Player_AnimPlayLoop(play, this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_defense_wait, this->modelAnimType)); @@ -8509,6 +8496,15 @@ void Player_Action_80843188(Player* this, PlayState* play) { func_8083721C(this); if (this->av2.actionVar2 != 0) { + f32 sp54; + f32 sp50; + s16 sp4E; + s16 sp4C; + s16 sp4A; + s16 sp48; + s16 sp46; + f32 sp40; + sp54 = sControlInput->rel.stick_y * 100; sp50 = sControlInput->rel.stick_x * -120; sp4E = this->actor.shape.rot.y - Camera_GetInputDirYaw(GET_ACTIVE_CAM(play)); @@ -8877,8 +8873,10 @@ void Player_Action_8084411C(Player* this, PlayState* play) { Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { + Actor* heldActor; + if (this->stateFlags1 & PLAYER_STATE1_11) { - Actor* heldActor = this->heldActor; + heldActor = this->heldActor; if (!func_80835644(play, this, heldActor) && (heldActor->id == ACTOR_EN_NIW) && CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { @@ -10737,15 +10735,15 @@ void Player_UpdateBodyBurn(PlayState* play, Player* this) { sp54 = (s32)(this->speedXZ * 0.4f) + 1; } - spawnedFlame = false; - timerPtr = this->bodyFlameTimers; - if (this->stateFlags2 & PLAYER_STATE2_3) { sp58 = 100; } else { sp58 = 0; } + spawnedFlame = false; + timerPtr = this->bodyFlameTimers; + func_8083819C(this, play); for (i = 0; i < PLAYER_BODYPART_MAX; i++, timerPtr++) { @@ -11301,58 +11299,74 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { Collider_ResetQuadAT(play, &this->shieldQuad.base); } -static Vec3f D_80854838 = { 0.0f, 0.0f, -30.0f }; +#if OOT_DEBUG +s32 Player_UpdateNoclip(Player* this, PlayState* play); +#endif void Player_Update(Actor* thisx, PlayState* play) { - static Vec3f sDogSpawnPos; Player* this = (Player*)thisx; s32 dogParams; s32 pad; - Input sp44; - Actor* dog; + Input input; - if (func_8084FCAC(this, play)) { - if (gSaveContext.dogParams < 0) { - if (Object_GetSlot(&play->objectCtx, OBJECT_DOG) < 0) { - gSaveContext.dogParams = 0; - } else { - gSaveContext.dogParams &= 0x7FFF; - Player_GetRelativePosition(this, &this->actor.world.pos, &D_80854838, &sDogSpawnPos); - dogParams = gSaveContext.dogParams; +#if OOT_DEBUG + if (!Player_UpdateNoclip(this, play)) { + goto skip_update; + } +#endif - dog = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_DOG, sDogSpawnPos.x, sDogSpawnPos.y, sDogSpawnPos.z, - 0, this->actor.shape.rot.y, 0, dogParams | 0x8000); - if (dog != NULL) { - dog->room = 0; - } - } - } + if (gSaveContext.dogParams < 0) { + static Vec3f sDogSpawnOffset = { 0.0f, 0.0f, -30.0f }; + static Vec3f sDogSpawnPos; - if ((this->interactRangeActor != NULL) && (this->interactRangeActor->update == NULL)) { - this->interactRangeActor = NULL; - } - - if ((this->heldActor != NULL) && (this->heldActor->update == NULL)) { - Player_DetachHeldActor(play, this); - } - - if (this->stateFlags1 & (PLAYER_STATE1_5 | PLAYER_STATE1_29)) { - bzero(&sp44, sizeof(sp44)); + if (Object_GetSlot(&play->objectCtx, OBJECT_DOG) < 0) { + gSaveContext.dogParams = 0; } else { - sp44 = play->state.input[0]; - if (this->unk_88E != 0) { - sp44.cur.button &= ~(BTN_A | BTN_B | BTN_CUP); - sp44.press.button &= ~(BTN_A | BTN_B | BTN_CUP); + Actor* dog; + + gSaveContext.dogParams &= 0x7FFF; + Player_GetRelativePosition(this, &this->actor.world.pos, &sDogSpawnOffset, &sDogSpawnPos); + dogParams = gSaveContext.dogParams; + + dog = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_DOG, sDogSpawnPos.x, sDogSpawnPos.y, sDogSpawnPos.z, 0, + this->actor.shape.rot.y, 0, dogParams | 0x8000); + if (dog != NULL) { + dog->room = 0; } } - - Player_UpdateCommon(this, play, &sp44); } - MREG(52) = this->actor.world.pos.x; - MREG(53) = this->actor.world.pos.y; - MREG(54) = this->actor.world.pos.z; - MREG(55) = this->actor.world.rot.y; + if ((this->interactRangeActor != NULL) && (this->interactRangeActor->update == NULL)) { + this->interactRangeActor = NULL; + } + + if ((this->heldActor != NULL) && (this->heldActor->update == NULL)) { + Player_DetachHeldActor(play, this); + } + + if (this->stateFlags1 & (PLAYER_STATE1_5 | PLAYER_STATE1_29)) { + bzero(&input, sizeof(input)); + } else { + input = play->state.input[0]; + + if (this->unk_88E != 0) { + input.cur.button &= ~(BTN_A | BTN_B | BTN_CUP); + input.press.button &= ~(BTN_A | BTN_B | BTN_CUP); + } + } + + Player_UpdateCommon(this, play, &input); + +skip_update:; + { + s32 pad; + + MREG(52) = this->actor.world.pos.x; + MREG(53) = this->actor.world.pos.y; + MREG(54) = this->actor.world.pos.z; + + MREG(55) = this->actor.world.rot.y; + } } typedef struct { @@ -11372,8 +11386,6 @@ static Gfx* sMaskDlists[PLAYER_MASK_MAX - 1] = { static Vec3s D_80854864 = { 0, 0, 0 }; void Player_DrawGameplay(PlayState* play, Player* this, s32 lod, Gfx* cullDList, OverrideLimbDrawOpa overrideLimbDraw) { - static s32 D_8085486C = 255; - OPEN_DISPS(play->state.gfxCtx, "../z_player.c", 19228); gSPSegment(POLY_OPA_DISP++, 0x0C, cullDList); @@ -11410,15 +11422,14 @@ void Player_DrawGameplay(PlayState* play, Player* this, s32 lod, Gfx* cullDList, } if ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && - !(this->stateFlags1 & PLAYER_STATE1_23) && (this->hoverBootsTimer != 0)) { - s32 sp5C; - s32 hoverBootsTimer = this->hoverBootsTimer; + !(this->stateFlags1 & PLAYER_STATE1_23) && ((u32)this->hoverBootsTimer != 0)) { + static s32 D_8085486C = 255; if (this->hoverBootsTimer < 19) { - if (hoverBootsTimer >= 15) { - D_8085486C = (19 - hoverBootsTimer) * 51.0f; - } else if (hoverBootsTimer < 19) { - sp5C = hoverBootsTimer; + if (this->hoverBootsTimer >= 15) { + D_8085486C = (19 - this->hoverBootsTimer) * 51.0f; + } else if (this->hoverBootsTimer < 19) { + s32 sp5C = this->hoverBootsTimer; if (sp5C > 9) { sp5C = 9; @@ -11445,6 +11456,8 @@ void Player_DrawGameplay(PlayState* play, Player* this, s32 lod, Gfx* cullDList, } } + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_player.c", 19328); } @@ -13004,6 +13017,8 @@ void Player_Action_8084E3C4(Player* this, PlayState* play) { this->stateFlags2 &= ~(PLAYER_STATE2_23 | PLAYER_STATE2_24 | PLAYER_STATE2_25); this->unk_6A8 = NULL; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_02) { + s32 pad; + gSaveContext.respawn[RESPAWN_MODE_RETURN].entranceIndex = sWarpSongEntrances[play->msgCtx.lastPlayedSong]; gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams = 0x5FF; gSaveContext.respawn[RESPAWN_MODE_RETURN].data = play->msgCtx.lastPlayedSong; @@ -13155,13 +13170,13 @@ void Player_Action_8084E9AC(Player* this, PlayState* play) { } } -static u8 D_808549FC[] = { - 0x01, 0x03, 0x02, 0x04, 0x04, -}; - void Player_Action_8084EAC0(Player* this, PlayState* play) { if (LinkAnimation_Update(play, &this->skelAnime)) { if (this->av2.actionVar2 == 0) { + static u8 D_808549FC[] = { + 0x01, 0x03, 0x02, 0x04, 0x04, + }; + if (this->itemAction == PLAYER_IA_BOTTLE_POE) { s32 rand = Rand_S16Offset(-1, 3); @@ -13196,11 +13211,10 @@ void Player_Action_8084EAC0(Player* this, PlayState* play) { Player_AnimPlayLoopAdjusted(play, this, &gPlayerAnim_link_bottle_drink_demo_wait); this->av2.actionVar2 = 1; - return; + } else { + func_8083C0E8(this, play); + Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN)); } - - func_8083C0E8(this, play); - Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN)); } else if (this->av2.actionVar2 == 1) { if ((gSaveContext.healthAccumulator == 0) && (gSaveContext.magicState != MAGIC_STATE_FILL)) { Player_AnimChangeOnceMorphAdjusted(play, this, &gPlayerAnim_link_bottle_drink_demo_end); @@ -13362,6 +13376,8 @@ void Player_Action_8084F104(Player* this, PlayState* play) { } if (this->av2.actionVar2 == 0) { + s32 pad; + Message_StartTextbox(play, this->actor.textId, &this->actor); if ((this->itemAction == PLAYER_IA_CHICKEN) || (this->itemAction == PLAYER_IA_POCKET_CUCCO)) { @@ -13618,21 +13634,42 @@ void Player_Action_8084FBF4(Player* this, PlayState* play) { func_8002F8F0(&this->actor, NA_SE_VO_LI_TAKEN_AWAY - SFX_FLAG + this->ageProperties->unk_92); } -s32 func_8084FCAC(Player* this, PlayState* play) { +#if OOT_DEBUG +/** + * Updates the "Noclip" debug feature, which allows the player to fly around anywhere + * in the world and clip through any collision. + * + * Noclip can be toggled on and off with two different button combos: + * Hold L + R + A and press B + * or + * Hold L and press D-pad right + * + * To control Noclip mode: + * - Move horizontally with the 4 D-pad directions + * - Move up with B + * - Move down with A + * - Hold R to move faster + * + * With Noclip enabled, another button combination can be pressed to set all "temp clear" flags + * in the current room. To do so hold L and press D-pad left. + * + * @return true if Noclip is disabled, false if enabled + */ +s32 Player_UpdateNoclip(Player* this, PlayState* play) { sControlInput = &play->state.input[0]; - if ((CHECK_BTN_ALL(sControlInput->cur.button, BTN_A | BTN_L | BTN_R) && + if ((CHECK_BTN_ALL(sControlInput->cur.button, BTN_L | BTN_R | BTN_A) && CHECK_BTN_ALL(sControlInput->press.button, BTN_B)) || (CHECK_BTN_ALL(sControlInput->cur.button, BTN_L) && CHECK_BTN_ALL(sControlInput->press.button, BTN_DRIGHT))) { - D_808535D0 ^= 1; + sNoclipEnabled ^= 1; - if (D_808535D0) { + if (sNoclipEnabled) { Camera_RequestMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_Z_AIM); } } - if (D_808535D0) { + if (sNoclipEnabled) { f32 speed; if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_R)) { @@ -13672,9 +13709,7 @@ s32 func_8084FCAC(Player* this, PlayState* play) { Player_ZeroSpeedXZ(this); this->actor.gravity = 0.0f; - this->actor.velocity.z = 0.0f; - this->actor.velocity.y = 0.0f; - this->actor.velocity.x = 0.0f; + this->actor.velocity.x = this->actor.velocity.y = this->actor.velocity.z = 0.0f; if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_L) && CHECK_BTN_ALL(sControlInput->press.button, BTN_DLEFT)) { Flags_SetTempClear(play, play->roomCtx.curRoom.num); @@ -13682,11 +13717,12 @@ s32 func_8084FCAC(Player* this, PlayState* play) { Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); - return 0; + return false; } - return 1; + return true; } +#endif void func_8084FF7C(Player* this) { this->unk_858 += this->unk_85C; @@ -13921,27 +13957,6 @@ static LinkAnimationHeader* D_80854A70[] = { static u8 D_80854A7C[] = { 70, 10, 10 }; -static AnimSfxEntry D_80854A80[] = { - { NA_SE_PL_SKIP, ANIMSFX_DATA(ANIMSFX_TYPE_1, 20) }, - { NA_SE_VO_LI_SWORD_N, ANIMSFX_DATA(ANIMSFX_TYPE_4, 20) }, - { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_6, 26) }, -}; - -static AnimSfxEntry D_80854A8C[][2] = { - { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 20) }, - { NA_SE_VO_LI_MAGIC_FROL, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 30) }, - }, - { - { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 20) }, - { NA_SE_VO_LI_MAGIC_NALE, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 44) }, - }, - { - { NA_SE_VO_LI_MAGIC_ATTACK, ANIMSFX_DATA(ANIMSFX_TYPE_4, 20) }, - { NA_SE_IT_SWORD_SWING_HARD, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 20) }, - }, -}; - void Player_Action_808507F4(Player* this, PlayState* play) { if (LinkAnimation_Update(play, &this->skelAnime)) { if (this->av1.actionVar1 < 0) { @@ -13992,8 +14007,29 @@ void Player_Action_808507F4(Player* this, PlayState* play) { } } else if (this->av1.actionVar1 >= 0) { if (this->av2.actionVar2 == 0) { + static AnimSfxEntry D_80854A80[] = { + { NA_SE_PL_SKIP, ANIMSFX_DATA(ANIMSFX_TYPE_1, 20) }, + { NA_SE_VO_LI_SWORD_N, ANIMSFX_DATA(ANIMSFX_TYPE_4, 20) }, + { 0, -ANIMSFX_DATA(ANIMSFX_TYPE_6, 26) }, + }; + Player_ProcessAnimSfxList(this, D_80854A80); } else if (this->av2.actionVar2 == 1) { + static AnimSfxEntry D_80854A8C[][2] = { + { + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 20) }, + { NA_SE_VO_LI_MAGIC_FROL, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 30) }, + }, + { + { 0, ANIMSFX_DATA(ANIMSFX_TYPE_8, 20) }, + { NA_SE_VO_LI_MAGIC_NALE, -ANIMSFX_DATA(ANIMSFX_TYPE_4, 44) }, + }, + { + { NA_SE_VO_LI_MAGIC_ATTACK, ANIMSFX_DATA(ANIMSFX_TYPE_4, 20) }, + { NA_SE_IT_SWORD_SWING_HARD, -ANIMSFX_DATA(ANIMSFX_TYPE_1, 20) }, + }, + }; + Player_ProcessAnimSfxList(this, D_80854A8C[this->av1.actionVar1]); if ((this->av1.actionVar1 == 2) && LinkAnimation_OnFrame(&this->skelAnime, 30.0f)) { this->stateFlags1 &= ~(PLAYER_STATE1_28 | PLAYER_STATE1_29); @@ -15101,7 +15137,6 @@ void func_80852C0C(PlayState* play, Player* this, s32 csAction) { void func_80852C50(PlayState* play, Player* this, CsCmdActorCue* cueUnused) { CsCmdActorCue* cue = play->csCtx.playerCue; s32 pad; - s32 csAction; if (play->csCtx.state == CS_STATE_STOP) { Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_7); @@ -15112,34 +15147,35 @@ void func_80852C50(PlayState* play, Player* this, CsCmdActorCue* cueUnused) { if (cue == NULL) { this->actor.flags &= ~ACTOR_FLAG_6; - return; - } + } else { + s32 csAction; - if (this->cueId != cue->id) { - csAction = sCueToCsActionMap[cue->id]; + if (this->cueId != cue->id) { + csAction = sCueToCsActionMap[cue->id]; - if (csAction >= PLAYER_CSACTION_NONE) { - if ((csAction == PLAYER_CSACTION_3) || (csAction == PLAYER_CSACTION_4)) { - func_80852A54(play, this, cue); - } else { - func_808529D0(play, this, cue); + if (csAction >= PLAYER_CSACTION_NONE) { + if ((csAction == PLAYER_CSACTION_3) || (csAction == PLAYER_CSACTION_4)) { + func_80852A54(play, this, cue); + } else { + func_808529D0(play, this, cue); + } } + + D_80858AA0 = this->skelAnime.moveFlags; + + func_80832DBC(this); + PRINTF("TOOL MODE=%d\n", csAction); + func_80852C0C(play, this, ABS(csAction)); + func_80852B4C(play, this, cue, &D_80854B18[ABS(csAction)]); + + this->av2.actionVar2 = 0; + this->av1.actionVar1 = 0; + this->cueId = cue->id; } - D_80858AA0 = this->skelAnime.moveFlags; - - func_80832DBC(this); - PRINTF("TOOL MODE=%d\n", csAction); - func_80852C0C(play, this, ABS(csAction)); - func_80852B4C(play, this, cue, &D_80854B18[ABS(csAction)]); - - this->av2.actionVar2 = 0; - this->av1.actionVar1 = 0; - this->cueId = cue->id; + csAction = sCueToCsActionMap[this->cueId]; + func_80852B4C(play, this, cue, &D_80854E50[ABS(csAction)]); } - - csAction = sCueToCsActionMap[this->cueId]; - func_80852B4C(play, this, cue, &D_80854E50[ABS(csAction)]); } void Player_Action_CsAction(Player* this, PlayState* play) { diff --git a/tools/compress.py b/tools/compress.py index d934ecb523..8abb8b09c6 100755 --- a/tools/compress.py +++ b/tools/compress.py @@ -8,7 +8,6 @@ from __future__ import annotations import argparse from pathlib import Path import dataclasses -import struct import time import multiprocessing import multiprocessing.pool @@ -28,6 +27,7 @@ class RomSegment: vrom_start: int vrom_end: int is_compressed: bool + is_syms: bool data: memoryview | None data_async: multiprocessing.pool.AsyncResult | None @@ -92,6 +92,7 @@ def compress_rom( dma_entry.vrom_start, dma_entry.vrom_end, is_compressed, + dma_entry.is_syms(), segment_data, segment_data_async, ) @@ -167,17 +168,23 @@ def compress_rom( assert i <= len(compressed_rom_data) compressed_rom_data[segment_rom_start:i] = segment.data + rom_offset = segment_rom_end + + if segment.is_syms: + segment_rom_start = 0xFFFFFFFF + segment_rom_end = 0xFFFFFFFF + elif not segment.is_compressed: + segment_rom_end = 0 + compressed_rom_dma_entries.append( dmadata.DmaEntry( segment.vrom_start, segment.vrom_end, segment_rom_start, - segment_rom_end if segment.is_compressed else 0, + segment_rom_end, ) ) - rom_offset = segment_rom_end - assert rom_offset == compressed_rom_size # Pad the compressed rom with the pattern matching the baseroms for i in range(compressed_rom_size, compressed_rom_size_padded): diff --git a/tools/decompress_baserom.py b/tools/decompress_baserom.py index dad9887a83..799c66a1e0 100755 --- a/tools/decompress_baserom.py +++ b/tools/decompress_baserom.py @@ -5,11 +5,11 @@ from __future__ import annotations +import argparse import hashlib import io -import struct from pathlib import Path -import argparse +import struct import crunch64 import ipl3checksum @@ -67,7 +67,7 @@ def decompress_rom( v_end = dma_entry.vrom_end p_start = dma_entry.rom_start p_end = dma_entry.rom_end - if p_start == 0xFFFFFFFF and p_end == 0xFFFFFFFF: + if dma_entry.is_syms(): new_dmadata.append(dma_entry) continue if dma_entry.is_compressed(): @@ -160,9 +160,9 @@ def find_baserom(version: str) -> Path | None: def main(): - description = "Convert a rom that uses dmadata to an uncompressed one." - - parser = argparse.ArgumentParser(description=description) + parser = argparse.ArgumentParser( + description="Convert a rom that uses dmadata to an uncompressed one." + ) parser.add_argument( "version", help="Version of the game to decompress.", @@ -245,7 +245,7 @@ def main(): exit(1) # Write out our new ROM - print(f"Writing new ROM {uncompressed_path}.") + print(f"Writing new ROM {uncompressed_path}...") uncompressed_path.write_bytes(file_content) print("Done!") diff --git a/tools/disasm/disasm.py b/tools/disasm/disasm.py index 1471a7e131..d0affdd485 100755 --- a/tools/disasm/disasm.py +++ b/tools/disasm/disasm.py @@ -3,13 +3,13 @@ # SPDX-FileCopyrightText: © 2024 ZeldaRET # SPDX-License-Identifier: CC0-1.0 +from __future__ import annotations + import argparse -import collections from pathlib import Path from typing import BinaryIO import spimdisasm -from spimdisasm import frontendCommon as fec from file_addresses import DmaFile, parse_file_addresses, get_z_name_for_overlay @@ -23,18 +23,18 @@ def load_file_splits( # Assume that we're reading from a decompressed ROM where the DMA file is # now located at the same ROM offset as the VROM start f.seek(dma_file.vrom_start) - data = bytearray(f.read(dma_file.vrom_end - dma_file.vrom_start)) + data = f.read(dma_file.vrom_end - dma_file.vrom_start) file_splits_path = config_dir / f"files_{dma_file.name}.csv" if file_splits_path.exists(): - default_filename = "" + default_filename = dma_file.name splits_data = spimdisasm.common.FileSplitFormat() splits_data.readCsvFile(file_splits_path) reloc_section = None elif dma_file.overlay_dir is not None: z_name = get_z_name_for_overlay(dma_file.name) default_filename = ( - f"src/overlays/{dma_file.overlay_dir}/{dma_file.name}/{z_name}.s" + f"src/overlays/{dma_file.overlay_dir}/{dma_file.name}/{z_name}" ) splits_data = None reloc_section = spimdisasm.mips.sections.SectionRelocZ64( @@ -42,7 +42,7 @@ def load_file_splits( vromStart=0, vromEnd=len(data), vram=dma_file.vram_start, - filename=default_filename, + filename=f"src/overlays/{dma_file.overlay_dir}/{dma_file.name}/{dma_file.name}", array_of_bytes=data, segmentVromStart=0, overlayCategory=None, @@ -88,68 +88,92 @@ def main(): context = spimdisasm.common.Context() context.parseArgs(args) context.changeGlobalSegmentRanges(0x00000000, 0x01000000, 0x8000000, 0x81000000) + context.addBannedSymbolRange(0x0000F000, 0x00010100) context.addBannedSymbolRange(0x10000000, 0x80000300) context.addBannedSymbolRange(0xA0000000, 0xFFFFFFFF) spimdisasm.mips.InstructionConfig.parseArgs(args) spimdisasm.common.GlobalConfig.parseArgs(args) - spimdisasm.common.GlobalConfig.ASM_USE_PRELUDE = False spimdisasm.common.GlobalConfig.PRODUCE_SYMBOLS_PLUS_OFFSET = True spimdisasm.common.GlobalConfig.TRUST_USER_FUNCTIONS = True dma_files = parse_file_addresses(args.config_dir / "file_addresses.csv") - output_files = collections.defaultdict(list) + print("Loading disasm info...") + all_file_splits: list[spimdisasm.mips.FileSplits] = [] with open(args.rom, "rb") as f: for dma_file in dma_files: file_splits = load_file_splits(context, args.config_dir, dma_file, f) + all_file_splits.append(file_splits) - for section_type, files in file_splits.sectionsDict.items(): - # TODO: disassemble overlay reloc sections? - if section_type == spimdisasm.common.FileSectionType.Reloc: - continue + print("Analyzing...") + for i, file_splits in enumerate(all_file_splits): + f = i / len(all_file_splits) + spimdisasm.common.Utils.printQuietless( + f"{f*100:3.0f}%", "Analyzing", file_splits.name, end=" \r" + ) + file_splits.analyze() + print() + print("Analyzing done.") - for path, section in files.items(): - output_files[path].append(section) + print("Writing disassembled sections...") + output_dir: Path = args.output_dir + output_dir.mkdir(parents=True, exist_ok=True) + for i, file_splits in enumerate(all_file_splits): + f = i / len(all_file_splits) + spimdisasm.common.Utils.printQuietless( + f"{f*100:3.0f}%", "Writing", file_splits.name, end=" \r" + ) + for sectDict in file_splits.sectionsDict.values(): + for name, section in sectDict.items(): + basepath = output_dir / name + basepath.parent.mkdir(parents=True, exist_ok=True) + if section.sectionType == spimdisasm.common.FileSectionType.Reloc: + # basepath is like + # .../ovl_Overlay_Name/z_overlay_name + # and we want to write relocs to + # .../ovl_Overlay_Name/ovl_Overlay_Name_reloc.s + path = basepath.parent / f"{basepath.parent.name}_reloc.s" + with path.open("w", encoding="UTF-8") as f: + section.disassembleToFile(f) + else: + section.saveToFile(str(basepath)) + print() + print("Writing sections done.") - for path, sections in sorted(output_files.items()): - spimdisasm.common.Utils.printQuietless(f"Analyzing {path} ...") - for section in sections: - section.analyze() + if args.split_functions is not None: + print("Writing disassembled functions individually...") + for i, file_splits in enumerate(all_file_splits): + f = i / len(all_file_splits) + spimdisasm.common.Utils.printQuietless( + f"{f*100:3.0f}%", "Writing", file_splits.name, end=" \r" + ) - for path, sections in sorted(output_files.items()): - spimdisasm.common.Utils.printQuietless(f"Writing {path} ...") - output_path = args.output_dir / path - output_path.parent.mkdir(parents=True, exist_ok=True) - with open(output_path, "w") as f: - f.write('.include "macro.inc"\n') - f.write("\n") - f.write(".set noat\n") - f.write(".set noreorder\n") - f.write(".set gp=64\n") - for section in sections: - f.write("\n") - f.write(f".section {section.sectionType.toStr()}\n") - f.write("\n") - f.write(f".align 4\n") - f.write("\n") - section.disassembleToFile(f) - - if args.split_functions is not None: - rodata_list = [] - for section in sections: - if section.sectionType == spimdisasm.common.FileSectionType.Rodata: - rodata_list.append(section) - - for section in sections: - if section.sectionType != spimdisasm.common.FileSectionType.Text: - continue - output_dir = (args.split_functions / section.name).with_suffix("") - for func in section.symbolList: - spimdisasm.mips.FilesHandlers.writeSplitedFunction( - output_dir, func, rodata_list + for section_name, text_section in file_splits.sectionsDict[ + spimdisasm.common.FileSectionType.Text + ].items(): + rodata_section = file_splits.sectionsDict[ + spimdisasm.common.FileSectionType.Rodata + ].get(section_name) + # FunctionRodataEntry represents a function, + # plus any associated rodata (strings, floats, jump tables...) + # It can also be rodata that hasn't been associated to any function + for ( + func_rodata_entry + ) in spimdisasm.mips.FunctionRodataEntry.getAllEntriesFromSections( + text_section, rodata_section + ): + output_dir = ( + args.split_functions + / section_name + / f"{func_rodata_entry.getName()}.s" ) + output_dir.parent.mkdir(parents=True, exist_ok=True) + with output_dir.open("w", encoding="UTF-8") as f: + func_rodata_entry.writeToFile(f, writeFunction=True) + print() + print("Writing functions done.") if __name__ == "__main__": diff --git a/tools/disasm/do_disasm.sh b/tools/disasm/do_disasm.sh new file mode 100755 index 0000000000..0c7c5e9cc8 --- /dev/null +++ b/tools/disasm/do_disasm.sh @@ -0,0 +1,55 @@ +#!/bin/bash +set -eu -o pipefail + +if [ "${VERBOSE-}" ] +then +echo "$VERSION" +echo "$DISASM_DIR" +echo "$DISASM_BASEROM" +echo "$PYTHON" +echo "$AS_CMD" +echo "$LD" +set -x +fi + +DISASM_DATA_DIR="tools/disasm/$VERSION" +DISASM_FLAGS="--custom-suffix _unknown --sequential-label-names --no-use-fpccsr --no-cop0-named-registers" +DISASM_FLAGS="$DISASM_FLAGS --config-dir $DISASM_DATA_DIR --symbol-addrs $DISASM_DATA_DIR/functions.txt --symbol-addrs $DISASM_DATA_DIR/variables.txt" + +echo Disassembling... +cmd="$PYTHON tools/disasm/disasm.py $DISASM_FLAGS $DISASM_BASEROM -o $DISASM_DIR --split-functions $DISASM_DIR/functions" +echo "$cmd" +$cmd || ( + echo + echo Error on disassembling. + false +) +echo Disassembling done. + +echo Assembling text,data,rodata,bss sections together for each file... +for filebase in `find $DISASM_DIR -name '*.s' | sed -E -n 's/\.(text|data|rodata|bss)\.s$//p' | sort | uniq` +do + printf '%s \r' "$filebase" + files= + for section in text data rodata bss + do + file="$filebase.$section.s" + if [ -e $file ] + then + files="$files $file" + fi + done + iconv_cmd="iconv -f UTF-8 -t EUC-JP $files" + asfile_cmd="$AS_CMD -o $filebase.o --" + ( $iconv_cmd | $asfile_cmd ) || ( + echo + echo Error on assembling: + echo "$filebase" + echo Command line: + echo "$iconv_cmd | $asfile_cmd" + false + ) +done +echo + +echo All done! diff --git a/tools/disasm/gc-eu-mq/files_boot.csv b/tools/disasm/gc-eu-mq/files_boot.csv index fb7cd3cbd2..74b3eb5213 100644 --- a/tools/disasm/gc-eu-mq/files_boot.csv +++ b/tools/disasm/gc-eu-mq/files_boot.csv @@ -1,135 +1,135 @@ offset,vram,.text -0,80000460,src/boot/boot_main.s -140,800005A0,src/boot/idle.s -3D0,80000830,src/boot/viconfig.s -520,80000980,src/boot/z_std_dma.s -B60,80000FC0,src/boot/yaz0.s -EA0,80001300,src/boot/z_locale.s -F60,800013C0,src/boot/is_debug.s -FC0,80001420,src/libultra/io/driverominit.s -11A0,80001600,src/boot/mio0.s -1250,800016B0,src/boot/stackcheck.s -14A0,80001900,src/boot/logutils.s -1500,80001960,src/libultra/io/piacs.s -15C0,80001A20,src/libultra/os/sendmesg.s -1710,80001B70,src/libultra/os/stopthread.s -17D0,80001C30,src/libultra/io/viextendvstart.s -17E0,80001C40,src/libultra/os/recvmesg.s -1920,80001D80,src/libultra/os/initialize.s -1C70,800020D0,src/libultra/libc/ll.s -1F30,80002390,src/libultra/os/exceptasm.s -2860,80002CC0,src/libultra/os/thread.s -28A0,80002D00,src/libultra/os/destroythread.s -29B0,80002E10,src/libultra/libc/bzero.s -2A50,80002EB0,src/libultra/os/parameters.s -2AB0,80002F10,src/libultra/os/createthread.s -2C00,80003060,src/libultra/os/setsr.s -2C10,80003070,src/libultra/os/getsr.s -2C20,80003080,src/libultra/os/writebackdcache.s -2CA0,80003100,src/libultra/io/vigetnextframebuf.s -2CE0,80003140,src/libultra/io/pimgr.s -2E60,800032C0,src/libultra/io/devmgr.s -3270,800036D0,src/libultra/io/pirawdma.s -3340,800037A0,src/libultra/os/virtualtophysical.s -33C0,80003820,src/libultra/io/viblack.s -3430,80003890,src/libultra/io/sirawread.s -3480,800038E0,src/libultra/os/getthreadid.s -34A0,80003900,src/libultra/os/setintmask.s -3540,800039A0,src/libultra/io/visetmode.s -35A0,80003A00,src/libultra/os/probetlb.s -3660,80003AC0,src/libultra/os/getmemsize.s -3780,80003BE0,src/libultra/os/seteventmesg.s -3840,80003CA0,src/libultra/os/unmaptlball.s -3890,80003CF0,src/libultra/io/epidma.s -3930,80003D90,src/libultra/os/invalicache.s -39B0,80003E10,src/libultra/os/createmesgqueue.s -39E0,80003E40,src/libultra/os/invaldcache.s -3A90,80003EF0,src/libultra/io/si.s -3AC0,80003F20,src/libultra/os/jammesg.s -3C10,80004070,src/libultra/os/setthreadpri.s -3CF0,80004150,src/libultra/os/getthreadpri.s -3D10,80004170,src/libultra/io/epirawread.s -3E70,800042D0,src/libultra/io/viswapbuf.s -3EC0,80004320,src/libultra/io/epirawdma.s -40A0,80004500,src/libultra/libc/bcmp.s -41C0,80004620,src/libultra/os/gettime.s -4250,800046B0,src/libultra/os/timerintr.s -4680,80004AE0,src/libultra/os/getcount.s -4690,80004AF0,src/libultra/os/setglobalintmask.s -46E0,80004B40,src/libultra/os/setcompare.s -46F0,80004B50,src/libultra/libc/bcopy.s -4A00,80004E60,src/libultra/os/resetglobalintmask.s -4A60,80004EC0,src/libultra/os/interrupt.s -4AF0,80004F50,src/libultra/io/vi.s -4C10,80005070,src/libultra/io/viswapcontext.s -4F10,80005370,src/libultra/io/pigetcmdq.s -4F40,800053A0,src/libultra/io/epiread.s -4F90,800053F0,src/libultra/io/visetspecial.s -50F0,80005550,src/libultra/io/cartrominit.s -5250,800056B0,src/libultra/os/setfpccsr.s -5260,800056C0,src/libultra/os/getfpccsr.s -5270,800056D0,src/libultra/os/maptlbrdb.s -52D0,80005730,src/libultra/os/yieldthread.s -5320,80005780,src/libultra/os/getcause.s -5330,80005790,src/libultra/io/epirawwrite.s -5490,800058F0,src/libultra/io/sirawwrite.s -54E0,80005940,src/libultra/io/vimgr.s -57F0,80005C50,src/libultra/io/vigetcurrcontext.s -5800,80005C60,src/libultra/os/startthread.s -5950,80005DB0,src/libultra/io/visetyscale.s -59A0,80005E00,src/libultra/io/visetxscale.s -5AB0,80005F10,src/libultra/os/sethwintrroutine.s -5B20,80005F80,src/libultra/os/gethwintrroutine.s -5B50,80005FB0,src/libultra/os/setwatchlo.s -5B60,80005FC0,data/rsp_boot.text.s +0,80000460,src/boot/boot_main +140,800005A0,src/boot/idle +3D0,80000830,src/boot/viconfig +520,80000980,src/boot/z_std_dma +B60,80000FC0,src/boot/yaz0 +EA0,80001300,src/boot/z_locale +F60,800013C0,src/boot/is_debug +FC0,80001420,src/libultra/io/driverominit +11A0,80001600,src/boot/mio0 +1250,800016B0,src/boot/stackcheck +14A0,80001900,src/boot/logutils +1500,80001960,src/libultra/io/piacs +15C0,80001A20,src/libultra/os/sendmesg +1710,80001B70,src/libultra/os/stopthread +17D0,80001C30,src/libultra/io/viextendvstart +17E0,80001C40,src/libultra/os/recvmesg +1920,80001D80,src/libultra/os/initialize +1C70,800020D0,src/libultra/libc/ll +1F30,80002390,src/libultra/os/exceptasm +2860,80002CC0,src/libultra/os/thread +28A0,80002D00,src/libultra/os/destroythread +29B0,80002E10,src/libultra/libc/bzero +2A50,80002EB0,src/libultra/os/parameters +2AB0,80002F10,src/libultra/os/createthread +2C00,80003060,src/libultra/os/setsr +2C10,80003070,src/libultra/os/getsr +2C20,80003080,src/libultra/os/writebackdcache +2CA0,80003100,src/libultra/io/vigetnextframebuf +2CE0,80003140,src/libultra/io/pimgr +2E60,800032C0,src/libultra/io/devmgr +3270,800036D0,src/libultra/io/pirawdma +3340,800037A0,src/libultra/os/virtualtophysical +33C0,80003820,src/libultra/io/viblack +3430,80003890,src/libultra/io/sirawread +3480,800038E0,src/libultra/os/getthreadid +34A0,80003900,src/libultra/os/setintmask +3540,800039A0,src/libultra/io/visetmode +35A0,80003A00,src/libultra/os/probetlb +3660,80003AC0,src/libultra/os/getmemsize +3780,80003BE0,src/libultra/os/seteventmesg +3840,80003CA0,src/libultra/os/unmaptlball +3890,80003CF0,src/libultra/io/epidma +3930,80003D90,src/libultra/os/invalicache +39B0,80003E10,src/libultra/os/createmesgqueue +39E0,80003E40,src/libultra/os/invaldcache +3A90,80003EF0,src/libultra/io/si +3AC0,80003F20,src/libultra/os/jammesg +3C10,80004070,src/libultra/os/setthreadpri +3CF0,80004150,src/libultra/os/getthreadpri +3D10,80004170,src/libultra/io/epirawread +3E70,800042D0,src/libultra/io/viswapbuf +3EC0,80004320,src/libultra/io/epirawdma +40A0,80004500,src/libultra/libc/bcmp +41C0,80004620,src/libultra/os/gettime +4250,800046B0,src/libultra/os/timerintr +4680,80004AE0,src/libultra/os/getcount +4690,80004AF0,src/libultra/os/setglobalintmask +46E0,80004B40,src/libultra/os/setcompare +46F0,80004B50,src/libultra/libc/bcopy +4A00,80004E60,src/libultra/os/resetglobalintmask +4A60,80004EC0,src/libultra/os/interrupt +4AF0,80004F50,src/libultra/io/vi +4C10,80005070,src/libultra/io/viswapcontext +4F10,80005370,src/libultra/io/pigetcmdq +4F40,800053A0,src/libultra/io/epiread +4F90,800053F0,src/libultra/io/visetspecial +50F0,80005550,src/libultra/io/cartrominit +5250,800056B0,src/libultra/os/setfpccsr +5260,800056C0,src/libultra/os/getfpccsr +5270,800056D0,src/libultra/os/maptlbrdb +52D0,80005730,src/libultra/os/yieldthread +5320,80005780,src/libultra/os/getcause +5330,80005790,src/libultra/io/epirawwrite +5490,800058F0,src/libultra/io/sirawwrite +54E0,80005940,src/libultra/io/vimgr +57F0,80005C50,src/libultra/io/vigetcurrcontext +5800,80005C60,src/libultra/os/startthread +5950,80005DB0,src/libultra/io/visetyscale +59A0,80005E00,src/libultra/io/visetxscale +5AB0,80005F10,src/libultra/os/sethwintrroutine +5B20,80005F80,src/libultra/os/gethwintrroutine +5B50,80005FB0,src/libultra/os/setwatchlo +5B60,80005FC0,data/rsp_boot.text offset,vram,.data -5C30,80006090,data/unk_800093F0.data.s -5C50,800060B0,data/unk_80009410.data.s -5C70,800060D0,src/boot/idle.s -5C90,800060F0,src/boot/viconfig.s -5CA0,80006100,src/boot/z_std_dma.s -5CB0,80006110,src/boot/z_locale.s -5CC0,80006120,src/libultra/io/driverominit.s -5CD0,80006130,src/boot/stackcheck.s -5CE0,80006140,src/libultra/io/piacs.s -5CF0,80006150,src/libultra/io/vimodepallan1.s -5D40,800061A0,src/libultra/os/initialize.s -5D60,800061C0,src/libultra/os/exceptasm.s -5D90,800061F0,src/libultra/os/thread.s -5DB0,80006210,src/libultra/io/pimgr.s -5DE0,80006240,src/libultra/os/seteventmesg.s -5DF0,80006250,src/libultra/os/timerintr.s -5E00,80006260,src/libultra/io/vimodentsclan1.s -5E50,800062B0,src/libultra/io/vimodempallan1.s -5EA0,80006300,src/libultra/io/vi.s -5F10,80006370,src/libultra/io/cartrominit.s -5F20,80006380,src/libultra/io/vimgr.s +5C30,80006090,data/unk_800093F0.data +5C50,800060B0,data/unk_80009410.data +5C70,800060D0,src/boot/idle +5C90,800060F0,src/boot/viconfig +5CA0,80006100,src/boot/z_std_dma +5CB0,80006110,src/boot/z_locale +5CC0,80006120,src/libultra/io/driverominit +5CD0,80006130,src/boot/stackcheck +5CE0,80006140,src/libultra/io/piacs +5CF0,80006150,src/libultra/io/vimodepallan1 +5D40,800061A0,src/libultra/os/initialize +5D60,800061C0,src/libultra/os/exceptasm +5D90,800061F0,src/libultra/os/thread +5DB0,80006210,src/libultra/io/pimgr +5DE0,80006240,src/libultra/os/seteventmesg +5DF0,80006250,src/libultra/os/timerintr +5E00,80006260,src/libultra/io/vimodentsclan1 +5E50,800062B0,src/libultra/io/vimodempallan1 +5EA0,80006300,src/libultra/io/vi +5F10,80006370,src/libultra/io/cartrominit +5F20,80006380,src/libultra/io/vimgr offset,vram,.rodata -5F40,800063A0,src/boot/boot_main.s -5F50,800063B0,src/boot/idle.s -5F60,800063C0,src/boot/z_std_dma.s -5FC0,80006420,src/boot/z_locale.s -5FD0,80006430,src/boot/stackcheck.s -5FE0,80006440,src/boot/logutils.s -5FF0,80006450,src/libultra/os/exceptasm.s -6040,800064A0,src/libultra/io/devmgr.s -6060,800064C0,src/libultra/os/setintmask.s -60E0,80006540,src/boot/build.s +5F40,800063A0,src/boot/boot_main +5F50,800063B0,src/boot/idle +5F60,800063C0,src/boot/z_std_dma +5FC0,80006420,src/boot/z_locale +5FD0,80006430,src/boot/stackcheck +5FE0,80006440,src/boot/logutils +5FF0,80006450,src/libultra/os/exceptasm +6040,800064A0,src/libultra/io/devmgr +6060,800064C0,src/libultra/os/setintmask +60E0,80006540,src/boot/build offset,vram,.bss -6110,80006570,src/boot/boot_main.s -6B00,80006F60,src/boot/idle.s -7710,80007B70,src/boot/z_std_dma.s -7E80,800082E0,src/boot/yaz0.s -8290,800086F0,src/boot/z_locale.s -82B0,80008710,src/libultra/io/driverominit.s -8330,80008790,src/libultra/io/piacs.s -8350,800087B0,src/libultra/os/initialize.s -8360,800087C0,src/libultra/io/pimgr.s -97D0,80009C30,src/libultra/os/seteventmesg.s -9850,80009CB0,src/libultra/os/timerintr.s -9890,80009CF0,src/libultra/io/cartrominit.s -9910,80009D70,src/libultra/io/vimgr.s +6110,80006570,src/boot/boot_main +6B00,80006F60,src/boot/idle +7710,80007B70,src/boot/z_std_dma +7E80,800082E0,src/boot/yaz0 +8290,800086F0,src/boot/z_locale +82B0,80008710,src/libultra/io/driverominit +8330,80008790,src/libultra/io/piacs +8350,800087B0,src/libultra/os/initialize +8360,800087C0,src/libultra/io/pimgr +97D0,80009C30,src/libultra/os/seteventmesg +9850,80009CB0,src/libultra/os/timerintr +9890,80009CF0,src/libultra/io/cartrominit +9910,80009D70,src/libultra/io/vimgr AB30,8000AF90,.end diff --git a/tools/disasm/gc-eu-mq/files_code.csv b/tools/disasm/gc-eu-mq/files_code.csv index b62bd56945..d22e15fe08 100644 --- a/tools/disasm/gc-eu-mq/files_code.csv +++ b/tools/disasm/gc-eu-mq/files_code.csv @@ -1,464 +1,464 @@ offset,vram,.text -0,80010F00,src/code/z_en_a_keep.s -AA0,800119A0,src/code/z_en_item00.s -2EA0,80013DA0,src/code/z_eff_blure.s -62D0,800171D0,src/code/z_eff_shield_particle.s -7930,80018830,src/code/z_eff_spark.s -8FE0,80019EE0,src/code/z_eff_ss_dead.s -9790,8001A690,src/code/z_effect.s -9F10,8001AE10,src/code/z_effect_soft_sprite.s -A9B0,8001B8B0,src/code/z_effect_soft_sprite_old_init.s -D4D0,8001E3D0,src/code/flg_set.s -D8F0,8001E7F0,src/code/z_DLF.s -DB40,8001EA40,src/code/z_actor.s -1A0C0,8002AFC0,src/code/z_actor_dlftbls.s -1A210,8002B110,src/code/z_bgcheck.s -23DF0,80034CF0,src/code/code_800430A0.s -24110,80035010,src/code/code_80043480.s -244A0,800353A0,src/code/z_camera.s -38AD0,800499D0,src/code/z_collision_btltbls.s -38B30,80049A30,src/code/z_collision_check.s -407B0,800516B0,src/code/z_common_data.s -40830,80051730,src/code/z_debug.s -40B40,80051A40,src/code/z_debug_display.s -41000,80051F00,src/code/z_demo.s -45CE0,80056BE0,src/code/code_80069420.s -45D70,80056C70,src/code/z_draw.s -47C70,80058B70,src/code/z_sfx_source.s -47E30,80058D30,src/code/z_elf_message.s -48510,80059410,src/code/z_face_reaction.s -48560,80059460,src/code/code_8006C3A0.s -486E0,800595E0,src/code/z_fcurve_data.s -48920,80059820,src/code/z_fcurve_data_skelanime.s -49130,8005A030,src/code/z_horse.s -49E10,8005AD10,src/code/z_jpeg.s -4A5D0,8005B4D0,src/code/z_kaleido_setup.s -4A9A0,8005B8A0,src/code/z_kanfont.s -4AB70,8005BA70,src/code/z_kankyo.s -52380,80063280,src/code/z_lib.s -53520,80064420,src/code/z_lifemeter.s -548C0,800657C0,src/code/z_lights.s -55960,80066860,src/code/z_malloc.s -55B40,80066A40,src/code/z_map_mark.s -56140,80067040,src/code/z_prenmi_buff.s -56200,80067100,src/code/z_nulltask.s -56280,80067180,src/code/z_olib.s -56970,80067870,src/code/z_onepointdemo.s -5A910,8006B810,src/code/z_map_exp.s -5C4B0,8006D3B0,src/code/z_parameter.s -67BA0,80078AA0,src/code/z_path.s -67D70,80078C70,src/code/z_frame_advance.s -67E20,80078D20,src/code/z_player_lib.s -6B890,8007C790,src/code/z_prenmi.s -6BA30,8007C930,src/code/z_quake.s -6C8A0,8007D7A0,src/code/z_rcp.s -6E160,8007F060,src/code/z_room.s -6F950,80080850,src/code/z_sample.s -6FD50,80080C50,src/code/code_80097A00.s -6FF10,80080E10,src/code/z_scene.s -713C0,800822C0,src/code/z_scene_table.s -77BA0,80088AA0,src/code/z_skelanime.s -7C590,8008D490,src/code/z_skin.s -7D130,8008E030,src/code/z_skin_awb.s -7DA40,8008E940,src/code/z_skin_matrix.s -7EDE0,8008FCE0,src/code/z_sram.s -80220,80091120,src/code/z_ss_sram.s -803F0,800912F0,src/code/z_rumble.s -80670,80091570,src/code/z_view.s -81D70,80092C70,src/code/z_vimode.s -828E0,800937E0,src/code/z_viscvg.s -82A80,80093980,src/code/z_vismono.s -832A0,800941A0,src/code/z_viszbuf.s -83530,80094430,src/code/z_vr_box.s -85E00,80096D00,src/code/z_vr_box_draw.s -864E0,800973E0,src/code/z_player_call.s -86650,80097550,src/code/z_fbdemo.s -87070,80097F70,src/code/z_fbdemo_triforce.s -87630,80098530,src/code/z_fbdemo_wipe1.s -87AA0,800989A0,src/code/z_fbdemo_circle.s -88160,80099060,src/code/z_fbdemo_fade.s -884C0,800993C0,src/code/shrink_window.s -88630,80099530,src/code/code_800BB0A0.s -88B00,80099A00,src/code/z_kaleido_manager.s -88D30,80099C30,src/code/z_kaleido_scope_call.s -89010,80099F10,src/code/z_play.s -8CA70,8009D970,src/code/PreRender.s -8EB60,8009FA60,src/code/TwoHeadGfxArena.s -8ED70,8009FC70,src/code/TwoHeadArena.s -8EF30,8009FE30,src/code/audio_stop_all_sfx.s -8EF80,8009FE80,src/code/audio_thread_manager.s -8F390,800A0290,src/code/title_setup.s -8F400,800A0300,src/code/game.s -8FB80,800A0A80,src/code/gamealloc.s -8FCC0,800A0BC0,src/code/graph.s -90660,800A1560,src/code/gfxalloc.s -906C0,800A15C0,src/code/listalloc.s -90810,800A1710,src/code/main.s -90B70,800A1A70,src/code/padmgr.s -91680,800A2580,src/code/sched.s -92300,800A3200,src/code/speed_meter.s -92D40,800A3C40,src/code/sys_cfb.s -92E60,800A3D60,src/code/sys_math.s -93100,800A4000,src/code/sys_math3d.s -98ED0,800A9DD0,src/code/sys_math_atan.s -99100,800AA000,src/code/sys_matrix.s -9B500,800AC400,src/code/sys_ucode.s -9B550,800AC450,src/code/sys_rumble.s -9B8B0,800AC7B0,src/code/code_800D31A0.s -9B8E0,800AC7E0,src/code/irqmgr.s -9BF00,800ACE00,src/code/fault.s -9E750,800AF650,src/code/fault_drawer.s -9F1D0,800B00D0,src/code/kanread.s -9FCC0,800B0BC0,src/audio/lib/synthesis.s -A2E20,800B3D20,src/audio/lib/heap.s -A61F0,800B70F0,src/audio/lib/load.s -A9FE0,800BAEE0,src/audio/lib/thread.s -AB840,800BC740,src/audio/lib/dcache.s -AB8C0,800BC7C0,src/audio/lib/aisetnextbuf.s -AB940,800BC840,src/audio/lib/playback.s -AD8C0,800BE7C0,src/audio/lib/effects.s -AE340,800BF240,src/audio/lib/seqplayer.s -B1960,800C2860,src/audio/general.s -B7AF0,800C89F0,src/audio/sfx.s -B9950,800CA850,src/audio/sequence.s -BB570,800CC470,src/code/gfxprint.s -BC2E0,800CD1E0,src/code/rcp_utils.s -BC340,800CD240,src/code/loadfragment2.s -BC3A0,800CD2A0,src/code/relocation.s -BC5E0,800CD4E0,src/code/load.s -BC6B0,800CD5B0,src/code/code_800FC620.s -BC9F0,800CD8F0,src/code/padutils.s -BCBE0,800CDAE0,src/code/padsetup.s -BCD20,800CDC20,src/code/code_800FCE80.s -BD230,800CE130,src/code/fp.s -BD390,800CE290,src/code/system_malloc.s -BD560,800CE460,src/code/code_800FD970.s -BD720,800CE620,src/code/__osMalloc.s -BE4D0,800CF3D0,src/libultra/libc/sprintf.s -BE5A0,800CF4A0,src/code/printutils.s -BE600,800CF500,src/code/sleep.s -BE7A0,800CF6A0,src/code/jpegutils.s -BECB0,800CFBB0,src/code/jpegdecoder.s -BF2A0,800D01A0,src/libultra/mgu/scale.s -BF350,800D0250,src/libultra/gu/sinf.s -BF510,800D0410,src/libultra/gu/sins.s -BF580,800D0480,src/libultra/io/sptask.s -BF840,800D0740,src/libultra/io/motor.s -BFC10,800D0B10,src/libultra/io/siacs.s -BFCD0,800D0BD0,src/libultra/io/controller.s -BFFB0,800D0EB0,src/libultra/io/contreaddata.s -C0190,800D1090,src/libultra/gu/perspective.s -C0420,800D1320,src/libultra/io/sprawdma.s -C04B0,800D13B0,src/libultra/io/sirawdma.s -C0560,800D1460,src/libultra/io/sptaskyield.s -C0580,800D1480,src/libultra/mgu/mtxidentf.s -C05D0,800D14D0,src/libultra/gu/lookat.s -C08F0,800D17F0,src/libultra/os/stoptimer.s -C09E0,800D18E0,src/libultra/gu/sqrtf.s -C09F0,800D18F0,src/libultra/os/afterprenmi.s -C0A10,800D1910,src/libultra/io/contquery.s -C0AB0,800D19B0,src/libultra/gu/lookathil.s -C1330,800D2230,src/libultra/libc/xprintf.s -C2010,800D2F10,src/libultra/libc/string.s -C20B0,800D2FB0,src/libultra/io/sp.s -C20E0,800D2FE0,src/libultra/mgu/mtxident.s -C2130,800D3030,src/libultra/gu/position.s -C2340,800D3240,src/libultra/io/sptaskyielded.s -C23A0,800D32A0,src/libultra/gu/rotate.s -C2570,800D3470,src/libultra/io/aisetfreq.s -C26C0,800D35C0,src/libultra/os/getactivequeue.s -C26E0,800D35E0,src/libultra/mgu/normalize.s -C2740,800D3640,src/libultra/io/dpgetstat.s -C2750,800D3650,src/libultra/io/dpsetstat.s -C2760,800D3660,src/libultra/gu/ortho.s -C2920,800D3820,src/libultra/gu/cosf.s -C2A90,800D3990,src/libultra/gu/coss.s -C2AC0,800D39C0,src/libultra/io/visetevent.s -C2B20,800D3A20,src/libultra/gu/us2dex.s -C2CA0,800D3BA0,src/libultra/io/pfsselectbank.s -C2D20,800D3C20,src/libultra/io/contsetch.s -C2D80,800D3C80,src/libultra/io/aigetlen.s -C2DA0,800D3CA0,src/libultra/mgu/translate.s -C2E70,800D3D70,src/libultra/io/contramwrite.s -C30C0,800D3FC0,src/libultra/io/pfsgetstatus.s -C32F0,800D41F0,src/libultra/io/contpfs.s -C3E70,800D4D70,src/libultra/io/contramread.s -C40A0,800D4FA0,src/libultra/io/crc.s -C4210,800D5110,src/libultra/io/pfsisplug.s -C4500,800D5400,src/libultra/os/settimer.s -C4690,800D5590,src/libultra/libc/xldtob.s -C51A0,800D60A0,src/libultra/libc/ldiv.s -C5330,800D6230,src/libultra/libc/xlitob.s -C55D0,800D64D0,src/libultra/io/spgetstat.s -C55E0,800D64E0,src/libultra/io/spsetstat.s -C55F0,800D64F0,src/libultra/os/writebackdcacheall.s -C5620,800D6520,src/libultra/os/getcurrfaultedthread.s -C5640,800D6540,src/libultra/mgu/mtxf2l.s -C56B0,800D65B0,src/libultra/libc/llcvt.s -C58C0,800D67C0,src/libultra/io/vigetcurrframebuf.s -C5900,800D6800,src/libultra/io/spsetpc.s -C5930,800D6830,src/libultra/libc/sqrt.s -C5940,800D6840,src/libultra/libc/absf.s -C5950,800D6850,src/code/fmodf.s -C59A0,800D68A0,src/code/__osMemset.s -C59D0,800D68D0,src/code/__osMemmove.s -C5A60,800D6960,src/code/z_message_PAL.s -CE820,800DF720,src/code/z_game_over.s -CED60,800DFC60,src/code/z_construct.s -D02A0,800E11A0,data/rsp.text.s +0,80010F00,src/code/z_en_a_keep +AA0,800119A0,src/code/z_en_item00 +2EA0,80013DA0,src/code/z_eff_blure +62D0,800171D0,src/code/z_eff_shield_particle +7930,80018830,src/code/z_eff_spark +8FE0,80019EE0,src/code/z_eff_ss_dead +9790,8001A690,src/code/z_effect +9F10,8001AE10,src/code/z_effect_soft_sprite +A9B0,8001B8B0,src/code/z_effect_soft_sprite_old_init +D4D0,8001E3D0,src/code/flg_set +D8F0,8001E7F0,src/code/z_DLF +DB40,8001EA40,src/code/z_actor +1A0C0,8002AFC0,src/code/z_actor_dlftbls +1A210,8002B110,src/code/z_bgcheck +23DF0,80034CF0,src/code/code_800430A0 +24110,80035010,src/code/code_80043480 +244A0,800353A0,src/code/z_camera +38AD0,800499D0,src/code/z_collision_btltbls +38B30,80049A30,src/code/z_collision_check +407B0,800516B0,src/code/z_common_data +40830,80051730,src/code/z_debug +40B40,80051A40,src/code/z_debug_display +41000,80051F00,src/code/z_demo +45CE0,80056BE0,src/code/code_80069420 +45D70,80056C70,src/code/z_draw +47C70,80058B70,src/code/z_sfx_source +47E30,80058D30,src/code/z_elf_message +48510,80059410,src/code/z_face_reaction +48560,80059460,src/code/code_8006C3A0 +486E0,800595E0,src/code/z_fcurve_data +48920,80059820,src/code/z_fcurve_data_skelanime +49130,8005A030,src/code/z_horse +49E10,8005AD10,src/code/z_jpeg +4A5D0,8005B4D0,src/code/z_kaleido_setup +4A9A0,8005B8A0,src/code/z_kanfont +4AB70,8005BA70,src/code/z_kankyo +52380,80063280,src/code/z_lib +53520,80064420,src/code/z_lifemeter +548C0,800657C0,src/code/z_lights +55960,80066860,src/code/z_malloc +55B40,80066A40,src/code/z_map_mark +56140,80067040,src/code/z_prenmi_buff +56200,80067100,src/code/z_nulltask +56280,80067180,src/code/z_olib +56970,80067870,src/code/z_onepointdemo +5A910,8006B810,src/code/z_map_exp +5C4B0,8006D3B0,src/code/z_parameter +67BA0,80078AA0,src/code/z_path +67D70,80078C70,src/code/z_frame_advance +67E20,80078D20,src/code/z_player_lib +6B890,8007C790,src/code/z_prenmi +6BA30,8007C930,src/code/z_quake +6C8A0,8007D7A0,src/code/z_rcp +6E160,8007F060,src/code/z_room +6F950,80080850,src/code/z_sample +6FD50,80080C50,src/code/code_80097A00 +6FF10,80080E10,src/code/z_scene +713C0,800822C0,src/code/z_scene_table +77BA0,80088AA0,src/code/z_skelanime +7C590,8008D490,src/code/z_skin +7D130,8008E030,src/code/z_skin_awb +7DA40,8008E940,src/code/z_skin_matrix +7EDE0,8008FCE0,src/code/z_sram +80220,80091120,src/code/z_ss_sram +803F0,800912F0,src/code/z_rumble +80670,80091570,src/code/z_view +81D70,80092C70,src/code/z_vimode +828E0,800937E0,src/code/z_viscvg +82A80,80093980,src/code/z_vismono +832A0,800941A0,src/code/z_viszbuf +83530,80094430,src/code/z_vr_box +85E00,80096D00,src/code/z_vr_box_draw +864E0,800973E0,src/code/z_player_call +86650,80097550,src/code/z_fbdemo +87070,80097F70,src/code/z_fbdemo_triforce +87630,80098530,src/code/z_fbdemo_wipe1 +87AA0,800989A0,src/code/z_fbdemo_circle +88160,80099060,src/code/z_fbdemo_fade +884C0,800993C0,src/code/shrink_window +88630,80099530,src/code/code_800BB0A0 +88B00,80099A00,src/code/z_kaleido_manager +88D30,80099C30,src/code/z_kaleido_scope_call +89010,80099F10,src/code/z_play +8CA70,8009D970,src/code/PreRender +8EB60,8009FA60,src/code/TwoHeadGfxArena +8ED70,8009FC70,src/code/TwoHeadArena +8EF30,8009FE30,src/code/audio_stop_all_sfx +8EF80,8009FE80,src/code/audio_thread_manager +8F390,800A0290,src/code/title_setup +8F400,800A0300,src/code/game +8FB80,800A0A80,src/code/gamealloc +8FCC0,800A0BC0,src/code/graph +90660,800A1560,src/code/gfxalloc +906C0,800A15C0,src/code/listalloc +90810,800A1710,src/code/main +90B70,800A1A70,src/code/padmgr +91680,800A2580,src/code/sched +92300,800A3200,src/code/speed_meter +92D40,800A3C40,src/code/sys_cfb +92E60,800A3D60,src/code/sys_math +93100,800A4000,src/code/sys_math3d +98ED0,800A9DD0,src/code/sys_math_atan +99100,800AA000,src/code/sys_matrix +9B500,800AC400,src/code/sys_ucode +9B550,800AC450,src/code/sys_rumble +9B8B0,800AC7B0,src/code/code_800D31A0 +9B8E0,800AC7E0,src/code/irqmgr +9BF00,800ACE00,src/code/fault +9E750,800AF650,src/code/fault_drawer +9F1D0,800B00D0,src/code/kanread +9FCC0,800B0BC0,src/audio/lib/synthesis +A2E20,800B3D20,src/audio/lib/heap +A61F0,800B70F0,src/audio/lib/load +A9FE0,800BAEE0,src/audio/lib/thread +AB840,800BC740,src/audio/lib/dcache +AB8C0,800BC7C0,src/audio/lib/aisetnextbuf +AB940,800BC840,src/audio/lib/playback +AD8C0,800BE7C0,src/audio/lib/effects +AE340,800BF240,src/audio/lib/seqplayer +B1960,800C2860,src/audio/general +B7AF0,800C89F0,src/audio/sfx +B9950,800CA850,src/audio/sequence +BB570,800CC470,src/code/gfxprint +BC2E0,800CD1E0,src/code/rcp_utils +BC340,800CD240,src/code/loadfragment2 +BC3A0,800CD2A0,src/code/relocation +BC5E0,800CD4E0,src/code/load +BC6B0,800CD5B0,src/code/code_800FC620 +BC9F0,800CD8F0,src/code/padutils +BCBE0,800CDAE0,src/code/padsetup +BCD20,800CDC20,src/code/code_800FCE80 +BD230,800CE130,src/code/fp +BD390,800CE290,src/code/system_malloc +BD560,800CE460,src/code/rand +BD720,800CE620,src/code/__osMalloc +BE4D0,800CF3D0,src/libultra/libc/sprintf +BE5A0,800CF4A0,src/code/printutils +BE600,800CF500,src/code/sleep +BE7A0,800CF6A0,src/code/jpegutils +BECB0,800CFBB0,src/code/jpegdecoder +BF2A0,800D01A0,src/libultra/mgu/scale +BF350,800D0250,src/libultra/gu/sinf +BF510,800D0410,src/libultra/gu/sins +BF580,800D0480,src/libultra/io/sptask +BF840,800D0740,src/libultra/io/motor +BFC10,800D0B10,src/libultra/io/siacs +BFCD0,800D0BD0,src/libultra/io/controller +BFFB0,800D0EB0,src/libultra/io/contreaddata +C0190,800D1090,src/libultra/gu/perspective +C0420,800D1320,src/libultra/io/sprawdma +C04B0,800D13B0,src/libultra/io/sirawdma +C0560,800D1460,src/libultra/io/sptaskyield +C0580,800D1480,src/libultra/mgu/mtxidentf +C05D0,800D14D0,src/libultra/gu/lookat +C08F0,800D17F0,src/libultra/os/stoptimer +C09E0,800D18E0,src/libultra/gu/sqrtf +C09F0,800D18F0,src/libultra/os/afterprenmi +C0A10,800D1910,src/libultra/io/contquery +C0AB0,800D19B0,src/libultra/gu/lookathil +C1330,800D2230,src/libultra/libc/xprintf +C2010,800D2F10,src/libultra/libc/string +C20B0,800D2FB0,src/libultra/io/sp +C20E0,800D2FE0,src/libultra/mgu/mtxident +C2130,800D3030,src/libultra/gu/position +C2340,800D3240,src/libultra/io/sptaskyielded +C23A0,800D32A0,src/libultra/gu/rotate +C2570,800D3470,src/libultra/io/aisetfreq +C26C0,800D35C0,src/libultra/os/getactivequeue +C26E0,800D35E0,src/libultra/mgu/normalize +C2740,800D3640,src/libultra/io/dpgetstat +C2750,800D3650,src/libultra/io/dpsetstat +C2760,800D3660,src/libultra/gu/ortho +C2920,800D3820,src/libultra/gu/cosf +C2A90,800D3990,src/libultra/gu/coss +C2AC0,800D39C0,src/libultra/io/visetevent +C2B20,800D3A20,src/libultra/gu/us2dex +C2CA0,800D3BA0,src/libultra/io/pfsselectbank +C2D20,800D3C20,src/libultra/io/contsetch +C2D80,800D3C80,src/libultra/io/aigetlen +C2DA0,800D3CA0,src/libultra/mgu/translate +C2E70,800D3D70,src/libultra/io/contramwrite +C30C0,800D3FC0,src/libultra/io/pfsgetstatus +C32F0,800D41F0,src/libultra/io/contpfs +C3E70,800D4D70,src/libultra/io/contramread +C40A0,800D4FA0,src/libultra/io/crc +C4210,800D5110,src/libultra/io/pfsisplug +C4500,800D5400,src/libultra/os/settimer +C4690,800D5590,src/libultra/libc/xldtob +C51A0,800D60A0,src/libultra/libc/ldiv +C5330,800D6230,src/libultra/libc/xlitob +C55D0,800D64D0,src/libultra/io/spgetstat +C55E0,800D64E0,src/libultra/io/spsetstat +C55F0,800D64F0,src/libultra/os/writebackdcacheall +C5620,800D6520,src/libultra/os/getcurrfaultedthread +C5640,800D6540,src/libultra/mgu/mtxf2l +C56B0,800D65B0,src/libultra/libc/llcvt +C58C0,800D67C0,src/libultra/io/vigetcurrframebuf +C5900,800D6800,src/libultra/io/spsetpc +C5930,800D6830,src/libultra/libc/sqrt +C5940,800D6840,src/libultra/libc/absf +C5950,800D6850,src/code/fmodf +C59A0,800D68A0,src/code/__osMemset +C59D0,800D68D0,src/code/__osMemmove +C5A60,800D6960,src/code/z_message_PAL +CE820,800DF720,src/code/z_game_over +CED60,800DFC60,src/code/z_construct +D02A0,800E11A0,data/rsp.text offset,vram,.data -D3600,800E4500,src/code/z_en_a_keep.s -D36A0,800E45A0,src/code/z_en_item00.s -D3940,800E4840,src/code/z_eff_blure.s -D39F0,800E48F0,src/code/z_eff_shield_particle.s -D3A40,800E4940,src/code/z_effect.s -D3A90,800E4990,src/code/z_effect_soft_sprite.s -D3AA0,800E49A0,src/code/z_effect_soft_sprite_old_init.s -D3B90,800E4A90,src/code/z_effect_soft_sprite_dlftbls.s -D3FA0,800E4EA0,src/code/flg_set.s -D4160,800E5060,src/code/z_actor.s -D4480,800E5380,src/code/z_actor_dlftbls.s -D7F70,800E8E70,src/code/z_bgcheck.s -D80C0,800E8FC0,src/code/z_camera.s -DB610,800EC510,src/code/z_collision_btltbls.s -DB8F0,800EC7F0,src/code/z_collision_check.s -DBBA0,800ECAA0,src/code/z_debug.s -DBBD0,800ECAD0,src/code/z_debug_display.s -DBC20,800ECB20,src/code/z_demo.s -DBD80,800ECC80,src/code/z_draw.s -DCE00,800EDD00,src/code/z_elf_message.s -DCE50,800EDD50,src/code/z_face_reaction.s -DD290,800EE190,src/code/z_game_dlftbls.s -DD3B0,800EE2B0,src/code/z_horse.s -DD4C0,800EE3C0,src/code/z_jpeg.s -DD500,800EE400,src/code/z_kaleido_setup.s -DD550,800EE450,src/code/z_kankyo.s -DD940,800EE840,src/code/z_lib.s -DD970,800EE870,src/code/z_lifemeter.s -DDA90,800EE990,src/code/z_lights.s -DDAA0,800EE9A0,src/code/z_map_mark.s -DDB60,800EEA60,src/code/z_onepointdemo.s -E1480,800F2380,src/code/z_map_exp.s -E14A0,800F23A0,src/code/z_map_data.s -E32A0,800F41A0,src/code/z_parameter.s -E35A0,800F44A0,src/code/z_player_lib.s -E3C80,800F4B80,src/code/z_quake.s -E3CB0,800F4BB0,src/code/z_rcp.s -E4AD0,800F59D0,src/code/z_room.s -E4B50,800F5A50,src/code/code_80097A00.s -E4ED0,800F5DD0,src/code/z_scene.s -E4F50,800F5E50,src/code/object_table.s -E5BF0,800F6AF0,src/code/z_scene_table.s -E7E00,800F8D00,src/code/z_skelanime.s -E7E20,800F8D20,src/code/z_skin_matrix.s -E7E60,800F8D60,src/code/z_sram.s -E8010,800F8F10,src/code/z_ss_sram.s -E80C0,800F8FC0,data/unk_8012ABC0.data.s -E80F0,800F8FF0,src/code/z_view.s -E8100,800F9000,src/code/z_viscvg.s -E8190,800F9090,src/code/z_vr_box.s -E8490,800F9390,src/code/z_player_call.s -E84B0,800F93B0,src/code/z_fbdemo.s -E8530,800F9430,src/code/z_fbdemo_triforce.s -E8600,800F9500,src/code/z_fbdemo_wipe1.s -E90A0,800F9FA0,src/code/z_fbdemo_circle.s -EA3A0,800FB2A0,src/code/z_fbdemo_fade.s -EA3D0,800FB2D0,src/code/shrink_window.s -EA3E0,800FB2E0,src/code/z_kaleido_manager.s -EA430,800FB330,src/code/z_play.s -EA440,800FB340,src/code/audio_stop_all_sfx.s -EA450,800FB350,src/code/graph.s -EA460,800FB360,src/code/main.s -EA470,800FB370,src/code/padmgr.s -EA480,800FB380,src/code/speed_meter.s -EA4B0,800FB3B0,src/code/sys_math.s -EA4F0,800FB3F0,src/code/sys_math_atan.s -EAD00,800FBC00,src/code/sys_matrix.s -EAD80,800FBC80,src/code/sys_ucode.s -EAD90,800FBC90,src/code/sys_rumble.s -EADA0,800FBCA0,src/code/irqmgr.s -EADC0,800FBCC0,src/code/fault.s -EAE20,800FBD20,src/code/fault_drawer.s -EAE60,800FBD60,src/audio/lib/data.s -ED270,800FE170,src/audio/lib/synthesis.s -ED2A0,800FE1A0,src/audio/lib/load.s -ED2B0,800FE1B0,src/audio/lib/thread.s -ED2D0,800FE1D0,src/audio/lib/aisetnextbuf.s -ED2E0,800FE1E0,src/audio/lib/effects.s -ED2F0,800FE1F0,src/audio/lib/seqplayer.s -ED340,800FE240,src/audio/general.s -EEA60,800FF960,src/audio/sfx_params.s -EFE30,80100D30,src/audio/data.s -EFEA0,80100DA0,src/audio/session_config.s -F0640,80101540,src/code/logseverity.s -F0650,80101550,src/code/gfxprint.s -F0F00,80101E00,src/code/code_800FC620.s -F0F20,80101E20,src/code/fp.s -F0F30,80101E30,src/code/code_800FD970.s -F0F40,80101E40,src/code/__osMalloc.s -F0F50,80101E50,src/libultra/gu/sins.s -F1750,80102650,src/libultra/io/siacs.s -F1760,80102660,src/libultra/io/controller.s -F1770,80102670,src/libultra/libc/xprintf.s -F17C0,801026C0,src/libultra/gu/position.s -F17D0,801026D0,src/libultra/gu/rotate.s -F17E0,801026E0,src/libultra/io/vimodefpallan1.s -F1830,80102730,src/libultra/io/contpfs.s -F1840,80102740,src/libultra/io/contramread.s -F1850,80102750,src/libultra/libc/xlitob.s +D3600,800E4500,src/code/z_en_a_keep +D36A0,800E45A0,src/code/z_en_item00 +D3940,800E4840,src/code/z_eff_blure +D39F0,800E48F0,src/code/z_eff_shield_particle +D3A40,800E4940,src/code/z_effect +D3A90,800E4990,src/code/z_effect_soft_sprite +D3AA0,800E49A0,src/code/z_effect_soft_sprite_old_init +D3B90,800E4A90,src/code/z_effect_soft_sprite_dlftbls +D3FA0,800E4EA0,src/code/flg_set +D4160,800E5060,src/code/z_actor +D4480,800E5380,src/code/z_actor_dlftbls +D7F70,800E8E70,src/code/z_bgcheck +D80C0,800E8FC0,src/code/z_camera +DB610,800EC510,src/code/z_collision_btltbls +DB8F0,800EC7F0,src/code/z_collision_check +DBBA0,800ECAA0,src/code/z_debug +DBBD0,800ECAD0,src/code/z_debug_display +DBC20,800ECB20,src/code/z_demo +DBD80,800ECC80,src/code/z_draw +DCE00,800EDD00,src/code/z_elf_message +DCE50,800EDD50,src/code/z_face_reaction +DD290,800EE190,src/code/z_game_dlftbls +DD3B0,800EE2B0,src/code/z_horse +DD4C0,800EE3C0,src/code/z_jpeg +DD500,800EE400,src/code/z_kaleido_setup +DD550,800EE450,src/code/z_kankyo +DD940,800EE840,src/code/z_lib +DD970,800EE870,src/code/z_lifemeter +DDA90,800EE990,src/code/z_lights +DDAA0,800EE9A0,src/code/z_map_mark +DDB60,800EEA60,src/code/z_onepointdemo +E1480,800F2380,src/code/z_map_exp +E14A0,800F23A0,src/code/z_map_data +E32A0,800F41A0,src/code/z_parameter +E35A0,800F44A0,src/code/z_player_lib +E3C80,800F4B80,src/code/z_quake +E3CB0,800F4BB0,src/code/z_rcp +E4AD0,800F59D0,src/code/z_room +E4B50,800F5A50,src/code/code_80097A00 +E4ED0,800F5DD0,src/code/z_scene +E4F50,800F5E50,src/code/object_table +E5BF0,800F6AF0,src/code/z_scene_table +E7E00,800F8D00,src/code/z_skelanime +E7E20,800F8D20,src/code/z_skin_matrix +E7E60,800F8D60,src/code/z_sram +E8010,800F8F10,src/code/z_ss_sram +E80C0,800F8FC0,data/unk_8012ABC0.data +E80F0,800F8FF0,src/code/z_view +E8100,800F9000,src/code/z_viscvg +E8190,800F9090,src/code/z_vr_box +E8490,800F9390,src/code/z_player_call +E84B0,800F93B0,src/code/z_fbdemo +E8530,800F9430,src/code/z_fbdemo_triforce +E8600,800F9500,src/code/z_fbdemo_wipe1 +E90A0,800F9FA0,src/code/z_fbdemo_circle +EA3A0,800FB2A0,src/code/z_fbdemo_fade +EA3D0,800FB2D0,src/code/shrink_window +EA3E0,800FB2E0,src/code/z_kaleido_manager +EA430,800FB330,src/code/z_play +EA440,800FB340,src/code/audio_stop_all_sfx +EA450,800FB350,src/code/graph +EA460,800FB360,src/code/main +EA470,800FB370,src/code/padmgr +EA480,800FB380,src/code/speed_meter +EA4B0,800FB3B0,src/code/sys_math +EA4F0,800FB3F0,src/code/sys_math_atan +EAD00,800FBC00,src/code/sys_matrix +EAD80,800FBC80,src/code/sys_ucode +EAD90,800FBC90,src/code/sys_rumble +EADA0,800FBCA0,src/code/irqmgr +EADC0,800FBCC0,src/code/fault +EAE20,800FBD20,src/code/fault_drawer +EAE60,800FBD60,src/audio/lib/data +ED270,800FE170,src/audio/lib/synthesis +ED2A0,800FE1A0,src/audio/lib/load +ED2B0,800FE1B0,src/audio/lib/thread +ED2D0,800FE1D0,src/audio/lib/aisetnextbuf +ED2E0,800FE1E0,src/audio/lib/effects +ED2F0,800FE1F0,src/audio/lib/seqplayer +ED340,800FE240,src/audio/general +EEA60,800FF960,src/audio/sfx_params +EFE30,80100D30,src/audio/data +EFEA0,80100DA0,src/audio/session_config +F0640,80101540,src/code/logseverity +F0650,80101550,src/code/gfxprint +F0F00,80101E00,src/code/code_800FC620 +F0F20,80101E20,src/code/fp +F0F30,80101E30,src/code/rand +F0F40,80101E40,src/code/__osMalloc +F0F50,80101E50,src/libultra/gu/sins +F1750,80102650,src/libultra/io/siacs +F1760,80102660,src/libultra/io/controller +F1770,80102670,src/libultra/libc/xprintf +F17C0,801026C0,src/libultra/gu/position +F17D0,801026D0,src/libultra/gu/rotate +F17E0,801026E0,src/libultra/io/vimodefpallan1 +F1830,80102730,src/libultra/io/contpfs +F1840,80102740,src/libultra/io/contramread +F1850,80102750,src/libultra/libc/xlitob offset,vram,.rodata -F1880,80102780,src/code/z_en_a_keep.s -F18D0,801027D0,src/code/z_en_item00.s -F1B40,80102A40,src/code/z_eff_blure.s -F1B70,80102A70,src/code/z_eff_shield_particle.s -F1B80,80102A80,src/code/z_eff_spark.s -F1B90,80102A90,src/code/z_eff_ss_dead.s -F1BA0,80102AA0,src/code/z_effect_soft_sprite_old_init.s -F1BC0,80102AC0,src/code/flg_set.s -F1F50,80102E50,src/code/z_actor.s -F2500,80103400,src/code/z_actor_dlftbls.s -F2550,80103450,src/code/z_bgcheck.s -F25F0,801034F0,src/code/code_80043480.s -F2600,80103500,src/code/z_camera.s -F2D80,80103C80,src/code/z_collision_check.s -F2DD0,80103CD0,src/code/z_debug.s -F2DE0,80103CE0,src/code/z_demo.s -F32C0,801041C0,src/code/z_draw.s -F32D0,801041D0,src/code/z_elf_message.s -F33F0,801042F0,src/code/z_fcurve_data.s -F3400,80104300,src/code/z_fcurve_data_skelanime.s -F3410,80104310,src/code/z_horse.s -F3420,80104320,src/code/z_jpeg.s -F34B0,801043B0,src/code/z_kankyo.s -F3560,80104460,src/code/z_lib.s -F3570,80104470,src/code/z_lifemeter.s -F3590,80104490,src/code/z_lights.s -F35A0,801044A0,src/code/z_map_mark.s -F3600,80104500,src/code/z_olib.s -F3620,80104520,src/code/z_onepointdemo.s -F3EE0,80104DE0,src/code/z_map_exp.s -F4200,80105100,src/code/z_parameter.s -F4410,80105310,src/code/z_path.s -F4420,80105320,src/code/z_player_lib.s -F4480,80105380,src/code/z_quake.s -F4510,80105410,src/code/z_room.s -F4550,80105450,src/code/z_sample.s -F4560,80105460,src/code/z_scene_table.s -F45A0,801054A0,src/code/z_skelanime.s -F45C0,801054C0,src/code/z_skin.s -F45D0,801054D0,src/code/z_skin_matrix.s -F45E0,801054E0,src/code/z_sram.s -F4650,80105550,src/code/z_rumble.s -F4660,80105560,src/code/z_view.s -F4670,80105570,src/code/z_vr_box.s -F4760,80105660,src/code/z_fbdemo_triforce.s -F4770,80105670,src/code/z_fbdemo_wipe1.s -F4780,80105680,src/code/z_fbdemo_circle.s -F4790,80105690,src/code/code_800BB0A0.s -F47A0,801056A0,src/code/z_kaleido_manager.s -F47C0,801056C0,src/code/z_play.s -F4880,80105780,src/code/game.s -F48A0,801057A0,src/code/graph.s -F48F0,801057F0,src/code/main.s -F4920,80105820,src/code/padmgr.s -F4930,80105830,src/code/sys_cfb.s -F4940,80105840,src/code/sys_math.s -F4950,80105850,src/code/sys_math3d.s -F49E0,801058E0,src/code/sys_math_atan.s -F49F0,801058F0,src/code/sys_matrix.s -F4A20,80105920,src/code/irqmgr.s -F4A40,80105940,src/code/fault.s -F5450,80106350,src/code/fault_drawer.s -F5880,80106780,src/audio/lib/synthesis.s -F58A0,801067A0,src/audio/lib/heap.s -F58D0,801067D0,src/audio/lib/load.s -F5940,80106840,src/audio/lib/thread.s -F5A70,80106970,src/audio/lib/playback.s -F5AA0,801069A0,src/audio/lib/effects.s -F5AD0,801069D0,src/audio/lib/seqplayer.s -F6110,80107010,src/audio/general.s -F62A0,801071A0,src/audio/sfx.s -F62C0,801071C0,src/audio/sequence.s -F6340,80107240,src/audio/session_config.s -F6350,80107250,src/code/gfxprint.s -F6370,80107270,src/code/code_800FCE80.s -F63C0,801072C0,src/code/__osMalloc.s -F6680,80107580,src/libultra/gu/sinf.s -F66D0,801075D0,src/libultra/gu/perspective.s -F66E0,801075E0,src/libultra/gu/lookathil.s -F66F0,801075F0,src/libultra/libc/xprintf.s -F67F0,801076F0,src/libultra/gu/cosf.s -F6840,80107740,src/libultra/gu/libm_vals.s -F6850,80107750,src/libultra/libc/xldtob.s -F68B0,801077B0,src/libultra/libc/llcvt.s +F1880,80102780,src/code/z_en_a_keep +F18D0,801027D0,src/code/z_en_item00 +F1B40,80102A40,src/code/z_eff_blure +F1B70,80102A70,src/code/z_eff_shield_particle +F1B80,80102A80,src/code/z_eff_spark +F1B90,80102A90,src/code/z_eff_ss_dead +F1BA0,80102AA0,src/code/z_effect_soft_sprite_old_init +F1BC0,80102AC0,src/code/flg_set +F1F50,80102E50,src/code/z_actor +F2500,80103400,src/code/z_actor_dlftbls +F2550,80103450,src/code/z_bgcheck +F25F0,801034F0,src/code/code_80043480 +F2600,80103500,src/code/z_camera +F2D80,80103C80,src/code/z_collision_check +F2DD0,80103CD0,src/code/z_debug +F2DE0,80103CE0,src/code/z_demo +F32C0,801041C0,src/code/z_draw +F32D0,801041D0,src/code/z_elf_message +F33F0,801042F0,src/code/z_fcurve_data +F3400,80104300,src/code/z_fcurve_data_skelanime +F3410,80104310,src/code/z_horse +F3420,80104320,src/code/z_jpeg +F34B0,801043B0,src/code/z_kankyo +F3560,80104460,src/code/z_lib +F3570,80104470,src/code/z_lifemeter +F3590,80104490,src/code/z_lights +F35A0,801044A0,src/code/z_map_mark +F3600,80104500,src/code/z_olib +F3620,80104520,src/code/z_onepointdemo +F3EE0,80104DE0,src/code/z_map_exp +F4200,80105100,src/code/z_parameter +F4410,80105310,src/code/z_path +F4420,80105320,src/code/z_player_lib +F4480,80105380,src/code/z_quake +F4510,80105410,src/code/z_room +F4550,80105450,src/code/z_sample +F4560,80105460,src/code/z_scene_table +F45A0,801054A0,src/code/z_skelanime +F45C0,801054C0,src/code/z_skin +F45D0,801054D0,src/code/z_skin_matrix +F45E0,801054E0,src/code/z_sram +F4650,80105550,src/code/z_rumble +F4660,80105560,src/code/z_view +F4670,80105570,src/code/z_vr_box +F4760,80105660,src/code/z_fbdemo_triforce +F4770,80105670,src/code/z_fbdemo_wipe1 +F4780,80105680,src/code/z_fbdemo_circle +F4790,80105690,src/code/code_800BB0A0 +F47A0,801056A0,src/code/z_kaleido_manager +F47C0,801056C0,src/code/z_play +F4880,80105780,src/code/game +F48A0,801057A0,src/code/graph +F48F0,801057F0,src/code/main +F4920,80105820,src/code/padmgr +F4930,80105830,src/code/sys_cfb +F4940,80105840,src/code/sys_math +F4950,80105850,src/code/sys_math3d +F49E0,801058E0,src/code/sys_math_atan +F49F0,801058F0,src/code/sys_matrix +F4A20,80105920,src/code/irqmgr +F4A40,80105940,src/code/fault +F5450,80106350,src/code/fault_drawer +F5880,80106780,src/audio/lib/synthesis +F58A0,801067A0,src/audio/lib/heap +F58D0,801067D0,src/audio/lib/load +F5940,80106840,src/audio/lib/thread +F5A70,80106970,src/audio/lib/playback +F5AA0,801069A0,src/audio/lib/effects +F5AD0,801069D0,src/audio/lib/seqplayer +F6110,80107010,src/audio/general +F62A0,801071A0,src/audio/sfx +F62C0,801071C0,src/audio/sequence +F6340,80107240,src/audio/session_config +F6350,80107250,src/code/gfxprint +F6370,80107270,src/code/code_800FCE80 +F63C0,801072C0,src/code/__osMalloc +F6680,80107580,src/libultra/gu/sinf +F66D0,801075D0,src/libultra/gu/perspective +F66E0,801075E0,src/libultra/gu/lookathil +F66F0,801075F0,src/libultra/libc/xprintf +F67F0,801076F0,src/libultra/gu/cosf +F6840,80107740,src/libultra/gu/libm_vals +F6850,80107750,src/libultra/libc/xldtob +F68B0,801077B0,src/libultra/libc/llcvt offset,vram,.data -F68C0,801077C0,src/code/z_message_PAL.s +F68C0,801077C0,src/code/z_message_PAL offset,vram,.rodata -FF350,80110250,src/code/z_message_PAL.s -FF510,80110410,src/code/z_game_over.s -FF570,80110470,data/audio_tables.rodata.s -100110,80111010,data/rsp.rodata.s +FF350,80110250,src/code/z_message_PAL +FF510,80110410,src/code/z_game_over +FF570,80110470,data/audio_tables.rodata +100110,80111010,data/rsp.rodata offset,vram,.bss -102230,80113130,src/code/z_en_item00.s -102240,80113140,src/code/z_effect.s -106030,80116F30,src/code/flg_set.s -106040,80116F40,src/code/z_actor.s -1060C0,80116FC0,src/code/z_actor_dlftbls.s -1060D0,80116FD0,src/code/z_bgcheck.s -1061F0,801170F0,src/code/z_camera.s -1062D0,801171D0,src/code/z_collision_check.s -107A30,80118930,src/code/z_common_data.s -108E60,80119D60,src/code/z_debug.s -109080,80119F80,src/code/z_debug_display.s -109090,80119F90,src/code/z_demo.s -1090C0,80119FC0,src/code/z_kankyo.s -109190,8011A090,src/code/z_lifemeter.s -1091C0,8011A0C0,src/code/z_lights.s -109350,8011A250,src/code/z_malloc.s -109380,8011A280,src/code/z_map_mark.s -109390,8011A290,src/code/z_map_exp.s -1093A0,8011A2A0,src/code/z_parameter.s -1093C0,8011A2C0,src/code/z_player_lib.s -1093E0,8011A2E0,src/code/z_quake.s -109470,8011A370,src/code/z_skelanime.s -109480,8011A380,src/code/z_skin.s -10A390,8011B290,src/code/z_rumble.s -10A4A0,8011B3A0,src/code/z_vr_box_draw.s -10A4B0,8011B3B0,src/code/z_player_call.s -10A4C0,8011B3C0,src/code/z_kaleido_scope_call.s -10A4E0,8011B3E0,src/code/z_play.s -10A5F0,8011B4F0,src/code/game.s -10A6D0,8011B5D0,src/code/graph.s -10A740,8011B640,src/code/main.s -10E5D0,8011F4D0,src/code/padmgr.s -10E5E0,8011F4E0,src/code/sched.s -10E600,8011F500,src/code/speed_meter.s -10E670,8011F570,src/code/sys_cfb.s -10E680,8011F580,src/code/sys_math3d.s -10E8A0,8011F7A0,src/code/sys_matrix.s -10E8B0,8011F7B0,src/code/fault.s -10F730,80120630,src/code/fault_drawer.s -10F790,80120690,src/audio/lib/load.s -10F850,80120750,src/audio/general.s -10FA50,80120950,src/audio/sfx.s -112260,80123160,src/audio/sequence.s -113020,80123F20,src/audio/session_config.s -119530,8012A430,src/code/gfxprint.s -119540,8012A440,src/code/code_800FCE80.s -119550,8012A450,src/code/system_malloc.s -119580,8012A480,src/code/code_800FD970.s -119590,8012A490,src/code/__osMalloc.s -1195A0,8012A4A0,src/code/jpegdecoder.s -1195B0,8012A4B0,src/libultra/io/sptask.s -1195F0,8012A4F0,src/libultra/io/motor.s -1196F0,8012A5F0,src/libultra/io/siacs.s -119710,8012A610,src/libultra/io/controller.s -1197A0,8012A6A0,src/libultra/io/contpfs.s -1198A0,8012A7A0,src/libultra/io/pfsisplug.s -1198E0,8012A7E0,src/code/z_message_PAL.s +102230,80113130,src/code/z_en_item00 +102240,80113140,src/code/z_effect +106030,80116F30,src/code/flg_set +106040,80116F40,src/code/z_actor +1060C0,80116FC0,src/code/z_actor_dlftbls +1060D0,80116FD0,src/code/z_bgcheck +1061F0,801170F0,src/code/z_camera +1062D0,801171D0,src/code/z_collision_check +107A30,80118930,src/code/z_common_data +108E60,80119D60,src/code/z_debug +109080,80119F80,src/code/z_debug_display +109090,80119F90,src/code/z_demo +1090C0,80119FC0,src/code/z_kankyo +109190,8011A090,src/code/z_lifemeter +1091C0,8011A0C0,src/code/z_lights +109350,8011A250,src/code/z_malloc +109380,8011A280,src/code/z_map_mark +109390,8011A290,src/code/z_map_exp +1093A0,8011A2A0,src/code/z_parameter +1093C0,8011A2C0,src/code/z_player_lib +1093E0,8011A2E0,src/code/z_quake +109470,8011A370,src/code/z_skelanime +109480,8011A380,src/code/z_skin +10A390,8011B290,src/code/z_rumble +10A4A0,8011B3A0,src/code/z_vr_box_draw +10A4B0,8011B3B0,src/code/z_player_call +10A4C0,8011B3C0,src/code/z_kaleido_scope_call +10A4E0,8011B3E0,src/code/z_play +10A5F0,8011B4F0,src/code/game +10A6D0,8011B5D0,src/code/graph +10A740,8011B640,src/code/main +10E5D0,8011F4D0,src/code/padmgr +10E5E0,8011F4E0,src/code/sched +10E600,8011F500,src/code/speed_meter +10E670,8011F570,src/code/sys_cfb +10E680,8011F580,src/code/sys_math3d +10E8A0,8011F7A0,src/code/sys_matrix +10E8B0,8011F7B0,src/code/fault +10F730,80120630,src/code/fault_drawer +10F790,80120690,src/audio/lib/load +10F850,80120750,src/audio/general +10FA50,80120950,src/audio/sfx +112260,80123160,src/audio/sequence +113020,80123F20,src/audio/session_config +119530,8012A430,src/code/gfxprint +119540,8012A440,src/code/code_800FCE80 +119550,8012A450,src/code/system_malloc +119580,8012A480,src/code/rand +119590,8012A490,src/code/__osMalloc +1195A0,8012A4A0,src/code/jpegdecoder +1195B0,8012A4B0,src/libultra/io/sptask +1195F0,8012A4F0,src/libultra/io/motor +1196F0,8012A5F0,src/libultra/io/siacs +119710,8012A610,src/libultra/io/controller +1197A0,8012A6A0,src/libultra/io/contpfs +1198A0,8012A7A0,src/libultra/io/pfsisplug +1198E0,8012A7E0,src/code/z_message_PAL 119900,8012A800,.end diff --git a/tools/disasm/gc-eu-mq/files_ovl_file_choose.csv b/tools/disasm/gc-eu-mq/files_ovl_file_choose.csv index 1a0310d1c2..aa498ef9a4 100644 --- a/tools/disasm/gc-eu-mq/files_ovl_file_choose.csv +++ b/tools/disasm/gc-eu-mq/files_ovl_file_choose.csv @@ -1,22 +1,22 @@ offset,vram,.text -0,80803630,src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.s -3040,80806670,src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.s -6F60,8080A590,src/overlays/gamestates/ovl_file_choose/z_file_choose.s +0,80803630,src/overlays/gamestates/ovl_file_choose/z_file_copy_erase +3040,80806670,src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL +6F60,8080A590,src/overlays/gamestates/ovl_file_choose/z_file_choose offset,vram,.data -D740,80810D70,src/overlays/gamestates/ovl_file_choose/z_file_nameset_data.s -E010,80811640,src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.s -E050,80811680,src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.s -E2B0,808118E0,src/overlays/gamestates/ovl_file_choose/z_file_choose.s +D740,80810D70,src/overlays/gamestates/ovl_file_choose/z_file_nameset_data +E010,80811640,src/overlays/gamestates/ovl_file_choose/z_file_copy_erase +E050,80811680,src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL +E2B0,808118E0,src/overlays/gamestates/ovl_file_choose/z_file_choose offset,vram,.rodata -E5F0,80811C20,src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.s -E600,80811C30,src/overlays/gamestates/ovl_file_choose/z_file_choose.s +E5F0,80811C20,src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL +E600,80811C30,src/overlays/gamestates/ovl_file_choose/z_file_choose offset,vram,.ovl -E620,80811C50,src/overlays/gamestates/ovl_file_choose/ovl_file_choose_reloc.s +E620,80811C50,src/overlays/gamestates/ovl_file_choose/ovl_file_choose_reloc offset,vram,.bss -EC10,80812240,src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.s -EC20,80812250,src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.s +EC10,80812240,src/overlays/gamestates/ovl_file_choose/z_file_copy_erase +EC20,80812250,src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL EC30,80812260,.end diff --git a/tools/disasm/gc-eu-mq/files_ovl_kaleido_scope.csv b/tools/disasm/gc-eu-mq/files_ovl_kaleido_scope.csv index c03d916257..ca3a62dcad 100644 --- a/tools/disasm/gc-eu-mq/files_ovl_kaleido_scope.csv +++ b/tools/disasm/gc-eu-mq/files_ovl_kaleido_scope.csv @@ -1,34 +1,34 @@ offset,vram,.text -0,80812260,src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.s -2400,80814660,src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.s -43B0,80816610,src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.s -5E30,80818090,src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.s -7E20,8081A080,src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.s -B100,8081D360,src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.s -B300,8081D560,src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.s -15350,808275B0,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.s +0,80812260,src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect +2400,80814660,src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug +43B0,80816610,src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment +5E30,80818090,src/overlays/misc/ovl_kaleido_scope/z_kaleido_item +7E20,8081A080,src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL +B100,8081D360,src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt +B300,8081D560,src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL +15350,808275B0,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark offset,vram,.data -15A10,80827C70,src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.s -15BC0,80827E20,src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.s -15D90,80827FF0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.s -15DC0,80828020,src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.s -15E30,80828090,src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.s -16080,808282E0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.s -16090,808282F0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.s -16C10,80828E70,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.s -16C60,80828EC0,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark_data.s +15A10,80827C70,src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect +15BC0,80827E20,src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug +15D90,80827FF0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment +15DC0,80828020,src/overlays/misc/ovl_kaleido_scope/z_kaleido_item +15E30,80828090,src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL +16080,808282E0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt +16090,808282F0,src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL +16C10,80828E70,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark +16C60,80828EC0,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark_data offset,vram,.rodata -1ADC0,8082D020,src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.s -1AEA0,8082D100,src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.s -1AEB0,8082D110,src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.s -1B190,8082D3F0,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.s -1B240,8082D4A0,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark_data.s +1ADC0,8082D020,src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug +1AEA0,8082D100,src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment +1AEB0,8082D110,src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL +1B190,8082D3F0,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark +1B240,8082D4A0,src/overlays/misc/ovl_kaleido_scope/z_lmap_mark_data offset,vram,.ovl -1B2C0,8082D560,src/overlays/misc/ovl_kaleido_scope/ovl_kaleido_scope_reloc.s +1B2C0,8082D560,src/overlays/misc/ovl_kaleido_scope/ovl_kaleido_scope_reloc offset,vram,.bss -1C9C0,8082EC20,src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.s +1C9C0,8082EC20,src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL 1CA30,8082EC90,.end diff --git a/tools/disasm/gc-eu-mq/functions.txt b/tools/disasm/gc-eu-mq/functions.txt index cd5d63da24..7b75f6ab7c 100644 --- a/tools/disasm/gc-eu-mq/functions.txt +++ b/tools/disasm/gc-eu-mq/functions.txt @@ -7460,7 +7460,7 @@ EnCs_ChangeAnim = 0x809CD450; // type:func EnCs_Init = 0x809CD574; // type:func EnCs_Destroy = 0x809CD708; // type:func EnCs_GetTalkState = 0x809CD734; // type:func -EnCs_GetTextID = 0x809CD868; // type:func +EnCs_GetTextId = 0x809CD868; // type:func EnCs_HandleTalking = 0x809CD8EC; // type:func EnCs_GetwaypointCount = 0x809CDA38; // type:func EnCs_GetPathPoint = 0x809CDA4C; // type:func @@ -7505,7 +7505,7 @@ EnDaikuKakariko_PostLimbDraw = 0x809D0D30; // type:func EnDaikuKakariko_Draw = 0x809D0DAC; // type:func EnDekubaba_Init = 0x809D1180; // type:func EnDekubaba_Destroy = 0x809D13C4; // type:func -EnDekubaba_DisableHitboxes = 0x809D13F0; // type:func +EnDekubaba_DisableACColliderElems = 0x809D13F0; // type:func EnDekubaba_SetupWait = 0x809D1478; // type:func EnDekubaba_SetupGrow = 0x809D16E0; // type:func EnDekubaba_SetupRetract = 0x809D1810; // type:func diff --git a/tools/disasm/gc-eu-mq/variables.txt b/tools/disasm/gc-eu-mq/variables.txt index 14c1220682..7be392076d 100644 --- a/tools/disasm/gc-eu-mq/variables.txt +++ b/tools/disasm/gc-eu-mq/variables.txt @@ -722,7 +722,7 @@ gGfxSPTaskYieldBuffer = 0x80168000; // size:0xC00 gGfxSPTaskStack = 0x80168C00; // size:0x400 gGfxPools = 0x80169000; // size:0x24820 gAudioHeap = 0x8018D820; // size:0x38000 -gSystemHeap = 0x801C5820; // +_buffersSegmentEnd = 0x801C5820; // D_80811BB0 = 0x80810D70; // size:0x180 D_80811D30 = 0x80810EF0; // size:0x100 D_80811E30 = 0x80810FF0; // size:0x100 diff --git a/tools/disasm/list_generated_files.py b/tools/disasm/list_generated_files.py deleted file mode 100755 index 2f160a961e..0000000000 --- a/tools/disasm/list_generated_files.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python3 - -# SPDX-FileCopyrightText: © 2024 ZeldaRET -# SPDX-License-Identifier: CC0-1.0 - -import argparse -import csv -from pathlib import Path - -from file_addresses import parse_file_addresses, get_z_name_for_overlay - - -def main(): - parser = argparse.ArgumentParser( - description="List generated files for the Makefile." - ) - parser.add_argument( - "-o", "--output-dir", help="Output directory", type=Path, required=True - ) - parser.add_argument( - "--config-dir", help="Config directory", type=Path, required=True - ) - - args = parser.parse_args() - - if not args.config_dir.exists(): # disassembly is not set up for this version - return - - file_addresses = parse_file_addresses(args.config_dir / "file_addresses.csv") - - generated_files = set() - for dma_file in file_addresses: - file_splits_path = args.config_dir / f"files_{dma_file.name}.csv" - if file_splits_path.exists(): - with open(file_splits_path) as f: - reader = csv.reader(f) - for row in reader: - if ( - not row # blank line - or row[2].startswith(".") # section name or .end - or row[2].endswith( - "_reloc.s" - ) # TODO: disassemble overlay reloc sections? - ): - continue - generated_files.add(row[2]) - elif dma_file.overlay_dir is not None: - z_name = get_z_name_for_overlay(dma_file.name) - generated_files.add( - f"src/overlays/{dma_file.overlay_dir}/{dma_file.name}/{z_name}.s" - ) - else: - raise Exception( - f"DMA file {dma_file.name} is not an overlay but has no file splits" - ) - - for filename in sorted(generated_files): - print(args.output_dir / filename) - - -if __name__ == "__main__": - main() diff --git a/tools/dmadata.py b/tools/dmadata.py index 68eb1e7107..06b9ae7557 100644 --- a/tools/dmadata.py +++ b/tools/dmadata.py @@ -58,6 +58,14 @@ class DmaEntry: def is_compressed(self) -> bool: return self.rom_end != 0 + def is_syms(self) -> bool: + """ + "SYMS" DMA entries describe segments that are always filled with 0's in the ROM. + The DMA entry has both rom_start and rom_end set to 0xFFFFFFFF, where the actual rom start and end is given by vrom_start and vrom_end instead. + These zeroed segments are used to record the offsets/sizes of subfiles in compressed yaz0 archive files but are not used by the game directly. + """ + return self.rom_start == 0xFFFFFFFF and self.rom_end == 0xFFFFFFFF + DMA_ENTRY_END = DmaEntry(0, 0, 0, 0) diff --git a/tools/extract_baserom.py b/tools/extract_baserom.py index bc4feb55a8..1d62f8c06e 100755 --- a/tools/extract_baserom.py +++ b/tools/extract_baserom.py @@ -56,12 +56,15 @@ def main(): args.output_dir.mkdir(parents=True, exist_ok=True) for dma_name, dma_entry in zip(dma_names, dma_entries): - if dma_entry.is_compressed(): + if dma_entry.is_syms(): + segment_rom_start = dma_entry.vrom_start + elif not dma_entry.is_compressed(): + segment_rom_start = dma_entry.rom_start + else: # Segment compressed print(f"Error: segment {dma_name} is compressed", file=sys.stderr) exit(1) - segment_rom_start = dma_entry.rom_start - segment_rom_end = dma_entry.rom_start + ( + segment_rom_end = segment_rom_start + ( dma_entry.vrom_end - dma_entry.vrom_start ) diff --git a/tools/msgdis.py b/tools/msgdis.py old mode 100644 new mode 100755 index a946779fac..1da85713ec --- a/tools/msgdis.py +++ b/tools/msgdis.py @@ -5,6 +5,7 @@ import re, struct from os import path +import argparse # =================================================== # Util @@ -404,3 +405,23 @@ def extract_all_text(text_out, staff_text_out): with open(staff_text_out, "w", encoding="utf8") as outfile: outfile.write(out.strip() + "\n") + + +def main(): + parser = argparse.ArgumentParser( + description="Extract text from the baserom into .h files" + ) + parser.add_argument("--text-out", help="Path to output .h file for text") + parser.add_argument( + "--staff-text-out", help="Path to output .h file for staff text" + ) + + args = parser.parse_args() + if not (args.text_out or args.staff_text_out): + parser.error("No output file requested") + + extract_all_text(args.text_out, args.staff_text_out) + + +if __name__ == "__main__": + main() diff --git a/tools/permuter_settings.toml b/tools/permuter_settings.toml index 57c19f3b50..472edb6964 100644 --- a/tools/permuter_settings.toml +++ b/tools/permuter_settings.toml @@ -1,3 +1,6 @@ +build_system = "make" +compiler_type = "ido" # adjusts default weights for permuting + [preserve_macros] "g[DS]P.*" = "void" "gDma.*" = "void" @@ -10,7 +13,6 @@ OPEN_DISPS = "void" CLOSE_DISPS = "void" GRAPH_ALLOC = "void*" LOG_UTILS_CHECK_NULL_POINTER = "void" -PRINTF = "void" WORK_DISP = "void*" POLY_OPA_DISP = "void*" POLY_XLU_DISP = "void*" @@ -20,10 +22,14 @@ ABS = "int" SQ = "int" CLAMP = "int" +# If changing to not preserve these, add a check for the permuter to IDO_PRINTF_WORKAROUND, +# so that modern CPP (used by the permuter import) does not error on the IDO-specific hack. +# For example: +# #define IDO_PRINTF_WORKAROUND (__sgi && !__GNUC__ && !PERMUTER && !M2CTX) +PRINTF = "void" +SCHED_DEBUG_PRINTF = "void" +ACTOR_DEBUG_PRINTF = "void" + [decompme.compilers] -"tools/ido_recomp/linux/7.1/cc" = "ido7.1" -"tools/ido_recomp/macos/7.1/cc" = "ido7.1" -"tools/ido_recomp/windows/7.1/cc" = "ido7.1" -"tools/ido_recomp/linux/5.3/cc" = "ido5.3" -"tools/ido_recomp/macos/5.3/cc" = "ido5.3" -"tools/ido_recomp/windows/5.3/cc" = "ido5.3" +"tools/ido_recomp/*/7.1/cc" = "ido7.1" +"tools/ido_recomp/*/5.3/cc" = "ido5.3" diff --git a/tools/spec.c b/tools/spec.c index 7d07caa13d..39dd088ec8 100644 --- a/tools/spec.c +++ b/tools/spec.c @@ -85,6 +85,8 @@ static bool parse_flags(char *str, unsigned int *flags) f |= FLAG_RAW; else if (strcmp(str, "NOLOAD") == 0) f |= FLAG_NOLOAD; + else if (strcmp(str, "SYMS") == 0) + f |= FLAG_SYMS; else return false; diff --git a/tools/spec.h b/tools/spec.h index aeabd07d1f..f0a16eeb4f 100644 --- a/tools/spec.h +++ b/tools/spec.h @@ -28,6 +28,7 @@ enum { FLAG_OBJECT = (1 << 1), FLAG_RAW = (1 << 2), FLAG_NOLOAD = (1 << 3), + FLAG_SYMS = (1 << 4) }; struct Include {