mirror of https://github.com/zeldaret/oot.git
Merge remote-tracking branch 'upstream/main' into EnGs_Doc
This commit is contained in:
commit
01ee3b64a7
1
Makefile
1
Makefile
|
@ -370,6 +370,7 @@ 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)
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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*);
|
||||
|
|
62
spec
62
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"
|
||||
|
@ -456,11 +484,16 @@ beginseg
|
|||
include "$(BUILD_DIR)/src/code/system_malloc.o"
|
||||
include "$(BUILD_DIR)/src/code/code_800FD970.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"
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -79,6 +79,7 @@ u16 sSurfaceMaterialToSfxOffset[SURFACE_MATERIAL_MAX] = {
|
|||
SURFACE_SFX_OFFSET_CARPET, // SURFACE_MATERIAL_CARPET
|
||||
};
|
||||
|
||||
#if OOT_DEBUG
|
||||
/**
|
||||
* original name: T_BGCheck_PosErrorCheck
|
||||
*/
|
||||
|
@ -94,6 +95,7 @@ s32 BgCheck_PosErrorCheck(Vec3f* pos, char* file, s32 line) {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Set SSNode
|
||||
|
@ -194,22 +196,15 @@ 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;
|
||||
}
|
||||
|
||||
a = COLPOLY_VTX_INDEX(poly->flags_vIA);
|
||||
b = COLPOLY_VTX_INDEX(poly->flags_vIB);
|
||||
c = poly->vIC;
|
||||
|
||||
min = vtxList[a].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;
|
||||
|
||||
if (min > vtxList[b].y) {
|
||||
min = vtxList[b].y;
|
||||
|
@ -219,6 +214,7 @@ s16 CollisionPoly_GetMinY(CollisionPoly* poly, Vec3s* vtxList) {
|
|||
}
|
||||
return vtxList[c].y;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* CollisionPoly get unit normal
|
||||
|
@ -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,9 +2814,10 @@ void DynaPoly_DeleteBgActor(PlayState* play, DynaCollisionContext* dyna, s32 bgI
|
|||
"確保していない/出来なかったインデックスの解放のため、処理を中止します。index == %d\n",
|
||||
bgId);
|
||||
PRINTF(VT_RST);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
} else {
|
||||
actor = DynaPoly_GetActor(&play->colCtx, bgId);
|
||||
if (actor != NULL) {
|
||||
|
||||
|
@ -2808,6 +2826,7 @@ void DynaPoly_DeleteBgActor(PlayState* play, DynaCollisionContext* dyna, s32 bgI
|
|||
dyna->bgActorFlags[bgId] |= BGACTOR_1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DynaPoly_InvalidateLookup(PlayState* play, DynaCollisionContext* dyna) {
|
||||
dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP;
|
||||
|
@ -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,7 +2919,9 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3
|
|||
|
||||
*polyStartIndex += pbgdata->numPolygons;
|
||||
*vtxStartIndex += pbgdata->numVertices;
|
||||
} else {
|
||||
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,
|
||||
|
@ -2911,6 +2934,7 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3
|
|||
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);
|
||||
|
@ -2937,8 +2961,6 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3
|
|||
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;
|
||||
|
@ -2957,10 +2979,10 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3
|
|||
*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->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;
|
||||
|
@ -3003,7 +3025,6 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3
|
|||
*polyStartIndex += pbgdata->numPolygons;
|
||||
*vtxStartIndex += pbgdata->numVertices;
|
||||
}
|
||||
}
|
||||
|
||||
void DynaPoly_UnsetAllInteractFlags(PlayState* play, DynaCollisionContext* dyna, Actor* actor) {
|
||||
DynaPolyActor* dynaActor;
|
||||
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) ||
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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->unk_1EC = 0;
|
||||
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->unk_1EC = 0;
|
||||
|
|
|
@ -20,7 +20,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)) {
|
||||
|
@ -65,23 +65,20 @@ 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->unk_1EA = 0;
|
||||
pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE;
|
||||
pauseCtx->mode = 0;
|
||||
pauseCtx->pageIndex = PAUSE_ITEM;
|
||||
|
||||
pauseCtx->unk_1F4 = 160.0f;
|
||||
pauseCtx->unk_1F8 = 160.0f;
|
||||
pauseCtx->unk_1FC = 160.0f;
|
||||
pauseCtx->unk_200 = 160.0f;
|
||||
pauseCtx->eye.x = pauseCtx->eye.y = 0.0f;
|
||||
pauseCtx->eye.z = 64.0f;
|
||||
pauseCtx->unk_1F0 = 936.0f;
|
||||
pauseCtx->eye.x = pauseCtx->eye.y = 0.0f;
|
||||
pauseCtx->unk_1F4 = pauseCtx->unk_1F8 = pauseCtx->unk_1FC = pauseCtx->unk_200 = 160.0f;
|
||||
|
||||
pauseCtx->alpha = 0;
|
||||
|
||||
// mainState = PAUSE_MAIN_STATE_IDLE , pageIndex = PAUSE_ITEM
|
||||
pauseCtx->unk_1EA = pauseCtx->mainState = pauseCtx->mode = pauseCtx->pageIndex = 0;
|
||||
|
||||
pauseCtx->unk_204 = -314.0f;
|
||||
|
||||
pauseCtx->cursorPoint[PAUSE_ITEM] = 0;
|
||||
|
@ -94,8 +91,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] = 1;
|
||||
pauseCtx->cursorY[PAUSE_EQUIP] = 0;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,19 +980,21 @@ 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) &&
|
||||
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) &&
|
||||
|
@ -988,8 +1003,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
|||
u8 blend8[2];
|
||||
s16 blend16[2];
|
||||
|
||||
timeChangeBlend =
|
||||
Environment_LerpWeight(sTimeBasedLightConfigs[envCtx->lightConfig][i].endTime,
|
||||
timeChangeBlend = Environment_LerpWeight(sTimeBasedLightConfigs[envCtx->lightConfig][i].endTime,
|
||||
sTimeBasedLightConfigs[envCtx->lightConfig][i].startTime,
|
||||
((void)0, gSaveContext.skyboxTime));
|
||||
|
||||
|
@ -1019,11 +1033,10 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
|||
blend8[1] = LERP(
|
||||
lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting]
|
||||
.ambientColor[j],
|
||||
lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i]
|
||||
.nextLightSetting]
|
||||
lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting]
|
||||
.ambientColor[j],
|
||||
timeChangeBlend);
|
||||
*(envCtx->lightSettings.ambientColor + j) = LERP(blend8[0], blend8[1], configChangeBlend);
|
||||
envCtx->lightSettings.ambientColor[j] = LERP(blend8[0], blend8[1], configChangeBlend);
|
||||
}
|
||||
|
||||
// set light1 direction for the sun
|
||||
|
@ -1050,11 +1063,10 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
|||
blend8[1] = LERP(
|
||||
lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting]
|
||||
.light1Color[j],
|
||||
lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i]
|
||||
.nextLightSetting]
|
||||
lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting]
|
||||
.light1Color[j],
|
||||
timeChangeBlend);
|
||||
*(envCtx->lightSettings.light1Color + j) = LERP(blend8[0], blend8[1], configChangeBlend);
|
||||
envCtx->lightSettings.light1Color[j] = LERP(blend8[0], blend8[1], configChangeBlend);
|
||||
|
||||
// blend light2Color
|
||||
blend8[0] =
|
||||
|
@ -1066,33 +1078,30 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
|||
blend8[1] = LERP(
|
||||
lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting]
|
||||
.light2Color[j],
|
||||
lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i]
|
||||
.nextLightSetting]
|
||||
lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting]
|
||||
.light2Color[j],
|
||||
timeChangeBlend);
|
||||
*(envCtx->lightSettings.light2Color + j) = LERP(blend8[0], blend8[1], configChangeBlend);
|
||||
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],
|
||||
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]
|
||||
lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting]
|
||||
.fogColor[j],
|
||||
timeChangeBlend);
|
||||
*(envCtx->lightSettings.fogColor + j) = LERP(blend8[0], blend8[1], configChangeBlend);
|
||||
envCtx->lightSettings.fogColor[j] = LERP(blend8[0], blend8[1], configChangeBlend);
|
||||
}
|
||||
|
||||
blend16[0] = LERP16(
|
||||
ENV_LIGHT_SETTINGS_FOG_NEAR(
|
||||
blend16[0] =
|
||||
LERP16(ENV_LIGHT_SETTINGS_FOG_NEAR(
|
||||
lightSettingsList[sTimeBasedLightConfigs[envCtx->lightConfig][i].lightSetting]
|
||||
.blendRateAndFogNear),
|
||||
ENV_LIGHT_SETTINGS_FOG_NEAR(
|
||||
|
@ -1104,26 +1113,25 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
|||
lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].lightSetting]
|
||||
.blendRateAndFogNear),
|
||||
ENV_LIGHT_SETTINGS_FOG_NEAR(
|
||||
lightSettingsList[sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i]
|
||||
.nextLightSetting]
|
||||
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,
|
||||
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].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!"
|
||||
|
@ -1134,6 +1142,8 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
|||
sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting,
|
||||
envCtx->numLightSettings - 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1153,7 +1163,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
|||
envCtx->lightSettings.zFar = lightSettingsList[envCtx->lightSetting].zFar;
|
||||
envCtx->lightBlend = 1.0f;
|
||||
} else {
|
||||
u8 blendRate =
|
||||
blendRate =
|
||||
ENV_LIGHT_SETTINGS_BLEND_RATE_U8(lightSettingsList[envCtx->lightSetting].blendRateAndFogNear);
|
||||
|
||||
if (blendRate == 0) {
|
||||
|
@ -1192,15 +1202,16 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
|||
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),
|
||||
|
||||
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,
|
||||
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) "カラーパレットがおかしいようです!");
|
||||
|
@ -1209,7 +1220,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
|||
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,9 +2482,10 @@ 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);
|
||||
|
||||
|
@ -2488,12 +2496,13 @@ void Environment_DrawSandstorm(PlayState* play, u8 sandstormState) {
|
|||
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));
|
||||
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);
|
||||
}
|
||||
|
||||
sSandstormScroll += (s32)sp98;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1246,23 +1246,33 @@ Gfx* Gfx_SetupDL_69NoCD(Gfx* gfx) {
|
|||
return gfx;
|
||||
}
|
||||
|
||||
#if OOT_DEBUG
|
||||
#define HREG_21 HREG(21)
|
||||
#define HREG_22 HREG(22)
|
||||
#else
|
||||
#define HREG_21 0
|
||||
#define HREG_22 0
|
||||
#endif
|
||||
|
||||
Gfx* func_800947AC(Gfx* gfx) {
|
||||
gSPDisplayList(gfx++, sSetupDL[SETUPDL_65]);
|
||||
gDPSetColorDither(gfx++, G_CD_DISABLE);
|
||||
|
||||
// clang-format off
|
||||
switch (HREG(21)) {
|
||||
switch (HREG_21) {
|
||||
case 1: gDPSetAlphaDither(gfx++, G_AD_DISABLE); break;
|
||||
case 2: gDPSetAlphaDither(gfx++, G_AD_PATTERN); break;
|
||||
case 3: gDPSetAlphaDither(gfx++, G_AD_NOTPATTERN); break;
|
||||
case 4: gDPSetAlphaDither(gfx++, G_AD_NOISE); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
switch (HREG(22)) {
|
||||
switch (HREG_22) {
|
||||
case 1: gDPSetColorDither(gfx++, G_CD_DISABLE); break;
|
||||
case 2: gDPSetColorDither(gfx++, G_CD_MAGICSQ); break;
|
||||
case 3: gDPSetColorDither(gfx++, G_CD_BAYER); break;
|
||||
case 4: gDPSetColorDither(gfx++, G_CD_NOISE); break;
|
||||
default: break;
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
|
@ -1472,6 +1482,7 @@ void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) {
|
|||
if ((R_PAUSE_BG_PRERENDER_STATE <= PAUSE_BG_PRERENDER_SETUP) && (gTransitionTileState <= TRANS_TILE_SETUP)) {
|
||||
s32 letterboxSize = Letterbox_GetSize();
|
||||
|
||||
#if OOT_DEBUG
|
||||
if (R_HREG_MODE == HREG_MODE_SETUP_FRAME) {
|
||||
if (R_SETUP_FRAME_INIT != HREG_MODE_SETUP_FRAME) {
|
||||
R_SETUP_FRAME_GET = (SETUP_FRAME_LETTERBOX_SIZE_FLAG | SETUP_FRAME_BASE_COLOR_FLAG);
|
||||
|
@ -1514,6 +1525,7 @@ void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) {
|
|||
b = R_SETUP_FRAME_BASE_COLOR_B;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Set the whole z buffer to maximum depth
|
||||
// Don't bother with pixels that are being covered by the letterbox
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
@ -618,6 +617,7 @@ void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCt
|
|||
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 +633,9 @@ void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCt
|
|||
} else {
|
||||
Sram_InitNewSave();
|
||||
}
|
||||
#else
|
||||
Sram_InitNewSave();
|
||||
#endif
|
||||
|
||||
ptr = (u16*)&gSaveContext;
|
||||
PRINTF("\n--------------------------------------------------------------\n");
|
||||
|
@ -718,20 +721,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 +762,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 +900,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 +909,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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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,9 +112,8 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, PlayState* play) {
|
|||
if ((prop == thisx) || (prop->id != ACTOR_BG_GANON_OTYUKA)) {
|
||||
prop = prop->next;
|
||||
continue;
|
||||
}
|
||||
|
||||
platform = (BgGanonOtyuka*)prop;
|
||||
} else {
|
||||
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;
|
||||
|
@ -124,10 +122,10 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, PlayState* play) {
|
|||
if ((fabsf(dx) < 10.0f) && (fabsf(dy) < 10.0f) && (fabsf(dz) < 10.0f)) {
|
||||
platform->visibleSides |= sSides[i];
|
||||
break;
|
||||
} else {
|
||||
prop = prop->next;
|
||||
}
|
||||
}
|
||||
prop = prop->next;
|
||||
}
|
||||
}
|
||||
|
||||
PRINTF("OTC O 2\n");
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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]);
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
{
|
||||
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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
@ -5224,16 +5222,16 @@ void func_8083A5C4(PlayState* play, Player* this, CollisionPoly* arg2, f32 arg3,
|
|||
}
|
||||
|
||||
s32 func_8083A6AC(Player* this, PlayState* play) {
|
||||
//! @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;
|
||||
|
||||
//! @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)) {
|
||||
sp74.x = this->actor.prevPos.x - this->actor.world.pos.x;
|
||||
sp74.z = this->actor.prevPos.z - this->actor.world.pos.z;
|
||||
|
||||
|
@ -7847,7 +7845,6 @@ void Player_Action_808414F8(Player* this, PlayState* play) {
|
|||
f32 speedTarget;
|
||||
s16 yawTarget;
|
||||
s32 sp2C;
|
||||
s16 sp2A;
|
||||
|
||||
func_80841138(this, play);
|
||||
|
||||
|
@ -7871,7 +7868,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);
|
||||
|
@ -8483,15 +8480,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 +8497,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));
|
||||
|
@ -11301,27 +11298,37 @@ 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 OOT_DEBUG
|
||||
if (!Player_UpdateNoclip(this, play)) {
|
||||
goto skip_update;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (func_8084FCAC(this, play)) {
|
||||
if (gSaveContext.dogParams < 0) {
|
||||
static Vec3f sDogSpawnOffset = { 0.0f, 0.0f, -30.0f };
|
||||
static Vec3f sDogSpawnPos;
|
||||
|
||||
if (Object_GetSlot(&play->objectCtx, OBJECT_DOG) < 0) {
|
||||
gSaveContext.dogParams = 0;
|
||||
} else {
|
||||
Actor* dog;
|
||||
|
||||
gSaveContext.dogParams &= 0x7FFF;
|
||||
Player_GetRelativePosition(this, &this->actor.world.pos, &D_80854838, &sDogSpawnPos);
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
@ -11337,23 +11344,29 @@ void Player_Update(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
if (this->stateFlags1 & (PLAYER_STATE1_5 | PLAYER_STATE1_29)) {
|
||||
bzero(&sp44, sizeof(sp44));
|
||||
bzero(&input, sizeof(input));
|
||||
} else {
|
||||
sp44 = play->state.input[0];
|
||||
input = 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);
|
||||
input.cur.button &= ~(BTN_A | BTN_B | BTN_CUP);
|
||||
input.press.button &= ~(BTN_A | BTN_B | BTN_CUP);
|
||||
}
|
||||
}
|
||||
|
||||
Player_UpdateCommon(this, play, &sp44);
|
||||
}
|
||||
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 {
|
||||
/* 0x0 */ Vec3s rot;
|
||||
|
@ -13618,21 +13631,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 +13706,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 +13714,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;
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue