mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-04 06:54:33 +00:00
Merge branch 'master' into doc_pause_menu
This commit is contained in:
commit
306dbb68cc
191 changed files with 4575 additions and 3678 deletions
2
Makefile
2
Makefile
|
@ -168,7 +168,7 @@ ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_XML:.xml=.c),$f) \
|
|||
UNDECOMPILED_DATA_DIRS := $(shell find data -type d)
|
||||
|
||||
# source files
|
||||
C_FILES := $(foreach dir,$(SRC_DIRS) $(ASSET_BIN_DIRS),$(wildcard $(dir)/*.c))
|
||||
C_FILES := $(filter-out %.inc.c,$(foreach dir,$(SRC_DIRS) $(ASSET_BIN_DIRS),$(wildcard $(dir)/*.c)))
|
||||
S_FILES := $(foreach dir,$(SRC_DIRS) $(UNDECOMPILED_DATA_DIRS),$(wildcard $(dir)/*.s))
|
||||
O_FILES := $(foreach f,$(S_FILES:.s=.o),build/$f) \
|
||||
$(foreach f,$(C_FILES:.c=.o),build/$f) \
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,29 +1,40 @@
|
|||
<Root>
|
||||
<File Name="object_bw" Segment="6">
|
||||
<Animation Name="object_bw_Anim_000228" Offset="0x228"/>
|
||||
<DList Name="object_bw_DL_0002C0" Offset="0x2C0"/>
|
||||
<DList Name="object_bw_DL_0003E8" Offset="0x3E8"/>
|
||||
<DList Name="object_bw_DL_000558" Offset="0x558"/>
|
||||
<DList Name="object_bw_DL_000680" Offset="0x680"/>
|
||||
<DList Name="object_bw_DL_001050" Offset="0x1050"/>
|
||||
<Texture Name="object_bw_Tex_001240" OutName="tex_00001240" Format="rgba16" Width="16" Height="16" Offset="0x1240"/>
|
||||
<Texture Name="object_bw_Tex_001440" OutName="tex_00001440" Format="rgba16" Width="16" Height="16" Offset="0x1440"/>
|
||||
<Texture Name="object_bw_TLUT_001640" OutName="tlut_00001640" Format="rgba16" Width="16" Height="16" Offset="0x1640"/>
|
||||
<Texture Name="object_bw_Tex_001840" OutName="tex_00001840" Format="ci8" Width="32" Height="32" Offset="0x1840" TlutOffset="0x1640"/>
|
||||
<Texture Name="object_bw_Tex_001C40" OutName="tex_00001C40" Format="ci8" Width="32" Height="32" Offset="0x1C40" TlutOffset="0x1640"/>
|
||||
<Limb Name="object_bw_Limb_002040" LimbType="Standard" Offset="0x2040"/>
|
||||
<Limb Name="object_bw_Limb_00204C" LimbType="Standard" Offset="0x204C"/>
|
||||
<Limb Name="object_bw_Limb_002058" LimbType="Standard" Offset="0x2058"/>
|
||||
<Limb Name="object_bw_Limb_002064" LimbType="Standard" Offset="0x2064"/>
|
||||
<Limb Name="object_bw_Limb_002070" LimbType="Standard" Offset="0x2070"/>
|
||||
<Limb Name="object_bw_Limb_00207C" LimbType="Standard" Offset="0x207C"/>
|
||||
<Limb Name="object_bw_Limb_002088" LimbType="Standard" Offset="0x2088"/>
|
||||
<Limb Name="object_bw_Limb_002094" LimbType="Standard" Offset="0x2094"/>
|
||||
<Limb Name="object_bw_Limb_0020A0" LimbType="Standard" Offset="0x20A0"/>
|
||||
<Limb Name="object_bw_Limb_0020AC" LimbType="Standard" Offset="0x20AC"/>
|
||||
<Limb Name="object_bw_Limb_0020B8" LimbType="Standard" Offset="0x20B8"/>
|
||||
<Skeleton Name="object_bw_Skel_0020F0" Type="Normal" LimbType="Standard" Offset="0x20F0"/>
|
||||
<Animation Name="object_bw_Anim_0021A0" Offset="0x21A0"/>
|
||||
<Animation Name="object_bw_Anim_002250" Offset="0x2250"/>
|
||||
<!-- Torch Slug Animation -->
|
||||
<Animation Name="gTorchSlugEyestalkWaveAnim" Offset="0x228"/> <!-- Original name is "bw_aruku" ("to walk"). Used for when the Torch Slug moves around. -->
|
||||
|
||||
<!-- Torch Slug Limb DisplayLists -->
|
||||
<DList Name="gTorchSlugLeftLowerEyestalkDL" Offset="0x2C0"/>
|
||||
<DList Name="gTorchSlugLeftUpperEyestalkDL" Offset="0x3E8"/>
|
||||
<DList Name="gTorchSlugRightLowerEyestalkDL" Offset="0x558"/>
|
||||
<DList Name="gTorchSlugRightUpperEyestalkDL" Offset="0x680"/>
|
||||
<DList Name="gTorchSlugBodyDL" Offset="0x1050"/>
|
||||
|
||||
<!-- Torch Slug Textures -->
|
||||
<Texture Name="gTorchSlugEyestalkTex" OutName="torch_slug_eyestalk" Format="rgba16" Width="16" Height="16" Offset="0x1240"/>
|
||||
<Texture Name="gTorchSlugEyeTex" OutName="torch_slug_eye" Format="rgba16" Width="16" Height="16" Offset="0x1440"/>
|
||||
<Texture Name="gTorchSlugBodyTLUT" OutName="torch_slug_body_tlut" Format="rgba16" Width="16" Height="16" Offset="0x1640"/>
|
||||
<Texture Name="gTorchSlugBody1Tex" OutName="torch_slug_body_1" Format="ci8" Width="32" Height="32" Offset="0x1840" TlutOffset="0x1640"/>
|
||||
<Texture Name="gTorchSlugBody2Tex" OutName="torch_slug_body_2" Format="ci8" Width="32" Height="32" Offset="0x1C40" TlutOffset="0x1640"/>
|
||||
|
||||
<!-- Torch Slug Limbs -->
|
||||
<Limb Name="gTorchSlugBodyLimb" LimbType="Standard" Offset="0x2040"/>
|
||||
<Limb Name="gTorchSlugLeftEyestalkRootRootLimb" LimbType="Standard" Offset="0x204C"/>
|
||||
<Limb Name="gTorchSlugLeftEyestalkRootLimb" LimbType="Standard" Offset="0x2058"/>
|
||||
<Limb Name="gTorchSlugLeftUpperEyestalkRootLimb" LimbType="Standard" Offset="0x2064"/>
|
||||
<Limb Name="gTorchSlugLeftUpperEyestalkLimb" LimbType="Standard" Offset="0x2070"/>
|
||||
<Limb Name="gTorchSlugLeftLowerEyestalkLimb" LimbType="Standard" Offset="0x207C"/>
|
||||
<Limb Name="gTorchSlugRightEyestalkRootRootLimb" LimbType="Standard" Offset="0x2088"/>
|
||||
<Limb Name="gTorchSlugRightEyestalkRootLimb" LimbType="Standard" Offset="0x2094"/>
|
||||
<Limb Name="gTorchSlugRightUpperEyestalkRootLimb" LimbType="Standard" Offset="0x20A0"/>
|
||||
<Limb Name="gTorchSlugRightUpperEyestalkLimb" LimbType="Standard" Offset="0x20AC"/>
|
||||
<Limb Name="gTorchSlugRightLowerEyestalkLimb" LimbType="Standard" Offset="0x20B8"/>
|
||||
|
||||
<!-- Torch Slug Skeleton -->
|
||||
<Skeleton Name="gTorchSlugSkel" Type="Normal" LimbType="Standard" Offset="0x20F0"/>
|
||||
|
||||
<!-- Torch Slug Animations -->
|
||||
<Animation Name="gTorchSlugEyestalkRaiseAnim" Offset="0x21A0"/> <!-- Original name is "bw_hakken" ("discovery; detection"). Used for when the Torch Slug spots the player. -->
|
||||
<Animation Name="gTorchSlugEyestalkFlailAnim" Offset="0x2250"/> <!-- Original name is "bw_kogeki" ("attack; offensive"). Used for when the Torch Slug jumps at the player or is flipped over. -->
|
||||
</File>
|
||||
</Root>
|
||||
|
|
|
@ -2,23 +2,23 @@
|
|||
<File Name="object_ice_objects" Segment="6">
|
||||
<DList Name="object_ice_objects_DL_000190" Offset="0x190"/>
|
||||
<Collision Name="object_ice_objects_Col_0003F0" Offset="0x3F0"/>
|
||||
<DList Name="object_ice_objects_DL_0006F0" Offset="0x6F0"/>
|
||||
<DList Name="object_ice_objects_DL_0012A0" Offset="0x12A0"/>
|
||||
<Collision Name="object_ice_objects_Col_001C1C" Offset="0x1C1C"/>
|
||||
<DList Name="gRedIceBlockDL" Offset="0x6F0"/>
|
||||
<DList Name="gRedIcePlatformDL" Offset="0x12A0"/>
|
||||
<Collision Name="gRedIcePlatformCol" Offset="0x1C1C"/>
|
||||
<DList Name="object_ice_objects_DL_001D10" Offset="0x1D10"/>
|
||||
<DList Name="object_ice_objects_DL_0021F0" Offset="0x21F0"/>
|
||||
<DList Name="object_ice_objects_DL_0023D0" Offset="0x23D0"/>
|
||||
<Collision Name="object_ice_objects_Col_002594" Offset="0x2594"/>
|
||||
<DList Name="object_ice_objects_DL_002640" Offset="0x2640"/>
|
||||
<DList Name="gRedIceWallDL" Offset="0x2640"/>
|
||||
<DList Name="object_ice_objects_DL_002740" Offset="0x2740"/>
|
||||
<Collision Name="object_ice_objects_Col_002854" Offset="0x2854"/>
|
||||
<Collision Name="object_ice_objects_Col_002920" Offset="0x2920"/>
|
||||
<Collision Name="gRedIceWallCol" Offset="0x2920"/>
|
||||
<Texture Name="object_ice_objects_Tex_002950" OutName="tex_00002950" Format="rgba16" Width="32" Height="32" Offset="0x2950"/>
|
||||
<Texture Name="object_ice_objects_Tex_003150" OutName="tex_00003150" Format="i8" Width="32" Height="128" Offset="0x3150"/>
|
||||
<Texture Name="gRedIceWallTex" OutName="red_ice_wall" Format="i8" Width="32" Height="128" Offset="0x3150"/>
|
||||
<Texture Name="object_ice_objects_Tex_004150" OutName="tex_00004150" Format="rgba16" Width="32" Height="32" Offset="0x4150"/>
|
||||
<Texture Name="object_ice_objects_Tex_004950" OutName="tex_00004950" Format="rgba16" Width="32" Height="32" Offset="0x4950"/>
|
||||
<Texture Name="object_ice_objects_Tex_005150" OutName="tex_00005150" Format="i8" Width="32" Height="32" Offset="0x5150"/>
|
||||
<Texture Name="object_ice_objects_Tex_005550" OutName="tex_00005550" Format="i4" Width="64" Height="64" Offset="0x5550"/>
|
||||
<Texture Name="gRedIceBlockTex" OutName="red_ice_block" Format="i8" Width="32" Height="32" Offset="0x5150"/>
|
||||
<Texture Name="gRedIcePlatformTex" OutName="red_ice_platform" Format="i4" Width="64" Height="64" Offset="0x5550"/>
|
||||
<Texture Name="object_ice_objects_Tex_005D50" OutName="tex_00005D50" Format="i8" Width="64" Height="64" Offset="0x5D50"/>
|
||||
<Texture Name="object_ice_objects_Tex_006D50" OutName="tex_00006D50" Format="rgba16" Width="32" Height="64" Offset="0x6D50"/>
|
||||
<Texture Name="object_ice_objects_Tex_007D50" OutName="tex_00007D50" Format="ia8" Width="64" Height="64" Offset="0x7D50"/>
|
||||
|
|
|
@ -1,77 +1,29 @@
|
|||
<Root>
|
||||
<ExternalFile XmlPath="objects/gameplay_keep.xml" OutPath="assets/objects/gameplay_keep/"/>
|
||||
<File Name="ovl_Boss_Ganon2" BaseAddress="0x808FCF40" RangeStart="0xA2C8" RangeEnd="0x10778">
|
||||
<Texture Name="ovl_Boss_Ganon2_Tex_00A2C8" OutName="tex_0000A2C8" Format="i8" Width="64" Height="64" Offset="0x00A2C8"/>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_00B2C8" Count="4" Offset="0x00B2C8">
|
||||
<Texture Name="gGanonLightOrbTex" OutName="ganon_light_orb" Format="i8" Width="64" Height="64" Offset="0xA2C8"/>
|
||||
<DList Name="gGanonLightOrbMaterialDL" Offset="0xB308"/>
|
||||
<DList Name="gGanonLightOrbModelDL" Offset="0xB378"/>
|
||||
<DList Name="gGanonShadowMaterialDL" Offset="0xB3D0"/>
|
||||
<DList Name="gGanonShadowModelDL" Offset="0xB3F0"/>
|
||||
<Texture Name="gGanonSwordTrailTex" OutName="ganon_sword_trail" Format="i8" Width="32" Height="32" Offset="0xB420"/>
|
||||
<Texture Name="gGanonSwordTrailMaskTex" OutName="ganon_sword_trail_mask" Format="i4" Width="32" Height="32" Offset="0xB820"/>
|
||||
<Array Name="gGanonSwordTrailVtx" Count="22" Offset="0xBA20">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="ovl_Boss_Ganon2_DL_00B308" Offset="0x00B308"/>
|
||||
<DList Name="ovl_Boss_Ganon2_DL_00B378" Offset="0x00B378"/>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_00B390" Count="4" Offset="0x00B390">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="ovl_Boss_Ganon2_DL_00B3D0" Offset="0x00B3D0"/>
|
||||
<DList Name="ovl_Boss_Ganon2_DL_00B3F0" Offset="0x00B3F0"/>
|
||||
<Texture Name="ovl_Boss_Ganon2_Tex_00B420" OutName="tex_0000B420" Format="i8" Width="32" Height="32" Offset="0x00B420"/>
|
||||
<Texture Name="ovl_Boss_Ganon2_Tex_00B820" OutName="tex_0000B820" Format="i4" Width="32" Height="32" Offset="0x00B820"/>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_00BA20" Count="22" Offset="0x00BA20">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="ovl_Boss_Ganon2_DL_00BB80" Offset="0x00BB80"/>
|
||||
<Texture Name="ovl_Boss_Ganon2_Tex_00BC98" OutName="tex_0000BC98" Format="i8" Width="64" Height="64" Offset="0x00BC98"/>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_00CC98" Count="4" Offset="0x00CC98">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="ovl_Boss_Ganon2_DL_00CCD8" Offset="0x00CCD8"/>
|
||||
<Texture Name="ovl_Boss_Ganon2_Tex_00CD58" OutName="tex_0000CD58" Format="i4" Width="32" Height="160" Offset="0x00CD58"/>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_00D758" Count="4" Offset="0x00D758">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="ovl_Boss_Ganon2_DL_00D798" Offset="0x00D798"/>
|
||||
<Texture Name="ovl_Boss_Ganon2_Tex_00D820" OutName="tex_0000D820" Format="i8" Width="32" Height="64" Offset="0x00D820"/>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_00E020" Count="26" Offset="0x00E020">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="ovl_Boss_Ganon2_DL_00E1C0" Offset="0x00E1C0"/>
|
||||
<Texture Name="ovl_Boss_Ganon2_Tex_00E2E0" OutName="tex_0000E2E0" Format="i8" Width="32" Height="64" Offset="0x00E2E0"/>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_00EAE0" Count="22" Offset="0x00EAE0">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="ovl_Boss_Ganon2_DL_00EC40" Offset="0x00EC40"/>
|
||||
<Texture Name="ovl_Boss_Ganon2_Tex_00ED48" OutName="tex_0000ED48" Format="i8" Width="32" Height="32" Offset="0x00ED48"/>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_00F148" Count="4" Offset="0x00F148">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="ovl_Boss_Ganon2_DL_00F188" Offset="0x00F188"/>
|
||||
<Texture Name="ovl_Boss_Ganon2_Tex_00F208" OutName="tex_0000F208" Format="rgba16" Width="16" Height="16" Offset="0x00F208"/>
|
||||
<Texture Name="ovl_Boss_Ganon2_Tex_00F408" OutName="tex_0000F408" Format="rgba16" Width="32" Height="32" Offset="0x00F408"/>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_00FC08" Count="3" Offset="0x00FC08">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_00FC38" Count="32" Offset="0x00FC38">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_00FE38" Count="15" Offset="0x00FE38">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_00FF28" Count="11" Offset="0x00FF28">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_00FFD8" Count="6" Offset="0x00FFD8">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_010038" Count="12" Offset="0x010038">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_0100F8" Count="10" Offset="0x0100F8">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_010198" Count="16" Offset="0x010198">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<Array Name="ovl_Boss_Ganon2_Vtx_010298" Count="17" Offset="0x010298">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="ovl_Boss_Ganon2_DL_0103A8" Offset="0x0103A8"/>
|
||||
<DList Name="gGanonSwordTrailDL" Offset="0xBB80"/>
|
||||
<Texture Name="gGanonTriforceTex" OutName="ganon_triforce" Format="i8" Width="64" Height="64" Offset="0xBC98"/>
|
||||
<DList Name="gGanonTriforceDL" Offset="0xCCD8"/>
|
||||
<Texture Name="gGanonLightningTex" OutName="ganon_lightning" Format="i4" Width="32" Height="160" Offset="0xCD58"/>
|
||||
<DList Name="gGanonLightningDL" Offset="0xD798"/> <!-- Original name might be "efc_fg2_thunder1_modelT" -->
|
||||
<Texture Name="gGanonFireRingTex" OutName="ganon_fire_ring" Format="i8" Width="32" Height="64" Offset="0xD820"/>
|
||||
<DList Name="gGanonFireRingDL" Offset="0xE1C0"/> <!-- Original name is "ganon_fire_modelT" -->
|
||||
<Texture Name="gGanonZeldaMagicTex" OutName="ganon_zelda_magic" Format="i8" Width="32" Height="64" Offset="0xE2E0"/>
|
||||
<DList Name="gGanonZeldaMagicDL" Offset="0xEC40"/> <!-- Original name is "efc_ganon2_hadou_modelT" ("wave motion; undulation; surge") -->
|
||||
<Texture Name="gGanonMasterSwordShadowTex" OutName="ganon_master_sword_shadow" Format="i8" Width="32" Height="32" Offset="0xED48"/>
|
||||
<DList Name="gGanonMasterSwordShadowDL" Offset="0xF188"/> <!-- Original name is "master_sword_shadow_model" -->
|
||||
<Texture Name="gGanonMasterSwordPommelTex" OutName="ganon_master_sword_pommel" Format="rgba16" Width="16" Height="16" Offset="0xF208"/>
|
||||
<Texture Name="gGanonMasterSwordGuardTex" OutName="ganon_master_sword_guard" Format="rgba16" Width="32" Height="32" Offset="0xF408"/>
|
||||
<DList Name="gGanonMasterSwordDL" Offset="0x103A8"/> <!-- Original name is "master_gn2_swordB_model" -->
|
||||
</File>
|
||||
</Root>
|
||||
|
|
14
format.py
14
format.py
|
@ -21,7 +21,11 @@ CLANG_VER = 11
|
|||
FORMAT_OPTS = "-i -style=file"
|
||||
|
||||
# Clang-Tidy options (see .clang-tidy for checks enabled)
|
||||
TIDY_OPTS = "-p . --fix --fix-errors"
|
||||
TIDY_OPTS = "-p ."
|
||||
TIDY_FIX_OPTS = "--fix --fix-errors"
|
||||
|
||||
# Clang-Apply-Replacements options (used for multiprocessing)
|
||||
APPLY_OPTS = "--format --style=file"
|
||||
|
||||
# Compiler options used with Clang-Tidy
|
||||
# Normal warnings are disabled with -Wno-everything to focus only on tidying
|
||||
|
@ -59,7 +63,7 @@ CLANG_APPLY_REPLACEMENTS = get_clang_executable([f"clang-apply-replacements-{CLA
|
|||
# Try to detect the clang-tidy version and add --fix-notes for version 13+
|
||||
# This is used to ensure all fixes are applied properly in recent versions
|
||||
if get_tidy_version(CLANG_TIDY) >= 13:
|
||||
TIDY_OPTS += " --fix-notes"
|
||||
TIDY_FIX_OPTS += " --fix-notes"
|
||||
|
||||
|
||||
def list_chunks(list: List, chunk_length: int):
|
||||
|
@ -73,7 +77,7 @@ def run_clang_format(files: List[str]):
|
|||
|
||||
|
||||
def run_clang_tidy(files: List[str]):
|
||||
exec_str = f"{CLANG_TIDY} {TIDY_OPTS} {' '.join(files)} -- {COMPILER_OPTS}"
|
||||
exec_str = f"{CLANG_TIDY} {TIDY_OPTS} {TIDY_FIX_OPTS} {' '.join(files)} -- {COMPILER_OPTS}"
|
||||
subprocess.run(exec_str, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
|
||||
|
||||
|
@ -86,8 +90,8 @@ def run_clang_tidy_with_export(tmp_dir: str, files: List[str]):
|
|||
|
||||
|
||||
def run_clang_apply_replacements(tmp_dir: str):
|
||||
exec_str = f"{CLANG_APPLY_REPLACEMENTS} --format --style=file --style-config=. {tmp_dir}"
|
||||
subprocess.run(exec_str, shell=True, stderr=subprocess.DEVNULL)
|
||||
exec_str = f"{CLANG_APPLY_REPLACEMENTS} {APPLY_OPTS} {tmp_dir}"
|
||||
subprocess.run(exec_str, shell=True)
|
||||
|
||||
|
||||
def add_final_new_line(file: str):
|
||||
|
|
|
@ -53,7 +53,7 @@ void* is_proutSyncPrintf(void* arg, const char* str, u32 count);
|
|||
void func_80002384(const char* exp, const char* file, u32 line);
|
||||
OSPiHandle* osDriveRomInit(void);
|
||||
void Mio0_Decompress(Yaz0Header* hdr, u8* dst);
|
||||
void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace,
|
||||
void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 initValue, s32 minSpace,
|
||||
const char* name);
|
||||
void StackCheck_Cleanup(StackEntry* entry);
|
||||
u32 StackCheck_GetState(StackEntry* entry);
|
||||
|
@ -1288,15 +1288,6 @@ void SsSram_Init(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8
|
|||
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 func_800A9F30(PadMgr*, s32);
|
||||
void func_800A9F6C(f32, u8, u8, u8);
|
||||
void func_800AA000(f32, u8, u8, u8);
|
||||
void func_800AA0B4(void);
|
||||
void func_800AA0F0(void);
|
||||
u32 func_800AA148(void);
|
||||
void func_800AA15C(void);
|
||||
void func_800AA16C(void);
|
||||
void func_800AA178(u32);
|
||||
View* View_New(GraphicsContext* gfxCtx);
|
||||
void View_Free(View* view);
|
||||
void View_Init(View*, GraphicsContext*);
|
||||
|
@ -1583,8 +1574,8 @@ void SpeedMeter_InitAllocEntry(SpeedMeterAllocEntry* this, u32 maxval, u32 val,
|
|||
void SpeedMeter_DrawAllocEntry(SpeedMeterAllocEntry* this, GraphicsContext* gfxCtx);
|
||||
void SpeedMeter_DrawAllocEntries(SpeedMeter* meter, GraphicsContext* gfxCtx, GameState* state);
|
||||
void SysCfb_Init(s32 n64dd);
|
||||
u32 SysCfb_GetFbPtr(s32 idx);
|
||||
u32 SysCfb_GetFbEnd(void);
|
||||
void* SysCfb_GetFbPtr(s32 idx);
|
||||
void* SysCfb_GetFbEnd(void);
|
||||
f32 Math_FactorialF(f32 n);
|
||||
f32 Math_Factorial(s32 n);
|
||||
f32 Math_PowF(f32 base, s32 exp);
|
||||
|
@ -1693,9 +1684,6 @@ u64* SysUcode_GetUCodeBoot(void);
|
|||
size_t SysUcode_GetUCodeBootSize(void);
|
||||
u64* SysUcode_GetUCode(void);
|
||||
u64* SysUcode_GetUCodeData(void);
|
||||
void func_800D2E30(UnkRumbleStruct* arg0);
|
||||
void func_800D3140(UnkRumbleStruct* arg0);
|
||||
void func_800D3178(UnkRumbleStruct* arg0);
|
||||
void func_800D31A0(void);
|
||||
void func_800D31F0(void);
|
||||
void func_800D3210(void);
|
||||
|
@ -1880,7 +1868,7 @@ void Audio_PlaySariaBgm(Vec3f* pos, u16 seqId, u16 distMax);
|
|||
void Audio_ClearSariaBgm2(void);
|
||||
void func_800F5510(u16 seqId);
|
||||
void func_800F5550(u16 seqId);
|
||||
void func_800F574C(f32 arg0, u8 arg2);
|
||||
void func_800F574C(f32 scaleTempoAndFreq, u8 duration);
|
||||
void func_800F5718(void);
|
||||
void func_800F5918(void);
|
||||
void func_800F595C(u16);
|
||||
|
@ -1891,7 +1879,7 @@ void func_800F5B58(void);
|
|||
void func_800F5BF0(u8 natureAmbienceId);
|
||||
void Audio_PlayFanfare(u16);
|
||||
void func_800F5C2C(void);
|
||||
void func_800F5E18(u8 playerIdx, u16 seqId, u8 fadeTimer, s8 arg3, s8 arg4);
|
||||
void func_800F5E18(u8 seqPlayerIndex, u16 seqId, u8 fadeTimer, s8 ioPort, s8 ioData);
|
||||
void Audio_SetSequenceMode(u8 seqMode);
|
||||
void Audio_SetBgmEnemyVolume(f32 dist);
|
||||
void func_800F6268(f32 dist, u16);
|
||||
|
@ -1910,7 +1898,7 @@ void func_800F6AB0(u16);
|
|||
// ? func_800F6BB8(?);
|
||||
void Audio_PreNMI(void);
|
||||
// ? func_800F6C34(?);
|
||||
void Audio_SetNatureAmbienceChannelIO(u8 channelIdxRange, u8 port, u8 val);
|
||||
void Audio_SetNatureAmbienceChannelIO(u8 channelIdxRange, u8 ioPort, u8 ioData);
|
||||
void Audio_PlayNatureAmbienceSequence(u8 natureAmbienceId);
|
||||
void Audio_Init(void);
|
||||
void Audio_InitSound(void);
|
||||
|
@ -1927,8 +1915,6 @@ void Audio_StopSfxByBank(u8 bankId);
|
|||
void func_800F8884(u8 bankId, Vec3f* pos);
|
||||
void Audio_StopSfxByPosAndBank(u8 bankId, Vec3f* pos);
|
||||
void Audio_StopSfxByPos(Vec3f* pos);
|
||||
void func_800F9280(u8 playerIdx, u8 seqId, u8 arg2, u16 fadeTimer);
|
||||
void Audio_QueueSeqCmd(u32 cmd);
|
||||
void Audio_StopSfxByPosAndId(Vec3f* pos, u16 sfxId);
|
||||
void Audio_StopSfxByTokenAndId(u8 token, u16 sfxId);
|
||||
void Audio_StopSfxById(u32 sfxId);
|
||||
|
@ -1936,19 +1922,17 @@ void Audio_ProcessSfxRequests(void);
|
|||
void func_800F8F88(void);
|
||||
u8 Audio_IsSfxPlaying(u32 sfxId);
|
||||
void Audio_ResetSfx(void);
|
||||
void func_800F9474(u8, u16);
|
||||
void func_800F94FC(u32);
|
||||
void Audio_ProcessSeqCmd(u32);
|
||||
void Audio_StartSequence(u8 seqPlayerIndex, u8 seqId, u8 seqArgs, u16 fadeInDuration);
|
||||
void Audio_StopSequence(u8 seqPlayerIndex, u16 fadeOutDuration);
|
||||
void Audio_QueueSeqCmd(u32 cmd);
|
||||
void Audio_ProcessSeqCmds(void);
|
||||
u16 func_800FA0B4(u8 playerIdx);
|
||||
s32 func_800FA11C(u32 arg0, u32 arg1);
|
||||
void func_800FA174(u8);
|
||||
void func_800FA18C(u8, u8);
|
||||
void Audio_SetVolScale(u8 playerIdx, u8 scaleIdx, u8 targetVol, u8 volFadeTimer);
|
||||
void func_800FA3DC(void);
|
||||
u16 Audio_GetActiveSeqId(u8 seqPlayerIndex);
|
||||
s32 Audio_IsSeqCmdNotQueued(u32 cmdVal, u32 cmdMask);
|
||||
void Audio_SetVolumeScale(u8 seqPlayerIndex, u8 scaleIndex, u8 targetVol, u8 volFadeTimer);
|
||||
void Audio_UpdateActiveSequences(void);
|
||||
u8 func_800FAD34(void);
|
||||
void func_800FADF8(void);
|
||||
void func_800FAEB4(void);
|
||||
void Audio_ResetActiveSequences(void);
|
||||
void Audio_ResetActiveSequencesAndVolume(void);
|
||||
void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a);
|
||||
void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y);
|
||||
void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y);
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
|
||||
#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
#define PHYSICAL_TO_VIRTUAL(addr) (void*)((u32)(addr) + 0x80000000)
|
||||
#define VIRTUAL_TO_PHYSICAL(addr) (u32)((u8*)(addr) - 0x80000000)
|
||||
#define PHYSICAL_TO_VIRTUAL(addr) (void*)((uintptr_t)(addr) + 0x80000000)
|
||||
#define VIRTUAL_TO_PHYSICAL(addr) (uintptr_t)((u8*)(addr) - 0x80000000)
|
||||
#define SEGMENTED_TO_VIRTUAL(addr) PHYSICAL_TO_VIRTUAL(gSegments[SEGMENT_NUMBER(addr)] + SEGMENT_OFFSET(addr))
|
||||
|
||||
#define SQ(x) ((x)*(x))
|
||||
|
|
|
@ -40,8 +40,8 @@ typedef struct PadMgr {
|
|||
/* 0x045C */ vu8 rumbleOffTimer; // amount of VI retraces to not rumble for, takes priority over rumbleOnTimer
|
||||
/* 0x045D */ vu8 rumbleOnTimer; // amount of VI retraces to rumble for
|
||||
/* 0x045E */ u8 isResetting;
|
||||
/* 0x0460 */ void (*retraceCallback)(struct PadMgr* padMgr, s32 arg);
|
||||
/* 0x0464 */ s32 retraceCallbackValue;
|
||||
/* 0x0460 */ void (*retraceCallback)(struct PadMgr* padMgr, void* arg);
|
||||
/* 0x0464 */ void* retraceCallbackArg;
|
||||
} PadMgr; // size = 0x468
|
||||
|
||||
extern PadMgr gPadMgr;
|
||||
|
@ -70,4 +70,36 @@ void PadMgr_RumbleReset(PadMgr* padMgr);
|
|||
void PadMgr_RumbleSetSingle(PadMgr* padMgr, u32 port, u32 rumble);
|
||||
void PadMgr_RumbleSet(PadMgr* padMgr, u8* enable);
|
||||
|
||||
// Retrace callback
|
||||
|
||||
/**
|
||||
* Sets the padmgr retrace callback that runs while waiting for controller input. The callback may be passed a single
|
||||
* user-provided argument. The callback function should be `void (*)(PadMgr*, void*)`.
|
||||
*
|
||||
* @param callback callback to run before rumble state is updated for the current VI
|
||||
* @param arg the argument to pass to the calback
|
||||
*
|
||||
* @see PADMGR_UNSET_RETRACE_CALLACK
|
||||
*/
|
||||
#define PADMGR_SET_RETRACE_CALLACK(padmgr, callback, arg) \
|
||||
do { \
|
||||
(padmgr)->retraceCallback = (callback); \
|
||||
(padmgr)->retraceCallbackArg = (arg); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* Unsets the current padmgr retrace callback if it and the argument are the same as the ones already registered.
|
||||
*
|
||||
* @param callback the callback to unset, if it is set
|
||||
* @param arg the argument to unset, if it is set
|
||||
*
|
||||
* @see PADMGR_SET_RETRACE_CALLACK
|
||||
*/
|
||||
#define PADMGR_UNSET_RETRACE_CALLACK(padmgr, callback, arg) \
|
||||
if ((padmgr)->retraceCallback == (callback) && (padmgr)->retraceCallbackArg == (arg)) { \
|
||||
(padmgr)->retraceCallback = NULL; \
|
||||
(padmgr)->retraceCallbackArg = NULL; \
|
||||
} \
|
||||
(void)0
|
||||
|
||||
#endif
|
||||
|
|
|
@ -109,8 +109,8 @@
|
|||
#define R_TRANS_DBG_TYPE CREG(12)
|
||||
#define R_ENV_WIND_DIR(i) CREG(16 + (i))
|
||||
#define R_ENV_WIND_SPEED CREG(19)
|
||||
#define R_PAUSE_STICK_REPEAT_DELAY_FIRST XREG(6)
|
||||
#define R_PAUSE_STICK_REPEAT_DELAY XREG(8)
|
||||
#define R_PAUSE_STICK_REPEAT_DELAY XREG(6)
|
||||
#define R_PAUSE_STICK_REPEAT_DELAY_FIRST XREG(8)
|
||||
#define R_A_BTN_Y XREG(16)
|
||||
#define R_A_BTN_X XREG(17)
|
||||
#define R_A_ICON_Y XREG(19)
|
||||
|
@ -193,6 +193,9 @@
|
|||
#define R_ITEM_AMMO_Y(i) VREG(68 + (i))
|
||||
#define R_ITEM_ICON_WIDTH(i) VREG(76 + (i))
|
||||
#define R_ITEM_BTN_WIDTH(i) VREG(80 + (i))
|
||||
#define R_GAME_OVER_RUMBLE_STRENGTH VREG(90)
|
||||
#define R_GAME_OVER_RUMBLE_DURATION VREG(91)
|
||||
#define R_GAME_OVER_RUMBLE_DECREASE_RATE VREG(92)
|
||||
#define R_DISABLE_INPUT_DISPLAY HREG(47)
|
||||
#define R_ENABLE_PLAY_LOGS HREG(63)
|
||||
#define R_EN_GOROIWA_SPEED mREG(12)
|
||||
|
|
51
include/rumble.h
Normal file
51
include/rumble.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
#ifndef RUMBLE_H
|
||||
#define RUMBLE_H
|
||||
|
||||
#include "ultra64.h"
|
||||
|
||||
#define RUMBLE_MAX_REQUESTS 64
|
||||
|
||||
typedef enum {
|
||||
RUMBLE_STATE_CLEAR,
|
||||
RUMBLE_STATE_RUNNING,
|
||||
RUMBLE_STATE_RESET
|
||||
} RumbleState;
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ u8 rumbleEnable[MAXCONTROLLERS];
|
||||
/* 0x004 */ u8 reqStrengths[RUMBLE_MAX_REQUESTS]; // Source strength modulated by distance to the source
|
||||
/* 0x044 */ u8 reqDurations[RUMBLE_MAX_REQUESTS]; // Duration until decreaseRate kicks in
|
||||
/* 0x084 */ u8 reqDecreaseRates[RUMBLE_MAX_REQUESTS]; // Decreases the strength by this much every Vertical Retrace, once the strength hits 0 the request slot is freed
|
||||
/* 0x0C4 */ u8 reqAccumulators[RUMBLE_MAX_REQUESTS]; // Starts at 0, incremented by the strength every Vertical Retrace
|
||||
/* 0x104 */ u8 state;
|
||||
/* 0x105 */ u8 updateEnabled;
|
||||
/* 0x106 */ u16 onTimer; // Duration for which there has been an active rumble request running
|
||||
/* 0x108 */ u16 offTimer; // Duration for which there has not been an active rumble request running, capped at 5
|
||||
/* 0x10A */ u8 overrideStrength; // overrides requests with these parameters
|
||||
/* 0x10B */ u8 overrideDuration;
|
||||
/* 0x10C */ u8 overrideDecreaseRate;
|
||||
/* 0x10D */ u8 overrideAccumulator;
|
||||
} RumbleMgr; // size = 0x10E
|
||||
|
||||
// internal
|
||||
|
||||
void RumbleMgr_Init(RumbleMgr* rumbleMgr);
|
||||
void RumbleMgr_Destroy(RumbleMgr* rumbleMgr);
|
||||
void RumbleMgr_Update(RumbleMgr* rumbleMgr);
|
||||
|
||||
// external
|
||||
|
||||
void Rumble_Override(f32 distSq, u8 sourceStrength, u8 duration, u8 decreaseRate);
|
||||
void Rumble_Request(f32 distSq, u8 sourceStrength, u8 duration, u8 decreaseRate);
|
||||
|
||||
void Rumble_Init(void);
|
||||
void Rumble_Destroy(void);
|
||||
|
||||
s32 Rumble_Controller1HasRumblePak(void);
|
||||
|
||||
void Rumble_Reset(void);
|
||||
void Rumble_ClearRequests(void);
|
||||
|
||||
void Rumble_SetUpdateEnabled(u32 enable);
|
||||
|
||||
#endif
|
506
include/seqcmd.h
Normal file
506
include/seqcmd.h
Normal file
|
@ -0,0 +1,506 @@
|
|||
#ifndef SEQCMD_H
|
||||
#define SEQCMD_H
|
||||
|
||||
// ==== Primary commands ====
|
||||
|
||||
#define SEQCMD_OP_MASK 0xF0000000
|
||||
|
||||
typedef enum {
|
||||
/* 0x0 */ SEQCMD_OP_PLAY_SEQUENCE,
|
||||
/* 0x1 */ SEQCMD_OP_STOP_SEQUENCE,
|
||||
/* 0x2 */ SEQCMD_OP_QUEUE_SEQUENCE,
|
||||
/* 0x3 */ SEQCMD_OP_UNQUEUE_SEQUENCE,
|
||||
/* 0x4 */ SEQCMD_OP_SET_PLAYER_VOLUME,
|
||||
/* 0x5 */ SEQCMD_OP_SET_PLAYER_FREQ,
|
||||
/* 0x6 */ SEQCMD_OP_SET_CHANNEL_VOLUME,
|
||||
/* 0x7 */ SEQCMD_OP_SET_PLAYER_IO,
|
||||
/* 0x8 */ SEQCMD_OP_SET_CHANNEL_IO,
|
||||
/* 0x9 */ SEQCMD_OP_SET_CHANNEL_IO_DISABLE_MASK,
|
||||
/* 0xA */ SEQCMD_OP_SET_CHANNEL_DISABLE_MASK,
|
||||
/* 0xB */ SEQCMD_OP_TEMPO_CMD,
|
||||
/* 0xC */ SEQCMD_OP_SETUP_CMD,
|
||||
/* 0xD */ SEQCMD_OP_SET_CHANNEL_FREQ,
|
||||
/* 0xE */ SEQCMD_OP_GLOBAL_CMD,
|
||||
/* 0xF */ SEQCMD_OP_RESET_AUDIO_HEAP
|
||||
} SeqCmdOp;
|
||||
|
||||
// ==== Secondary commands ====
|
||||
|
||||
// Subset of `SEQCMD_OP_TEMPO_CMD`
|
||||
typedef enum {
|
||||
/* 0x0 */ SEQCMD_SUB_OP_TEMPO_SET,
|
||||
/* 0x1 */ SEQCMD_SUB_OP_TEMPO_SPEED_UP,
|
||||
/* 0x2 */ SEQCMD_SUB_OP_TEMPO_SLOW_DOWN,
|
||||
/* 0x3 */ SEQCMD_SUB_OP_TEMPO_SCALE,
|
||||
/* 0x4 */ SEQCMD_SUB_OP_TEMPO_RESET
|
||||
} SeqCmdTempoCmdOp;
|
||||
|
||||
// Subset of `SEQCMD_OP_SETUP_CMD`
|
||||
typedef enum {
|
||||
/* 0x0 */ SEQCMD_SUB_OP_SETUP_RESTORE_VOLUME,
|
||||
/* 0x1 */ SEQCMD_SUB_OP_SETUP_SEQ_UNQUEUE,
|
||||
/* 0x2 */ SEQCMD_SUB_OP_SETUP_RESTART_SEQ,
|
||||
/* 0x3 */ SEQCMD_SUB_OP_SETUP_TEMPO_SCALE,
|
||||
/* 0x4 */ SEQCMD_SUB_OP_SETUP_TEMPO_RESET,
|
||||
/* 0x5 */ SEQCMD_SUB_OP_SETUP_PLAY_SEQ,
|
||||
/* 0x6 */ SEQCMD_SUB_OP_SETUP_SET_FADE_TIMER,
|
||||
/* 0x7 */ SEQCMD_SUB_OP_SETUP_RESTORE_VOLUME_IF_QUEUED,
|
||||
/* 0x8 */ SEQCMD_SUB_OP_SETUP_RESTORE_VOLUME_WITH_SCALE_INDEX,
|
||||
/* 0x9 */ SEQCMD_SUB_OP_SETUP_SET_CHANNEL_DISABLE_MASK,
|
||||
/* 0xA */ SEQCMD_SUB_OP_SETUP_SET_PLAYER_FREQ,
|
||||
/* 0xE */ SEQCMD_SUB_OP_SETUP_POP_PERSISTENT_CACHE = 0xE,
|
||||
/* 0xF */ SEQCMD_SUB_OP_SETUP_RESET_SETUP_CMDS
|
||||
} SeqCmdSetupCmdOp;
|
||||
|
||||
// Subset of `SEQCMD_OP_GLOBAL_CMD`
|
||||
typedef enum {
|
||||
/* 0x0 */ SEQCMD_SUB_OP_GLOBAL_SET_SOUND_MODE,
|
||||
/* 0x1 */ SEQCMD_SUB_OP_GLOBAL_DISABLE_NEW_SEQUENCES
|
||||
} SeqCmdSubCmdOp;
|
||||
|
||||
// ==== Audio Sequence Primary Commands ====
|
||||
|
||||
/**
|
||||
* Play a sequence on a given seqPlayer
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to play the sequence
|
||||
* @param fadeInDuration duration the sequence will fade in over
|
||||
* @param seqArg no effect: < 0x7F, skip ticks: = 0x7F, will not play: >= 0x80 (see note)
|
||||
* @param seqId the id of the sequence to play, see `SeqId`
|
||||
*
|
||||
* @note seqArg will also be stored in gActiveSeqs.seqId, any check against that seqId must also include seqArg.
|
||||
* seqArg = 0x7F will interpret the duration as the number of ticks to skip.
|
||||
* seqArg >= 0x80 was intented to load a soundFont asynchronously but the code is unfinished (based on MM).
|
||||
*/
|
||||
#define SEQCMD_PLAY_SEQUENCE(seqPlayerIndex, fadeInDuration, seqArg, seqId) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_PLAY_SEQUENCE << 28) | ((u8)(seqPlayerIndex) << 24) | ((u8)(fadeInDuration) << 16) | \
|
||||
((u8)(seqArg) << 8) | (u16)(seqId))
|
||||
|
||||
/**
|
||||
* Stop a sequence on a given seqPlayer
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to play the sequence
|
||||
* @param fadeOutDuration duration the sequence will fade out over
|
||||
*
|
||||
* @note the 0xFF in the command is not read from at all, but is common in all Stop SeqPlayer Commands
|
||||
*/
|
||||
#define SEQCMD_STOP_SEQUENCE(seqPlayerIndex, fadeOutDuration) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_STOP_SEQUENCE << 28) | 0xFF | ((u8)(seqPlayerIndex) << 24) | \
|
||||
((u8)(fadeOutDuration) << 16))
|
||||
|
||||
/**
|
||||
* Add a sequence to a queue of sequences associated with a given seqPlayer.
|
||||
* If the sequence is first in queue, play the sequence
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to queue the sequence
|
||||
* @param fadeInDuration if the sequence is played, duration the sequence will fade in over
|
||||
* @param priority priority in the queue. The highest valued priority will be queued to play first. Also used as `seqArg`.
|
||||
* @param seqId the id of the sequence to play, see `SeqId`
|
||||
*
|
||||
* @note for the next sequence in the queue to play, the current sequence must be unqueued with the unqueue command
|
||||
* @note for a priority >= 0x7F, similar effects happen as `seqArg` in the play sequence command
|
||||
*/
|
||||
#define SEQCMD_QUEUE_SEQUENCE(seqPlayerIndex, fadeInDuration, priority, seqId) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_QUEUE_SEQUENCE << 28) | ((u8)(seqPlayerIndex) << 24) | ((u8)(fadeInDuration) << 16) | \
|
||||
((u8)(priority) << 8) | (u8)(seqId))
|
||||
|
||||
/**
|
||||
* Remove a sequence from a queue of sequences associated with a given seqPlayer.
|
||||
* If the sequence is first in queue, stop the sequence, and play the next one in queue if any
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to queue the sequence
|
||||
* @param fadeInDuration if the sequence is stopped, duration the sequence will fade out over, and duration the next seq will fade in over
|
||||
* @param seqId the id of the sequence to remove, see `SeqId`
|
||||
*
|
||||
* @note for the next sequence in the queue to play, the current sequence must be unqueued with this command
|
||||
*/
|
||||
#define SEQCMD_UNQUEUE_SEQUENCE(seqPlayerIndex, fadeOutInDuration, seqId) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_UNQUEUE_SEQUENCE << 28) | ((u8)(seqPlayerIndex) << 24) | \
|
||||
((u8)(fadeOutInDuration) << 16) | (seqId))
|
||||
|
||||
/**
|
||||
* Set the volume of an entire sequence on a given seqPlayer. Fade to the volume over a specified duration
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param duration duration to transition to the volume
|
||||
* @param volume the target volume for the sequence. Ranged from 0-0xFF, with 0x7F mapping to 1.0f
|
||||
*/
|
||||
#define SEQCMD_SET_PLAYER_VOLUME(seqPlayerIndex, duration, volume) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SET_PLAYER_VOLUME << 28) | ((u8)(seqPlayerIndex) << 24) | ((duration) << 16) | \
|
||||
(volume))
|
||||
|
||||
/**
|
||||
* Scale the frequency of every channel on a given seqPlayer over a specified duration.
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param duration duration to transition to the frequency
|
||||
* @param freqScale the scaling factor to shift the pitch. Ranged from 0-0xFFFF, with 1000 mapping to 1.0f
|
||||
*
|
||||
* @note 2000 will double the frequency (raise an octave), 500 will halve the frequency (lower an octave).
|
||||
* Cannot be used with `SEQCMD_SET_CHANNEL_FREQ` as they will overwrite one another.
|
||||
*/
|
||||
#define SEQCMD_SET_PLAYER_FREQ(seqPlayerIndex, duration, freqScale) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SET_PLAYER_FREQ << 28) | ((u8)(seqPlayerIndex) << 24) | ((duration) << 16) | \
|
||||
(freqScale))
|
||||
|
||||
/**
|
||||
* Scale the frequency of a specific channel on a given seqPlayer over a specified duration
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param channelIndex the index of the channel to modify
|
||||
* @param duration duration to transition to the frequency
|
||||
* @param freqScale the scaling factor to shift the pitch. Ranged from 0-0xFFF, with 1000 mapping to 1.0f
|
||||
*
|
||||
* @note a frequency of 2000 will double the frequency (raise an octave), 500 will halve the frequency (lower an octave).
|
||||
* Cannot be used with `SEQCMD_SET_PLAYER_FREQ` as they will overwrite one another.
|
||||
*/
|
||||
#define SEQCMD_SET_CHANNEL_FREQ(seqPlayerIndex, channelIndex, duration, freqScale) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SET_CHANNEL_FREQ << 28) | ((u8)(seqPlayerIndex) << 24) | ((duration) << 16) | \
|
||||
((channelIndex) << 12) | (freqScale))
|
||||
|
||||
/**
|
||||
* Set the volume of a specific channel on a given seqPlayer. Fade to the volume over a specified duration
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param channelIndex the index of the channel to modify
|
||||
* @param duration duration to transition to the volume
|
||||
* @param volume the target volume for the sequence. Ranged from 0-0xFF, with 0x7F mapping to 1.0f
|
||||
*/
|
||||
#define SEQCMD_SET_CHANNEL_VOLUME(seqPlayerIndex, channelIndex, duration, volume) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SET_CHANNEL_VOLUME << 28) | ((u8)(seqPlayerIndex) << 24) | ((u8)(duration) << 16) | \
|
||||
((u8)(channelIndex) << 8) | ((u8)volume))
|
||||
|
||||
/**
|
||||
* Write a value that can be read as input directly by the sequence itself. This will be set to the global
|
||||
* ioPort, which can affect the entire sequence.
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to write the input to
|
||||
* @param ioPort the index of the array to store the input-output value,
|
||||
* @param ioData the value s8 that's written to the input-output array
|
||||
*
|
||||
* @note Each seqPlayer has 8 global ioPorts indexed 0-7.
|
||||
* ioPort 0 and 1 are read-only-once, and will reset after being read by the sequence.
|
||||
* ioPort 2-7 can be read multiple times.
|
||||
*/
|
||||
#define SEQCMD_SET_PLAYER_IO(seqPlayerIndex, ioPort, ioData) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SET_PLAYER_IO << 28) | ((u8)(seqPlayerIndex) << 24) | ((u8)(ioPort) << 16) | \
|
||||
(u8)(ioData))
|
||||
|
||||
/**
|
||||
* Write a value that can be read as input directly by the sequence itself. This will be set to the channel
|
||||
* ioPort, which will only affect a single channel.
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to write the input to
|
||||
* @param channelIndex the index of the channel to write the input to
|
||||
* @param ioPort the index of the array to store the input-output value
|
||||
* @param ioData the value s8 that's written to the input-output array
|
||||
*
|
||||
* @note Each channel has 8 channel ioPorts indexed 0-7.
|
||||
* ioPort 0 and 1 are read-only-once, and will reset after being read by the sequence.
|
||||
* ioPort 2-7 can be read multiple times.
|
||||
*/
|
||||
#define SEQCMD_SET_CHANNEL_IO(seqPlayerIndex, channelIndex, ioPort, ioData) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SET_CHANNEL_IO << 28) | ((u8)(seqPlayerIndex) << 24) | ((u8)(ioPort) << 16) | \
|
||||
((u8)(channelIndex) << 8) | (u8)(ioData))
|
||||
|
||||
/**
|
||||
* Disable (or reenable) specific channels from receiving input set by `SEQCMD_SET_CHANNEL_IO`
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param channelMask a 16 bit mask where each bit maps to a channel. Bitflag on to disable
|
||||
*
|
||||
* @note using Audio_QueueCmdS8 0x06 will bypass this channelMask
|
||||
*/
|
||||
#define SEQCMD_SET_CHANNEL_IO_DISABLE_MASK(seqPlayerIndex, channelMask) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SET_CHANNEL_IO_DISABLE_MASK << 28) | ((u8)(seqPlayerIndex) << 24) | (u16)(channelMask))
|
||||
|
||||
/**
|
||||
* Disable (or reenable) specific channels
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param channelMask a 16 bit mask where each bit maps to a channel. Bitflag on to disable
|
||||
*/
|
||||
#define SEQCMD_SET_CHANNEL_DISABLE_MASK(seqPlayerIndex, channelMask) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SET_CHANNEL_DISABLE_MASK << 28) | ((u8)(seqPlayerIndex) << 24) | (u16)(channelMask))
|
||||
|
||||
// ==== Audio Sequence Tempo Commands ====
|
||||
|
||||
/**
|
||||
* Set the absolute tempo of a sequence on a given seqPlayer, fading over a specified duration
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param duration duration to transition to the tempo
|
||||
* @param tempoTarget the target tempo for the sequence
|
||||
*
|
||||
* @note the absolute tempo is constrained to a maximum of 300
|
||||
*/
|
||||
#define SEQCMD_SET_TEMPO(seqPlayerIndex, duration, tempoTarget) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_TEMPO_CMD << 28) | (SEQCMD_SUB_OP_TEMPO_SET << 12) | ((u8)(seqPlayerIndex) << 24) | \
|
||||
((u8)(duration) << 16) | (u16)(tempoTarget))
|
||||
|
||||
/**
|
||||
* Increase the tempo of a sequence by a relative value on a given seqPlayer over a specified duration
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param duration duration to transition to the tempo
|
||||
* @param tempoIncrease the change to add to the current tempo
|
||||
*
|
||||
* @note the absolute tempo is constrained to a maximum of 300
|
||||
*/
|
||||
#define SEQCMD_SPEED_UP_TEMPO(seqPlayerIndex, duration, tempoIncrease) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_TEMPO_CMD << 28) | (SEQCMD_SUB_OP_TEMPO_SPEED_UP << 12) | \
|
||||
((u8)(seqPlayerIndex) << 24) | ((u8)(duration) << 16) | (u16)(tempoIncrease))
|
||||
|
||||
/**
|
||||
* Decrease the tempo of a sequence by a relative value on a given seqPlayer over a specified duration
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param duration duration to transition to the tempo
|
||||
* @param tempoDecrease the change to subtract to the current tempo
|
||||
*
|
||||
* @note the absolute tempo is constrained to a maximum of 300
|
||||
*/
|
||||
#define SEQCMD_SLOW_DOWN_TEMPO(seqPlayerIndex, duration, tempoDecrease) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_TEMPO_CMD << 28) | (SEQCMD_SUB_OP_TEMPO_SLOW_DOWN << 12) | \
|
||||
((u8)(seqPlayerIndex) << 24) | ((u8)(duration) << 16) | (u16)(tempoDecrease))
|
||||
|
||||
/**
|
||||
* Scale the tempo of a sequence by a multiplicative value on a given seqPlayer over a specified duration
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param duration duration to transition to the tempo
|
||||
* @param tempoScale the scaling factor of the tempo, relative to 100
|
||||
*
|
||||
* @note a tempoScale of 200 will go double-time, 50 will go half-time.
|
||||
* the absolute tempo is constrained to a maximum of 300
|
||||
*/
|
||||
#define SEQCMD_SCALE_TEMPO(seqPlayerIndex, duration, tempoScale) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_TEMPO_CMD << 28) | (SEQCMD_SUB_OP_TEMPO_SCALE << 12) | ((u8)(seqPlayerIndex) << 24) | \
|
||||
((u8)(duration) << 16) | (u16)(tempoScale))
|
||||
|
||||
/**
|
||||
* Reset the tempo of a sequence to the original tempo on a given seqPlayer over a specified duration
|
||||
*
|
||||
* @param seqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param duration duration to transition to the tempo
|
||||
*/
|
||||
#define SEQCMD_RESET_TEMPO(seqPlayerIndex, duration) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_TEMPO_CMD << 28) | (SEQCMD_SUB_OP_TEMPO_RESET << 12) | ((u8)(seqPlayerIndex) << 24) | \
|
||||
((u8)(duration) << 16))
|
||||
|
||||
/**
|
||||
* ==== Audio Sequence Setup Commands ====
|
||||
*
|
||||
* The setup commands are designed to wait to be executed.
|
||||
* Up to 8 commands can be queued per `seqPlayerIndex`.
|
||||
* These commands will only execute once that `seqPlayerIndex` is finished playing and is no longer enabled.
|
||||
* They will often target a different player (`targetSeqPlayerIndex`) but not always.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Setup a request to restore a volume on target seqPlayer once a setup seqPlayer is finished playing and disabled
|
||||
*
|
||||
* @param setupSeqPlayerIndex the index of the seqPlayer to wait for to be disabled
|
||||
* @param targetSeqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param duration duration to transition to the volume
|
||||
*/
|
||||
#define SEQCMD_SETUP_RESTORE_PLAYER_VOLUME(setupSeqPlayerIndex, targetSeqPlayerIndex, duration) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SETUP_CMD << 28) | (SEQCMD_SUB_OP_SETUP_RESTORE_VOLUME << 20) | \
|
||||
((u8)(setupSeqPlayerIndex) << 24) | ((u8)(targetSeqPlayerIndex) << 16) | (u8)(duration))
|
||||
|
||||
/**
|
||||
* Setup a request to unqueue a seqPlayer once that same setup seqPlayer is finished playing and disabled
|
||||
*
|
||||
* @param setupSeqPlayerIndex the index of the seqPlayer to unqueue once the same seqPlayer is disabled
|
||||
*
|
||||
* @bug this command was misimplemented and fails to unqueue. The command relies on `gActiveSeqs.seqId` for
|
||||
* unqueueing, but seqId is reset before being used to unqueue. A simple fix is to unqueue based on
|
||||
* `gActiveSeqs.prevSeqId` instead.
|
||||
*/
|
||||
#define SEQCMD_SETUP_UNQUEUE_SEQUENCE(setupSeqPlayerIndex) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SETUP_CMD << 28) | (SEQCMD_SUB_OP_SETUP_SEQ_UNQUEUE << 20) | \
|
||||
((u8)(setupSeqPlayerIndex) << 24))
|
||||
|
||||
/**
|
||||
* Setup a request to restart and play an active sequence currently playing on a target seqPlayer
|
||||
* once a setup seqPlayer is finished playing and disabled
|
||||
*
|
||||
* @param setupSeqPlayerIndex the index of the seqPlayer to wait for to be disabled
|
||||
* @param targetSeqPlayerIndex the index of the seqPlayer to restart its active sequence
|
||||
*/
|
||||
#define SEQCMD_SETUP_RESTART_SEQUENCE(setupSeqPlayerIndex, targetSeqPlayerIndex) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SETUP_CMD << 28) | (SEQCMD_SUB_OP_SETUP_RESTART_SEQ << 20) | \
|
||||
((u8)(setupSeqPlayerIndex) << 24) | ((u8)(targetSeqPlayerIndex) << 16))
|
||||
|
||||
/**
|
||||
* Setup a request to scale the tempo of a sequence by a multiplicative value on a target seqPlayer
|
||||
* once a setup seqPlayer is finished playing and disabled
|
||||
*
|
||||
* @param setupSeqPlayerIndex the index of the seqPlayer to wait for to be disabled
|
||||
* @param targetSeqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param duration duration to transition to the tempo
|
||||
* @param tempoScale the scaling factor of the tempo, relative to 100
|
||||
*
|
||||
* @note a tempoScale of 200 will go double-time, 50 will go half-time.
|
||||
* the absolute tempo is constrained to a maximum of 300
|
||||
*/
|
||||
#define SEQCMD_SETUP_SCALE_TEMPO(setupSeqPlayerIndex, targetSeqPlayerIndex, duration, tempoScale) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SETUP_CMD << 28) | (SEQCMD_SUB_OP_SETUP_TEMPO_SCALE << 20) | \
|
||||
((u8)(setupSeqPlayerIndex) << 24) | ((u8)(targetSeqPlayerIndex) << 16) | ((u8)(duration) << 8) | \
|
||||
(u8)(tempoScale))
|
||||
|
||||
/**
|
||||
* Setup a request to reset the tempo of a sequence to the original tempo on a target seqPlayer
|
||||
* once a setup seqPlayer is finished playing and disabled
|
||||
*
|
||||
* @param setupSeqPlayerIndex the index of the seqPlayer to wait for to be disabled
|
||||
* @param targetSeqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param duration duration to transition to the tempo
|
||||
*/
|
||||
#define SEQCMD_SETUP_RESET_TEMPO(setupSeqPlayerIndex, targetSeqPlayerIndex, duration) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SETUP_CMD << 28) | (SEQCMD_SUB_OP_SETUP_TEMPO_RESET << 20) | \
|
||||
((u8)(setupSeqPlayerIndex) << 24) | ((u8)(targetSeqPlayerIndex) << 16) | (u8)(duration))
|
||||
|
||||
/**
|
||||
* Setup a request to play a sequence on a target seqPlayer once a setup seqPlayer is finished playing and disabled.
|
||||
* This command is optionally paired with `SEQCMD_SETUP_SET_FADE_IN_TIMER` to set the fade in duration
|
||||
*
|
||||
* @param setupSeqPlayerIndex the index of the seqPlayer to wait for to be disabled
|
||||
* @param targetSeqPlayerIndex the index of the seqPlayer to play the sequence
|
||||
* @param seqId the id of the sequence to play, see `SeqId`
|
||||
*/
|
||||
#define SEQCMD_SETUP_PLAY_SEQUENCE(setupSeqPlayerIndex, targetSeqPlayerIndex, seqId) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SETUP_CMD << 28) | (SEQCMD_SUB_OP_SETUP_PLAY_SEQ << 20) | \
|
||||
((u8)(setupSeqPlayerIndex) << 24) | ((u8)(targetSeqPlayerIndex) << 16) | (u16)(seqId))
|
||||
|
||||
/**
|
||||
* This command is an optional command before `SEQCMD_SETUP_PLAY_SEQUENCE` to set the fade in duration
|
||||
* (see cmd above)
|
||||
*
|
||||
* @param targetSeqPlayerIndex the index of the seqPlayer to play the sequence
|
||||
* @param fadeInDuration duration the sequence will fade in over
|
||||
*/
|
||||
#define SEQCMD_SETUP_SET_FADE_IN_TIMER(targetSeqPlayerIndex, fadeInDuration) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SETUP_CMD << 28) | (SEQCMD_SUB_OP_SETUP_SET_FADE_TIMER << 20) | \
|
||||
((u8)(targetSeqPlayerIndex) << 24) | ((u8)(fadeInDuration) << 8))
|
||||
|
||||
/**
|
||||
* Setup a request to restore a volume on target seqPlayer once a setup seqPlayer is finished playing and disabled.
|
||||
* Specifically, it will only restore volume if the number of queued requests on the setup seqPlayer matches
|
||||
* the number of sequences queued
|
||||
*
|
||||
* @param setupSeqPlayerIndex the index of the seqPlayer to wait for to be disabled
|
||||
* @param targetSeqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param duration duration to transition to the volume
|
||||
* @param numSeqRequests the number of sequence requests queued that must match the actual number of sequence requests
|
||||
*/
|
||||
#define SEQCMD_SETUP_RESTORE_PLAYER_VOLUME_IF_QUEUED(setupSeqPlayerIndex, targetSeqPlayerIndex, duration, \
|
||||
numSeqRequests) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SETUP_CMD << 28) | (SEQCMD_SUB_OP_SETUP_RESTORE_VOLUME_IF_QUEUED << 20) | \
|
||||
((u8)(setupSeqPlayerIndex) << 24) | ((u8)(targetSeqPlayerIndex) << 16) | ((u8)(duration) << 8) | \
|
||||
(u8)(numSeqRequests))
|
||||
|
||||
/**
|
||||
* Setup a request to restore a volume on target seqPlayer once a setup seqPlayer is finished playing and disabled.
|
||||
* Allows `scaleIndex` to be specified.
|
||||
*
|
||||
* @param setupSeqPlayerIndex the index of the seqPlayer to wait for to be disabled
|
||||
* @param targetSeqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param scaleIndex the scale index of a seqPlayer
|
||||
* @param duration duration to transition to the volume
|
||||
*/
|
||||
#define SEQCMD_SETUP_RESTORE_PLAYER_VOLUME_WITH_SCALE_INDEX(setupSeqPlayerIndex, targetSeqPlayerIndex, scaleIndex, duration) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SETUP_CMD << 28) | (SEQCMD_SUB_OP_SETUP_RESTORE_VOLUME_WITH_SCALE_INDEX << 20) | \
|
||||
((u8)(setupSeqPlayerIndex) << 24) | ((u8)(targetSeqPlayerIndex) << 16) | \
|
||||
((u8)(scaleIndex) << 8) | (u8)(duration))
|
||||
|
||||
/**
|
||||
* Setup a request to disable (or reenable) specific channels on a target seqPlayer
|
||||
* once a setup seqPlayer is finished playing and disabled.
|
||||
*
|
||||
* @param setupSeqPlayerIndex the index of the seqPlayer to wait for to be disabled
|
||||
* @param targetSeqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param channelMask a 16 bit mask where each bit maps to a channel. Bitflag on to disable
|
||||
*/
|
||||
#define SEQCMD_SETUP_SET_CHANNEL_DISABLE_MASK(setupSeqPlayerIndex, targetSeqPlayerIndex, channelMask) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SETUP_CMD << 28) | (SEQCMD_SUB_OP_SETUP_SET_CHANNEL_DISABLE_MASK << 20) | \
|
||||
((u8)(setupSeqPlayerIndex) << 24) | ((u8)(targetSeqPlayerIndex) << 16) | (u16)(channelMask))
|
||||
|
||||
/**
|
||||
* Queue a request to scale the frequency of an entire sequence on a target seqPlayer
|
||||
* once a setup seqPlayer is finished playing and disabled.
|
||||
*
|
||||
* @param setupSeqPlayerIndex the index of the seqPlayer to wait for to be disabled
|
||||
* @param targetSeqPlayerIndex the index of the seqPlayer to modify
|
||||
* @param duration duration to transition to the frequency
|
||||
* @param freqScale the scaling factor to shift the pitch. Ranged from 0-0xFF, with 100 mapping to 1.0f
|
||||
*
|
||||
* @note The base value for frequency, 100, is 10 times smaller than other frequency commands.
|
||||
* 200 will double the frequency (raise an octave), 50 will halve the frequency (lower an octave).
|
||||
*/
|
||||
#define SEQCMD_SETUP_SET_PLAYER_FREQ(setupSeqPlayerIndex, targetSeqPlayerIndex, duration, freqScale) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SETUP_CMD << 28) | (SEQCMD_SUB_OP_SETUP_SET_PLAYER_FREQ << 20) | \
|
||||
((u8)(setupSeqPlayerIndex) << 24) | ((u8)(targetSeqPlayerIndex) << 16) | ((u8)(duration) << 8) | \
|
||||
(u8)(freqScale))
|
||||
|
||||
/**
|
||||
* Queue a request to discard audio data by popping an entry from the persistent caches on the audio heap,
|
||||
* once a setup seqPlayer is finished playing and disabled.
|
||||
*
|
||||
* @param setupSeqPlayerIndex the index of the seqPlayer to wait for to be disabled
|
||||
* @param tableTypeFlag All tables with the flag `(tableTypeFlag & (1 << tableType))` will be discarded. Specifically:
|
||||
* `(tableTypeFlag & 1)` will discard the `SEQUENCE_TABLE`
|
||||
* `(tableTypeFlag & 2)` will discard the `FONT_TABLE`
|
||||
* `(tableTypeFlag & 4)` will discard the `SAMPLE_TABLE`
|
||||
*/
|
||||
#define SEQCMD_SETUP_POP_PERSISTENT_CACHE(setupSeqPlayerIndex, tableTypeFlag) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SETUP_CMD << 28) | (SEQCMD_SUB_OP_SETUP_POP_PERSISTENT_CACHE << 20) | \
|
||||
((u8)(setupSeqPlayerIndex) << 24) | ((u8)tableTypeFlag))
|
||||
|
||||
/**
|
||||
* Discard all setup command requests on a seqPlayerIndex by resetting the setup command queue
|
||||
*
|
||||
* @param setupSeqPlayerIndex the index of the seqPlayer to disable all setup commands
|
||||
*/
|
||||
#define SEQCMD_RESET_SETUP_CMDS(setupSeqPlayerIndex) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_SETUP_CMD << 28) | (SEQCMD_SUB_OP_SETUP_RESET_SETUP_CMDS << 20) | \
|
||||
((u8)(setupSeqPlayerIndex) << 24))
|
||||
|
||||
/**
|
||||
* ==== Audio Sequence Global Commands ====
|
||||
*
|
||||
* The global commands will apply to the entire audio system and all 4 sequence players
|
||||
*/
|
||||
|
||||
/**
|
||||
* Change the sound mode of audio
|
||||
*
|
||||
* @param soundMode see the `SoundMode` enum
|
||||
*/
|
||||
#define SEQCMD_SET_SOUND_MODE(soundMode) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_GLOBAL_CMD << 28) | (SEQCMD_SUB_OP_GLOBAL_SET_SOUND_MODE << 8) | (u8)(soundMode))
|
||||
|
||||
/**
|
||||
* Disable (or reenable) new sequences from starting
|
||||
*
|
||||
* @param isDisabled true to disable, false to enable
|
||||
*
|
||||
* @note this does not disable the sfx player
|
||||
*/
|
||||
#define SEQCMD_DISABLE_PLAY_SEQUENCES(isDisabled) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_GLOBAL_CMD << 28) | (SEQCMD_SUB_OP_GLOBAL_DISABLE_NEW_SEQUENCES << 8) | \
|
||||
(u16)(isDisabled))
|
||||
|
||||
/**
|
||||
* Restart the audio heap with the specified settings
|
||||
*
|
||||
* @param sfxChannelLayout index for different mappings between the 7 banks and the 16 channels
|
||||
* @param specId index for the audio specifications to set high-level audio parameters
|
||||
*
|
||||
* @note: For sfxChannelLayout, There are 4 possible layouts indexed by 0-3.
|
||||
* However, only index 0 is properly implemented. Other indices lead to bugs and softlocks.
|
||||
*/
|
||||
#define SEQCMD_RESET_AUDIO_HEAP(sfxChannelLayout, specId) \
|
||||
Audio_QueueSeqCmd((SEQCMD_OP_RESET_AUDIO_HEAP << 28) | ((u8)(sfxChannelLayout) << 8) | (u8)(specId))
|
||||
|
||||
#endif
|
|
@ -1,121 +1,121 @@
|
|||
#ifndef SEQUENCE_H
|
||||
#define SEQUENCE_H
|
||||
|
||||
#define NA_BGM_STOP 0x100000FF
|
||||
|
||||
#define NA_BGM_GENERAL_SFX 0x0 // General Sound Effects
|
||||
#define NA_BGM_NATURE_AMBIENCE 0x1 // Environmental nature background sounds
|
||||
#define NA_BGM_FIELD_LOGIC 0x2 // Hyrule Field
|
||||
#define NA_BGM_FIELD_INIT 0x3 // Hyrule Field Initial Segment From Loading Area
|
||||
#define NA_BGM_FIELD_DEFAULT_1 0x4 // Hyrule Field Moving Segment 1
|
||||
#define NA_BGM_FIELD_DEFAULT_2 0x5 // Hyrule Field Moving Segment 2
|
||||
#define NA_BGM_FIELD_DEFAULT_3 0x6 // Hyrule Field Moving Segment 3
|
||||
#define NA_BGM_FIELD_DEFAULT_4 0x7 // Hyrule Field Moving Segment 4
|
||||
#define NA_BGM_FIELD_DEFAULT_5 0x8 // Hyrule Field Moving Segment 5
|
||||
#define NA_BGM_FIELD_DEFAULT_6 0x9 // Hyrule Field Moving Segment 6
|
||||
#define NA_BGM_FIELD_DEFAULT_7 0x0A // Hyrule Field Moving Segment 7
|
||||
#define NA_BGM_FIELD_DEFAULT_8 0x0B // Hyrule Field Moving Segment 8
|
||||
#define NA_BGM_FIELD_DEFAULT_9 0x0C // Hyrule Field Moving Segment 9
|
||||
#define NA_BGM_FIELD_DEFAULT_A 0x0D // Hyrule Field Moving Segment 10
|
||||
#define NA_BGM_FIELD_DEFAULT_B 0x0E // Hyrule Field Moving Segment 11
|
||||
#define NA_BGM_FIELD_ENEMY_INIT 0x0F // Hyrule Field Enemy Approaches
|
||||
#define NA_BGM_FIELD_ENEMY_1 0x10 // Hyrule Field Enemy Near Segment 1
|
||||
#define NA_BGM_FIELD_ENEMY_2 0x11 // Hyrule Field Enemy Near Segment 2
|
||||
#define NA_BGM_FIELD_ENEMY_3 0x12 // Hyrule Field Enemy Near Segment 3
|
||||
#define NA_BGM_FIELD_ENEMY_4 0x13 // Hyrule Field Enemy Near Segment 4
|
||||
#define NA_BGM_FIELD_STILL_1 0x14 // Hyrule Field Standing Still Segment 1
|
||||
#define NA_BGM_FIELD_STILL_2 0x15 // Hyrule Field Standing Still Segment 2
|
||||
#define NA_BGM_FIELD_STILL_3 0x16 // Hyrule Field Standing Still Segment 3
|
||||
#define NA_BGM_FIELD_STILL_4 0x17 // Hyrule Field Standing Still Segment 4
|
||||
#define NA_BGM_DUNGEON 0x18 // Dodongo's Cavern
|
||||
#define NA_BGM_KAKARIKO_ADULT 0x19 // Kakariko Village (Adult)
|
||||
#define NA_BGM_ENEMY 0x1A // Battle
|
||||
#define NA_BGM_BOSS 0x1B // Boss Battle "NA_BGM_BOSS00"
|
||||
#define NA_BGM_INSIDE_DEKU_TREE 0x1C // Inside the Deku Tree "NA_BGM_FAIRY_DUNGEON"
|
||||
#define NA_BGM_MARKET 0x1D // Market
|
||||
#define NA_BGM_TITLE 0x1E // Title Theme
|
||||
#define NA_BGM_LINK_HOUSE 0x1F // House
|
||||
#define NA_BGM_GAME_OVER 0x20 // Game Over
|
||||
#define NA_BGM_BOSS_CLEAR 0x21 // Boss Clear
|
||||
#define NA_BGM_ITEM_GET 0x22 // Obtain Item
|
||||
#define NA_BGM_OPENING_GANON 0x23 // Enter Ganondorf
|
||||
#define NA_BGM_HEART_GET 0x24 // Obtain Heart Container
|
||||
#define NA_BGM_OCA_LIGHT 0x25 // Prelude of Light
|
||||
#define NA_BGM_JABU_JABU 0x26 // Inside Jabu-Jabu's Belly "NA_BGM_BUYO_DUNGEON"
|
||||
#define NA_BGM_KAKARIKO_KID 0x27 // Kakariko Village (Child)
|
||||
#define NA_BGM_GREAT_FAIRY 0x28 // Great Fairy's Fountain "NA_BGM_GODESS"
|
||||
#define NA_BGM_ZELDA_THEME 0x29 // Zelda's Theme "NA_BGM_HIME"
|
||||
#define NA_BGM_FIRE_TEMPLE 0x2A // Fire Temple "NA_BGM_FIRE_DUNGEON"
|
||||
#define NA_BGM_OPEN_TRE_BOX 0x2B // Open Treasure Chest
|
||||
#define NA_BGM_FOREST_TEMPLE 0x2C // Forest Temple "NA_BGM_FORST_DUNGEON"
|
||||
#define NA_BGM_COURTYARD 0x2D // Hyrule Castle Courtyard "NA_BGM_HIRAL_GARDEN"
|
||||
#define NA_BGM_GANON_TOWER 0x2E // Ganondorf's Theme
|
||||
#define NA_BGM_LONLON 0x2F // Lon Lon Ranch "NA_BGM_RONRON"
|
||||
#define NA_BGM_GORON_CITY 0x30 // Goron City "NA_BGM_GORON"
|
||||
#define NA_BGM_FIELD_MORNING 0x31 // Hyrule Field Morning Theme
|
||||
#define NA_BGM_SPIRITUAL_STONE 0x32 // Spiritual Stone Get "NA_BGM_SPIRIT_STONE"
|
||||
#define NA_BGM_OCA_BOLERO 0x33 // Bolero of Fire "NA_BGM_OCA_FLAME"
|
||||
#define NA_BGM_OCA_MINUET 0x34 // Minuet of Forest "NA_BGM_OCA_WIND"
|
||||
#define NA_BGM_OCA_SERENADE 0x35 // Serenade of Water "NA_BGM_OCA_WATER"
|
||||
#define NA_BGM_OCA_REQUIEM 0x36 // Requiem of Spirit "NA_BGM_OCA_SOUL"
|
||||
#define NA_BGM_OCA_NOCTURNE 0x37 // Nocturne of Shadow "NA_BGM_OCA_DARKNESS"
|
||||
#define NA_BGM_MINI_BOSS 0x38 // Mini-Boss Battle "NA_BGM_MIDDLE_BOSS"
|
||||
#define NA_BGM_SMALL_ITEM_GET 0x39 // Obtain Small Item "NA_BGM_S_ITEM_GET"
|
||||
#define NA_BGM_TEMPLE_OF_TIME 0x3A // Temple of Time "NA_BGM_SHRINE_OF_TIME"
|
||||
#define NA_BGM_EVENT_CLEAR 0x3B // Escape from Lon Lon Ranch
|
||||
#define NA_BGM_KOKIRI 0x3C // Kokiri Forest
|
||||
#define NA_BGM_OCA_FAIRY_GET 0x3D // Obtain Fairy Ocarina "NA_BGM_OCA_YOUSEI"
|
||||
#define NA_BGM_SARIA_THEME 0x3E // Lost Woods "NA_BGM_MAYOIMORI"
|
||||
#define NA_BGM_SPIRIT_TEMPLE 0x3F // Spirit Temple "NA_BGM_SOUL_DUNGEON"
|
||||
#define NA_BGM_HORSE 0x40 // Horse Race
|
||||
#define NA_BGM_HORSE_GOAL 0x41 // Horse Race Goal
|
||||
#define NA_BGM_INGO 0x42 // Ingo's Theme
|
||||
#define NA_BGM_MEDALLION_GET 0x43 // Obtain Medallion "NA_BGM_MEDAL_GET"
|
||||
#define NA_BGM_OCA_SARIA 0x44 // Ocarina Saria's Song
|
||||
#define NA_BGM_OCA_EPONA 0x45 // Ocarina Epona's Song
|
||||
#define NA_BGM_OCA_ZELDA 0x46 // Ocarina Zelda's Lullaby
|
||||
#define NA_BGM_OCA_SUNS 0x47 // Ocarina Sun's Song "NA_BGM_OCA_SUNMOON"
|
||||
#define NA_BGM_OCA_TIME 0x48 // Ocarina Song of Time
|
||||
#define NA_BGM_OCA_STORM 0x49 // Ocarina Song of Storms
|
||||
#define NA_BGM_NAVI_OPENING 0x4A // Fairy Flying "NA_BGM_NAVI"
|
||||
#define NA_BGM_DEKU_TREE_CS 0x4B // Deku Tree "NA_BGM_DEKUNOKI"
|
||||
#define NA_BGM_WINDMILL 0x4C // Windmill Hut "NA_BGM_FUSHA"
|
||||
#define NA_BGM_HYRULE_CS 0x4D // Legend of Hyrule "NA_BGM_HIRAL_DEMO"
|
||||
#define NA_BGM_MINI_GAME 0x4E // Shooting Gallery
|
||||
#define NA_BGM_SHEIK 0x4F // Sheik's Theme "NA_BGM_SEAK"
|
||||
#define NA_BGM_ZORA_DOMAIN 0x50 // Zora's Domain "NA_BGM_ZORA"
|
||||
#define NA_BGM_APPEAR 0x51 // Enter Zelda
|
||||
#define NA_BGM_ADULT_LINK 0x52 // Goodbye to Zelda
|
||||
#define NA_BGM_MASTER_SWORD 0x53 // Master Sword
|
||||
#define NA_BGM_INTRO_GANON 0x54
|
||||
#define NA_BGM_SHOP 0x55 // Shop
|
||||
#define NA_BGM_CHAMBER_OF_SAGES 0x56 // Chamber of the Sages "NA_BGM_KENJA"
|
||||
#define NA_BGM_FILE_SELECT 0x57 // File Select
|
||||
#define NA_BGM_ICE_CAVERN 0x58 // Ice Cavern "NA_BGM_ICE_DUNGEON"
|
||||
#define NA_BGM_DOOR_OF_TIME 0x59 // Open Door of Temple of Time "NA_BGM_GATE_OPEN"
|
||||
#define NA_BGM_OWL 0x5A // Kaepora Gaebora's Theme
|
||||
#define NA_BGM_SHADOW_TEMPLE 0x5B // Shadow Temple "NA_BGM_DARKNESS_DUNGEON"
|
||||
#define NA_BGM_WATER_TEMPLE 0x5C // Water Temple "NA_BGM_AQUA_DUNGEON"
|
||||
#define NA_BGM_BRIDGE_TO_GANONS 0x5D // Ganon's Castle Bridge "NA_BGM_BRIDGE"
|
||||
#define NA_BGM_OCARINA_OF_TIME 0x5E // Ocarina of Time "NA_BGM_SARIA"
|
||||
#define NA_BGM_GERUDO_VALLEY 0x5F // Gerudo Valley "NA_BGM_GERUDO"
|
||||
#define NA_BGM_POTION_SHOP 0x60 // Potion Shop "NA_BGM_DRUGSTORE"
|
||||
#define NA_BGM_KOTAKE_KOUME 0x61 // Kotake & Koume's Theme
|
||||
#define NA_BGM_ESCAPE 0x62 // Escape from Ganon's Castle
|
||||
#define NA_BGM_UNDERGROUND 0x63 // Ganon's Castle Under Ground
|
||||
#define NA_BGM_GANONDORF_BOSS 0x64 // Ganondorf Battle
|
||||
#define NA_BGM_GANON_BOSS 0x65 // Ganon Battle
|
||||
#define NA_BGM_END_DEMO 0x66 // Seal of Six Sages
|
||||
#define NA_BGM_STAFF_1 0x67 // End Credits I
|
||||
#define NA_BGM_STAFF_2 0x68 // End Credits II
|
||||
#define NA_BGM_STAFF_3 0x69 // End Credits III
|
||||
#define NA_BGM_STAFF_4 0x6A // End Credits IV
|
||||
#define NA_BGM_FIRE_BOSS 0x6B // King Dodongo & Volvagia Boss Battle "NA_BGM_BOSS01"
|
||||
#define NA_BGM_TIMED_MINI_GAME 0x6C // Mini-Game
|
||||
#define NA_BGM_CUTSCENE_EFFECTS 0x6D // A small collection of various cutscene sounds
|
||||
#define NA_BGM_NO_MUSIC 0x7F // No bgm music is played
|
||||
#define NA_BGM_NATURE_SFX_RAIN 0x80 // Related to rain
|
||||
#define NA_BGM_DISABLED 0xFFFF
|
||||
typedef enum {
|
||||
/* 0x00 */ NA_BGM_GENERAL_SFX, // General Sound Effects
|
||||
/* 0x01 */ NA_BGM_NATURE_AMBIENCE, // Environmental nature background sounds
|
||||
/* 0x02 */ NA_BGM_FIELD_LOGIC, // Hyrule Field
|
||||
/* 0x03 */ NA_BGM_FIELD_INIT, // Hyrule Field Initial Segment From Loading Area
|
||||
/* 0x04 */ NA_BGM_FIELD_DEFAULT_1, // Hyrule Field Moving Segment 1
|
||||
/* 0x05 */ NA_BGM_FIELD_DEFAULT_2, // Hyrule Field Moving Segment 2
|
||||
/* 0x06 */ NA_BGM_FIELD_DEFAULT_3, // Hyrule Field Moving Segment 3
|
||||
/* 0x07 */ NA_BGM_FIELD_DEFAULT_4, // Hyrule Field Moving Segment 4
|
||||
/* 0x08 */ NA_BGM_FIELD_DEFAULT_5, // Hyrule Field Moving Segment 5
|
||||
/* 0x09 */ NA_BGM_FIELD_DEFAULT_6, // Hyrule Field Moving Segment 6
|
||||
/* 0x0A */ NA_BGM_FIELD_DEFAULT_7, // Hyrule Field Moving Segment 7
|
||||
/* 0x0B */ NA_BGM_FIELD_DEFAULT_8, // Hyrule Field Moving Segment 8
|
||||
/* 0x0C */ NA_BGM_FIELD_DEFAULT_9, // Hyrule Field Moving Segment 9
|
||||
/* 0x0D */ NA_BGM_FIELD_DEFAULT_A, // Hyrule Field Moving Segment 10
|
||||
/* 0x0E */ NA_BGM_FIELD_DEFAULT_B, // Hyrule Field Moving Segment 11
|
||||
/* 0x0F */ NA_BGM_FIELD_ENEMY_INIT, // Hyrule Field Enemy Approaches
|
||||
/* 0x10 */ NA_BGM_FIELD_ENEMY_1, // Hyrule Field Enemy Near Segment 1
|
||||
/* 0x11 */ NA_BGM_FIELD_ENEMY_2, // Hyrule Field Enemy Near Segment 2
|
||||
/* 0x12 */ NA_BGM_FIELD_ENEMY_3, // Hyrule Field Enemy Near Segment 3
|
||||
/* 0x13 */ NA_BGM_FIELD_ENEMY_4, // Hyrule Field Enemy Near Segment 4
|
||||
/* 0x14 */ NA_BGM_FIELD_STILL_1, // Hyrule Field Standing Still Segment 1
|
||||
/* 0x15 */ NA_BGM_FIELD_STILL_2, // Hyrule Field Standing Still Segment 2
|
||||
/* 0x16 */ NA_BGM_FIELD_STILL_3, // Hyrule Field Standing Still Segment 3
|
||||
/* 0x17 */ NA_BGM_FIELD_STILL_4, // Hyrule Field Standing Still Segment 4
|
||||
/* 0x18 */ NA_BGM_DUNGEON, // Dodongo's Cavern
|
||||
/* 0x19 */ NA_BGM_KAKARIKO_ADULT, // Kakariko Village (Adult)
|
||||
/* 0x1A */ NA_BGM_ENEMY, // Battle
|
||||
/* 0x1B */ NA_BGM_BOSS, // Boss Battle "NA_BGM_BOSS00"
|
||||
/* 0x1C */ NA_BGM_INSIDE_DEKU_TREE, // Inside the Deku Tree "NA_BGM_FAIRY_DUNGEON"
|
||||
/* 0x1D */ NA_BGM_MARKET, // Market
|
||||
/* 0x1E */ NA_BGM_TITLE, // Title Theme
|
||||
/* 0x1F */ NA_BGM_LINK_HOUSE, // House
|
||||
/* 0x20 */ NA_BGM_GAME_OVER, // Game Over
|
||||
/* 0x21 */ NA_BGM_BOSS_CLEAR, // Boss Clear
|
||||
/* 0x22 */ NA_BGM_ITEM_GET, // Obtain Item
|
||||
/* 0x23 */ NA_BGM_OPENING_GANON, // Enter Ganondorf
|
||||
/* 0x24 */ NA_BGM_HEART_GET, // Obtain Heart Container
|
||||
/* 0x25 */ NA_BGM_OCA_LIGHT, // Prelude of Light
|
||||
/* 0x26 */ NA_BGM_JABU_JABU, // Inside Jabu-Jabu's Belly "NA_BGM_BUYO_DUNGEON"
|
||||
/* 0x27 */ NA_BGM_KAKARIKO_KID, // Kakariko Village (Child)
|
||||
/* 0x28 */ NA_BGM_GREAT_FAIRY, // Great Fairy's Fountain "NA_BGM_GODESS"
|
||||
/* 0x29 */ NA_BGM_ZELDA_THEME, // Zelda's Theme "NA_BGM_HIME"
|
||||
/* 0x2A */ NA_BGM_FIRE_TEMPLE, // Fire Temple "NA_BGM_FIRE_DUNGEON"
|
||||
/* 0x2B */ NA_BGM_OPEN_TRE_BOX, // Open Treasure Chest
|
||||
/* 0x2C */ NA_BGM_FOREST_TEMPLE, // Forest Temple "NA_BGM_FORST_DUNGEON"
|
||||
/* 0x2D */ NA_BGM_COURTYARD, // Hyrule Castle Courtyard "NA_BGM_HIRAL_GARDEN"
|
||||
/* 0x2E */ NA_BGM_GANON_TOWER, // Ganondorf's Theme
|
||||
/* 0x2F */ NA_BGM_LONLON, // Lon Lon Ranch "NA_BGM_RONRON"
|
||||
/* 0x30 */ NA_BGM_GORON_CITY, // Goron City "NA_BGM_GORON"
|
||||
/* 0x31 */ NA_BGM_FIELD_MORNING, // Hyrule Field Morning Theme
|
||||
/* 0x32 */ NA_BGM_SPIRITUAL_STONE, // Spiritual Stone Get "NA_BGM_SPIRIT_STONE"
|
||||
/* 0x33 */ NA_BGM_OCA_BOLERO, // Bolero of Fire "NA_BGM_OCA_FLAME"
|
||||
/* 0x34 */ NA_BGM_OCA_MINUET, // Minuet of Forest "NA_BGM_OCA_WIND"
|
||||
/* 0x35 */ NA_BGM_OCA_SERENADE, // Serenade of Water "NA_BGM_OCA_WATER"
|
||||
/* 0x36 */ NA_BGM_OCA_REQUIEM, // Requiem of Spirit "NA_BGM_OCA_SOUL"
|
||||
/* 0x37 */ NA_BGM_OCA_NOCTURNE, // Nocturne of Shadow "NA_BGM_OCA_DARKNESS"
|
||||
/* 0x38 */ NA_BGM_MINI_BOSS, // Mini-Boss Battle "NA_BGM_MIDDLE_BOSS"
|
||||
/* 0x39 */ NA_BGM_SMALL_ITEM_GET, // Obtain Small Item "NA_BGM_S_ITEM_GET"
|
||||
/* 0x3A */ NA_BGM_TEMPLE_OF_TIME, // Temple of Time "NA_BGM_SHRINE_OF_TIME"
|
||||
/* 0x3B */ NA_BGM_EVENT_CLEAR, // Escape from Lon Lon Ranch
|
||||
/* 0x3C */ NA_BGM_KOKIRI, // Kokiri Forest
|
||||
/* 0x3D */ NA_BGM_OCA_FAIRY_GET, // Obtain Fairy Ocarina "NA_BGM_OCA_YOUSEI"
|
||||
/* 0x3E */ NA_BGM_SARIA_THEME, // Lost Woods "NA_BGM_MAYOIMORI"
|
||||
/* 0x3F */ NA_BGM_SPIRIT_TEMPLE, // Spirit Temple "NA_BGM_SOUL_DUNGEON"
|
||||
/* 0x40 */ NA_BGM_HORSE, // Horse Race
|
||||
/* 0x41 */ NA_BGM_HORSE_GOAL, // Horse Race Goal
|
||||
/* 0x42 */ NA_BGM_INGO, // Ingo's Theme
|
||||
/* 0x43 */ NA_BGM_MEDALLION_GET, // Obtain Medallion "NA_BGM_MEDAL_GET"
|
||||
/* 0x44 */ NA_BGM_OCA_SARIA, // Ocarina Saria's Song
|
||||
/* 0x45 */ NA_BGM_OCA_EPONA, // Ocarina Epona's Song
|
||||
/* 0x46 */ NA_BGM_OCA_ZELDA, // Ocarina Zelda's Lullaby
|
||||
/* 0x47 */ NA_BGM_OCA_SUNS, // Ocarina Sun's Song "NA_BGM_OCA_SUNMOON"
|
||||
/* 0x48 */ NA_BGM_OCA_TIME, // Ocarina Song of Time
|
||||
/* 0x49 */ NA_BGM_OCA_STORM, // Ocarina Song of Storms
|
||||
/* 0x4A */ NA_BGM_NAVI_OPENING, // Fairy Flying "NA_BGM_NAVI"
|
||||
/* 0x4B */ NA_BGM_DEKU_TREE_CS, // Deku Tree "NA_BGM_DEKUNOKI"
|
||||
/* 0x4C */ NA_BGM_WINDMILL, // Windmill Hut "NA_BGM_FUSHA"
|
||||
/* 0x4D */ NA_BGM_HYRULE_CS, // Legend of Hyrule "NA_BGM_HIRAL_DEMO"
|
||||
/* 0x4E */ NA_BGM_MINI_GAME, // Shooting Gallery
|
||||
/* 0x4F */ NA_BGM_SHEIK, // Sheik's Theme "NA_BGM_SEAK"
|
||||
/* 0x50 */ NA_BGM_ZORA_DOMAIN, // Zora's Domain "NA_BGM_ZORA"
|
||||
/* 0x51 */ NA_BGM_APPEAR, // Enter Zelda
|
||||
/* 0x52 */ NA_BGM_ADULT_LINK, // Goodbye to Zelda
|
||||
/* 0x53 */ NA_BGM_MASTER_SWORD, // Master Sword
|
||||
/* 0x54 */ NA_BGM_INTRO_GANON,
|
||||
/* 0x55 */ NA_BGM_SHOP, // Shop
|
||||
/* 0x56 */ NA_BGM_CHAMBER_OF_SAGES, // Chamber of the Sages "NA_BGM_KENJA"
|
||||
/* 0x57 */ NA_BGM_FILE_SELECT, // File Select
|
||||
/* 0x58 */ NA_BGM_ICE_CAVERN, // Ice Cavern "NA_BGM_ICE_DUNGEON"
|
||||
/* 0x59 */ NA_BGM_DOOR_OF_TIME, // Open Door of Temple of Time "NA_BGM_GATE_OPEN"
|
||||
/* 0x5A */ NA_BGM_OWL, // Kaepora Gaebora's Theme
|
||||
/* 0x5B */ NA_BGM_SHADOW_TEMPLE, // Shadow Temple "NA_BGM_DARKNESS_DUNGEON"
|
||||
/* 0x5C */ NA_BGM_WATER_TEMPLE, // Water Temple "NA_BGM_AQUA_DUNGEON"
|
||||
/* 0x5D */ NA_BGM_BRIDGE_TO_GANONS, // Ganon's Castle Bridge "NA_BGM_BRIDGE"
|
||||
/* 0x5E */ NA_BGM_OCARINA_OF_TIME, // Ocarina of Time "NA_BGM_SARIA"
|
||||
/* 0x5F */ NA_BGM_GERUDO_VALLEY, // Gerudo Valley "NA_BGM_GERUDO"
|
||||
/* 0x60 */ NA_BGM_POTION_SHOP, // Potion Shop "NA_BGM_DRUGSTORE"
|
||||
/* 0x61 */ NA_BGM_KOTAKE_KOUME, // Kotake & Koume's Theme
|
||||
/* 0x62 */ NA_BGM_ESCAPE, // Escape from Ganon's Castle
|
||||
/* 0x63 */ NA_BGM_UNDERGROUND, // Ganon's Castle Under Ground
|
||||
/* 0x64 */ NA_BGM_GANONDORF_BOSS, // Ganondorf Battle
|
||||
/* 0x65 */ NA_BGM_GANON_BOSS, // Ganon Battle
|
||||
/* 0x66 */ NA_BGM_END_DEMO, // Seal of Six Sages
|
||||
/* 0x67 */ NA_BGM_STAFF_1, // End Credits I
|
||||
/* 0x68 */ NA_BGM_STAFF_2, // End Credits II
|
||||
/* 0x69 */ NA_BGM_STAFF_3, // End Credits III
|
||||
/* 0x6A */ NA_BGM_STAFF_4, // End Credits IV
|
||||
/* 0x6B */ NA_BGM_FIRE_BOSS, // King Dodongo & Volvagia Boss Battle "NA_BGM_BOSS01"
|
||||
/* 0x6C */ NA_BGM_TIMED_MINI_GAME, // Mini-Game
|
||||
/* 0x6D */ NA_BGM_CUTSCENE_EFFECTS, // A small collection of various cutscene sounds
|
||||
/* 0x7F */ NA_BGM_NO_MUSIC = 0x7F, // No bgm music is played
|
||||
/* 0x80 */ NA_BGM_NATURE_SFX_RAIN = 0x80, // Related to rain
|
||||
/* 0xFFFF */ NA_BGM_DISABLED = 0xFFFF
|
||||
} SeqId;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SEQ_PLAYER_BGM_MAIN,
|
||||
|
@ -161,6 +161,53 @@ typedef enum {
|
|||
/* 0x7 */ CHANNEL_IO_PORT_7
|
||||
} ChannelIOPort;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ VOL_SCALE_INDEX_BGM_MAIN,
|
||||
/* 1 */ VOL_SCALE_INDEX_FANFARE,
|
||||
/* 2 */ VOL_SCALE_INDEX_SFX,
|
||||
/* 3 */ VOL_SCALE_INDEX_BGM_SUB,
|
||||
/* 4 */ VOL_SCALE_INDEX_MAX
|
||||
} VolumeScaleIndex; // May be worth using SequencePlayerId instead
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ f32 volCur;
|
||||
/* 0x04 */ f32 volTarget;
|
||||
/* 0x08 */ f32 volStep;
|
||||
/* 0x0C */ u16 volTimer;
|
||||
/* 0x10 */ f32 freqScaleCur;
|
||||
/* 0x14 */ f32 freqScaleTarget;
|
||||
/* 0x18 */ f32 freqScaleStep;
|
||||
/* 0x1C */ u16 freqScaleTimer;
|
||||
} ActiveSequenceChannelData; // size = 0x20
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ f32 volCur;
|
||||
/* 0x004 */ f32 volTarget;
|
||||
/* 0x008 */ f32 volStep;
|
||||
/* 0x00C */ u16 volTimer;
|
||||
/* 0x00E */ u8 volScales[VOL_SCALE_INDEX_MAX];
|
||||
/* 0x012 */ u8 volFadeTimer;
|
||||
/* 0x013 */ u8 fadeVolUpdate;
|
||||
/* 0x014 */ u32 tempoCmd;
|
||||
/* 0x018 */ u16 tempoOriginal; // stores the original tempo before modifying it (to reset back to)
|
||||
/* 0x01C */ f32 tempoCur;
|
||||
/* 0x020 */ f32 tempoTarget;
|
||||
/* 0x024 */ f32 tempoStep;
|
||||
/* 0x028 */ u16 tempoTimer;
|
||||
/* 0x02C */ u32 setupCmd[8]; // a queue of cmds to execute once the player is disabled
|
||||
/* 0x04C */ u8 setupCmdTimer; // only execute setup commands when the timer is at 0.
|
||||
/* 0x04D */ u8 setupCmdNum; // number of setup commands requested once the player is disabled
|
||||
/* 0x04E */ u8 setupFadeTimer;
|
||||
/* 0x050 */ ActiveSequenceChannelData channelData[16];
|
||||
/* 0x250 */ u16 freqScaleChannelFlags;
|
||||
/* 0x252 */ u16 volChannelFlags;
|
||||
/* 0x254 */ u16 seqId; // active seqId currently playing. Resets when sequence stops
|
||||
/* 0x256 */ u16 prevSeqId; // last seqId played on a player. Does not reset when sequence stops
|
||||
/* 0x258 */ u16 channelPortMask;
|
||||
/* 0x25C */ u32 startSeqCmd; // This name comes from MM
|
||||
/* 0x260 */ u8 isWaitingForFonts; // This name comes from MM
|
||||
} ActiveSequence; // size = 0x264
|
||||
|
||||
typedef enum {
|
||||
/* 0x0 */ NATURE_CHANNEL_STREAM_0,
|
||||
/* 0x1 */ NATURE_CHANNEL_CRITTER_0,
|
||||
|
@ -175,7 +222,7 @@ typedef enum {
|
|||
/* 0xD */ NATURE_CHANNEL_UNK,
|
||||
/* 0xE */ NATURE_CHANNEL_RAIN,
|
||||
/* 0xF */ NATURE_CHANNEL_LIGHTNING
|
||||
} NatureChannelIdx; // playerIdx = 0 (Overlaps with main bgm)
|
||||
} NatureChannelIndex; // seqPlayerIndex = 0 (Overlaps with main bgm)
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ NATURE_ID_GENERAL_NIGHT,
|
||||
|
|
|
@ -150,10 +150,10 @@ extern s8 gSfxDefaultReverb;
|
|||
extern u8 D_801333F0;
|
||||
extern u8 gAudioSfxSwapOff;
|
||||
extern u8 D_801333F8;
|
||||
extern u8 gSeqCmdWrPos;
|
||||
extern u8 gSeqCmdRdPos;
|
||||
extern u8 D_80133408;
|
||||
extern u8 D_8013340C;
|
||||
extern u8 gSeqCmdWritePos;
|
||||
extern u8 gSeqCmdReadPos;
|
||||
extern u8 gStartSeqDisabled;
|
||||
extern u8 gAudioDebugPrintSeqCmd;
|
||||
extern u8 gSoundModeList[];
|
||||
extern u8 gAudioSpecId;
|
||||
extern u8 D_80133418;
|
||||
|
@ -191,7 +191,7 @@ extern s32 gTrnsnUnkState;
|
|||
extern Color_RGBA8_u32 D_801614B0;
|
||||
extern PreNmiBuff* gAppNmiBufferPtr;
|
||||
extern Scheduler gScheduler;
|
||||
extern u32 gSegments[NUM_SEGMENTS];
|
||||
extern uintptr_t gSegments[NUM_SEGMENTS];
|
||||
extern volatile OSTime D_8016A520;
|
||||
extern volatile OSTime D_8016A528;
|
||||
extern volatile OSTime D_8016A530;
|
||||
|
@ -217,7 +217,7 @@ extern u8 gSfxBankMuted[];
|
|||
extern u16 gAudioSfxSwapSource[10];
|
||||
extern u16 gAudioSfxSwapTarget[10];
|
||||
extern u8 gAudioSfxSwapMode[10];
|
||||
extern unk_D_8016E750 D_8016E750[4];
|
||||
extern ActiveSequence gActiveSeqs[4];
|
||||
extern AudioContext gAudioContext;
|
||||
extern void(*D_801755D0)(void);
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "z64transition.h"
|
||||
#include "z64interface.h"
|
||||
#include "alignment.h"
|
||||
#include "seqcmd.h"
|
||||
#include "sequence.h"
|
||||
#include "sfx.h"
|
||||
#include "color.h"
|
||||
|
@ -36,13 +37,14 @@
|
|||
#include "padmgr.h"
|
||||
#include "fault.h"
|
||||
#include "sched.h"
|
||||
#include "rumble.h"
|
||||
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 240
|
||||
|
||||
#define REGION_NULL 0
|
||||
#define REGION_US 1
|
||||
#define REGION_JP 2
|
||||
#define REGION_JP 1
|
||||
#define REGION_US 2
|
||||
#define REGION_EU 3
|
||||
|
||||
#define THREAD_PRI_IDLE_INIT 10
|
||||
|
@ -708,8 +710,8 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* loadedRamAddr;
|
||||
/* 0x04 */ u32 vromStart;
|
||||
/* 0x08 */ u32 vromEnd;
|
||||
/* 0x04 */ uintptr_t vromStart;
|
||||
/* 0x08 */ uintptr_t vromEnd;
|
||||
/* 0x0C */ void* vramStart;
|
||||
/* 0x10 */ void* vramEnd;
|
||||
/* 0x14 */ u32 offset; // loadedRamAddr - vramStart
|
||||
|
@ -845,7 +847,7 @@ typedef struct {
|
|||
/* 0x022C */ s16 cursorY[5]; // "cur_ypt"
|
||||
/* 0x0236 */ s16 dungeonMapSlot;
|
||||
/* 0x0238 */ s16 cursorSpecialPos; // "key_angle"
|
||||
/* 0x023A */ s16 delaySwitchPageInputTimer; // Used to introduce a delay before switching page when arriving on the "scroll left/right" positions while holding stick left/right.
|
||||
/* 0x023A */ s16 pageSwitchInputTimer; // Used to introduce a delay before switching page when arriving on the "scroll left/right" positions while holding stick left/right.
|
||||
/* 0x023C */ u16 namedItem; // "zoom_name"
|
||||
/* 0x023E */ u16 cursorItem[4]; // "select_name"
|
||||
/* 0x0246 */ u16 cursorSlot[4];
|
||||
|
@ -1431,8 +1433,8 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* loadedRamAddr;
|
||||
/* 0x04 */ u32 vromStart; // if applicable
|
||||
/* 0x08 */ u32 vromEnd; // if applicable
|
||||
/* 0x04 */ uintptr_t vromStart; // if applicable
|
||||
/* 0x08 */ uintptr_t vromEnd; // if applicable
|
||||
/* 0x0C */ void* vramStart; // if applicable
|
||||
/* 0x10 */ void* vramEnd; // if applicable
|
||||
/* 0x14 */ void* unk_14;
|
||||
|
@ -1873,22 +1875,6 @@ typedef struct {
|
|||
/* 0x08 */ Color_RGBA8_u32 envColor;
|
||||
} struct_80166500; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ u8 rumbleEnable[4];
|
||||
/* 0x004 */ u8 unk_04[0x40];
|
||||
/* 0x044 */ u8 unk_44[0x40];
|
||||
/* 0x084 */ u8 unk_84[0x40];
|
||||
/* 0x0C4 */ u8 unk_C4[0x40];
|
||||
/* 0x104 */ u8 unk_104;
|
||||
/* 0x105 */ u8 unk_105;
|
||||
/* 0x106 */ u16 unk_106;
|
||||
/* 0x108 */ u16 unk_108;
|
||||
/* 0x10A */ u8 unk_10A;
|
||||
/* 0x10B */ u8 unk_10B;
|
||||
/* 0x10C */ u8 unk_10C;
|
||||
/* 0x10D */ u8 unk_10D;
|
||||
} UnkRumbleStruct; // size = 0x10E
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0x18];
|
||||
/* 0x18 */ s32 unk_18;
|
||||
|
@ -1953,9 +1939,9 @@ typedef struct {
|
|||
} SkyboxFile; // size = 0x10
|
||||
|
||||
#define ROM_FILE(name) \
|
||||
{ (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomEnd }
|
||||
{ (uintptr_t)_##name##SegmentRomStart, (uintptr_t)_##name##SegmentRomEnd }
|
||||
#define ROM_FILE_EMPTY(name) \
|
||||
{ (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomStart }
|
||||
{ (uintptr_t)_##name##SegmentRomStart, (uintptr_t)_##name##SegmentRomStart }
|
||||
#define ROM_FILE_UNSET \
|
||||
{ 0 }
|
||||
|
||||
|
|
|
@ -85,8 +85,8 @@ typedef struct {
|
|||
#define ACTOROVL_ALLOC_PERSISTENT (1 << 1)
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 vromStart;
|
||||
/* 0x04 */ u32 vromEnd;
|
||||
/* 0x00 */ uintptr_t vromStart;
|
||||
/* 0x04 */ uintptr_t vromEnd;
|
||||
/* 0x08 */ void* vramStart;
|
||||
/* 0x0C */ void* vramEnd;
|
||||
/* 0x10 */ void* loadedRamAddr; // original name: "allocp"
|
||||
|
|
|
@ -975,43 +975,4 @@ typedef struct {
|
|||
/* 0x08 */ u32 permanentPoolSize;
|
||||
} AudioHeapInitSizes; // size = 0xC
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ f32 unk_00;
|
||||
/* 0x04 */ f32 unk_04;
|
||||
/* 0x08 */ f32 unk_08;
|
||||
/* 0x0C */ u16 unk_0C;
|
||||
/* 0x10 */ f32 unk_10;
|
||||
/* 0x14 */ f32 unk_14;
|
||||
/* 0x18 */ f32 unk_18;
|
||||
/* 0x1C */ u16 unk_1C;
|
||||
} unk_50_s; // size = 0x20
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ f32 volCur;
|
||||
/* 0x004 */ f32 volTarget;
|
||||
/* 0x008 */ f32 unk_08;
|
||||
/* 0x00C */ u16 unk_0C;
|
||||
/* 0x00E */ u8 volScales[0x4];
|
||||
/* 0x012 */ u8 volFadeTimer;
|
||||
/* 0x013 */ u8 fadeVolUpdate;
|
||||
/* 0x014 */ u32 unk_14;
|
||||
/* 0x018 */ u16 unk_18;
|
||||
/* 0x01C */ f32 unk_1C;
|
||||
/* 0x020 */ f32 unk_20;
|
||||
/* 0x024 */ f32 unk_24;
|
||||
/* 0x028 */ u16 unk_28;
|
||||
/* 0x02C */ u32 unk_2C[8];
|
||||
/* 0x04C */ u8 unk_4C;
|
||||
/* 0x04D */ u8 unk_4D;
|
||||
/* 0x04E */ u8 unk_4E;
|
||||
/* 0x050 */ unk_50_s unk_50[0x10];
|
||||
/* 0x250 */ u16 unk_250;
|
||||
/* 0x252 */ u16 unk_252;
|
||||
/* 0x254 */ u16 unk_254;
|
||||
/* 0x256 */ u16 unk_256;
|
||||
/* 0x258 */ u16 unk_258;
|
||||
/* 0x25C */ u32 unk_25C;
|
||||
/* 0x260 */ u8 unk_260;
|
||||
} unk_D_8016E750; // size = 0x264
|
||||
|
||||
#endif
|
||||
|
|
|
@ -202,8 +202,8 @@ typedef struct {
|
|||
} EffectSsInit; // size = 0x08
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 vromStart;
|
||||
/* 0x04 */ u32 vromEnd;
|
||||
/* 0x00 */ uintptr_t vromStart;
|
||||
/* 0x04 */ uintptr_t vromEnd;
|
||||
/* 0x08 */ void* vramStart;
|
||||
/* 0x0C */ void* vramEnd;
|
||||
/* 0x10 */ void* loadedRamAddr;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
#include "command_macros_base.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 vromStart;
|
||||
/* 0x04 */ u32 vromEnd;
|
||||
/* 0x00 */ uintptr_t vromStart;
|
||||
/* 0x04 */ uintptr_t vromEnd;
|
||||
} RomFile; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
|
|
6
spec
6
spec
|
@ -38,7 +38,7 @@ beginseg
|
|||
include "build/src/libultra/os/exceptasm.o"
|
||||
include "build/src/libultra/os/dequeuethread.o"
|
||||
include "build/src/libultra/os/destroythread.o"
|
||||
include "build/src/libultra/libc//bzero.o"
|
||||
include "build/src/libultra/libc/bzero.o"
|
||||
include "build/src/libultra/os/parameters.o"
|
||||
include "build/src/libultra/os/createthread.o"
|
||||
include "build/src/libultra/os/setsr.o"
|
||||
|
@ -360,7 +360,7 @@ beginseg
|
|||
include "build/src/code/z_skin_matrix.o"
|
||||
include "build/src/code/z_sram.o"
|
||||
include "build/src/code/z_ss_sram.o"
|
||||
include "build/src/code/code_800A9F30.o"
|
||||
include "build/src/code/z_rumble.o"
|
||||
include "build/data/z_text.data.o"
|
||||
include "build/data/unk_8012ABC0.data.o"
|
||||
include "build/src/code/z_view.o"
|
||||
|
@ -402,7 +402,7 @@ beginseg
|
|||
include "build/src/code/sys_math_atan.o"
|
||||
include "build/src/code/sys_matrix.o"
|
||||
include "build/src/code/sys_ucode.o"
|
||||
include "build/src/code/code_800D2E30.o"
|
||||
include "build/src/code/sys_rumble.o"
|
||||
include "build/src/code/code_800D31A0.o"
|
||||
include "build/src/code/irqmgr.o"
|
||||
include "build/src/code/debug_malloc.o"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
StackEntry* sStackInfoListStart = NULL;
|
||||
StackEntry* sStackInfoListEnd = NULL;
|
||||
|
||||
void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace,
|
||||
void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 initValue, s32 minSpace,
|
||||
const char* name) {
|
||||
StackEntry* iter;
|
||||
u32* addr;
|
||||
|
@ -12,8 +12,8 @@ void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 i
|
|||
if (entry == NULL) {
|
||||
sStackInfoListStart = NULL;
|
||||
} else {
|
||||
entry->head = stackTop;
|
||||
entry->tail = stackBottom;
|
||||
entry->head = stackBottom;
|
||||
entry->tail = stackTop;
|
||||
entry->initValue = initValue;
|
||||
entry->minSpace = minSpace;
|
||||
entry->name = name;
|
||||
|
|
|
@ -9,12 +9,12 @@ void Locale_Init(void) {
|
|||
osEPiReadIo(gCartHandle, 0x3C, &sCartInfo.regionInfo);
|
||||
|
||||
switch (sCartInfo.countryCode) {
|
||||
case 'J': // "NTSC-U (North America)"
|
||||
gCurrentRegion = REGION_US;
|
||||
break;
|
||||
case 'E': // "NTSC-J (Japan)"
|
||||
case 'J': // "NTSC-J (Japan)"
|
||||
gCurrentRegion = REGION_JP;
|
||||
break;
|
||||
case 'E': // "NTSC-U (North America)"
|
||||
gCurrentRegion = REGION_US;
|
||||
break;
|
||||
case 'P': // "PAL (Europe)"
|
||||
gCurrentRegion = REGION_EU;
|
||||
break;
|
||||
|
|
|
@ -445,7 +445,7 @@ s32 DmaMgr_SendRequest1(void* ram, uintptr_t vrom, u32 size, const char* file, s
|
|||
req.filename = file;
|
||||
req.line = line;
|
||||
osCreateMesgQueue(&queue, &msg, 1);
|
||||
ret = DmaMgr_SendRequestImpl(&req, ram, vrom, size, 0, &queue, 0);
|
||||
ret = DmaMgr_SendRequestImpl(&req, ram, vrom, size, 0, &queue, NULL);
|
||||
if (ret == -1) {
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -553,7 +553,7 @@ EnvelopePoint gDefaultEnvelope[] = {
|
|||
NoteSubEu gZeroNoteSub = { 0 };
|
||||
|
||||
NoteSubEu gDefaultNoteSub = {
|
||||
{ 1, 1, 0, 0, 0, 0, 0, 0 }, { 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
{ 1, 1, 0, 0, 0, 0, 0, 0 }, { 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 0,
|
||||
};
|
||||
|
||||
u16 gHaasEffectDelaySizes[64] = {
|
||||
|
|
|
@ -52,10 +52,10 @@ u8 D_801333F8 = 0;
|
|||
|
||||
s32 D_801333FC = 0; // unused
|
||||
|
||||
u8 gSeqCmdWrPos = 0;
|
||||
u8 gSeqCmdRdPos = 0;
|
||||
u8 D_80133408 = 0;
|
||||
u8 D_8013340C = 1;
|
||||
u8 gSeqCmdWritePos = 0;
|
||||
u8 gSeqCmdReadPos = 0;
|
||||
u8 gStartSeqDisabled = false;
|
||||
u8 gAudioDebugPrintSeqCmd = true;
|
||||
|
||||
u8 gSoundModeList[] = {
|
||||
SOUNDMODE_STEREO,
|
||||
|
|
|
@ -1085,7 +1085,7 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS
|
|||
}
|
||||
|
||||
filter = noteSubEu->filter;
|
||||
if (filter != 0) {
|
||||
if (filter != NULL) {
|
||||
AudioSynth_LoadFilterSize(cmd++, aiBufLen * SAMPLE_SIZE, filter);
|
||||
AudioSynth_LoadFilterBuffer(cmd++, flags, DMEM_TEMP, synthState->synthesisBuffers->mixEnvelopeState);
|
||||
}
|
||||
|
|
|
@ -1,91 +0,0 @@
|
|||
#include "global.h"
|
||||
|
||||
UnkRumbleStruct D_80160FD0;
|
||||
|
||||
void func_800A9F30(PadMgr* a, s32 b) {
|
||||
func_800D2E30(&D_80160FD0);
|
||||
PadMgr_RumbleSet(a, D_80160FD0.rumbleEnable);
|
||||
}
|
||||
|
||||
void func_800A9F6C(f32 a, u8 b, u8 c, u8 d) {
|
||||
s32 temp1;
|
||||
s32 temp2;
|
||||
|
||||
if (1000000.0f < a) {
|
||||
temp1 = 1000;
|
||||
} else {
|
||||
temp1 = sqrtf(a);
|
||||
}
|
||||
|
||||
if ((temp1 < 1000) && (b != 0) && (d != 0)) {
|
||||
temp2 = b - (temp1 * 255) / 1000;
|
||||
if (temp2 > 0) {
|
||||
D_80160FD0.unk_10A = temp2;
|
||||
D_80160FD0.unk_10B = c;
|
||||
D_80160FD0.unk_10C = d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_800AA000(f32 a, u8 b, u8 c, u8 d) {
|
||||
s32 temp1;
|
||||
s32 temp2;
|
||||
s32 i;
|
||||
|
||||
if (1000000.0f < a) {
|
||||
temp1 = 1000;
|
||||
} else {
|
||||
temp1 = sqrtf(a);
|
||||
}
|
||||
|
||||
if (temp1 < 1000 && b != 0 && d != 0) {
|
||||
temp2 = b - (temp1 * 255) / 1000;
|
||||
|
||||
for (i = 0; i < 0x40; i++) {
|
||||
if (D_80160FD0.unk_04[i] == 0) {
|
||||
if (temp2 > 0) {
|
||||
D_80160FD0.unk_04[i] = temp2;
|
||||
D_80160FD0.unk_44[i] = c;
|
||||
D_80160FD0.unk_84[i] = d;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_800AA0B4(void) {
|
||||
func_800D3140(&D_80160FD0);
|
||||
|
||||
gPadMgr.retraceCallback = func_800A9F30;
|
||||
gPadMgr.retraceCallbackValue = 0;
|
||||
|
||||
if (1) {}
|
||||
}
|
||||
|
||||
void func_800AA0F0(void) {
|
||||
PadMgr* padmgr = &gPadMgr;
|
||||
|
||||
if ((padmgr->retraceCallback == func_800A9F30) && (padmgr->retraceCallbackValue == 0)) {
|
||||
padmgr->retraceCallback = NULL;
|
||||
padmgr->retraceCallbackValue = 0;
|
||||
}
|
||||
|
||||
func_800D3178(&D_80160FD0);
|
||||
}
|
||||
|
||||
u32 func_800AA148(void) {
|
||||
return gPadMgr.pakType[0] == 1;
|
||||
}
|
||||
|
||||
void func_800AA15C(void) {
|
||||
D_80160FD0.unk_104 = 2;
|
||||
}
|
||||
|
||||
void func_800AA16C(void) {
|
||||
D_80160FD0.unk_104 = 0;
|
||||
}
|
||||
|
||||
void func_800AA178(u32 a) {
|
||||
D_80160FD0.unk_105 = !!a;
|
||||
}
|
|
@ -1,119 +0,0 @@
|
|||
#include "global.h"
|
||||
|
||||
void func_800D2E30(UnkRumbleStruct* arg0) {
|
||||
static u8 D_8012DBB0 = 1;
|
||||
s32 i;
|
||||
s32 unk_a3;
|
||||
s32 index = -1;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
arg0->rumbleEnable[i] = 0;
|
||||
}
|
||||
|
||||
if (arg0->unk_105 == 0) {
|
||||
if (D_8012DBB0 != 0) {
|
||||
for (i = 0; i < 4; i++) {
|
||||
gPadMgr.pakType[i] = 0;
|
||||
}
|
||||
}
|
||||
D_8012DBB0 = arg0->unk_105;
|
||||
return;
|
||||
}
|
||||
|
||||
D_8012DBB0 = arg0->unk_105;
|
||||
|
||||
if (arg0->unk_104 == 2) {
|
||||
for (i = 0; i < 4; ++i) {
|
||||
gPadMgr.pakType[i] = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < 0x40; i++) {
|
||||
arg0->unk_C4[i] = 0;
|
||||
arg0->unk_84[i] = 0;
|
||||
arg0->unk_44[i] = 0;
|
||||
arg0->unk_04[i] = 0;
|
||||
}
|
||||
arg0->unk_106 = arg0->unk_108 = arg0->unk_10A = arg0->unk_10B = arg0->unk_10C = arg0->unk_10D = 0;
|
||||
arg0->unk_104 = 1;
|
||||
}
|
||||
if (arg0->unk_104 != 0) {
|
||||
for (i = 0; i < 0x40; i++) {
|
||||
if (arg0->unk_04[i] != 0) {
|
||||
if (arg0->unk_44[i] > 0) {
|
||||
arg0->unk_44[i]--;
|
||||
} else {
|
||||
unk_a3 = arg0->unk_04[i] - arg0->unk_84[i];
|
||||
if (unk_a3 > 0) {
|
||||
arg0->unk_04[i] = unk_a3;
|
||||
} else {
|
||||
arg0->unk_04[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
unk_a3 = arg0->unk_C4[i] + arg0->unk_04[i];
|
||||
arg0->unk_C4[i] = unk_a3;
|
||||
if (index == -1) {
|
||||
index = i;
|
||||
arg0->rumbleEnable[0] = (unk_a3 >= 0x100);
|
||||
} else if (arg0->unk_04[index] < arg0->unk_04[i]) {
|
||||
index = i;
|
||||
arg0->rumbleEnable[0] = (unk_a3 >= 0x100);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (arg0->unk_10A != 0) {
|
||||
if (arg0->unk_10B > 0) {
|
||||
arg0->unk_10B--;
|
||||
} else {
|
||||
unk_a3 = arg0->unk_10A - arg0->unk_10C;
|
||||
if (unk_a3 > 0) {
|
||||
arg0->unk_10A = unk_a3;
|
||||
} else {
|
||||
arg0->unk_10A = 0;
|
||||
}
|
||||
}
|
||||
unk_a3 = arg0->unk_10D + arg0->unk_10A;
|
||||
arg0->unk_10D = unk_a3;
|
||||
arg0->rumbleEnable[0] = (unk_a3 >= 0x100);
|
||||
}
|
||||
if (arg0->unk_10A != 0) {
|
||||
unk_a3 = arg0->unk_10A;
|
||||
} else {
|
||||
if (index == -1) {
|
||||
unk_a3 = 0;
|
||||
} else {
|
||||
unk_a3 = arg0->unk_04[index];
|
||||
}
|
||||
}
|
||||
if (unk_a3 == 0) {
|
||||
if ((++arg0->unk_108) >= 6) {
|
||||
arg0->unk_106 = 0;
|
||||
arg0->unk_108 = 5;
|
||||
}
|
||||
} else {
|
||||
arg0->unk_108 = 0;
|
||||
if ((++arg0->unk_106) >= 0x1C21) {
|
||||
arg0->unk_104 = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 0x40; i++) {
|
||||
arg0->unk_C4[i] = 0;
|
||||
arg0->unk_84[i] = 0;
|
||||
arg0->unk_44[i] = 0;
|
||||
arg0->unk_04[i] = 0;
|
||||
}
|
||||
|
||||
arg0->unk_106 = arg0->unk_108 = arg0->unk_10A = arg0->unk_10B = arg0->unk_10C = arg0->unk_10D = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void func_800D3140(UnkRumbleStruct* arg0) {
|
||||
bzero(arg0, sizeof(UnkRumbleStruct));
|
||||
arg0->unk_104 = 2;
|
||||
arg0->unk_105 = 1;
|
||||
}
|
||||
|
||||
void func_800D3178(UnkRumbleStruct* arg0) {
|
||||
bzero(arg0, sizeof(UnkRumbleStruct));
|
||||
}
|
|
@ -1,27 +1,7 @@
|
|||
#include "ultra64.h"
|
||||
#include "global.h"
|
||||
|
||||
// TODO: can these macros be shared between files? code_800F9280 seems to use
|
||||
// versions without any casts...
|
||||
#define Audio_DisableSeq(playerIdx, fadeOut) Audio_QueueCmdS32(0x83000000 | ((u8)playerIdx << 16), fadeOut)
|
||||
#define Audio_StartSeq(playerIdx, fadeTimer, seqId) \
|
||||
Audio_QueueSeqCmd(0x00000000 | ((u8)playerIdx << 24) | ((u8)(fadeTimer) << 0x10) | (u16)seqId)
|
||||
#define Audio_SeqCmd7(playerIdx, a, b) \
|
||||
Audio_QueueSeqCmd(0x70000000 | ((u8)playerIdx << 0x18) | ((u8)a << 0x10) | (u8)(b))
|
||||
#define Audio_SeqCmdC(playerIdx, a, b, c) \
|
||||
Audio_QueueSeqCmd(0xC0000000 | ((u8)playerIdx << 24) | ((u8)a << 16) | ((u8)b << 8) | ((u8)(c)))
|
||||
#define Audio_SeqCmdA(playerIdx, a) Audio_QueueSeqCmd(0xA0000000 | ((u8)playerIdx << 24) | ((u16)(a)))
|
||||
#define Audio_SeqCmd1(playerIdx, a) Audio_QueueSeqCmd(0x100000FF | ((u8)playerIdx << 24) | ((u8)(a) << 16))
|
||||
#define Audio_SeqCmdB(playerIdx, a, b, c) \
|
||||
Audio_QueueSeqCmd(0xB0000000 | ((u8)playerIdx << 24) | ((u8)a << 16) | ((u8)b << 8) | ((u8)c))
|
||||
#define Audio_SeqCmdB40(playerIdx, a, b) Audio_QueueSeqCmd(0xB0004000 | ((u8)playerIdx << 24) | ((u8)a << 16) | ((u8)b))
|
||||
#define Audio_SeqCmd6(playerIdx, a, b, c) \
|
||||
Audio_QueueSeqCmd(0x60000000 | ((u8)playerIdx << 24) | ((u8)(a) << 16) | ((u8)b << 8) | ((u8)c))
|
||||
#define Audio_SeqCmdE0(playerIdx, a) Audio_QueueSeqCmd(0xE0000000 | ((u8)playerIdx << 24) | ((u8)a))
|
||||
#define Audio_SeqCmdE01(playerIdx, a) Audio_QueueSeqCmd(0xE0000100 | ((u8)playerIdx << 24) | ((u16)a))
|
||||
#define Audio_SeqCmd8(playerIdx, a, b, c) \
|
||||
Audio_QueueSeqCmd(0x80000000 | ((u8)playerIdx << 24) | ((u8)a << 16) | ((u8)b << 8) | ((u8)c))
|
||||
#define Audio_SeqCmdF(playerIdx, a) Audio_QueueSeqCmd(0xF0000000 | ((u8)playerIdx << 24) | ((u8)a))
|
||||
#define Audio_DisableSeq(seqPlayerIndex, fadeOut) Audio_QueueCmdS32(0x83000000 | ((u8)seqPlayerIndex << 16), fadeOut)
|
||||
|
||||
#define ABS_ALT(x) ((x) < 0 ? -(x) : (x))
|
||||
|
||||
|
@ -1768,7 +1748,7 @@ void AudioOcarina_SetInstrument(u8 ocarinaInstrumentId) {
|
|||
return;
|
||||
}
|
||||
|
||||
Audio_SeqCmd8(SEQ_PLAYER_SFX, 1, SFX_CHANNEL_OCARINA, ocarinaInstrumentId);
|
||||
SEQCMD_SET_CHANNEL_IO(SEQ_PLAYER_SFX, SFX_CHANNEL_OCARINA, 1, ocarinaInstrumentId);
|
||||
sOcarinaInstrumentId = ocarinaInstrumentId;
|
||||
if (ocarinaInstrumentId == OCARINA_INSTRUMENT_OFF) {
|
||||
sOcarinaInputButtonCur = 0;
|
||||
|
@ -3071,7 +3051,7 @@ void AudioDebug_Draw(GfxPrint* printer) {
|
|||
}
|
||||
|
||||
GfxPrint_SetPos(printer, 3, 24);
|
||||
if (sSariaBgmPtr != 0) {
|
||||
if (sSariaBgmPtr != NULL) {
|
||||
GfxPrint_Printf(printer, "SARIA BGM PTR %08x", sSariaBgmPtr);
|
||||
}
|
||||
|
||||
|
@ -3158,7 +3138,7 @@ void AudioDebug_ProcessInput_SndCont(void) {
|
|||
switch (sAudioSndContSel) {
|
||||
case 0:
|
||||
case 1:
|
||||
Audio_StartSeq(sAudioSndContSel, 0, sAudioSndContWork[sAudioSndContSel]);
|
||||
SEQCMD_PLAY_SEQUENCE(sAudioSndContSel, 0, 0, sAudioSndContWork[sAudioSndContSel]);
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
|
@ -3170,10 +3150,10 @@ void AudioDebug_ProcessInput_SndCont(void) {
|
|||
func_800F6700(sAudioSndContWork[sAudioSndContSel]);
|
||||
break;
|
||||
case 5:
|
||||
Audio_SeqCmdE01(SEQ_PLAYER_BGM_MAIN, sAudioSndContWork[sAudioSndContSel]);
|
||||
SEQCMD_DISABLE_PLAY_SEQUENCES(sAudioSndContWork[sAudioSndContSel]);
|
||||
break;
|
||||
case 6:
|
||||
Audio_SeqCmdF(SEQ_PLAYER_BGM_MAIN, sAudioSndContWork[sAudioSndContSel]);
|
||||
SEQCMD_RESET_AUDIO_HEAP(0, sAudioSndContWork[sAudioSndContSel]);
|
||||
sAudioSubTrackInfoSpec = sAudioSndContWork[6];
|
||||
if (sAudioSubTrackInfoPlayerSel > gAudioSpecs[sAudioSubTrackInfoSpec].numSequencePlayers - 1) {
|
||||
sAudioSubTrackInfoPlayerSel = gAudioSpecs[sAudioSubTrackInfoSpec].numSequencePlayers - 1;
|
||||
|
@ -3195,10 +3175,10 @@ void AudioDebug_ProcessInput_SndCont(void) {
|
|||
switch (sAudioSndContSel) {
|
||||
case 0:
|
||||
case 1:
|
||||
Audio_SeqCmd1(sAudioSndContSel, 0);
|
||||
SEQCMD_STOP_SEQUENCE(sAudioSndContSel, 0);
|
||||
break;
|
||||
case 7:
|
||||
Audio_SeqCmd1(SEQ_PLAYER_BGM_MAIN, 0);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0);
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
|
@ -3488,11 +3468,11 @@ void AudioDebug_ProcessInput_BlkChgBgm(void) {
|
|||
|
||||
if (CHECK_BTN_ANY(sDebugPadPress, BTN_A)) {
|
||||
Audio_QueueCmdS8(MK_CMD(0x46, SEQ_PLAYER_BGM_MAIN, 0x00, 0x00), sAudioBlkChgBgmWork[1]);
|
||||
Audio_QueueSeqCmd(sAudioBlkChgBgmWork[0] | 0x10000);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1, 0, sAudioBlkChgBgmWork[0]);
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ANY(sDebugPadPress, BTN_B)) {
|
||||
Audio_QueueSeqCmd(0x100100FF);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3644,12 +3624,12 @@ void AudioDebug_ProcessInput(void) {
|
|||
case PAGE_NON:
|
||||
if (CHECK_BTN_ANY(sDebugPadPress, BTN_A)) {
|
||||
sAudioSndContWork[5] ^= 1;
|
||||
Audio_SeqCmdE01(SEQ_PLAYER_BGM_MAIN, sAudioSndContWork[5]);
|
||||
if (func_800FA0B4(SEQ_PLAYER_BGM_MAIN) != NA_BGM_NATURE_AMBIENCE) {
|
||||
Audio_SeqCmd1(SEQ_PLAYER_BGM_MAIN, 0);
|
||||
SEQCMD_DISABLE_PLAY_SEQUENCES(sAudioSndContWork[5]);
|
||||
if (Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_NATURE_AMBIENCE) {
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0);
|
||||
}
|
||||
Audio_SeqCmd1(SEQ_PLAYER_FANFARE, 0);
|
||||
Audio_SeqCmd1(SEQ_PLAYER_BGM_SUB, 0);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 0);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_SUB, 0);
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ANY(sDebugPadPress, BTN_B)) {
|
||||
|
@ -3691,7 +3671,7 @@ void AudioDebug_ProcessInput(void) {
|
|||
break;
|
||||
}
|
||||
|
||||
D_8013340C = sAudioScrPrtWork[10];
|
||||
gAudioDebugPrintSeqCmd = sAudioScrPrtWork[10];
|
||||
}
|
||||
|
||||
void Audio_UpdateRiverSoundVolumes(void);
|
||||
|
@ -3716,7 +3696,7 @@ void func_800F3054(void) {
|
|||
Audio_ProcessSfxRequests();
|
||||
Audio_ProcessSeqCmds();
|
||||
func_800F8F88();
|
||||
func_800FA3DC();
|
||||
Audio_UpdateActiveSequences();
|
||||
AudioDebug_SetInput();
|
||||
AudioDebug_ProcessInput();
|
||||
Audio_ScheduleProcessCmds();
|
||||
|
@ -4094,8 +4074,8 @@ void Audio_ResetSfxChannelState(void) {
|
|||
|
||||
void Audio_PlayCutsceneEffectsSequence(u8 csEffectType) {
|
||||
if (gSfxBankMuted[0] != 1) {
|
||||
Audio_StartSeq(SEQ_PLAYER_BGM_SUB, 0, NA_BGM_CUTSCENE_EFFECTS);
|
||||
Audio_SeqCmd8(SEQ_PLAYER_BGM_SUB, 0, 0, csEffectType);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_SUB, 0, 0, NA_BGM_CUTSCENE_EFFECTS);
|
||||
SEQCMD_SET_CHANNEL_IO(SEQ_PLAYER_BGM_SUB, 0, 0, csEffectType);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4263,17 +4243,17 @@ void Audio_StepFreqLerp(FreqLerp* lerp) {
|
|||
}
|
||||
|
||||
void func_800F47BC(void) {
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 1, 0, 10);
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 1, 0, 10);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_FANFARE, 0, 10);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_SUB, VOL_SCALE_INDEX_FANFARE, 0, 10);
|
||||
}
|
||||
|
||||
void func_800F47FC(void) {
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 1, 0x7F, 3);
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 1, 0x7F, 3);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_FANFARE, 0x7F, 3);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_SUB, VOL_SCALE_INDEX_FANFARE, 0x7F, 3);
|
||||
}
|
||||
|
||||
void func_800F483C(u8 targetVol, u8 volFadeTimer) {
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 0, targetVol, volFadeTimer);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_BGM_MAIN, targetVol, volFadeTimer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4315,7 +4295,7 @@ s32 Audio_SetGanonsTowerBgmVolume(u8 targetVol) {
|
|||
|
||||
if (sGanonsTowerVol != targetVol) {
|
||||
// Sets the volume
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 0, targetVol, 2);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_BGM_MAIN, targetVol, 2);
|
||||
|
||||
// Sets the filter cutoff of the form (lowPassFilterCutoff << 4) | (highPassFilter & 0xF). highPassFilter is
|
||||
// always set to 0
|
||||
|
@ -4327,7 +4307,7 @@ s32 Audio_SetGanonsTowerBgmVolume(u8 targetVol) {
|
|||
lowPassFilterCutoff = (((targetVol - 0x40) >> 2) + 1) << 4;
|
||||
}
|
||||
// Set lowPassFilterCutoff to io port 4 from channel 15
|
||||
Audio_SeqCmd8(SEQ_PLAYER_BGM_MAIN, 4, 15, lowPassFilterCutoff);
|
||||
SEQCMD_SET_CHANNEL_IO(SEQ_PLAYER_BGM_MAIN, 15, 4, lowPassFilterCutoff);
|
||||
|
||||
// Sets the reverb
|
||||
for (channelIdx = 0; channelIdx < 16; channelIdx++) {
|
||||
|
@ -4369,14 +4349,14 @@ void Audio_UpdateRiverSoundVolumes(void) {
|
|||
if (sRiverSoundMainBgmLower == true) {
|
||||
if (sRiverSoundMainBgmCurrentVol != sRiverSoundMainBgmVol) {
|
||||
// lowers the volume for 1 frame
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 0, sRiverSoundMainBgmVol, 0xA);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_BGM_MAIN, sRiverSoundMainBgmVol, 10);
|
||||
sRiverSoundMainBgmCurrentVol = sRiverSoundMainBgmVol;
|
||||
sRiverSoundMainBgmRestore = true;
|
||||
}
|
||||
sRiverSoundMainBgmLower = false;
|
||||
} else if (sRiverSoundMainBgmRestore == true && D_80130608 == 0) {
|
||||
// restores the volume every frame
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 0, 0x7F, 0xA);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_BGM_MAIN, 0x7F, 10);
|
||||
sRiverSoundMainBgmCurrentVol = 0x7F;
|
||||
sRiverSoundMainBgmRestore = false;
|
||||
}
|
||||
|
@ -4464,7 +4444,7 @@ void func_800F4E30(Vec3f* pos, f32 arg1) {
|
|||
|
||||
for (i = 0; i < 0x10; i++) {
|
||||
if (i != 9) {
|
||||
Audio_SeqCmd6(SEQ_PLAYER_BGM_MAIN, 2, i, (127.0f * phi_f22));
|
||||
SEQCMD_SET_CHANNEL_VOLUME(SEQ_PLAYER_BGM_MAIN, i, 2, (127.0f * phi_f22));
|
||||
Audio_QueueCmdS8(0x3 << 24 | SEQ_PLAYER_BGM_MAIN << 16 | ((u8)((u32)i) << 8), phi_s4);
|
||||
}
|
||||
}
|
||||
|
@ -4494,8 +4474,8 @@ void Audio_SplitBgmChannels(s8 volSplit) {
|
|||
u8 channelIdx;
|
||||
u8 i;
|
||||
|
||||
if ((func_800FA0B4(SEQ_PLAYER_FANFARE) == NA_BGM_DISABLED) &&
|
||||
(func_800FA0B4(SEQ_PLAYER_BGM_SUB) != NA_BGM_LONLON)) {
|
||||
if ((Audio_GetActiveSeqId(SEQ_PLAYER_FANFARE) == NA_BGM_DISABLED) &&
|
||||
(Audio_GetActiveSeqId(SEQ_PLAYER_BGM_SUB) != NA_BGM_LONLON)) {
|
||||
for (i = 0; i < ARRAY_COUNT(bgmPlayers); i++) {
|
||||
if (i == 0) {
|
||||
// Main Bgm SeqPlayer
|
||||
|
@ -4523,7 +4503,7 @@ void Audio_SplitBgmChannels(s8 volSplit) {
|
|||
}
|
||||
}
|
||||
|
||||
Audio_SeqCmdA(bgmPlayers[i], channelBits);
|
||||
SEQCMD_SET_CHANNEL_DISABLE_MASK(bgmPlayers[i], channelBits);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4570,8 +4550,8 @@ void Audio_PlaySariaBgm(Vec3f* pos, u16 seqId, u16 distMax) {
|
|||
Audio_SplitBgmChannels(vol);
|
||||
}
|
||||
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 3, vol, 0);
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 3, 0x7F - vol, 0);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_SUB, VOL_SCALE_INDEX_BGM_SUB, vol, 0);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_BGM_SUB, 0x7F - vol, 0);
|
||||
}
|
||||
|
||||
void Audio_ClearSariaBgm2(void) {
|
||||
|
@ -4587,9 +4567,9 @@ void func_800F5550(u16 seqId) {
|
|||
u8 sp27 = 0;
|
||||
u16 nv;
|
||||
|
||||
if (func_800FA0B4(SEQ_PLAYER_BGM_MAIN) != NA_BGM_WINDMILL) {
|
||||
if (func_800FA0B4(SEQ_PLAYER_BGM_SUB) == NA_BGM_LONLON) {
|
||||
func_800F9474(SEQ_PLAYER_BGM_SUB, 0);
|
||||
if (Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_WINDMILL) {
|
||||
if (Audio_GetActiveSeqId(SEQ_PLAYER_BGM_SUB) == NA_BGM_LONLON) {
|
||||
Audio_StopSequence(SEQ_PLAYER_BGM_SUB, 0);
|
||||
Audio_QueueCmdS32(0xF8000000, 0);
|
||||
}
|
||||
|
||||
|
@ -4617,7 +4597,7 @@ void func_800F56A8(void) {
|
|||
u16 temp_v0;
|
||||
u8 bvar;
|
||||
|
||||
temp_v0 = func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
|
||||
temp_v0 = Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN);
|
||||
bvar = temp_v0 & 0xFF;
|
||||
if ((temp_v0 != NA_BGM_DISABLED) && (sSeqFlags[bvar] & SEQ_FLAG_4)) {
|
||||
if (D_8013062C != 0xC0) {
|
||||
|
@ -4629,23 +4609,25 @@ void func_800F56A8(void) {
|
|||
}
|
||||
|
||||
void func_800F5718(void) {
|
||||
if (func_800FA0B4(SEQ_PLAYER_BGM_MAIN) != NA_BGM_WINDMILL) {
|
||||
Audio_StartSeq(SEQ_PLAYER_BGM_MAIN, 0, NA_BGM_WINDMILL);
|
||||
if (Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_WINDMILL) {
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_WINDMILL);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800F574C(f32 arg0, u8 arg2) {
|
||||
if (arg0 == 1.0f) {
|
||||
Audio_SeqCmdB40(SEQ_PLAYER_BGM_MAIN, arg2, 0);
|
||||
void func_800F574C(f32 scaleTempoAndFreq, u8 duration) {
|
||||
if (scaleTempoAndFreq == 1.0f) {
|
||||
SEQCMD_RESET_TEMPO(SEQ_PLAYER_BGM_MAIN, duration);
|
||||
} else {
|
||||
Audio_SeqCmdC(SEQ_PLAYER_FANFARE, 0x30, arg2, arg0 * 100.0f);
|
||||
SEQCMD_SETUP_SCALE_TEMPO(SEQ_PLAYER_FANFARE, SEQ_PLAYER_BGM_MAIN, duration, scaleTempoAndFreq * 100.0f);
|
||||
}
|
||||
Audio_SeqCmdC(SEQ_PLAYER_FANFARE, 0xA0, arg2, arg0 * 100.0f);
|
||||
|
||||
SEQCMD_SETUP_SET_PLAYER_FREQ(SEQ_PLAYER_FANFARE, SEQ_PLAYER_BGM_MAIN, duration, scaleTempoAndFreq * 100.0f);
|
||||
}
|
||||
|
||||
void func_800F5918(void) {
|
||||
if (func_800FA0B4(SEQ_PLAYER_BGM_MAIN) == NA_BGM_TIMED_MINI_GAME && func_800FA11C(0, 0xF0000000)) {
|
||||
Audio_SeqCmdB(SEQ_PLAYER_BGM_MAIN, 5, 0, 0xD2);
|
||||
if (Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) == NA_BGM_TIMED_MINI_GAME &&
|
||||
Audio_IsSeqCmdNotQueued(SEQCMD_OP_PLAY_SEQUENCE << 28, SEQCMD_OP_MASK)) {
|
||||
SEQCMD_SET_TEMPO(SEQ_PLAYER_BGM_MAIN, 5, 210);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4655,11 +4637,11 @@ void func_800F595C(u16 arg0) {
|
|||
if (sSeqFlags[arg0b] & SEQ_FLAG_FANFARE) {
|
||||
Audio_PlayFanfare(arg0);
|
||||
} else if (sSeqFlags[arg0b] & SEQ_FLAG_FANFARE_GANON) {
|
||||
Audio_StartSeq(SEQ_PLAYER_FANFARE, 0, arg0);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_FANFARE, 0, 0, arg0);
|
||||
|
||||
} else {
|
||||
func_800F5E18(SEQ_PLAYER_BGM_MAIN, arg0, 0, 7, -1);
|
||||
Audio_SeqCmd1(SEQ_PLAYER_FANFARE, 0);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4667,11 +4649,11 @@ void func_800F59E8(u16 arg0) {
|
|||
u8 arg0b = arg0 & 0xFF;
|
||||
|
||||
if (sSeqFlags[arg0b] & SEQ_FLAG_FANFARE) {
|
||||
Audio_SeqCmd1(SEQ_PLAYER_FANFARE, 0);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 0);
|
||||
} else if (sSeqFlags[arg0b] & SEQ_FLAG_FANFARE_GANON) {
|
||||
Audio_SeqCmd1(SEQ_PLAYER_FANFARE, 0);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 0);
|
||||
} else {
|
||||
Audio_SeqCmd1(SEQ_PLAYER_BGM_MAIN, 0);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4684,7 +4666,7 @@ s32 func_800F5A58(u8 arg0) {
|
|||
phi_a1 = 1;
|
||||
}
|
||||
|
||||
if (arg0 == (u8)func_800FA0B4(phi_a1)) {
|
||||
if (arg0 == (u8)Audio_GetActiveSeqId(phi_a1)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
|
@ -4696,7 +4678,7 @@ s32 func_800F5A58(u8 arg0) {
|
|||
* Designed for the mini-boss sequence, but also used by mini-game 2 sequence
|
||||
*/
|
||||
void func_800F5ACC(u16 seqId) {
|
||||
u16 curSeqId = func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
|
||||
u16 curSeqId = Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN);
|
||||
|
||||
if ((curSeqId & 0xFF) != NA_BGM_GANON_TOWER && (curSeqId & 0xFF) != NA_BGM_ESCAPE && curSeqId != seqId) {
|
||||
Audio_SetSequenceMode(SEQ_MODE_IGNORE);
|
||||
|
@ -4706,7 +4688,7 @@ void func_800F5ACC(u16 seqId) {
|
|||
osSyncPrintf("Middle Boss BGM Start not stack \n");
|
||||
}
|
||||
|
||||
Audio_StartSeq(SEQ_PLAYER_BGM_MAIN, 0, seqId);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, seqId);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4714,12 +4696,12 @@ void func_800F5ACC(u16 seqId) {
|
|||
* Restores the previous sequence to the main bgm player before func_800F5ACC was called
|
||||
*/
|
||||
void func_800F5B58(void) {
|
||||
if ((func_800FA0B4(SEQ_PLAYER_BGM_MAIN) != NA_BGM_DISABLED) && (sPrevMainBgmSeqId != NA_BGM_DISABLED) &&
|
||||
(sSeqFlags[func_800FA0B4(SEQ_PLAYER_BGM_MAIN) & 0xFF] & SEQ_FLAG_RESTORE)) {
|
||||
if ((Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_DISABLED) && (sPrevMainBgmSeqId != NA_BGM_DISABLED) &&
|
||||
(sSeqFlags[Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) & 0xFF] & SEQ_FLAG_RESTORE)) {
|
||||
if (sPrevMainBgmSeqId == NA_BGM_DISABLED) {
|
||||
Audio_SeqCmd1(SEQ_PLAYER_BGM_MAIN, 0);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0);
|
||||
} else {
|
||||
Audio_StartSeq(SEQ_PLAYER_BGM_MAIN, 0, sPrevMainBgmSeqId);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, sPrevMainBgmSeqId);
|
||||
}
|
||||
|
||||
sPrevMainBgmSeqId = NA_BGM_DISABLED;
|
||||
|
@ -4730,7 +4712,7 @@ void func_800F5B58(void) {
|
|||
* Plays the nature ambience sequence on the main bgm player, but stores the previous sequence to return to later
|
||||
*/
|
||||
void func_800F5BF0(u8 natureAmbienceId) {
|
||||
u16 curSeqId = func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
|
||||
u16 curSeqId = Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN);
|
||||
|
||||
if (curSeqId != NA_BGM_NATURE_AMBIENCE) {
|
||||
sPrevMainBgmSeqId = curSeqId;
|
||||
|
@ -4744,7 +4726,7 @@ void func_800F5BF0(u8 natureAmbienceId) {
|
|||
*/
|
||||
void func_800F5C2C(void) {
|
||||
if (sPrevMainBgmSeqId != NA_BGM_DISABLED) {
|
||||
Audio_StartSeq(SEQ_PLAYER_BGM_MAIN, 0, sPrevMainBgmSeqId);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, sPrevMainBgmSeqId);
|
||||
}
|
||||
sPrevMainBgmSeqId = NA_BGM_DISABLED;
|
||||
}
|
||||
|
@ -4755,53 +4737,58 @@ void Audio_PlayFanfare(u16 seqId) {
|
|||
u8* sp1C;
|
||||
u8* sp18;
|
||||
|
||||
sp26 = func_800FA0B4(SEQ_PLAYER_FANFARE);
|
||||
sp26 = Audio_GetActiveSeqId(SEQ_PLAYER_FANFARE);
|
||||
sp1C = func_800E5E84(sp26 & 0xFF, &sp20);
|
||||
sp18 = func_800E5E84(seqId & 0xFF, &sp20);
|
||||
if ((sp26 == NA_BGM_DISABLED) || (*sp1C == *sp18)) {
|
||||
D_8016B9F4 = 1;
|
||||
} else {
|
||||
D_8016B9F4 = 5;
|
||||
Audio_SeqCmd1(SEQ_PLAYER_FANFARE, 0);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 0);
|
||||
}
|
||||
D_8016B9F6 = seqId;
|
||||
}
|
||||
|
||||
void func_800F5CF8(void) {
|
||||
u16 sp26;
|
||||
u16 pad;
|
||||
u16 sp22;
|
||||
u16 seqIdFanfare;
|
||||
u16 seqIdBgmMain;
|
||||
u16 seqIdBgmSub;
|
||||
|
||||
if (D_8016B9F4 != 0) {
|
||||
D_8016B9F4--;
|
||||
if (D_8016B9F4 == 0) {
|
||||
Audio_QueueCmdS32(0xE3000000, SEQUENCE_TABLE);
|
||||
Audio_QueueCmdS32(0xE3000000, FONT_TABLE);
|
||||
func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
|
||||
sp26 = func_800FA0B4(SEQ_PLAYER_FANFARE);
|
||||
sp22 = func_800FA0B4(SEQ_PLAYER_BGM_SUB);
|
||||
if (sp26 == NA_BGM_DISABLED) {
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 1, 0, 5);
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 1, 0, 5);
|
||||
Audio_SeqCmdC(SEQ_PLAYER_FANFARE, 0x80, 1, 0xA);
|
||||
Audio_SeqCmdC(SEQ_PLAYER_FANFARE, 0x83, 1, 0xA);
|
||||
Audio_SeqCmdC(SEQ_PLAYER_FANFARE, 0x90, 0, 0);
|
||||
if (sp22 != NA_BGM_LONLON) {
|
||||
Audio_SeqCmdC(SEQ_PLAYER_FANFARE, 0x93, 0, 0);
|
||||
|
||||
seqIdBgmMain = Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN);
|
||||
seqIdFanfare = Audio_GetActiveSeqId(SEQ_PLAYER_FANFARE);
|
||||
seqIdBgmSub = Audio_GetActiveSeqId(SEQ_PLAYER_BGM_SUB);
|
||||
|
||||
(void)seqIdBgmMain; // suppresses set but unused warning
|
||||
if (seqIdFanfare == NA_BGM_DISABLED) {
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_FANFARE, 0, 5);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_SUB, VOL_SCALE_INDEX_FANFARE, 0, 5);
|
||||
SEQCMD_SETUP_RESTORE_PLAYER_VOLUME_WITH_SCALE_INDEX(SEQ_PLAYER_FANFARE, SEQ_PLAYER_BGM_MAIN,
|
||||
VOL_SCALE_INDEX_FANFARE, 10);
|
||||
SEQCMD_SETUP_RESTORE_PLAYER_VOLUME_WITH_SCALE_INDEX(SEQ_PLAYER_FANFARE, SEQ_PLAYER_BGM_SUB,
|
||||
VOL_SCALE_INDEX_FANFARE, 10);
|
||||
SEQCMD_SETUP_SET_CHANNEL_DISABLE_MASK(SEQ_PLAYER_FANFARE, SEQ_PLAYER_BGM_MAIN, 0);
|
||||
if (seqIdBgmSub != NA_BGM_LONLON) {
|
||||
SEQCMD_SETUP_SET_CHANNEL_DISABLE_MASK(SEQ_PLAYER_FANFARE, SEQ_PLAYER_BGM_SUB, 0);
|
||||
}
|
||||
}
|
||||
Audio_StartSeq(SEQ_PLAYER_FANFARE, 1, D_8016B9F6);
|
||||
Audio_SeqCmdA(0, 0xFFFF);
|
||||
if (sp22 != NA_BGM_LONLON) {
|
||||
Audio_SeqCmdA(SEQ_PLAYER_BGM_SUB, 0xFFFF);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_FANFARE, 1, 0, D_8016B9F6);
|
||||
SEQCMD_SET_CHANNEL_DISABLE_MASK(SEQ_PLAYER_BGM_MAIN, 0xFFFF);
|
||||
if (seqIdBgmSub != NA_BGM_LONLON) {
|
||||
SEQCMD_SET_CHANNEL_DISABLE_MASK(SEQ_PLAYER_BGM_SUB, 0xFFFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_800F5E18(u8 playerIdx, u16 seqId, u8 fadeTimer, s8 arg3, s8 arg4) {
|
||||
Audio_SeqCmd7(playerIdx, arg3, arg4);
|
||||
Audio_StartSeq(playerIdx, fadeTimer, seqId);
|
||||
void func_800F5E18(u8 seqPlayerIndex, u16 seqId, u8 fadeTimer, s8 ioPort, s8 ioData) {
|
||||
SEQCMD_SET_PLAYER_IO(seqPlayerIndex, ioPort, ioData);
|
||||
SEQCMD_PLAY_SEQUENCE(seqPlayerIndex, fadeTimer, 0, seqId);
|
||||
}
|
||||
|
||||
void Audio_SetSequenceMode(u8 seqMode) {
|
||||
|
@ -4815,9 +4802,9 @@ void Audio_SetSequenceMode(u8 seqMode) {
|
|||
seqMode = SEQ_MODE_IGNORE;
|
||||
}
|
||||
|
||||
seqId = D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254;
|
||||
seqId = gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId;
|
||||
|
||||
if (seqId == NA_BGM_FIELD_LOGIC && func_800FA0B4(SEQ_PLAYER_BGM_SUB) == (NA_BGM_ENEMY | 0x800)) {
|
||||
if (seqId == NA_BGM_FIELD_LOGIC && Audio_GetActiveSeqId(SEQ_PLAYER_BGM_SUB) == (NA_BGM_ENEMY | 0x800)) {
|
||||
seqMode = SEQ_MODE_IGNORE;
|
||||
}
|
||||
|
||||
|
@ -4826,29 +4813,33 @@ void Audio_SetSequenceMode(u8 seqMode) {
|
|||
if (seqMode != (sPrevSeqMode & 0x7F)) {
|
||||
if (seqMode == SEQ_MODE_ENEMY) {
|
||||
// Start playing enemy bgm
|
||||
if (D_8016E750[SEQ_PLAYER_BGM_SUB].volScales[1] - sAudioEnemyVol < 0) {
|
||||
volumeFadeInTimer = -(D_8016E750[SEQ_PLAYER_BGM_SUB].volScales[1] - sAudioEnemyVol);
|
||||
if (gActiveSeqs[SEQ_PLAYER_BGM_SUB].volScales[VOL_SCALE_INDEX_FANFARE] - sAudioEnemyVol < 0) {
|
||||
volumeFadeInTimer =
|
||||
-(gActiveSeqs[SEQ_PLAYER_BGM_SUB].volScales[VOL_SCALE_INDEX_FANFARE] - sAudioEnemyVol);
|
||||
} else {
|
||||
volumeFadeInTimer = D_8016E750[SEQ_PLAYER_BGM_SUB].volScales[1] - sAudioEnemyVol;
|
||||
volumeFadeInTimer =
|
||||
gActiveSeqs[SEQ_PLAYER_BGM_SUB].volScales[VOL_SCALE_INDEX_FANFARE] - sAudioEnemyVol;
|
||||
}
|
||||
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 3, sAudioEnemyVol, volumeFadeInTimer);
|
||||
Audio_StartSeq(SEQ_PLAYER_BGM_SUB, 10, NA_BGM_ENEMY | 0x800);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_SUB, VOL_SCALE_INDEX_BGM_SUB, sAudioEnemyVol,
|
||||
volumeFadeInTimer);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_SUB, 10, 8, NA_BGM_ENEMY);
|
||||
|
||||
if (seqId != NA_BGM_NATURE_AMBIENCE) {
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 3, (0x7F - sAudioEnemyVol) & 0xFF, 0xA);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_BGM_SUB,
|
||||
(0x7F - sAudioEnemyVol) & 0xFF, 0xA);
|
||||
Audio_SplitBgmChannels(sAudioEnemyVol);
|
||||
}
|
||||
} else if ((sPrevSeqMode & 0x7F) == SEQ_MODE_ENEMY) {
|
||||
// Stop playing enemy bgm
|
||||
Audio_SeqCmd1(SEQ_PLAYER_BGM_SUB, 10);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_SUB, 10);
|
||||
if (seqMode == SEQ_MODE_IGNORE) {
|
||||
volumeFadeOutTimer = 0;
|
||||
} else {
|
||||
volumeFadeOutTimer = 10;
|
||||
}
|
||||
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 3, 0x7F, volumeFadeOutTimer);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_BGM_SUB, 0x7F, volumeFadeOutTimer);
|
||||
Audio_SplitBgmChannels(0);
|
||||
}
|
||||
|
||||
|
@ -4872,7 +4863,7 @@ void Audio_SetSequenceMode(u8 seqMode) {
|
|||
}
|
||||
|
||||
sPrevSeqMode = seqMode;
|
||||
Audio_SeqCmd7(SEQ_PLAYER_BGM_MAIN, 2, seqMode);
|
||||
SEQCMD_SET_PLAYER_IO(SEQ_PLAYER_BGM_MAIN, 2, seqMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4891,12 +4882,12 @@ void Audio_SetBgmEnemyVolume(f32 dist) {
|
|||
}
|
||||
|
||||
sAudioEnemyVol = ((350.0f - adjDist) * 127.0f) / 350.0f;
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 3, sAudioEnemyVol, 10);
|
||||
if (D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254 != NA_BGM_NATURE_AMBIENCE) {
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 3, (0x7F - sAudioEnemyVol), 10);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_SUB, VOL_SCALE_INDEX_BGM_SUB, sAudioEnemyVol, 10);
|
||||
if (gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId != NA_BGM_NATURE_AMBIENCE) {
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_BGM_SUB, (0x7F - sAudioEnemyVol), 10);
|
||||
}
|
||||
}
|
||||
if (D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254 != NA_BGM_NATURE_AMBIENCE) {
|
||||
if (gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId != NA_BGM_NATURE_AMBIENCE) {
|
||||
Audio_SplitBgmChannels(sAudioEnemyVol);
|
||||
}
|
||||
}
|
||||
|
@ -4911,7 +4902,7 @@ void func_800F6268(f32 dist, u16 arg1) {
|
|||
sAudioHasMalonBgm = true;
|
||||
sAudioMalonBgmDist = dist;
|
||||
if (D_8016B9F2 == 0) {
|
||||
temp_a0 = (s8)(func_800FA0B4(SEQ_PLAYER_BGM_MAIN) & 0xFF);
|
||||
temp_a0 = (s8)(Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) & 0xFF);
|
||||
if (temp_a0 == (arg1 & 0xFF)) {
|
||||
if ((arg1 & 0xFF) == NA_BGM_LONLON) {
|
||||
|
||||
|
@ -4923,18 +4914,18 @@ void func_800F6268(f32 dist, u16 arg1) {
|
|||
phi_v1 = (s8)(((dist - 200.0f) * 127.0f) / 1800.0f);
|
||||
}
|
||||
// Transition volume of channels 0, 1 and 13 on seq player 0 over 3 frames
|
||||
Audio_SeqCmd6(SEQ_PLAYER_BGM_MAIN, 3, 0, 127 - phi_v1);
|
||||
Audio_SeqCmd6(SEQ_PLAYER_BGM_MAIN, 3, 1, 127 - phi_v1);
|
||||
Audio_SeqCmd6(SEQ_PLAYER_BGM_MAIN, 3, 13, phi_v1);
|
||||
SEQCMD_SET_CHANNEL_VOLUME(SEQ_PLAYER_BGM_MAIN, 0, 3, 127 - phi_v1);
|
||||
SEQCMD_SET_CHANNEL_VOLUME(SEQ_PLAYER_BGM_MAIN, 1, 3, 127 - phi_v1);
|
||||
SEQCMD_SET_CHANNEL_VOLUME(SEQ_PLAYER_BGM_MAIN, 13, 3, phi_v1);
|
||||
if (D_8016B9D8 == 0) {
|
||||
D_8016B9D8++;
|
||||
}
|
||||
}
|
||||
} else if ((temp_a0 == NA_BGM_NATURE_AMBIENCE) && ((arg1 & 0xFF) == NA_BGM_LONLON)) {
|
||||
temp_a0 = (s8)(func_800FA0B4(SEQ_PLAYER_BGM_SUB) & 0xFF);
|
||||
temp_a0 = (s8)(Audio_GetActiveSeqId(SEQ_PLAYER_BGM_SUB) & 0xFF);
|
||||
if ((temp_a0 != (arg1 & 0xFF)) && (D_8016B9D8 < 10)) {
|
||||
func_800F5E18(SEQ_PLAYER_BGM_SUB, NA_BGM_LONLON, 0, 0, 0);
|
||||
Audio_SeqCmdA(SEQ_PLAYER_BGM_SUB, 0xFFFC);
|
||||
SEQCMD_SET_CHANNEL_DISABLE_MASK(SEQ_PLAYER_BGM_SUB, 0xFFFC);
|
||||
D_8016B9D8 = 10;
|
||||
}
|
||||
|
||||
|
@ -4946,8 +4937,8 @@ void func_800F6268(f32 dist, u16 arg1) {
|
|||
phi_v1 = (s8)(((dist - 200.0f) * 127.0f) / 1800.0f);
|
||||
}
|
||||
// Transition volume of channels 0 and 1 on seq player 0 over 3 frames
|
||||
Audio_SeqCmd6(SEQ_PLAYER_BGM_SUB, 3, 0, 127 - phi_v1);
|
||||
Audio_SeqCmd6(SEQ_PLAYER_BGM_SUB, 3, 1, 127 - phi_v1);
|
||||
SEQCMD_SET_CHANNEL_VOLUME(SEQ_PLAYER_BGM_SUB, 0, 3, 127 - phi_v1);
|
||||
SEQCMD_SET_CHANNEL_VOLUME(SEQ_PLAYER_BGM_SUB, 1, 3, 127 - phi_v1);
|
||||
}
|
||||
|
||||
if (D_8016B9D8 < 10) {
|
||||
|
@ -4970,34 +4961,34 @@ void func_800F64E0(u8 arg0) {
|
|||
}
|
||||
|
||||
void func_800F6584(u8 arg0) {
|
||||
u8 playerIdx;
|
||||
u8 seqPlayerIndex;
|
||||
u16 sp34;
|
||||
|
||||
D_8016B9F2 = arg0;
|
||||
if ((func_800FA0B4(SEQ_PLAYER_BGM_MAIN) & 0xFF) == NA_BGM_LONLON) {
|
||||
playerIdx = SEQ_PLAYER_BGM_MAIN;
|
||||
if ((Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) & 0xFF) == NA_BGM_LONLON) {
|
||||
seqPlayerIndex = SEQ_PLAYER_BGM_MAIN;
|
||||
sp34 = 0;
|
||||
} else if ((func_800FA0B4(SEQ_PLAYER_BGM_SUB) & 0xFF) == NA_BGM_LONLON) {
|
||||
playerIdx = SEQ_PLAYER_BGM_SUB;
|
||||
} else if ((Audio_GetActiveSeqId(SEQ_PLAYER_BGM_SUB) & 0xFF) == NA_BGM_LONLON) {
|
||||
seqPlayerIndex = SEQ_PLAYER_BGM_SUB;
|
||||
sp34 = 0xFFFC;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
if (arg0 != 0) {
|
||||
Audio_SeqCmd6(playerIdx, 1, 0, 0);
|
||||
Audio_SeqCmd6(playerIdx, 1, 1, 0);
|
||||
if (playerIdx == SEQ_PLAYER_BGM_SUB) {
|
||||
Audio_SeqCmdA(playerIdx, sp34 | 3);
|
||||
SEQCMD_SET_CHANNEL_VOLUME(seqPlayerIndex, 0, 1, 0);
|
||||
SEQCMD_SET_CHANNEL_VOLUME(seqPlayerIndex, 1, 1, 0);
|
||||
if (seqPlayerIndex == SEQ_PLAYER_BGM_SUB) {
|
||||
SEQCMD_SET_CHANNEL_DISABLE_MASK(seqPlayerIndex, sp34 | 3);
|
||||
}
|
||||
} else {
|
||||
if (playerIdx == SEQ_PLAYER_BGM_SUB) {
|
||||
if (seqPlayerIndex == SEQ_PLAYER_BGM_SUB) {
|
||||
func_800F5E18(SEQ_PLAYER_BGM_SUB, NA_BGM_LONLON, 0, 0, 0);
|
||||
}
|
||||
Audio_SeqCmd6(playerIdx, 1, 0, 0x7F);
|
||||
Audio_SeqCmd6(playerIdx, 1, 1, 0x7F);
|
||||
if (playerIdx == SEQ_PLAYER_BGM_SUB) {
|
||||
Audio_SeqCmdA(playerIdx, sp34);
|
||||
SEQCMD_SET_CHANNEL_VOLUME(seqPlayerIndex, 0, 1, 0x7F);
|
||||
SEQCMD_SET_CHANNEL_VOLUME(seqPlayerIndex, 1, 1, 0x7F);
|
||||
if (seqPlayerIndex == SEQ_PLAYER_BGM_SUB) {
|
||||
SEQCMD_SET_CHANNEL_DISABLE_MASK(seqPlayerIndex, sp34);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5037,7 +5028,7 @@ void func_800F6700(s8 audioSetting) {
|
|||
break;
|
||||
}
|
||||
|
||||
Audio_SeqCmdE0(SEQ_PLAYER_BGM_MAIN, soundModeIndex);
|
||||
SEQCMD_SET_SOUND_MODE(soundModeIndex);
|
||||
}
|
||||
|
||||
void Audio_SetBaseFilter(u8 filter) {
|
||||
|
@ -5059,7 +5050,7 @@ void Audio_SetExtraFilter(u8 filter) {
|
|||
|
||||
sAudioExtraFilter2 = filter;
|
||||
sAudioExtraFilter = filter;
|
||||
if (D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254 == NA_BGM_NATURE_AMBIENCE) {
|
||||
if (gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId == NA_BGM_NATURE_AMBIENCE) {
|
||||
for (i = 0; i < 16; i++) {
|
||||
t = i;
|
||||
// CHAN_UPD_SCRIPT_IO (seq player 0, all channels, slot 6)
|
||||
|
@ -5087,8 +5078,8 @@ void func_800F6964(u16 arg0) {
|
|||
s32 skip;
|
||||
u8 channelIdx;
|
||||
|
||||
Audio_SeqCmd1(SEQ_PLAYER_BGM_MAIN, (arg0 * 3) / 2);
|
||||
Audio_SeqCmd1(SEQ_PLAYER_FANFARE, (arg0 * 3) / 2);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, (arg0 * 3) / 2);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, (arg0 * 3) / 2);
|
||||
for (channelIdx = 0; channelIdx < 16; channelIdx++) {
|
||||
skip = false;
|
||||
switch (channelIdx) {
|
||||
|
@ -5104,23 +5095,23 @@ void func_800F6964(u16 arg0) {
|
|||
}
|
||||
|
||||
if (!skip) {
|
||||
Audio_SeqCmd6(SEQ_PLAYER_SFX, arg0 >> 1, channelIdx, 0);
|
||||
SEQCMD_SET_CHANNEL_VOLUME(SEQ_PLAYER_SFX, channelIdx, arg0 >> 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Audio_SeqCmd1(SEQ_PLAYER_BGM_SUB, (arg0 * 3) / 2);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_SUB, (arg0 * 3) / 2);
|
||||
}
|
||||
|
||||
void func_800F6AB0(u16 arg0) {
|
||||
Audio_SeqCmd1(SEQ_PLAYER_BGM_MAIN, arg0);
|
||||
Audio_SeqCmd1(SEQ_PLAYER_FANFARE, arg0);
|
||||
Audio_SeqCmd1(SEQ_PLAYER_BGM_SUB, arg0);
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 3, 0x7F, 0);
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 1, 0x7F, 0);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, arg0);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, arg0);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_SUB, arg0);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_BGM_SUB, 0x7F, 0);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_FANFARE, 0x7F, 0);
|
||||
}
|
||||
|
||||
void func_800F6B3C(void) {
|
||||
func_800F9280(SEQ_PLAYER_SFX, 0, 0xFF, 5);
|
||||
Audio_StartSequence(SEQ_PLAYER_SFX, 0, 0xFF, 5);
|
||||
}
|
||||
|
||||
void Audio_DisableAllSeq(void) {
|
||||
|
@ -5179,19 +5170,20 @@ void func_800F6C34(void) {
|
|||
D_8016B9F2 = 0;
|
||||
}
|
||||
|
||||
void Audio_SetNatureAmbienceChannelIO(u8 channelIdxRange, u8 port, u8 val) {
|
||||
void Audio_SetNatureAmbienceChannelIO(u8 channelIdxRange, u8 ioPort, u8 ioData) {
|
||||
u8 firstChannelIdx;
|
||||
u8 lastChannelIdx;
|
||||
u8 channelIdx;
|
||||
|
||||
if ((D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254 != NA_BGM_NATURE_AMBIENCE) && func_800FA11C(1, 0xF00000FF)) {
|
||||
if ((gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId != NA_BGM_NATURE_AMBIENCE) &&
|
||||
Audio_IsSeqCmdNotQueued(SEQCMD_OP_PLAY_SEQUENCE << 28 | NA_BGM_NATURE_AMBIENCE, SEQCMD_OP_MASK | 0xFF)) {
|
||||
sAudioNatureFailed = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// channelIdxRange = 01 on port 1
|
||||
if (((channelIdxRange << 8) + port) == ((NATURE_CHANNEL_CRITTER_0 << 8) + CHANNEL_IO_PORT_1)) {
|
||||
if (func_800FA0B4(SEQ_PLAYER_BGM_SUB) != NA_BGM_LONLON) {
|
||||
// channelIdxRange = 01 on ioPort 1
|
||||
if (((channelIdxRange << 8) + ioPort) == ((NATURE_CHANNEL_CRITTER_0 << 8) + CHANNEL_IO_PORT_1)) {
|
||||
if (Audio_GetActiveSeqId(SEQ_PLAYER_BGM_SUB) != NA_BGM_LONLON) {
|
||||
D_8016B9D8 = 0;
|
||||
}
|
||||
}
|
||||
|
@ -5204,38 +5196,38 @@ void Audio_SetNatureAmbienceChannelIO(u8 channelIdxRange, u8 port, u8 val) {
|
|||
}
|
||||
|
||||
for (channelIdx = firstChannelIdx; channelIdx <= lastChannelIdx; channelIdx++) {
|
||||
Audio_SeqCmd8(SEQ_PLAYER_BGM_MAIN, port, channelIdx, val);
|
||||
SEQCMD_SET_CHANNEL_IO(SEQ_PLAYER_BGM_MAIN, channelIdx, ioPort, ioData);
|
||||
}
|
||||
}
|
||||
|
||||
void Audio_StartNatureAmbienceSequence(u16 playerIO, u16 channelMask) {
|
||||
u8 channelIdx;
|
||||
|
||||
if (func_800FA0B4(SEQ_PLAYER_BGM_MAIN) == NA_BGM_WINDMILL) {
|
||||
if (Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) == NA_BGM_WINDMILL) {
|
||||
Audio_PlayCutsceneEffectsSequence(SEQ_CS_EFFECTS_RAINFALL);
|
||||
return;
|
||||
}
|
||||
|
||||
Audio_SeqCmd7(SEQ_PLAYER_BGM_MAIN, 0, 1);
|
||||
Audio_SeqCmd7(SEQ_PLAYER_BGM_MAIN, 4, playerIO >> 8);
|
||||
Audio_SeqCmd7(SEQ_PLAYER_BGM_MAIN, 5, playerIO & 0xFF);
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 0, 0x7F, 1);
|
||||
SEQCMD_SET_PLAYER_IO(SEQ_PLAYER_BGM_MAIN, 0, 1);
|
||||
SEQCMD_SET_PLAYER_IO(SEQ_PLAYER_BGM_MAIN, 4, playerIO >> 8);
|
||||
SEQCMD_SET_PLAYER_IO(SEQ_PLAYER_BGM_MAIN, 5, playerIO & 0xFF);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_BGM_MAIN, 0x7F, 1);
|
||||
|
||||
channelIdx = false;
|
||||
if (D_80133408 != 0) {
|
||||
if (gStartSeqDisabled) {
|
||||
channelIdx = true;
|
||||
Audio_SeqCmdE01(SEQ_PLAYER_BGM_MAIN, 0);
|
||||
SEQCMD_DISABLE_PLAY_SEQUENCES(false);
|
||||
}
|
||||
|
||||
Audio_StartSeq(SEQ_PLAYER_BGM_MAIN, 0, NA_BGM_NATURE_AMBIENCE);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_NATURE_AMBIENCE);
|
||||
|
||||
if (channelIdx) {
|
||||
Audio_SeqCmdE01(SEQ_PLAYER_BGM_MAIN, 1);
|
||||
SEQCMD_DISABLE_PLAY_SEQUENCES(true);
|
||||
}
|
||||
|
||||
for (channelIdx = 0; channelIdx < 16; channelIdx++) {
|
||||
if (!(channelMask & (1 << channelIdx)) && (playerIO & (1 << channelIdx))) {
|
||||
Audio_SeqCmd8(SEQ_PLAYER_BGM_MAIN, CHANNEL_IO_PORT_1, channelIdx, 1);
|
||||
SEQCMD_SET_CHANNEL_IO(SEQ_PLAYER_BGM_MAIN, channelIdx, CHANNEL_IO_PORT_1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5243,24 +5235,23 @@ void Audio_StartNatureAmbienceSequence(u16 playerIO, u16 channelMask) {
|
|||
void Audio_PlayNatureAmbienceSequence(u8 natureAmbienceId) {
|
||||
u8 i = 0;
|
||||
u8 channelIdx;
|
||||
u8 port;
|
||||
u8 val;
|
||||
u8 ioPort;
|
||||
u8 ioData;
|
||||
|
||||
if (!((D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254 != NA_BGM_DISABLED) &&
|
||||
(sSeqFlags[((u8)D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254) & 0xFF] & SEQ_FLAG_NO_AMBIENCE))) {
|
||||
if ((gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId == NA_BGM_DISABLED) ||
|
||||
!(sSeqFlags[((u8)gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId) & 0xFF] & SEQ_FLAG_NO_AMBIENCE)) {
|
||||
|
||||
Audio_StartNatureAmbienceSequence(sNatureAmbienceDataIO[natureAmbienceId].playerIO,
|
||||
sNatureAmbienceDataIO[natureAmbienceId].channelMask);
|
||||
|
||||
while ((sNatureAmbienceDataIO[natureAmbienceId].channelIO[i] != 0xFF) && (i < 100)) {
|
||||
// Probably a fake match, using Audio_SeqCmd8 doesn't work.
|
||||
channelIdx = sNatureAmbienceDataIO[natureAmbienceId].channelIO[i++];
|
||||
port = sNatureAmbienceDataIO[natureAmbienceId].channelIO[i++];
|
||||
val = sNatureAmbienceDataIO[natureAmbienceId].channelIO[i++];
|
||||
Audio_QueueSeqCmd(0x80000000 | (SEQ_PLAYER_BGM_MAIN << 24) | (port << 0x10) | (channelIdx << 8) | val);
|
||||
ioPort = sNatureAmbienceDataIO[natureAmbienceId].channelIO[i++];
|
||||
ioData = sNatureAmbienceDataIO[natureAmbienceId].channelIO[i++];
|
||||
SEQCMD_SET_CHANNEL_IO(SEQ_PLAYER_BGM_MAIN, channelIdx, ioPort, ioData);
|
||||
}
|
||||
|
||||
Audio_SeqCmd8(SEQ_PLAYER_BGM_MAIN, CHANNEL_IO_PORT_7, NATURE_CHANNEL_UNK, sSoundMode);
|
||||
SEQCMD_SET_CHANNEL_IO(SEQ_PLAYER_BGM_MAIN, NATURE_CHANNEL_UNK, CHANNEL_IO_PORT_7, sSoundMode);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5272,13 +5263,13 @@ void Audio_InitSound(void) {
|
|||
func_800F6C34();
|
||||
AudioOcarina_ResetStaffs();
|
||||
Audio_ResetSfxChannelState();
|
||||
func_800FAEB4();
|
||||
Audio_ResetActiveSequencesAndVolume();
|
||||
Audio_ResetSfx();
|
||||
func_800F9280(SEQ_PLAYER_SFX, 0, 0x70, 10);
|
||||
Audio_StartSequence(SEQ_PLAYER_SFX, 0, 0x70, 10);
|
||||
}
|
||||
|
||||
void func_800F7170(void) {
|
||||
func_800F9280(SEQ_PLAYER_SFX, 0, 0x70, 1);
|
||||
Audio_StartSequence(SEQ_PLAYER_SFX, 0, 0x70, 1);
|
||||
Audio_QueueCmdS32(0xF2000000, 1);
|
||||
Audio_ScheduleProcessCmds();
|
||||
Audio_QueueCmdS32(0xF8000000, 0);
|
||||
|
@ -5289,14 +5280,14 @@ void func_800F71BC(s32 arg0) {
|
|||
func_800F6C34();
|
||||
AudioOcarina_ResetStaffs();
|
||||
Audio_ResetSfxChannelState();
|
||||
func_800FADF8();
|
||||
Audio_ResetActiveSequences();
|
||||
Audio_ResetSfx();
|
||||
}
|
||||
|
||||
void func_800F7208(void) {
|
||||
func_800FADF8();
|
||||
Audio_ResetActiveSequences();
|
||||
Audio_QueueCmdS32(0xF2000000, 1);
|
||||
func_800F6C34();
|
||||
Audio_ResetSfxChannelState();
|
||||
func_800F9280(SEQ_PLAYER_SFX, 0, 0x70, 1);
|
||||
Audio_StartSequence(SEQ_PLAYER_SFX, 0, 0x70, 1);
|
||||
}
|
||||
|
|
|
@ -52,15 +52,15 @@ void Audio_SetSfxBanksMute(u16 muteMask) {
|
|||
|
||||
void Audio_QueueSeqCmdMute(u8 channelIdx) {
|
||||
D_801333D0 |= (1 << channelIdx);
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 2, 0x40, 0xF);
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 2, 0x40, 0xF);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_SFX, 0x40, 0xF);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_SUB, VOL_SCALE_INDEX_SFX, 0x40, 0xF);
|
||||
}
|
||||
|
||||
void Audio_ClearBGMMute(u8 channelIdx) {
|
||||
D_801333D0 &= ((1 << channelIdx) ^ 0xFFFF);
|
||||
if (D_801333D0 == 0) {
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 2, 0x7F, 0xF);
|
||||
Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 2, 0x7F, 0xF);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_MAIN, VOL_SCALE_INDEX_SFX, 0x7F, 0xF);
|
||||
Audio_SetVolumeScale(SEQ_PLAYER_BGM_SUB, VOL_SCALE_INDEX_SFX, 0x7F, 0xF);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -73,10 +73,10 @@ void func_800FCA18(void* blk, u32 nBlk, u32 blkSize, arg3_800FCA18 arg3, s32 arg
|
|||
u32 pos;
|
||||
u32 end;
|
||||
|
||||
if (blk == 0) {
|
||||
if (blk == NULL) {
|
||||
return;
|
||||
}
|
||||
if (arg3 != 0) {
|
||||
if (arg3 != NULL) {
|
||||
end = (u32)blk;
|
||||
pos = (u32)end + (nBlk * blkSize);
|
||||
|
||||
|
|
|
@ -1271,8 +1271,8 @@ void Fault_Init(void) {
|
|||
sFaultInstance->autoScroll = false;
|
||||
gFaultMgr.faultHandlerEnabled = true;
|
||||
osCreateMesgQueue(&sFaultInstance->queue, &sFaultInstance->msg, 1);
|
||||
StackCheck_Init(&sFaultThreadInfo, &sFaultStack, STACK_TOP(sFaultStack), 0, 0x100, "fault");
|
||||
osCreateThread(&sFaultInstance->thread, THREAD_ID_FAULT, Fault_ThreadEntry, 0, STACK_TOP(sFaultStack),
|
||||
StackCheck_Init(&sFaultThreadInfo, sFaultStack, STACK_TOP(sFaultStack), 0, 0x100, "fault");
|
||||
osCreateThread(&sFaultInstance->thread, THREAD_ID_FAULT, Fault_ThreadEntry, NULL, STACK_TOP(sFaultStack),
|
||||
THREAD_PRI_FAULT);
|
||||
osStartThread(&sFaultInstance->thread);
|
||||
}
|
||||
|
|
|
@ -410,7 +410,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
|
|||
ViMode_Init(&sViMode);
|
||||
}
|
||||
SpeedMeter_Init(&D_801664D0);
|
||||
func_800AA0B4();
|
||||
Rumble_Init();
|
||||
osSendMesg(&gameState->gfxCtx->queue, NULL, OS_MESG_BLOCK);
|
||||
|
||||
endTime = osGetTime();
|
||||
|
@ -431,7 +431,7 @@ void GameState_Destroy(GameState* gameState) {
|
|||
if (gameState->destroy != NULL) {
|
||||
gameState->destroy(gameState);
|
||||
}
|
||||
func_800AA0F0();
|
||||
Rumble_Destroy();
|
||||
SpeedMeter_Destroy(&D_801664D0);
|
||||
func_800ACE90(&D_801664F0);
|
||||
func_800AD950(&D_80166500);
|
||||
|
|
|
@ -24,7 +24,7 @@ UCodeInfo D_8012D248[3] = {
|
|||
|
||||
void Graph_FaultClient(void) {
|
||||
void* nextFb = osViGetNextFramebuffer();
|
||||
void* newFb = (void*)((SysCfb_GetFbPtr(0) != (u32)nextFb) ? SysCfb_GetFbPtr(0) : SysCfb_GetFbPtr(1));
|
||||
void* newFb = (SysCfb_GetFbPtr(0) != nextFb) ? SysCfb_GetFbPtr(0) : SysCfb_GetFbPtr(1);
|
||||
|
||||
osViSwapBuffer(newFb);
|
||||
Fault_WaitForInput();
|
||||
|
@ -95,7 +95,7 @@ void Graph_InitTHGA(GraphicsContext* gfxCtx) {
|
|||
gfxCtx->overlayBuffer = pool->overlayBuffer;
|
||||
gfxCtx->workBuffer = pool->workBuffer;
|
||||
|
||||
gfxCtx->curFrameBuffer = (u16*)SysCfb_GetFbPtr(gfxCtx->fbIdx % 2);
|
||||
gfxCtx->curFrameBuffer = SysCfb_GetFbPtr(gfxCtx->fbIdx % 2);
|
||||
gfxCtx->unk_014 = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ PreNmiBuff* gAppNmiBufferPtr;
|
|||
Scheduler gScheduler;
|
||||
PadMgr gPadMgr;
|
||||
IrqMgr gIrqMgr;
|
||||
u32 gSegments[NUM_SEGMENTS];
|
||||
uintptr_t gSegments[NUM_SEGMENTS];
|
||||
OSThread sGraphThread;
|
||||
STACK(sGraphStack, 0x1800);
|
||||
STACK(sSchedStack, 0x600);
|
||||
|
@ -37,9 +37,9 @@ void Main(void* arg) {
|
|||
IrqMgrClient irqClient;
|
||||
OSMesgQueue irqMgrMsgQueue;
|
||||
OSMesg irqMgrMsgBuf[60];
|
||||
u32 systemHeapStart;
|
||||
u32 fb;
|
||||
u32 debugHeapStart;
|
||||
uintptr_t systemHeapStart;
|
||||
uintptr_t fb;
|
||||
void* debugHeapStart;
|
||||
u32 debugHeapSize;
|
||||
s16* msg;
|
||||
|
||||
|
@ -50,21 +50,21 @@ void Main(void* arg) {
|
|||
PreNmiBuff_Init(gAppNmiBufferPtr);
|
||||
Fault_Init();
|
||||
SysCfb_Init(0);
|
||||
systemHeapStart = (u32)gSystemHeap;
|
||||
fb = SysCfb_GetFbPtr(0);
|
||||
systemHeapStart = (uintptr_t)gSystemHeap;
|
||||
fb = (uintptr_t)SysCfb_GetFbPtr(0);
|
||||
gSystemHeapSize = fb - systemHeapStart;
|
||||
// "System heap initalization"
|
||||
osSyncPrintf("システムヒープ初期化 %08x-%08x %08x\n", systemHeapStart, fb, gSystemHeapSize);
|
||||
SystemHeap_Init((void*)systemHeapStart, gSystemHeapSize); // initializes the system heap
|
||||
if (osMemSize >= 0x800000) {
|
||||
debugHeapStart = SysCfb_GetFbEnd();
|
||||
debugHeapSize = PHYS_TO_K0(0x600000) - debugHeapStart;
|
||||
debugHeapSize = PHYS_TO_K0(0x600000) - (uintptr_t)debugHeapStart;
|
||||
} else {
|
||||
debugHeapSize = 0x400;
|
||||
debugHeapStart = (u32)SystemArena_MallocDebug(debugHeapSize, "../main.c", 565);
|
||||
debugHeapStart = SystemArena_MallocDebug(debugHeapSize, "../main.c", 565);
|
||||
}
|
||||
osSyncPrintf("debug_InitArena(%08x, %08x)\n", debugHeapStart, debugHeapSize);
|
||||
DebugArena_Init((void*)debugHeapStart, debugHeapSize);
|
||||
DebugArena_Init(debugHeapStart, debugHeapSize);
|
||||
func_800636C0();
|
||||
|
||||
R_ENABLE_ARENA_DBG = 0;
|
||||
|
|
|
@ -361,7 +361,7 @@ void PadMgr_HandleRetrace(PadMgr* padMgr) {
|
|||
|
||||
// Execute retrace callback
|
||||
if (padMgr->retraceCallback != NULL) {
|
||||
padMgr->retraceCallback(padMgr, padMgr->retraceCallbackValue);
|
||||
padMgr->retraceCallback(padMgr, padMgr->retraceCallbackArg);
|
||||
}
|
||||
|
||||
// Wait for controller data
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include "global.h"
|
||||
|
||||
u32 sSysCfbFbPtr[2];
|
||||
u32 sSysCfbEnd;
|
||||
uintptr_t sSysCfbFbPtr[2];
|
||||
uintptr_t sSysCfbEnd;
|
||||
|
||||
void SysCfb_Init(s32 n64dd) {
|
||||
u32 screenSize;
|
||||
u32 tmpFbEnd;
|
||||
uintptr_t tmpFbEnd;
|
||||
|
||||
if (osMemSize >= 0x800000) {
|
||||
// "8MB or more memory is installed"
|
||||
|
@ -42,13 +42,13 @@ void SysCfb_Reset(void) {
|
|||
sSysCfbEnd = 0;
|
||||
}
|
||||
|
||||
u32 SysCfb_GetFbPtr(s32 idx) {
|
||||
void* SysCfb_GetFbPtr(s32 idx) {
|
||||
if (idx < 2) {
|
||||
return sSysCfbFbPtr[idx];
|
||||
return (void*)sSysCfbFbPtr[idx];
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u32 SysCfb_GetFbEnd(void) {
|
||||
return sSysCfbEnd;
|
||||
void* SysCfb_GetFbEnd(void) {
|
||||
return (void*)sSysCfbEnd;
|
||||
}
|
||||
|
|
151
src/code/sys_rumble.c
Normal file
151
src/code/sys_rumble.c
Normal file
|
@ -0,0 +1,151 @@
|
|||
/**
|
||||
* @file sys_rumble.c
|
||||
*
|
||||
* This file implements a manager for storing and processing rumble pak requests made by the game state. Despite some
|
||||
* parts of the system appearing to accommodate all four controller ports, only controller 1 will rumble according to
|
||||
* the processed requests.
|
||||
* This file is half of the system that runs on the padmgr thread alongside controller communications. The rest of the
|
||||
* system that receives the requests from the game state runs on the graph thread and is implemented in `z_rumble.c`.
|
||||
*
|
||||
* @see RumbleMgr
|
||||
* @see z_rumble.c
|
||||
*
|
||||
* @note Original filename is likely sys_vibrate.c or similar as it is ordered after sys_ucode.c
|
||||
*/
|
||||
#include "global.h"
|
||||
|
||||
/**
|
||||
* Rumble manager update, runs on Vertical Retrace on the padmgr thread.
|
||||
*/
|
||||
void RumbleMgr_Update(RumbleMgr* rumbleMgr) {
|
||||
static u8 sWasEnabled = true;
|
||||
s32 i;
|
||||
s32 strength;
|
||||
s32 strongestIndex = -1;
|
||||
|
||||
// Clear enable status for all controllers
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
rumbleMgr->rumbleEnable[i] = false;
|
||||
}
|
||||
|
||||
if (!rumbleMgr->updateEnabled) {
|
||||
if (sWasEnabled) {
|
||||
// If it was previously enabled, reset pak type
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
gPadMgr.pakType[i] = CONT_PAK_NONE;
|
||||
}
|
||||
}
|
||||
sWasEnabled = rumbleMgr->updateEnabled;
|
||||
return;
|
||||
}
|
||||
|
||||
sWasEnabled = rumbleMgr->updateEnabled;
|
||||
|
||||
if (rumbleMgr->state == RUMBLE_STATE_RESET) {
|
||||
// Reset
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
gPadMgr.pakType[i] = CONT_PAK_NONE;
|
||||
}
|
||||
|
||||
for (i = 0; i < RUMBLE_MAX_REQUESTS; i++) {
|
||||
rumbleMgr->reqAccumulators[i] = 0;
|
||||
rumbleMgr->reqDecreaseRates[i] = 0;
|
||||
rumbleMgr->reqDurations[i] = 0;
|
||||
rumbleMgr->reqStrengths[i] = 0;
|
||||
}
|
||||
|
||||
rumbleMgr->onTimer = rumbleMgr->offTimer = rumbleMgr->overrideStrength = rumbleMgr->overrideDuration =
|
||||
rumbleMgr->overrideDecreaseRate = rumbleMgr->overrideAccumulator = 0;
|
||||
|
||||
rumbleMgr->state = RUMBLE_STATE_RUNNING;
|
||||
}
|
||||
|
||||
if (rumbleMgr->state != RUMBLE_STATE_CLEAR) {
|
||||
// Search for index with largest strength
|
||||
for (i = 0; i < RUMBLE_MAX_REQUESTS; i++) {
|
||||
if (rumbleMgr->reqStrengths[i] != 0) {
|
||||
// Non-empty request slot
|
||||
if (rumbleMgr->reqDurations[i] > 0) {
|
||||
rumbleMgr->reqDurations[i]--;
|
||||
} else {
|
||||
// After duration, decrease the strength by the decrease rate
|
||||
strength = rumbleMgr->reqStrengths[i] - rumbleMgr->reqDecreaseRates[i];
|
||||
rumbleMgr->reqStrengths[i] = MAX(strength, 0);
|
||||
}
|
||||
|
||||
// Increment accumulator by the strength
|
||||
strength = rumbleMgr->reqAccumulators[i] + rumbleMgr->reqStrengths[i];
|
||||
rumbleMgr->reqAccumulators[i] = strength;
|
||||
|
||||
if (strongestIndex == -1) {
|
||||
strongestIndex = i;
|
||||
// Rumble is enabled on the controller only when there is overflow of the accumulator, overflow
|
||||
// will happen more often for larger request strengths making it feel stronger to the player
|
||||
rumbleMgr->rumbleEnable[0] = strength > 255;
|
||||
} else if (rumbleMgr->reqStrengths[i] > rumbleMgr->reqStrengths[strongestIndex]) {
|
||||
strongestIndex = i;
|
||||
rumbleMgr->rumbleEnable[0] = strength > 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rumbleMgr->overrideStrength != 0) {
|
||||
// Set override
|
||||
if (rumbleMgr->overrideDuration > 0) {
|
||||
rumbleMgr->overrideDuration--;
|
||||
} else {
|
||||
// Once the duration is over, start decrementing the strength
|
||||
strength = rumbleMgr->overrideStrength - rumbleMgr->overrideDecreaseRate;
|
||||
rumbleMgr->overrideStrength = MAX(strength, 0);
|
||||
}
|
||||
// Increment accumulator, set rumble enabled on overflow
|
||||
strength = rumbleMgr->overrideAccumulator + rumbleMgr->overrideStrength;
|
||||
rumbleMgr->overrideAccumulator = strength;
|
||||
rumbleMgr->rumbleEnable[0] = strength > 255;
|
||||
}
|
||||
|
||||
if (rumbleMgr->overrideStrength != 0) {
|
||||
strength = rumbleMgr->overrideStrength;
|
||||
} else {
|
||||
strength = (strongestIndex == -1) ? 0 : rumbleMgr->reqStrengths[strongestIndex];
|
||||
}
|
||||
|
||||
if (strength == 0) {
|
||||
// No rumble
|
||||
if ((++rumbleMgr->offTimer) > 5) {
|
||||
// After 5 VIs with no rumble, reset the rumble on timer
|
||||
rumbleMgr->onTimer = 0;
|
||||
rumbleMgr->offTimer = 5;
|
||||
}
|
||||
} else {
|
||||
// Rumble
|
||||
rumbleMgr->offTimer = 0;
|
||||
if ((++rumbleMgr->onTimer) > 7200) { // 2 minutes at 60 VI/s, 2 minutes 24 seconds at 50 VI/s
|
||||
// Clear all requests if rumble has been on for too long
|
||||
rumbleMgr->state = RUMBLE_STATE_CLEAR;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Clear all requests
|
||||
for (i = 0; i < RUMBLE_MAX_REQUESTS; i++) {
|
||||
rumbleMgr->reqAccumulators[i] = 0;
|
||||
rumbleMgr->reqDecreaseRates[i] = 0;
|
||||
rumbleMgr->reqDurations[i] = 0;
|
||||
rumbleMgr->reqStrengths[i] = 0;
|
||||
}
|
||||
|
||||
// Clear override request
|
||||
rumbleMgr->onTimer = rumbleMgr->offTimer = rumbleMgr->overrideStrength = rumbleMgr->overrideDuration =
|
||||
rumbleMgr->overrideDecreaseRate = rumbleMgr->overrideAccumulator = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void RumbleMgr_Init(RumbleMgr* rumbleMgr) {
|
||||
bzero(rumbleMgr, sizeof(RumbleMgr));
|
||||
rumbleMgr->state = RUMBLE_STATE_RESET;
|
||||
rumbleMgr->updateEnabled = true;
|
||||
}
|
||||
|
||||
void RumbleMgr_Destroy(RumbleMgr* rumbleMgr) {
|
||||
bzero(rumbleMgr, sizeof(RumbleMgr));
|
||||
}
|
|
@ -7,7 +7,7 @@ void Overlay_LoadGameState(GameStateOverlay* overlayEntry) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (overlayEntry->vramStart == 0) {
|
||||
if (overlayEntry->vramStart == NULL) {
|
||||
overlayEntry->unk_28 = 0;
|
||||
} else {
|
||||
overlayEntry->loadedRamAddr = Overlay_AllocateAndLoad(overlayEntry->vromStart, overlayEntry->vromEnd,
|
||||
|
|
|
@ -2661,7 +2661,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
|
|||
ActorInit* actorInit;
|
||||
s32 objBankIndex;
|
||||
ActorOverlay* overlayEntry;
|
||||
u32 temp;
|
||||
uintptr_t temp;
|
||||
char* name;
|
||||
u32 overlaySize;
|
||||
|
||||
|
@ -2682,7 +2682,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (overlayEntry->vramStart == 0) {
|
||||
if (overlayEntry->vramStart == NULL) {
|
||||
if (HREG(20) != 0) {
|
||||
osSyncPrintf("オーバーレイではありません\n"); // "Not an overlay"
|
||||
}
|
||||
|
@ -2894,7 +2894,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) {
|
|||
|
||||
ZeldaArena_FreeDebug(actor, "../z_actor.c", 7242);
|
||||
|
||||
if (overlayEntry->vramStart == 0) {
|
||||
if (overlayEntry->vramStart == NULL) {
|
||||
if (HREG(20) != 0) {
|
||||
osSyncPrintf("オーバーレイではありません\n"); // "Not an overlay"
|
||||
}
|
||||
|
@ -3001,7 +3001,7 @@ Actor* func_80032AF0(PlayState* play, ActorContext* actorCtx, Actor** actorPtr,
|
|||
}
|
||||
}
|
||||
|
||||
if (D_8015BBE8 == 0) {
|
||||
if (D_8015BBE8 == NULL) {
|
||||
*actorPtr = D_8015BBEC;
|
||||
} else {
|
||||
*actorPtr = D_8015BBE8;
|
||||
|
@ -3523,9 +3523,9 @@ void func_80033E1C(PlayState* play, s16 arg1, s16 arg2, s16 arg3) {
|
|||
|
||||
void func_80033E88(Actor* actor, PlayState* play, s16 arg2, s16 arg3) {
|
||||
if (arg2 >= 5) {
|
||||
func_800AA000(actor->xyzDistToPlayerSq, 0xFF, 0x14, 0x96);
|
||||
Rumble_Request(actor->xyzDistToPlayerSq, 255, 20, 150);
|
||||
} else {
|
||||
func_800AA000(actor->xyzDistToPlayerSq, 0xB4, 0x14, 0x64);
|
||||
Rumble_Request(actor->xyzDistToPlayerSq, 180, 20, 100);
|
||||
}
|
||||
|
||||
func_80033DB8(play, arg2, arg3);
|
||||
|
@ -3963,7 +3963,7 @@ s32 func_80035124(Actor* actor, PlayState* play) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
#include "z_cheap_proc.c"
|
||||
#include "z_cheap_proc.inc.c"
|
||||
|
||||
u8 func_800353E8(PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
|
||||
// Actor Overlay Table definition
|
||||
#define DEFINE_ACTOR(name, _1, allocType, nameString) \
|
||||
{ (u32)_ovl_##name##SegmentRomStart, \
|
||||
(u32)_ovl_##name##SegmentRomEnd, \
|
||||
{ (uintptr_t)_ovl_##name##SegmentRomStart, \
|
||||
(uintptr_t)_ovl_##name##SegmentRomEnd, \
|
||||
_ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, \
|
||||
NULL, \
|
||||
|
|
|
@ -33,7 +33,7 @@ s32 Camera_UpdateWater(Camera* camera);
|
|||
#define DISTORTION_UNDERWATER_STRONG (1 << 3)
|
||||
#define DISTORTION_UNDERWATER_FISHING (1 << 4)
|
||||
|
||||
#include "z_camera_data.c"
|
||||
#include "z_camera_data.inc.c"
|
||||
|
||||
/*===============================================================*/
|
||||
|
||||
|
|
|
@ -680,7 +680,7 @@ s32 Collider_ResetTrisElementOC(PlayState* play, ColliderTrisElement* element) {
|
|||
s32 Collider_InitTris(PlayState* play, ColliderTris* tris) {
|
||||
Collider_InitBase(play, &tris->base);
|
||||
tris->count = 0;
|
||||
tris->elements = 0;
|
||||
tris->elements = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ void Interface_Init(PlayState* play) {
|
|||
interfaceCtx->cDownAlpha = interfaceCtx->cRightAlpha = interfaceCtx->healthAlpha = interfaceCtx->startAlpha =
|
||||
interfaceCtx->magicAlpha = 0;
|
||||
|
||||
parameterSize = (u32)_parameter_staticSegmentRomEnd - (u32)_parameter_staticSegmentRomStart;
|
||||
parameterSize = (uintptr_t)_parameter_staticSegmentRomEnd - (uintptr_t)_parameter_staticSegmentRomStart;
|
||||
|
||||
// "Permanent PARAMETER Segment = %x"
|
||||
osSyncPrintf("常駐PARAMETERセグメント=%x\n", parameterSize);
|
||||
|
@ -37,7 +37,7 @@ void Interface_Init(PlayState* play) {
|
|||
osSyncPrintf("parameter->parameterSegment=%x\n", interfaceCtx->parameterSegment);
|
||||
|
||||
ASSERT(interfaceCtx->parameterSegment != NULL, "parameter->parameterSegment != NULL", "../z_construct.c", 161);
|
||||
DmaMgr_SendRequest1(interfaceCtx->parameterSegment, (u32)_parameter_staticSegmentRomStart, parameterSize,
|
||||
DmaMgr_SendRequest1(interfaceCtx->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, parameterSize,
|
||||
"../z_construct.c", 162);
|
||||
|
||||
interfaceCtx->doActionSegment = GameState_Alloc(&play->state, 3 * DO_ACTION_TEX_SIZE, "../z_construct.c", 166);
|
||||
|
@ -55,8 +55,8 @@ void Interface_Init(PlayState* play) {
|
|||
doActionOffset = (LANGUAGE_FRA * DO_ACTION_MAX + DO_ACTION_ATTACK) * DO_ACTION_TEX_SIZE;
|
||||
}
|
||||
|
||||
DmaMgr_SendRequest1(interfaceCtx->doActionSegment, (u32)_do_action_staticSegmentRomStart + doActionOffset, 0x300,
|
||||
"../z_construct.c", 174);
|
||||
DmaMgr_SendRequest1(interfaceCtx->doActionSegment, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset,
|
||||
0x300, "../z_construct.c", 174);
|
||||
|
||||
if (gSaveContext.language == LANGUAGE_ENG) {
|
||||
doActionOffset = (LANGUAGE_ENG * DO_ACTION_MAX + DO_ACTION_RETURN) * DO_ACTION_TEX_SIZE;
|
||||
|
@ -67,7 +67,7 @@ void Interface_Init(PlayState* play) {
|
|||
}
|
||||
|
||||
DmaMgr_SendRequest1(interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE * 2,
|
||||
(u32)_do_action_staticSegmentRomStart + doActionOffset, 0x180, "../z_construct.c", 178);
|
||||
(uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, 0x180, "../z_construct.c", 178);
|
||||
|
||||
interfaceCtx->iconItemSegment = GameState_Alloc(&play->state, 0x4000, "../z_construct.c", 190);
|
||||
|
||||
|
@ -83,30 +83,30 @@ void Interface_Init(PlayState* play) {
|
|||
|
||||
if (gSaveContext.equips.buttonItems[0] < 0xF0) {
|
||||
DmaMgr_SendRequest1(interfaceCtx->iconItemSegment,
|
||||
(u32)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x1000, 0x1000,
|
||||
"../z_construct.c", 198);
|
||||
(uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x1000,
|
||||
0x1000, "../z_construct.c", 198);
|
||||
} else if (gSaveContext.equips.buttonItems[0] != 0xFF) {
|
||||
DmaMgr_SendRequest1(interfaceCtx->iconItemSegment,
|
||||
(u32)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x1000, 0x1000,
|
||||
"../z_construct.c", 203);
|
||||
(uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x1000,
|
||||
0x1000, "../z_construct.c", 203);
|
||||
}
|
||||
|
||||
if (gSaveContext.equips.buttonItems[1] < 0xF0) {
|
||||
DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x1000,
|
||||
(u32)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[1] * 0x1000, 0x1000,
|
||||
"../z_construct.c", 209);
|
||||
(uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[1] * 0x1000,
|
||||
0x1000, "../z_construct.c", 209);
|
||||
}
|
||||
|
||||
if (gSaveContext.equips.buttonItems[2] < 0xF0) {
|
||||
DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x2000,
|
||||
(u32)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[2] * 0x1000, 0x1000,
|
||||
"../z_construct.c", 214);
|
||||
(uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[2] * 0x1000,
|
||||
0x1000, "../z_construct.c", 214);
|
||||
}
|
||||
|
||||
if (gSaveContext.equips.buttonItems[3] < 0xF0) {
|
||||
DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x3000,
|
||||
(u32)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[3] * 0x1000, 0x1000,
|
||||
"../z_construct.c", 219);
|
||||
(uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[3] * 0x1000,
|
||||
0x1000, "../z_construct.c", 219);
|
||||
}
|
||||
|
||||
osSyncPrintf("EVENT=%d\n", ((void)0, gSaveContext.timer1State));
|
||||
|
@ -345,9 +345,9 @@ void func_80111070(void) {
|
|||
XREG(3) = -4;
|
||||
XREG(4) = 3;
|
||||
XREG(5) = 0;
|
||||
R_PAUSE_STICK_REPEAT_DELAY_FIRST = 2;
|
||||
R_PAUSE_STICK_REPEAT_DELAY = 2;
|
||||
XREG(7) = 30;
|
||||
R_PAUSE_STICK_REPEAT_DELAY = 10;
|
||||
R_PAUSE_STICK_REPEAT_DELAY_FIRST = 10;
|
||||
XREG(9) = 0;
|
||||
XREG(10) = -9550;
|
||||
XREG(11) = 9950;
|
||||
|
@ -596,9 +596,11 @@ void func_80111070(void) {
|
|||
VREG(87) = 64;
|
||||
VREG(88) = 66;
|
||||
VREG(89) = 0;
|
||||
VREG(90) = 126;
|
||||
VREG(91) = 124;
|
||||
VREG(92) = -63;
|
||||
R_GAME_OVER_RUMBLE_STRENGTH = 126;
|
||||
R_GAME_OVER_RUMBLE_DURATION = 124;
|
||||
//! @bug This is eventually cast to a u8 after some scaling in `GameOver_Update`, negative numbers typically
|
||||
//! become large (fast) decrease rates
|
||||
R_GAME_OVER_RUMBLE_DECREASE_RATE = -63;
|
||||
}
|
||||
|
||||
void func_80112098(PlayState* play) {
|
||||
|
|
|
@ -96,7 +96,7 @@ char sRegGroupChars[REG_GROUPS] = {
|
|||
void func_800636C0(void) {
|
||||
s32 i;
|
||||
|
||||
gGameInfo = (GameInfo*)SystemArena_MallocDebug(sizeof(GameInfo), "../z_debug.c", 260);
|
||||
gGameInfo = SystemArena_MallocDebug(sizeof(GameInfo), "../z_debug.c", 260);
|
||||
gGameInfo->regPage = 0;
|
||||
gGameInfo->regGroup = 0;
|
||||
gGameInfo->regCur = 0;
|
||||
|
@ -229,7 +229,7 @@ void func_8006390C(Input* input) {
|
|||
|
||||
if (iREG(0)) {
|
||||
iREG(0) = 0;
|
||||
func_800AA000(0, iREG(1), iREG(2), iREG(3));
|
||||
Rumble_Request(0.0f, iREG(1), iREG(2), iREG(3));
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -449,15 +449,15 @@ void Cutscene_Command_StopBGM(PlayState* play, CutsceneContext* csCtx, CsCmdMusi
|
|||
|
||||
// Command 0x7C: Fade Background Music over duration
|
||||
void Cutscene_Command_FadeBGM(PlayState* play, CutsceneContext* csCtx, CsCmdMusicFade* cmd) {
|
||||
u8 var1;
|
||||
u8 fadeTimer;
|
||||
|
||||
if ((csCtx->frames == cmd->startFrame) && (csCtx->frames < cmd->endFrame)) {
|
||||
var1 = cmd->endFrame - cmd->startFrame;
|
||||
fadeTimer = cmd->endFrame - cmd->startFrame;
|
||||
|
||||
if (cmd->type == 3) {
|
||||
Audio_QueueSeqCmd(var1 << 0x10 | (0x1 << 28 | SEQ_PLAYER_FANFARE << 24 | 0xFF));
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, fadeTimer);
|
||||
} else {
|
||||
Audio_QueueSeqCmd(var1 << 0x10 | (0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xFF));
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, fadeTimer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -465,7 +465,7 @@ void Cutscene_Command_FadeBGM(PlayState* play, CutsceneContext* csCtx, CsCmdMusi
|
|||
// Command 9: ?
|
||||
void Cutscene_Command_09(PlayState* play, CutsceneContext* csCtx, CsCmdUnknown9* cmd) {
|
||||
if (csCtx->frames == cmd->startFrame) {
|
||||
func_800AA000(0.0f, cmd->unk_06, cmd->unk_07, cmd->unk_08);
|
||||
Rumble_Request(0.0f, cmd->unk_06, cmd->unk_07, cmd->unk_08);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,15 +19,15 @@
|
|||
#undef DEFINE_EFFECT_SS_UNSET
|
||||
|
||||
// Effect SS Overlay Table definition
|
||||
#define DEFINE_EFFECT_SS(name, _1) \
|
||||
{ \
|
||||
(u32)_ovl_##name##SegmentRomStart, \
|
||||
(u32)_ovl_##name##SegmentRomEnd, \
|
||||
_ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, \
|
||||
NULL, \
|
||||
&name##_InitVars, \
|
||||
1, \
|
||||
#define DEFINE_EFFECT_SS(name, _1) \
|
||||
{ \
|
||||
(uintptr_t)_ovl_##name##SegmentRomStart, \
|
||||
(uintptr_t)_ovl_##name##SegmentRomEnd, \
|
||||
_ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, \
|
||||
NULL, \
|
||||
&name##_InitVars, \
|
||||
1, \
|
||||
},
|
||||
|
||||
#define DEFINE_EFFECT_SS_UNSET(_0) { 0 },
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include "global.h"
|
||||
|
||||
#define GAMESTATE_OVERLAY(name, init, destroy, size) \
|
||||
{ \
|
||||
NULL, (u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, _ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, NULL, init, destroy, NULL, NULL, 0, size \
|
||||
#define GAMESTATE_OVERLAY(name, init, destroy, size) \
|
||||
{ \
|
||||
NULL, (uintptr_t)_ovl_##name##SegmentRomStart, (uintptr_t)_ovl_##name##SegmentRomEnd, \
|
||||
_ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, NULL, init, destroy, NULL, NULL, 0, size \
|
||||
}
|
||||
#define GAMESTATE_OVERLAY_INTERNAL(init, destroy, size) \
|
||||
{ NULL, 0, 0, NULL, NULL, NULL, init, destroy, NULL, NULL, 0, size }
|
||||
|
|
|
@ -20,9 +20,9 @@ void GameOver_Update(PlayState* play) {
|
|||
GameOverContext* gameOverCtx = &play->gameOverCtx;
|
||||
s16 i;
|
||||
s16 j;
|
||||
s32 v90;
|
||||
s32 v91;
|
||||
s32 v92;
|
||||
s32 rumbleStrength;
|
||||
s32 rumbleDuration;
|
||||
s32 rumbleDecreaseRate;
|
||||
|
||||
switch (gameOverCtx->state) {
|
||||
case GAMEOVER_DEATH_START:
|
||||
|
@ -74,13 +74,15 @@ void GameOver_Update(PlayState* play) {
|
|||
|
||||
Environment_InitGameOverLights(play);
|
||||
gGameOverTimer = 20;
|
||||
if (1) {}
|
||||
v90 = VREG(90);
|
||||
v91 = VREG(91);
|
||||
v92 = VREG(92);
|
||||
|
||||
func_800AA000(0.0f, ((v90 > 0x64) ? 0xFF : (v90 * 0xFF) / 0x64), (CLAMP_MAX(v91 * 3, 0xFF)),
|
||||
((v92 > 0x64) ? 0xFF : (v92 * 0xFF) / 0x64));
|
||||
if (1) {}
|
||||
rumbleStrength = R_GAME_OVER_RUMBLE_STRENGTH;
|
||||
rumbleDuration = R_GAME_OVER_RUMBLE_DURATION;
|
||||
rumbleDecreaseRate = R_GAME_OVER_RUMBLE_DECREASE_RATE;
|
||||
|
||||
Rumble_Request(0.0f, ((rumbleStrength > 100) ? 255 : (rumbleStrength * 255) / 100),
|
||||
(CLAMP_MAX(rumbleDuration * 3, 255)),
|
||||
((rumbleDecreaseRate > 100) ? 255 : (rumbleDecreaseRate * 255) / 100));
|
||||
|
||||
gameOverCtx->state = GAMEOVER_DEATH_WAIT_GROUND;
|
||||
break;
|
||||
|
@ -94,7 +96,7 @@ void GameOver_Update(PlayState* play) {
|
|||
if (gGameOverTimer == 0) {
|
||||
play->pauseCtx.state = PAUSE_STATE_8;
|
||||
gameOverCtx->state++;
|
||||
func_800AA15C();
|
||||
Rumble_Reset();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -108,14 +110,15 @@ void GameOver_Update(PlayState* play) {
|
|||
case GAMEOVER_REVIVE_RUMBLE:
|
||||
gGameOverTimer = 50;
|
||||
gameOverCtx->state++;
|
||||
|
||||
if (1) {}
|
||||
rumbleStrength = R_GAME_OVER_RUMBLE_STRENGTH;
|
||||
rumbleDuration = R_GAME_OVER_RUMBLE_DURATION;
|
||||
rumbleDecreaseRate = R_GAME_OVER_RUMBLE_DECREASE_RATE;
|
||||
|
||||
v90 = VREG(90);
|
||||
v91 = VREG(91);
|
||||
v92 = VREG(92);
|
||||
|
||||
func_800AA000(0.0f, ((v90 > 0x64) ? 0xFF : (v90 * 0xFF) / 0x64), (CLAMP_MAX(v91 * 3, 0xFF)),
|
||||
((v92 > 0x64) ? 0xFF : (v92 * 0xFF) / 0x64));
|
||||
Rumble_Request(0.0f, ((rumbleStrength > 100) ? 255 : (rumbleStrength * 255) / 100),
|
||||
(CLAMP_MAX(rumbleDuration * 3, 255)),
|
||||
((rumbleDecreaseRate > 100) ? 255 : (rumbleDecreaseRate * 255) / 100));
|
||||
break;
|
||||
|
||||
case GAMEOVER_REVIVE_WAIT_GROUND:
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#include "global.h"
|
||||
#include "vt.h"
|
||||
|
||||
#define KALEIDO_OVERLAY(name, nameString) \
|
||||
{ \
|
||||
NULL, (u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, _ovl_##name##SegmentStart, \
|
||||
_ovl_##name##SegmentEnd, 0, nameString, \
|
||||
#define KALEIDO_OVERLAY(name, nameString) \
|
||||
{ \
|
||||
NULL, (uintptr_t)_ovl_##name##SegmentRomStart, (uintptr_t)_ovl_##name##SegmentRomEnd, \
|
||||
_ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, 0, nameString, \
|
||||
}
|
||||
|
||||
KaleidoMgrOverlay gKaleidoMgrOverlayTable[] = {
|
||||
|
@ -64,7 +64,7 @@ void KaleidoManager_Init(PlayState* play) {
|
|||
osSyncPrintf("KaleidoArea %08x - %08x\n", sKaleidoAreaPtr, (u32)sKaleidoAreaPtr + largestSize);
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
gKaleidoMgrCurOvl = 0;
|
||||
gKaleidoMgrCurOvl = NULL;
|
||||
}
|
||||
|
||||
void KaleidoManager_Destroy(void) {
|
||||
|
|
|
@ -437,7 +437,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused)
|
|||
}
|
||||
|
||||
gCustomLensFlareOn = false;
|
||||
func_800AA15C();
|
||||
Rumble_Reset();
|
||||
}
|
||||
|
||||
u8 Environment_SmoothStepToU8(u8* pvalue, u8 target, u8 scale, u8 step, u8 minStep) {
|
||||
|
@ -883,7 +883,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
|||
|
||||
if ((((void)0, gSaveContext.gameMode) != GAMEMODE_NORMAL) &&
|
||||
(((void)0, gSaveContext.gameMode) != GAMEMODE_END_CREDITS)) {
|
||||
func_800AA16C();
|
||||
Rumble_ClearRequests();
|
||||
}
|
||||
|
||||
if (pauseCtx->state == PAUSE_STATE_OFF) {
|
||||
|
@ -2035,7 +2035,7 @@ void Environment_PlaySceneSequence(PlayState* play) {
|
|||
Audio_PlayNatureAmbienceSequence(NATURE_ID_KOKIRI_REGION);
|
||||
} else if (((void)0, gSaveContext.forcedSeqId) != NA_BGM_GENERAL_SFX) {
|
||||
if (!Environment_IsForcedSequenceDisabled()) {
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | (s32)((void)0, gSaveContext.forcedSeqId));
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, ((void)0, gSaveContext.forcedSeqId));
|
||||
}
|
||||
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
|
||||
} else if (play->sequenceCtx.seqId == NA_BGM_NO_MUSIC) {
|
||||
|
@ -2102,7 +2102,7 @@ void Environment_PlayTimeBasedSequence(PlayState* play) {
|
|||
if (gSaveContext.dayTime > CLOCK_TIME(17, 10)) {
|
||||
if (play->envCtx.precipitation[PRECIP_RAIN_MAX] == 0 &&
|
||||
play->envCtx.precipitation[PRECIP_SOS_MAX] == 0) {
|
||||
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xF000FF);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 240);
|
||||
}
|
||||
|
||||
play->envCtx.timeSeqState++;
|
||||
|
@ -2570,7 +2570,7 @@ void Environment_StopStormNatureAmbience(PlayState* play) {
|
|||
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_RAIN, CHANNEL_IO_PORT_1, 0);
|
||||
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_LIGHTNING, CHANNEL_IO_PORT_1, 0);
|
||||
|
||||
if (func_800FA0B4(SEQ_PLAYER_BGM_MAIN) == NA_BGM_NATURE_AMBIENCE) {
|
||||
if (Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) == NA_BGM_NATURE_AMBIENCE) {
|
||||
gSaveContext.seqId = NA_BGM_NATURE_SFX_RAIN;
|
||||
Environment_PlaySceneSequence(play);
|
||||
}
|
||||
|
|
|
@ -131,7 +131,8 @@ void Map_InitData(PlayState* play, s16 room) {
|
|||
osSyncPrintf(VT_RST);
|
||||
sEntranceIconMapIndex = extendedMapIndex;
|
||||
DmaMgr_SendRequest1(interfaceCtx->mapSegment,
|
||||
(u32)_map_grand_staticSegmentRomStart + gMapData->owMinimapTexOffset[extendedMapIndex],
|
||||
(uintptr_t)_map_grand_staticSegmentRomStart +
|
||||
gMapData->owMinimapTexOffset[extendedMapIndex],
|
||||
gMapData->owMinimapTexSize[mapIndex], "../z_map_exp.c", 309);
|
||||
interfaceCtx->unk_258 = mapIndex;
|
||||
break;
|
||||
|
@ -159,7 +160,7 @@ void Map_InitData(PlayState* play, s16 room) {
|
|||
mapIndex, VREG(30));
|
||||
osSyncPrintf(VT_RST);
|
||||
DmaMgr_SendRequest1(play->interfaceCtx.mapSegment,
|
||||
(u32)_map_i_staticSegmentRomStart +
|
||||
(uintptr_t)_map_i_staticSegmentRomStart +
|
||||
((gMapData->dgnMinimapTexIndexOffset[mapIndex] + room) * 0xFF0),
|
||||
0xFF0, "../z_map_exp.c", 346);
|
||||
R_COMPASS_OFFSET_X = gMapData->roomCompassOffsetX[mapIndex][room];
|
||||
|
|
|
@ -16,8 +16,8 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* loadedRamAddr; // original name: "allocp"
|
||||
/* 0x04 */ u32 vromStart;
|
||||
/* 0x08 */ u32 vromEnd;
|
||||
/* 0x04 */ uintptr_t vromStart;
|
||||
/* 0x08 */ uintptr_t vromEnd;
|
||||
/* 0x0C */ void* vramStart;
|
||||
/* 0x10 */ void* vramEnd;
|
||||
/* 0x14 */ void* vramTable;
|
||||
|
@ -44,8 +44,8 @@ static MapMarkInfo sMapMarkInfoTable[] = {
|
|||
|
||||
static MapMarkDataOverlay sMapMarkDataOvl = {
|
||||
NULL,
|
||||
(u32)_ovl_map_mark_dataSegmentRomStart,
|
||||
(u32)_ovl_map_mark_dataSegmentRomEnd,
|
||||
(uintptr_t)_ovl_map_mark_dataSegmentRomStart,
|
||||
(uintptr_t)_ovl_map_mark_dataSegmentRomEnd,
|
||||
_ovl_map_mark_dataSegmentStart,
|
||||
_ovl_map_mark_dataSegmentEnd,
|
||||
gMapMarkDataTable,
|
||||
|
|
|
@ -1167,8 +1167,8 @@ void Message_LoadItemIcon(PlayState* play, u16 itemId, s16 y) {
|
|||
R_TEXTBOX_ICON_YPOS = y + 6;
|
||||
R_TEXTBOX_ICON_SIZE = 32;
|
||||
DmaMgr_SendRequest1(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE,
|
||||
(u32)_icon_item_staticSegmentRomStart + (itemId * 0x1000), 0x1000, "../z_message_PAL.c",
|
||||
1473);
|
||||
(uintptr_t)_icon_item_staticSegmentRomStart + (itemId * 0x1000), 0x1000,
|
||||
"../z_message_PAL.c", 1473);
|
||||
// "Item 32-0"
|
||||
osSyncPrintf("アイテム32-0\n");
|
||||
} else {
|
||||
|
@ -1176,8 +1176,8 @@ void Message_LoadItemIcon(PlayState* play, u16 itemId, s16 y) {
|
|||
R_TEXTBOX_ICON_YPOS = y + 10;
|
||||
R_TEXTBOX_ICON_SIZE = 24;
|
||||
DmaMgr_SendRequest1(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE,
|
||||
(u32)_icon_item_24_staticSegmentRomStart + (itemId - ITEM_MEDALLION_FOREST) * 0x900, 0x900,
|
||||
"../z_message_PAL.c", 1482);
|
||||
(uintptr_t)_icon_item_24_staticSegmentRomStart + (itemId - ITEM_MEDALLION_FOREST) * 0x900,
|
||||
0x900, "../z_message_PAL.c", 1482);
|
||||
// "Item 24"
|
||||
osSyncPrintf("アイテム24=%d (%d) {%d}\n", itemId, itemId - ITEM_KOKIRI_EMERALD, 84);
|
||||
}
|
||||
|
@ -1535,10 +1535,11 @@ void Message_Decode(PlayState* play) {
|
|||
msgCtx->textboxBackgroundYOffsetIdx = (font->msgBuf[msgCtx->msgBufPos + 3] & 0xF0) >> 4;
|
||||
msgCtx->textboxBackgroundUnkArg = font->msgBuf[msgCtx->msgBufPos + 3] & 0xF;
|
||||
DmaMgr_SendRequest1(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE,
|
||||
(u32)_message_texture_staticSegmentRomStart + msgCtx->textboxBackgroundIdx * 0x900,
|
||||
(uintptr_t)_message_texture_staticSegmentRomStart +
|
||||
msgCtx->textboxBackgroundIdx * 0x900,
|
||||
0x900, "../z_message_PAL.c", 1830);
|
||||
DmaMgr_SendRequest1(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE + 0x900,
|
||||
(u32)_message_texture_staticSegmentRomStart +
|
||||
(uintptr_t)_message_texture_staticSegmentRomStart +
|
||||
(msgCtx->textboxBackgroundIdx + 1) * 0x900,
|
||||
0x900, "../z_message_PAL.c", 1834);
|
||||
msgCtx->msgBufPos += 3;
|
||||
|
@ -1635,23 +1636,23 @@ void Message_OpenText(PlayState* play, u16 textId) {
|
|||
if (sTextIsCredits) {
|
||||
Message_FindCreditsMessage(play, textId);
|
||||
msgCtx->msgLength = font->msgLength;
|
||||
DmaMgr_SendRequest1(font->msgBuf, (u32)(_staff_message_data_staticSegmentRomStart + font->msgOffset),
|
||||
DmaMgr_SendRequest1(font->msgBuf, (uintptr_t)_staff_message_data_staticSegmentRomStart + font->msgOffset,
|
||||
font->msgLength, "../z_message_PAL.c", 1954);
|
||||
} else {
|
||||
if (gSaveContext.language == LANGUAGE_ENG) {
|
||||
Message_FindMessage(play, textId);
|
||||
msgCtx->msgLength = font->msgLength;
|
||||
DmaMgr_SendRequest1(font->msgBuf, (u32)(_nes_message_data_staticSegmentRomStart + font->msgOffset),
|
||||
DmaMgr_SendRequest1(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset,
|
||||
font->msgLength, "../z_message_PAL.c", 1966);
|
||||
} else if (gSaveContext.language == LANGUAGE_GER) {
|
||||
Message_FindMessage(play, textId);
|
||||
msgCtx->msgLength = font->msgLength;
|
||||
DmaMgr_SendRequest1(font->msgBuf, (u32)(_ger_message_data_staticSegmentRomStart + font->msgOffset),
|
||||
DmaMgr_SendRequest1(font->msgBuf, (uintptr_t)_ger_message_data_staticSegmentRomStart + font->msgOffset,
|
||||
font->msgLength, "../z_message_PAL.c", 1978);
|
||||
} else {
|
||||
Message_FindMessage(play, textId);
|
||||
msgCtx->msgLength = font->msgLength;
|
||||
DmaMgr_SendRequest1(font->msgBuf, (u32)(_fra_message_data_staticSegmentRomStart + font->msgOffset),
|
||||
DmaMgr_SendRequest1(font->msgBuf, (uintptr_t)_fra_message_data_staticSegmentRomStart + font->msgOffset,
|
||||
font->msgLength, "../z_message_PAL.c", 1990);
|
||||
}
|
||||
}
|
||||
|
@ -1662,10 +1663,10 @@ void Message_OpenText(PlayState* play, u16 textId) {
|
|||
// "Text Box Type"
|
||||
osSyncPrintf("吹き出し種類=%d\n", msgCtx->textBoxType);
|
||||
if (textBoxType < TEXTBOX_TYPE_NONE_BOTTOM) {
|
||||
DmaMgr_SendRequest1(
|
||||
msgCtx->textboxSegment,
|
||||
(u32)(_message_staticSegmentRomStart + (messageStaticIndices[textBoxType] * MESSAGE_STATIC_TEX_SIZE)),
|
||||
MESSAGE_STATIC_TEX_SIZE, "../z_message_PAL.c", 2006);
|
||||
DmaMgr_SendRequest1(msgCtx->textboxSegment,
|
||||
(uintptr_t)_message_staticSegmentRomStart +
|
||||
(messageStaticIndices[textBoxType] * MESSAGE_STATIC_TEX_SIZE),
|
||||
MESSAGE_STATIC_TEX_SIZE, "../z_message_PAL.c", 2006);
|
||||
if (textBoxType == TEXTBOX_TYPE_BLACK) {
|
||||
msgCtx->textboxColorRed = 0;
|
||||
msgCtx->textboxColorGreen = 0;
|
||||
|
|
|
@ -6,7 +6,7 @@ static s16 sDisableAttention = false;
|
|||
static s16 sUnused = -1;
|
||||
static s32 sPrevFrameCs1100 = -4096;
|
||||
|
||||
#include "z_onepointdemo_data.c"
|
||||
#include "z_onepointdemo_data.inc.c"
|
||||
|
||||
void OnePointCutscene_AddVecSphToVec3f(Vec3f* dst, Vec3f* src, VecSph* vecSph) {
|
||||
Vec3f out;
|
||||
|
|
|
@ -1272,7 +1272,8 @@ void Interface_LoadItemIcon1(PlayState* play, u16 button) {
|
|||
|
||||
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
|
||||
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->iconItemSegment + button * 0x1000,
|
||||
(u32)_icon_item_staticSegmentRomStart + (gSaveContext.equips.buttonItems[button] * 0x1000),
|
||||
(uintptr_t)_icon_item_staticSegmentRomStart +
|
||||
(gSaveContext.equips.buttonItems[button] * 0x1000),
|
||||
0x1000, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1171);
|
||||
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
|
@ -1282,7 +1283,8 @@ void Interface_LoadItemIcon2(PlayState* play, u16 button) {
|
|||
|
||||
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
|
||||
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_180, interfaceCtx->iconItemSegment + button * 0x1000,
|
||||
(u32)_icon_item_staticSegmentRomStart + (gSaveContext.equips.buttonItems[button] * 0x1000),
|
||||
(uintptr_t)_icon_item_staticSegmentRomStart +
|
||||
(gSaveContext.equips.buttonItems[button] * 0x1000),
|
||||
0x1000, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1193);
|
||||
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
|
@ -2081,8 +2083,8 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 l
|
|||
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
|
||||
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160,
|
||||
interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE),
|
||||
(u32)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE,
|
||||
0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145);
|
||||
(uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE),
|
||||
DO_ACTION_TEX_SIZE, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145);
|
||||
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
|
||||
} else {
|
||||
gSegments[7] = VIRTUAL_TO_PHYSICAL(interfaceCtx->doActionSegment);
|
||||
|
@ -2144,8 +2146,8 @@ void Interface_LoadActionLabelB(PlayState* play, u16 action) {
|
|||
|
||||
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
|
||||
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE,
|
||||
(u32)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE, 0,
|
||||
&interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2228);
|
||||
(uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE,
|
||||
0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2228);
|
||||
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
|
||||
|
||||
interfaceCtx->unk_1FA = true;
|
||||
|
|
|
@ -175,7 +175,7 @@ void Play_Destroy(GameState* thisx) {
|
|||
Player* player = GET_PLAYER(this);
|
||||
|
||||
this->state.gfxCtx->callback = NULL;
|
||||
this->state.gfxCtx->callbackParam = 0;
|
||||
this->state.gfxCtx->callbackParam = NULL;
|
||||
|
||||
SREG(91) = 0;
|
||||
R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_OFF;
|
||||
|
@ -852,7 +852,7 @@ void Play_Update(PlayState* this) {
|
|||
PLAY_LOG(3580);
|
||||
|
||||
this->gameplayFrames++;
|
||||
func_800AA178(1);
|
||||
Rumble_SetUpdateEnabled(true);
|
||||
|
||||
if (this->actorCtx.freezeFlashTimer && (this->actorCtx.freezeFlashTimer-- < 5)) {
|
||||
osSyncPrintf("FINISH=%d\n", this->actorCtx.freezeFlashTimer);
|
||||
|
@ -902,7 +902,7 @@ void Play_Update(PlayState* this) {
|
|||
PLAY_LOG(3662);
|
||||
}
|
||||
} else {
|
||||
func_800AA178(0);
|
||||
Rumble_SetUpdateEnabled(false);
|
||||
}
|
||||
|
||||
PLAY_LOG(3672);
|
||||
|
|
|
@ -1659,8 +1659,8 @@ u32 Player_InitDrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime) {
|
|||
gSegments[6] =
|
||||
VIRTUAL_TO_PHYSICAL(segment + PAUSE_EQUIP_BUFFER_SIZE + PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE);
|
||||
|
||||
SkelAnime_InitLink(play, skelAnime, gPlayerSkelHeaders[(void)0, gSaveContext.linkAge], &gPlayerAnim_003238, 9, ptr,
|
||||
ptr, PLAYER_LIMB_MAX);
|
||||
SkelAnime_InitLink(play, skelAnime, gPlayerSkelHeaders[(void)0, gSaveContext.linkAge],
|
||||
&gPlayerAnim_link_normal_wait, 9, ptr, ptr, PLAYER_LIMB_MAX);
|
||||
|
||||
return PAUSE_EQUIP_BUFFER_SIZE + PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE + size +
|
||||
sizeof(Vec3s[PLAYER_LIMB_BUF_COUNT]);
|
||||
|
|
135
src/code/z_rumble.c
Normal file
135
src/code/z_rumble.c
Normal file
|
@ -0,0 +1,135 @@
|
|||
/**
|
||||
* @file z_rumble.c
|
||||
*
|
||||
* This file implements an interface for the game state to set up, manage and request use of the rumble pak. Despite
|
||||
* some parts of the system appearing to accommodate all four controller ports, only controller 1 can be instructed
|
||||
* to rumble.
|
||||
* This file is half of the system that runs on the graph thread alongside the game state. The rest of the system that
|
||||
* processes the requests runs on the padmgr thread and is implemented in `sys_rumble.c`.
|
||||
*
|
||||
* @see sys_rumble.c
|
||||
*
|
||||
* @note Original filename is likely z_vibrate.c or similar as it is ordered after z_ss_sram.c and before z_view.c
|
||||
*/
|
||||
#include "global.h"
|
||||
|
||||
RumbleMgr sRumbleMgr;
|
||||
|
||||
/**
|
||||
* Padmgr callback to update the state of rumble on Vertical Retrace.
|
||||
*
|
||||
* Unlike every other function in this file, this runs on the padmgr thread.
|
||||
*/
|
||||
void Rumble_Update(PadMgr* padMgr, void* arg) {
|
||||
RumbleMgr_Update(&sRumbleMgr);
|
||||
PadMgr_RumbleSet(padMgr, sRumbleMgr.rumbleEnable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Forces the rumble state to use the supplied parameters.
|
||||
* The parameters are the same as in `Rumble_Request`.
|
||||
*
|
||||
* @see Rumble_Request
|
||||
*/
|
||||
void Rumble_Override(f32 distSq, u8 sourceStrength, u8 duration, u8 decreaseRate) {
|
||||
s32 dist;
|
||||
s32 strength;
|
||||
|
||||
if (distSq > SQ(1000)) {
|
||||
dist = 1000;
|
||||
} else {
|
||||
dist = sqrtf(distSq);
|
||||
}
|
||||
|
||||
if (dist < 1000 && sourceStrength != 0 && decreaseRate != 0) {
|
||||
// Decrease the strength linearly with distance
|
||||
strength = sourceStrength - (dist * 255) / 1000;
|
||||
|
||||
if (strength > 0) {
|
||||
// Note: sRumbleMgr is a shared resource between the graph and padmgr threads, no locking is done
|
||||
// to ensure that the entire request is written before it is possibly used.
|
||||
sRumbleMgr.overrideStrength = strength;
|
||||
sRumbleMgr.overrideDuration = duration;
|
||||
sRumbleMgr.overrideDecreaseRate = decreaseRate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits a request to the rumble manager with the properties given in the arguments. If there is no free request slot
|
||||
* the request is silently dropped.
|
||||
*
|
||||
* @param distSq
|
||||
* Squared distance, usually taken to be from an apparent source to the player in world coordinates.
|
||||
* @param sourceStrength
|
||||
* The strength of the rumble at 0 distance from the source.
|
||||
* The rumble source strength decreases linearly with distance, a distance of 0 results in the full source strength
|
||||
* while a distance of 1000 or greater is discarded. A source strength of 0 is discarded. A minimum source strength
|
||||
* of 1 drops to 0 at 3 units of distance from the source. A maximum source strength of 255 drops to 0 at 1000
|
||||
* units of distance from the source.
|
||||
* Note that, once the request has been submitted, if the distance to the source changes in subsequent frames while
|
||||
* the rumble request is still running, the request will not be updated with the new distance.
|
||||
* @param duration
|
||||
* The duration for which the rumble will sustain full strength. It is measured in Vertical Retraces rather than
|
||||
* game frames. There are ~60 Retraces/s on NTSC and 50 Retraces/s on PAL.
|
||||
* @param decreaseRate
|
||||
* The amount by which to lower the strength every Vertical Retrace once duration has hit 0.
|
||||
*/
|
||||
void Rumble_Request(f32 distSq, u8 sourceStrength, u8 duration, u8 decreaseRate) {
|
||||
s32 dist;
|
||||
s32 strength;
|
||||
s32 i;
|
||||
|
||||
if (distSq > SQ(1000)) {
|
||||
dist = 1000;
|
||||
} else {
|
||||
dist = sqrtf(distSq);
|
||||
}
|
||||
|
||||
if (dist < 1000 && sourceStrength != 0 && decreaseRate != 0) {
|
||||
// Decrease the strength linearly with distance
|
||||
strength = sourceStrength - (dist * 255) / 1000;
|
||||
|
||||
for (i = 0; i < RUMBLE_MAX_REQUESTS; i++) {
|
||||
// Search for an empty slot
|
||||
if (sRumbleMgr.reqStrengths[i] == 0) {
|
||||
if (strength > 0) {
|
||||
// Note: sRumbleMgr is a shared resource between the graph and padmgr threads, no locking is done
|
||||
// to ensure that the entire request is written before it is possibly used.
|
||||
sRumbleMgr.reqStrengths[i] = strength;
|
||||
sRumbleMgr.reqDurations[i] = duration;
|
||||
sRumbleMgr.reqDecreaseRates[i] = decreaseRate;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Rumble_Init(void) {
|
||||
RumbleMgr_Init(&sRumbleMgr);
|
||||
PADMGR_SET_RETRACE_CALLACK(&gPadMgr, Rumble_Update, NULL);
|
||||
}
|
||||
|
||||
void Rumble_Destroy(void) {
|
||||
PadMgr* padmgr = &gPadMgr;
|
||||
|
||||
PADMGR_UNSET_RETRACE_CALLACK(padmgr, Rumble_Update, NULL);
|
||||
RumbleMgr_Destroy(&sRumbleMgr);
|
||||
}
|
||||
|
||||
s32 Rumble_Controller1HasRumblePak(void) {
|
||||
return gPadMgr.pakType[0] == CONT_PAK_RUMBLE;
|
||||
}
|
||||
|
||||
void Rumble_Reset(void) {
|
||||
sRumbleMgr.state = RUMBLE_STATE_RESET;
|
||||
}
|
||||
|
||||
void Rumble_ClearRequests(void) {
|
||||
sRumbleMgr.state = RUMBLE_STATE_CLEAR;
|
||||
}
|
||||
|
||||
void Rumble_SetUpdateEnabled(u32 enable) {
|
||||
sRumbleMgr.updateEnabled = !!enable;
|
||||
}
|
|
@ -80,7 +80,7 @@ void Sample_LoadTitleStatic(SampleState* this) {
|
|||
u32 size = _title_staticSegmentRomEnd - _title_staticSegmentRomStart;
|
||||
|
||||
this->staticSegment = GameState_Alloc(&this->state, size, "../z_sample.c", 163);
|
||||
DmaMgr_SendRequest1(this->staticSegment, (u32)_title_staticSegmentRomStart, size, "../z_sample.c", 164);
|
||||
DmaMgr_SendRequest1(this->staticSegment, (uintptr_t)_title_staticSegmentRomStart, size, "../z_sample.c", 164);
|
||||
}
|
||||
|
||||
void Sample_Init(GameState* thisx) {
|
||||
|
|
|
@ -397,7 +397,7 @@ void Scene_CommandSoundSettings(PlayState* play, SceneCmd* cmd) {
|
|||
play->sequenceCtx.natureAmbienceId = cmd->soundSettings.natureAmbienceId;
|
||||
|
||||
if (gSaveContext.seqId == (u8)NA_BGM_DISABLED) {
|
||||
Audio_QueueSeqCmd(cmd->soundSettings.specId | 0xF0000000);
|
||||
SEQCMD_RESET_AUDIO_HEAP(0, cmd->soundSettings.specId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable,
|
|||
|
||||
newDList = limbDList = rootLimb->dLists[lod];
|
||||
|
||||
if ((overrideLimbDraw == 0) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) {
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
Matrix_ToMtx(mtx, "../z_skelanime.c", 1033);
|
||||
|
|
|
@ -449,16 +449,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_BAZAAR:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_SP1a_staticSegmentRomStart;
|
||||
size = (u32)_vr_SP1a_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_SP1a_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_SP1a_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1127);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1128);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1129);
|
||||
|
||||
start = (u32)_vr_SP1a_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_SP1a_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_SP1a_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_SP1a_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1132);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1133);
|
||||
|
||||
|
@ -466,8 +466,8 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
skyboxCtx->rot.y = 0.8f;
|
||||
break;
|
||||
case SKYBOX_OVERCAST_SUNSET:
|
||||
start = (u32)_vr_cloud2_staticSegmentRomStart;
|
||||
size = (u32)_vr_cloud2_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_cloud2_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_cloud2_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1155);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1156);
|
||||
|
@ -480,8 +480,8 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[1], start, size, "../z_vr_box.c", 1166);
|
||||
|
||||
start = (u32)_vr_cloud2_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_cloud2_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_cloud2_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_cloud2_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1170);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1171);
|
||||
|
||||
|
@ -491,16 +491,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_MARKET_ADULT:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_RUVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_RUVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_RUVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_RUVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1182);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1183);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1184);
|
||||
|
||||
start = (u32)_vr_RUVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_RUVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_RUVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_RUVR_pal_staticSegmentRomEnd - start;
|
||||
osSyncPrintf("SIZE = %d\n", size);
|
||||
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1188);
|
||||
|
@ -509,44 +509,44 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1190);
|
||||
break;
|
||||
case SKYBOX_CUTSCENE_MAP:
|
||||
start = (u32)_vr_holy0_staticSegmentRomStart;
|
||||
size = (u32)_vr_holy0_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_holy0_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_holy0_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1196);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1197);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1200);
|
||||
|
||||
start = (u32)_vr_holy1_staticSegmentRomStart;
|
||||
size = (u32)_vr_holy1_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_holy1_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_holy1_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[1] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1203);
|
||||
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
|
||||
1204);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[1], start, size, "../z_vr_box.c", 1207);
|
||||
|
||||
start = (u32)_vr_holy0_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_holy0_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_holy0_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_holy0_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1211);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1212);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1214);
|
||||
DmaMgr_SendRequest1((u8*)skyboxCtx->palettes + size, (u32)_vr_holy1_pal_staticSegmentRomStart, size,
|
||||
DmaMgr_SendRequest1((u8*)skyboxCtx->palettes + size, (uintptr_t)_vr_holy1_pal_staticSegmentRomStart, size,
|
||||
"../z_vr_box.c", 1216);
|
||||
break;
|
||||
case SKYBOX_HOUSE_LINK:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_LHVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_LHVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_LHVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_LHVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1226);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1227);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1228);
|
||||
|
||||
start = (u32)_vr_LHVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_LHVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_LHVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_LHVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1231);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1232);
|
||||
|
||||
|
@ -555,16 +555,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_MARKET_CHILD_DAY:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_MDVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_MDVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_MDVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_MDVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1257);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1258);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1259);
|
||||
|
||||
start = (u32)_vr_MDVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_MDVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_MDVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_MDVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1262);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1263);
|
||||
|
||||
|
@ -573,16 +573,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_MARKET_CHILD_NIGHT:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_MNVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_MNVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_MNVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_MNVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1271);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1272);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1273);
|
||||
|
||||
start = (u32)_vr_MNVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_MNVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_MNVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_MNVR_pal_staticSegmentRomEnd - start;
|
||||
osSyncPrintf("SIZE = %d\n", size);
|
||||
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1277);
|
||||
|
@ -593,16 +593,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_HAPPY_MASK_SHOP:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_FCVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_FCVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_FCVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_FCVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1286);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1287);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1288);
|
||||
|
||||
start = (u32)_vr_FCVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_FCVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_FCVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_FCVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1291);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1292);
|
||||
|
||||
|
@ -612,16 +612,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_HOUSE_KNOW_IT_ALL_BROTHERS:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_KHVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_KHVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_KHVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_KHVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1301);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1302);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1303);
|
||||
|
||||
start = (u32)_vr_KHVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_KHVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_KHVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_KHVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1306);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1307);
|
||||
|
||||
|
@ -630,16 +630,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_HOUSE_OF_TWINS:
|
||||
skyboxCtx->unk_140 = 2;
|
||||
|
||||
start = (u32)_vr_K3VR_staticSegmentRomStart;
|
||||
size = (u32)_vr_K3VR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_K3VR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_K3VR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1331);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1332);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1333);
|
||||
|
||||
start = (u32)_vr_K3VR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_K3VR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_K3VR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_K3VR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1336);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1337);
|
||||
|
||||
|
@ -648,16 +648,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_STABLES:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_MLVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_MLVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_MLVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_MLVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1345);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1346);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1347);
|
||||
|
||||
start = (u32)_vr_MLVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_MLVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_MLVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_MLVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1350);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1351);
|
||||
|
||||
|
@ -666,16 +666,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_HOUSE_KAKARIKO:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_KKRVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_KKRVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_KKRVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_KKRVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1359);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1360);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1361);
|
||||
|
||||
start = (u32)_vr_KKRVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_KKRVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_KKRVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_KKRVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1364);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1365);
|
||||
|
||||
|
@ -684,16 +684,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_KOKIRI_SHOP:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_KSVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_KSVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_KSVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_KSVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1373);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1374);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1375);
|
||||
|
||||
start = (u32)_vr_KSVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_KSVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_KSVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_KSVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1378);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1379);
|
||||
|
||||
|
@ -703,16 +703,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_GORON_SHOP:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_GLVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_GLVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_GLVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_GLVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1405);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1406);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1407);
|
||||
|
||||
start = (u32)_vr_GLVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_GLVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_GLVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_GLVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1410);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1411);
|
||||
|
||||
|
@ -722,16 +722,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_ZORA_SHOP:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_ZRVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_ZRVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_ZRVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_ZRVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1420);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1421);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1422);
|
||||
|
||||
start = (u32)_vr_ZRVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_ZRVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_ZRVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_ZRVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1425);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1426);
|
||||
|
||||
|
@ -741,16 +741,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_POTION_SHOP_KAKARIKO:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_DGVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_DGVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_DGVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_DGVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1451);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1452);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1453);
|
||||
|
||||
start = (u32)_vr_DGVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_DGVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_DGVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_DGVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1456);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1457);
|
||||
|
||||
|
@ -760,16 +760,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_POTION_SHOP_MARKET:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_ALVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_ALVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_ALVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_ALVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1466);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1467);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1468);
|
||||
|
||||
start = (u32)_vr_ALVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_ALVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_ALVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_ALVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1471);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1472);
|
||||
|
||||
|
@ -779,16 +779,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_BOMBCHU_SHOP:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_NSVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_NSVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_NSVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_NSVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1481);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1482);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1483);
|
||||
|
||||
start = (u32)_vr_NSVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_NSVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_NSVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_NSVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1486);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1487);
|
||||
|
||||
|
@ -798,16 +798,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_HOUSE_RICHARD:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_IPVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_IPVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_IPVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_IPVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1512);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1513);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1514);
|
||||
|
||||
start = (u32)_vr_IPVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_IPVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_IPVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_IPVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1517);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1518);
|
||||
|
||||
|
@ -816,16 +816,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_HOUSE_IMPA:
|
||||
skyboxCtx->unk_140 = 1;
|
||||
|
||||
start = (u32)_vr_LBVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_LBVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_LBVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_LBVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1526);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1527);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1528);
|
||||
|
||||
start = (u32)_vr_LBVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_LBVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_LBVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_LBVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1531);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1532);
|
||||
|
||||
|
@ -834,16 +834,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_TENT:
|
||||
skyboxCtx->unk_140 = 2;
|
||||
|
||||
start = (u32)_vr_TTVR_staticSegmentRomStart;
|
||||
size = (u32)_vr_TTVR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_TTVR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_TTVR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1540);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1541);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1542);
|
||||
|
||||
start = (u32)_vr_TTVR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_TTVR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_TTVR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_TTVR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1545);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1546);
|
||||
|
||||
|
@ -852,16 +852,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_HOUSE_MIDO:
|
||||
skyboxCtx->unk_140 = 2;
|
||||
|
||||
start = (u32)_vr_K4VR_staticSegmentRomStart;
|
||||
size = (u32)_vr_K4VR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_K4VR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_K4VR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1560);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1561);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1562);
|
||||
|
||||
start = (u32)_vr_K4VR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_K4VR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_K4VR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_K4VR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1565);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1566);
|
||||
|
||||
|
@ -870,16 +870,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_HOUSE_SARIA:
|
||||
skyboxCtx->unk_140 = 2;
|
||||
|
||||
start = (u32)_vr_K5VR_staticSegmentRomStart;
|
||||
size = (u32)_vr_K5VR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_K5VR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_K5VR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1574);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1575);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1576);
|
||||
|
||||
start = (u32)_vr_K5VR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_K5VR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_K5VR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_K5VR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1579);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1580);
|
||||
|
||||
|
@ -888,16 +888,16 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
|
|||
case SKYBOX_HOUSE_ALLEY:
|
||||
skyboxCtx->unk_140 = 2;
|
||||
|
||||
start = (u32)_vr_KR3VR_staticSegmentRomStart;
|
||||
size = (u32)_vr_KR3VR_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_KR3VR_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_KR3VR_staticSegmentRomEnd - start;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1588);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1589);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1590);
|
||||
|
||||
start = (u32)_vr_KR3VR_pal_staticSegmentRomStart;
|
||||
size = (u32)_vr_KR3VR_pal_staticSegmentRomEnd - start;
|
||||
start = (uintptr_t)_vr_KR3VR_pal_staticSegmentRomStart;
|
||||
size = (uintptr_t)_vr_KR3VR_pal_staticSegmentRomEnd - start;
|
||||
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1593);
|
||||
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1594);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "ultra64.h"
|
||||
#include "sintable.c"
|
||||
|
||||
#include "sintable.inc.c"
|
||||
|
||||
s16 sins(u16 x) {
|
||||
s16 value;
|
||||
|
|
|
@ -26,7 +26,7 @@ s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* e
|
|||
|
||||
if ((dir.company_code == companyCode) && (dir.game_code == gameCode)) {
|
||||
err = 0;
|
||||
if (gameName != 0) {
|
||||
if (gameName != NULL) {
|
||||
for (i = 0; i < PFS_FILE_NAME_LEN; i++) {
|
||||
if (dir.game_name[i] != gameName[i]) {
|
||||
err = 1;
|
||||
|
@ -34,7 +34,7 @@ s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* e
|
|||
}
|
||||
}
|
||||
}
|
||||
if ((extName != 0) && (err == 0)) {
|
||||
if ((extName != NULL) && (err == 0)) {
|
||||
for (i = 0; i < PFS_FILE_EXT_LEN; i++) {
|
||||
if (dir.ext_name[i] != extName[i]) {
|
||||
err = 1;
|
||||
|
|
|
@ -182,7 +182,7 @@ void func_8086C054(BgBdanObjects* this, PlayState* play) {
|
|||
player->actor.world.pos.x = -1130.0f;
|
||||
player->actor.world.pos.y = -1025.0f;
|
||||
player->actor.world.pos.z = -3300.0f;
|
||||
func_800AA000(0.0f, 0xFF, 0x14, 0x96);
|
||||
Rumble_Request(0.0f, 255, 20, 150);
|
||||
}
|
||||
} else if (this->timer != 0) {
|
||||
if (this->timer != 0) {
|
||||
|
@ -207,13 +207,13 @@ void func_8086C1A0(BgBdanObjects* this, PlayState* play) {
|
|||
this->actionFunc = func_8086C29C;
|
||||
this->timer = 30;
|
||||
BgBdanObjects_SetContactRu1(this, 2);
|
||||
func_800AA000(0.0f, 0xFF, 0x14, 0x96);
|
||||
Rumble_Request(0.0f, 255, 20, 150);
|
||||
} else {
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
}
|
||||
if (this->timer == 0) {
|
||||
func_800AA000(0.0f, 0x78, 0x14, 0xA);
|
||||
Rumble_Request(0.0f, 120, 20, 10);
|
||||
this->timer = 11;
|
||||
}
|
||||
func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_RISING - SFX_FLAG);
|
||||
|
@ -261,14 +261,14 @@ void func_8086C3D8(BgBdanObjects* this, PlayState* play) {
|
|||
player->actor.world.pos.z = -3500.0f;
|
||||
player->actor.shape.rot.y = 0x7530;
|
||||
player->actor.world.rot.y = player->actor.shape.rot.y;
|
||||
func_800AA000(0.0f, 0xFF, 0x1E, 0x96);
|
||||
Rumble_Request(0.0f, 255, 30, 150);
|
||||
} else {
|
||||
func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_FALL - SFX_FLAG);
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
}
|
||||
if (this->timer == 0) {
|
||||
func_800AA000(0.0f, 0x78, 0x14, 0xA);
|
||||
Rumble_Request(0.0f, 120, 20, 10);
|
||||
this->timer = 11;
|
||||
}
|
||||
if (this->dyna.actor.child != NULL) {
|
||||
|
|
|
@ -273,7 +273,7 @@ void func_8086D694(BgBdanSwitch* this, PlayState* play) {
|
|||
if (this->unk_1C8 <= 0.1f) {
|
||||
func_8086D730(this);
|
||||
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
|
||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
|
||||
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ void func_8086D8CC(BgBdanSwitch* this, PlayState* play) {
|
|||
if (this->unk_1C8 <= 0.6f) {
|
||||
func_8086D9F8(this);
|
||||
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
|
||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
|
||||
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -351,7 +351,7 @@ void func_8086D95C(BgBdanSwitch* this, PlayState* play) {
|
|||
if (this->unk_1C8 <= 0.1f) {
|
||||
func_8086DB24(this);
|
||||
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
|
||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
|
||||
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ void func_8086E638(BgBomGuard* this, PlayState* play) {
|
|||
|
||||
this->unk_168 = 0;
|
||||
|
||||
while (it != 0) {
|
||||
while (it != NULL) {
|
||||
if (it->id == ACTOR_EN_BOM_BOWL_MAN) {
|
||||
if ((((EnBomBowlMan*)it)->minigamePlayStatus != 0) && (fabsf(play->view.eye.x) > -20.0f) &&
|
||||
(fabsf(play->view.eye.y) > 110.0f)) {
|
||||
|
|
|
@ -127,7 +127,7 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, PlayState* play) {
|
|||
f32 effectStrength;
|
||||
|
||||
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 4.0f, 0.5f, 0.025f, 0.0f);
|
||||
func_800AA000(500.0f, 0x78, 0x14, 0xA);
|
||||
Rumble_Request(500.0f, 120, 20, 10);
|
||||
|
||||
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 200.0f - 20.0f, 0.075f,
|
||||
this->dyna.actor.speedXZ, 0.0075f) == 0.0f) {
|
||||
|
|
|
@ -244,7 +244,7 @@ void BgDodoago_OpenJaw(BgDodoago* this, PlayState* play) {
|
|||
BgDodoago_SpawnSparkles(&pos, play);
|
||||
|
||||
Math_StepToS(&this->state, 100, 3);
|
||||
func_800AA000(500.0f, 0x78, 0x14, 0xA);
|
||||
Rumble_Request(500.0f, 120, 20, 10);
|
||||
|
||||
if (Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, 0x1333, 110 - this->state, 0x3E8, 0x32) == 0) {
|
||||
BgDodoago_SetupAction(this, BgDodoago_DoNothing);
|
||||
|
|
|
@ -180,7 +180,7 @@ void BgHakaTrap_Init(Actor* thisx, PlayState* play) {
|
|||
thisx->uncullZoneScale = 500.0f;
|
||||
}
|
||||
|
||||
CollisionCheck_SetInfo(&thisx->colChkInfo, 0, &sColChkInfoInit);
|
||||
CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit);
|
||||
}
|
||||
|
||||
void BgHakaTrap_Destroy(Actor* thisx, PlayState* play) {
|
||||
|
|
|
@ -189,7 +189,7 @@ void BgHeavyBlock_MovePiece(BgHeavyBlock* this, PlayState* play) {
|
|||
thisx->velocity.z = Rand_CenteredFloat(8.0f);
|
||||
BgHeavyBlock_SetPieceRandRot(this, 1.0f);
|
||||
Audio_PlayActorSfx2(thisx, NA_SE_EV_ROCK_BROKEN);
|
||||
func_800AA000(thisx->xzDistToPlayer, 0x96, 0xA, 8);
|
||||
Rumble_Request(thisx->xzDistToPlayer, 150, 10, 8);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ void BgHeavyBlock_LiftedUp(BgHeavyBlock* this, PlayState* play) {
|
|||
f32 xOffset;
|
||||
|
||||
if (this->timer == 11) {
|
||||
func_800AA000(0.0f, 0xFF, 0x14, 0x14);
|
||||
Rumble_Request(0.0f, 255, 20, 20);
|
||||
func_8002F7DC(&player->actor, NA_SE_PL_PULL_UP_BIGROCK);
|
||||
LOG_STRING("NA_SE_PL_PULL_UP_BIGROCK", "../z_bg_heavy_block.c", 691);
|
||||
}
|
||||
|
@ -390,7 +390,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) {
|
|||
this->dyna.actor.floorHeight = yIntersect;
|
||||
|
||||
if (this->dyna.actor.home.pos.y <= yIntersect) {
|
||||
func_800AA000(0.0f, 0xFF, 0x3C, 4);
|
||||
Rumble_Request(0.0f, 255, 60, 4);
|
||||
|
||||
switch (this->dyna.actor.params & 0xFF) {
|
||||
case HEAVYBLOCK_BREAKABLE:
|
||||
|
|
|
@ -313,7 +313,7 @@ void func_80888860(BgHidanHamstep* this, PlayState* play) {
|
|||
Quake_SetQuakeValues(quakeIndex, 0, 0, 500, 0);
|
||||
Quake_SetCountdown(quakeIndex, 20);
|
||||
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
|
||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 255, 20, 150);
|
||||
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 255, 20, 150);
|
||||
func_80888638(this, play);
|
||||
osSyncPrintf("A(%d)\n", this->dyna.actor.params);
|
||||
}
|
||||
|
@ -373,7 +373,7 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) {
|
|||
Quake_SetCountdown(quakeIndex, 7);
|
||||
|
||||
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
|
||||
func_800AA000(10000.0f, 255, 20, 150);
|
||||
Rumble_Request(SQ(100.0f), 255, 20, 150);
|
||||
func_808884C8(this, play);
|
||||
|
||||
if ((this->dyna.actor.params & 0xFF) == 5) {
|
||||
|
|
|
@ -161,7 +161,7 @@ void func_808894B0(BgHidanHrock* this, PlayState* play) {
|
|||
(Math_CosS(this->dyna.actor.world.rot.y + (this->unk_168 << 0xE)) * 5.0f) + this->dyna.actor.home.pos.z;
|
||||
|
||||
if (!(this->unk_168 % 4)) {
|
||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100);
|
||||
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100);
|
||||
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
|
||||
}
|
||||
|
||||
|
|
|
@ -233,7 +233,7 @@ void func_8088B69C(BgHidanRock* this, PlayState* play) {
|
|||
}
|
||||
|
||||
if (!(this->timer % 4)) {
|
||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0xB4, 0x0A, 0x64);
|
||||
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100);
|
||||
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ void func_8088E5D0(BgHidanSima* this, PlayState* play) {
|
|||
this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z;
|
||||
}
|
||||
if (!(this->timer % 4)) {
|
||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100);
|
||||
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 10, 100);
|
||||
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,27 @@
|
|||
/*
|
||||
* File: z_bg_ice_shelter.c
|
||||
* Overlay: Bg_Ice_Shelter
|
||||
* Description: Red Ice
|
||||
*/
|
||||
|
||||
#include "z_bg_ice_shelter.h"
|
||||
#include "assets/objects/object_ice_objects/object_ice_objects.h"
|
||||
|
||||
#define FLAGS 0
|
||||
|
||||
#define BGICESHELTER_GET_TYPE(thisx) (((thisx)->params >> 8) & 7)
|
||||
#define BGICESHELTER_NO_SWITCH_FLAG(thisx) (((thisx)->params >> 6) & 1)
|
||||
|
||||
void BgIceShelter_Init(Actor* thisx, PlayState* play);
|
||||
void BgIceShelter_Destroy(Actor* thisx, PlayState* play);
|
||||
void BgIceShelter_Update(Actor* thisx, PlayState* play);
|
||||
void BgIceShelter_Draw(Actor* thisx, PlayState* play2);
|
||||
|
||||
void func_80891064(BgIceShelter* this);
|
||||
void func_808911BC(BgIceShelter* this);
|
||||
void BgIceShelter_SetupIdle(BgIceShelter* this);
|
||||
void BgIceShelter_SetupMelt(BgIceShelter* this);
|
||||
|
||||
void func_8089107C(BgIceShelter* this, PlayState* play);
|
||||
void func_808911D4(BgIceShelter* this, PlayState* play);
|
||||
void BgIceShelter_Idle(BgIceShelter* this, PlayState* play);
|
||||
void BgIceShelter_Melt(BgIceShelter* this, PlayState* play);
|
||||
|
||||
const ActorInit Bg_Ice_Shelter_InitVars = {
|
||||
ACTOR_BG_ICE_SHELTER,
|
||||
|
@ -26,12 +35,12 @@ const ActorInit Bg_Ice_Shelter_InitVars = {
|
|||
(ActorFunc)BgIceShelter_Draw,
|
||||
};
|
||||
|
||||
static f32 sScales[] = { 0.1f, 0.06f, 0.1f, 0.1f, 0.25f };
|
||||
static f32 sRedIceScales[] = { 0.1f, 0.06f, 0.1f, 0.1f, 0.25f };
|
||||
|
||||
static Color_RGBA8 sDustPrimColor = { 250, 250, 250, 255 };
|
||||
static Color_RGBA8 sDustEnvColor = { 180, 180, 180, 255 };
|
||||
static Color_RGBA8 sSteamPrimColor = { 250, 250, 250, 255 };
|
||||
static Color_RGBA8 sSteamEnvColor = { 180, 180, 180, 255 };
|
||||
|
||||
static ColliderCylinderInit D_8089170C = {
|
||||
static ColliderCylinderInit sCylinderInit1 = {
|
||||
{
|
||||
COLTYPE_NONE,
|
||||
AT_NONE,
|
||||
|
@ -51,7 +60,7 @@ static ColliderCylinderInit D_8089170C = {
|
|||
{ 0, 0, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
static ColliderCylinderInit D_80891738 = {
|
||||
static ColliderCylinderInit sCylinderInit2 = {
|
||||
{
|
||||
COLTYPE_HARD,
|
||||
AT_NONE,
|
||||
|
@ -71,34 +80,39 @@ static ColliderCylinderInit D_80891738 = {
|
|||
{ 0, 0, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
void func_80890740(BgIceShelter* this, PlayState* play) {
|
||||
/**
|
||||
* Initializes either one or both cylinder colliders, depending on the actor's type.
|
||||
*/
|
||||
void BgIceShelter_InitColliders(BgIceShelter* this, PlayState* play) {
|
||||
static s16 cylinderRadii[] = { 47, 33, 44, 41, 100 };
|
||||
static s16 cylinderHeights[] = { 80, 54, 90, 60, 200 };
|
||||
s32 pad;
|
||||
s32 type = (this->dyna.actor.params >> 8) & 7;
|
||||
s32 type = BGICESHELTER_GET_TYPE(&this->dyna.actor);
|
||||
|
||||
// All types use at least one collider in order to detect blue fire
|
||||
Collider_InitCylinder(play, &this->cylinder1);
|
||||
Collider_SetCylinder(play, &this->cylinder1, &this->dyna.actor, &D_8089170C);
|
||||
Collider_SetCylinder(play, &this->cylinder1, &this->dyna.actor, &sCylinderInit1);
|
||||
Collider_UpdateCylinder(&this->dyna.actor, &this->cylinder1);
|
||||
|
||||
this->cylinder1.dim.radius = cylinderRadii[type];
|
||||
this->cylinder1.dim.height = cylinderHeights[type];
|
||||
|
||||
if (type == 0 || type == 1 || type == 4) {
|
||||
// The wall and platform types use DynaPoly for collision, so they don't need the second collider
|
||||
if (type == RED_ICE_LARGE || type == RED_ICE_SMALL || type == RED_ICE_KING_ZORA) {
|
||||
Collider_InitCylinder(play, &this->cylinder2);
|
||||
Collider_SetCylinder(play, &this->cylinder2, &this->dyna.actor, &D_80891738);
|
||||
Collider_SetCylinder(play, &this->cylinder2, &this->dyna.actor, &sCylinderInit2);
|
||||
Collider_UpdateCylinder(&this->dyna.actor, &this->cylinder2);
|
||||
this->cylinder2.dim.radius = cylinderRadii[type];
|
||||
this->cylinder2.dim.height = cylinderHeights[type];
|
||||
}
|
||||
|
||||
if (type == 4) {
|
||||
if (type == RED_ICE_KING_ZORA) {
|
||||
this->cylinder1.dim.pos.z += 30;
|
||||
this->cylinder2.dim.pos.z += 30;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80890874(BgIceShelter* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) {
|
||||
void BgIceShelter_InitDynaPoly(BgIceShelter* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) {
|
||||
s32 pad;
|
||||
CollisionHeader* colHeader = NULL;
|
||||
s32 pad2;
|
||||
|
@ -114,7 +128,7 @@ void func_80890874(BgIceShelter* this, PlayState* play, CollisionHeader* collisi
|
|||
}
|
||||
}
|
||||
|
||||
void func_808908FC(Vec3f* dest, Vec3f* src, s16 angle) {
|
||||
void BgIceShelter_RotateY(Vec3f* dest, Vec3f* src, s16 angle) {
|
||||
f32 sin = Math_SinS(angle);
|
||||
f32 cos = Math_CosS(angle);
|
||||
|
||||
|
@ -132,42 +146,45 @@ 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 = (this->dyna.actor.params >> 8) & 7;
|
||||
s16 type = BGICESHELTER_GET_TYPE(&this->dyna.actor);
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
|
||||
if (type == 4) {
|
||||
if (type == RED_ICE_KING_ZORA) {
|
||||
this->dyna.actor.world.rot.x += 0xBB8;
|
||||
this->dyna.actor.world.pos.y -= 45.0f;
|
||||
this->dyna.actor.shape.rot.x = this->dyna.actor.world.rot.x;
|
||||
this->dyna.actor.world.pos.z -= 38.0f;
|
||||
}
|
||||
|
||||
if (type == 4) {
|
||||
if (type == RED_ICE_KING_ZORA) {
|
||||
Math_Vec3f_Copy(&this->dyna.actor.scale, &kzIceScale);
|
||||
} else {
|
||||
Actor_SetScale(&this->dyna.actor, sScales[type]);
|
||||
Actor_SetScale(&this->dyna.actor, sRedIceScales[type]);
|
||||
}
|
||||
|
||||
// Only 2 types use DynaPoly
|
||||
switch (type) {
|
||||
case 2:
|
||||
func_80890874(this, play, &object_ice_objects_Col_001C1C, 0);
|
||||
case RED_ICE_PLATFORM:
|
||||
BgIceShelter_InitDynaPoly(this, play, &gRedIcePlatformCol, 0);
|
||||
break;
|
||||
case 3:
|
||||
func_80890874(this, play, &object_ice_objects_Col_002920, 0);
|
||||
case RED_ICE_WALL:
|
||||
BgIceShelter_InitDynaPoly(this, play, &gRedIceWallCol, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
func_80890740(this, play);
|
||||
// All types use at least one collider
|
||||
BgIceShelter_InitColliders(this, play);
|
||||
|
||||
this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE;
|
||||
|
||||
if (!((this->dyna.actor.params >> 6) & 1) && (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F))) {
|
||||
// The only red ice actor in the game that doesn't use a switch flag is the one for King Zora
|
||||
if (!BGICESHELTER_NO_SWITCH_FLAG(&this->dyna.actor) && (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F))) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
return;
|
||||
}
|
||||
|
||||
func_80891064(this);
|
||||
BgIceShelter_SetupIdle(this);
|
||||
|
||||
osSyncPrintf("(ice shelter)(arg_data 0x%04x)\n", this->dyna.actor.params);
|
||||
}
|
||||
|
@ -175,15 +192,15 @@ void BgIceShelter_Init(Actor* thisx, PlayState* play) {
|
|||
void BgIceShelter_Destroy(Actor* thisx, PlayState* play) {
|
||||
BgIceShelter* this = (BgIceShelter*)thisx;
|
||||
|
||||
switch ((this->dyna.actor.params >> 8) & 7) {
|
||||
case 2:
|
||||
case 3:
|
||||
switch (BGICESHELTER_GET_TYPE(&this->dyna.actor)) {
|
||||
case RED_ICE_PLATFORM:
|
||||
case RED_ICE_WALL:
|
||||
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
|
||||
break;
|
||||
|
||||
case 0:
|
||||
case 1:
|
||||
case 4:
|
||||
case RED_ICE_LARGE:
|
||||
case RED_ICE_SMALL:
|
||||
case RED_ICE_KING_ZORA:
|
||||
Collider_DestroyCylinder(play, &this->cylinder2);
|
||||
break;
|
||||
}
|
||||
|
@ -191,126 +208,155 @@ void BgIceShelter_Destroy(Actor* thisx, PlayState* play) {
|
|||
Collider_DestroyCylinder(play, &this->cylinder1);
|
||||
}
|
||||
|
||||
static s16 D_80891794[] = { 0x0000, 0x4000, 0x2000, 0x6000, 0x1000, 0x5000, 0x3000, 0x7000 };
|
||||
static s16 D_808917A4[] = { 0x0000, 0x003C, 0x0018, 0x0054, 0x0030, 0x000C, 0x0048, 0x0024 };
|
||||
/**
|
||||
* Angles used to spawn steam particles in a circle.
|
||||
*/
|
||||
static s16 sSteamCircleAngles[] = { 0x0000, 0x4000, 0x2000, 0x6000, 0x1000, 0x5000, 0x3000, 0x7000 };
|
||||
|
||||
void func_80890B8C(BgIceShelter* this, PlayState* play, f32 chance, f32 scale) {
|
||||
/**
|
||||
* Positions used to spawn steam particles in a straight line.
|
||||
*/
|
||||
static s16 sSteamLinePositions[] = { 0x0000, 0x003C, 0x0018, 0x0054, 0x0030, 0x000C, 0x0048, 0x0024 };
|
||||
|
||||
/**
|
||||
* Spawns steam particle effects in a circle around the ice block.
|
||||
*
|
||||
* On each frame the function is called, two particles have a chance to appear, at the same distance and opposite
|
||||
* sides from the center.
|
||||
*/
|
||||
void BgIceShelter_SpawnSteamAround(BgIceShelter* this, PlayState* play, f32 particleSpawningChance,
|
||||
f32 steamEffectScale) {
|
||||
f32 cos;
|
||||
f32 sin;
|
||||
f32 xzOffset;
|
||||
f32 distance;
|
||||
Vec3f* icePos;
|
||||
s16 angle;
|
||||
s16 frames;
|
||||
s16 frameCounter;
|
||||
s32 i;
|
||||
s32 pad[2];
|
||||
Vec3f dustPos;
|
||||
Vec3f dustVel;
|
||||
Vec3f dustAccel;
|
||||
Vec3f steamPos;
|
||||
Vec3f steamVel;
|
||||
Vec3f steamAccel;
|
||||
|
||||
frames = (s16)play->state.frames & 7;
|
||||
frameCounter = (s16)play->state.frames & 7;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (chance < Rand_ZeroOne()) {
|
||||
if (particleSpawningChance < Rand_ZeroOne()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
xzOffset = 42.0f * scale;
|
||||
// The steamEffectScale is used here to make the particles appear at the edges of the red ice.
|
||||
distance = 42.0f * steamEffectScale;
|
||||
icePos = &this->dyna.actor.world.pos;
|
||||
angle = D_80891794[frames] + (i * 0x8000);
|
||||
angle = sSteamCircleAngles[frameCounter] + (i * 0x8000);
|
||||
sin = Math_SinS(angle);
|
||||
cos = Math_CosS(angle);
|
||||
|
||||
dustPos.x = (xzOffset * sin) + icePos->x;
|
||||
dustPos.y = (16.0f * scale) + icePos->y;
|
||||
dustPos.z = (xzOffset * cos) + icePos->z;
|
||||
steamPos.x = (distance * sin) + icePos->x;
|
||||
steamPos.y = (16.0f * steamEffectScale) + icePos->y;
|
||||
steamPos.z = (distance * cos) + icePos->z;
|
||||
|
||||
dustVel.x = ((Rand_ZeroOne() * 3.0f) - 1.0f) * sin;
|
||||
dustVel.y = 0.0f;
|
||||
dustVel.z = ((Rand_ZeroOne() * 3.0f) - 1.0f) * cos;
|
||||
steamVel.x = ((Rand_ZeroOne() * 3.0f) - 1.0f) * sin;
|
||||
steamVel.y = 0.0f;
|
||||
steamVel.z = ((Rand_ZeroOne() * 3.0f) - 1.0f) * cos;
|
||||
|
||||
dustAccel.x = 0.07f * sin;
|
||||
dustAccel.y = 0.8f;
|
||||
dustAccel.z = 0.07f * cos;
|
||||
steamAccel.x = 0.07f * sin;
|
||||
steamAccel.y = 0.8f;
|
||||
steamAccel.z = 0.07f * cos;
|
||||
|
||||
func_8002829C(play, &dustPos, &dustVel, &dustAccel, &sDustPrimColor, &sDustEnvColor, 450.0f * scale,
|
||||
(s16)((Rand_ZeroOne() * 40.0f) + 40.0f) * scale);
|
||||
func_8002829C(play, &steamPos, &steamVel, &steamAccel, &sSteamPrimColor, &sSteamEnvColor,
|
||||
450.0f * steamEffectScale, (s16)((Rand_ZeroOne() * 40.0f) + 40.0f) * steamEffectScale);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80890E00(BgIceShelter* this, PlayState* play, f32 chance, f32 arg3) {
|
||||
static f32 D_808917B4[] = { -1.0f, 1.0f };
|
||||
/**
|
||||
* Spawns steam particle effects in a straight line. Only used for the ice wall type.
|
||||
*
|
||||
* On each frame the function is called, two particles have a chance to appear, at the same distance and opposite
|
||||
* sides from the midpoint.
|
||||
*
|
||||
* The last argument is unused because only one red ice type can call this function, so the scale isn't needed.
|
||||
*/
|
||||
void BgIceShelter_SpawnSteamAlong(BgIceShelter* this, PlayState* play, f32 particleSpawningChance, f32 unusedArg) {
|
||||
static f32 signs[] = { -1.0f, 1.0f };
|
||||
Vec3f* icePos;
|
||||
s16 frames;
|
||||
s16 frameCounter;
|
||||
s32 pad[2];
|
||||
Vec3f dustPos;
|
||||
Vec3f dustVel;
|
||||
Vec3f dustAccel;
|
||||
Vec3f steamPos;
|
||||
Vec3f steamVel;
|
||||
Vec3f steamAccel;
|
||||
Vec3f posOffset;
|
||||
s32 i;
|
||||
|
||||
frames = (s16)play->state.frames & 7;
|
||||
frameCounter = (s16)play->state.frames & 7;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
icePos = &this->dyna.actor.world.pos;
|
||||
|
||||
if (chance < Rand_ZeroOne()) {
|
||||
if (particleSpawningChance < Rand_ZeroOne()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
posOffset.x = (D_808917A4[frames] + ((Rand_ZeroOne() * 12.0f) - 6.0f)) * D_808917B4[i];
|
||||
posOffset.x = (sSteamLinePositions[frameCounter] + ((Rand_ZeroOne() * 12.0f) - 6.0f)) * signs[i];
|
||||
posOffset.y = 15.0f;
|
||||
posOffset.z = ((84.0f - posOffset.x) * 0.2f) + (Rand_ZeroOne() * 20.0f);
|
||||
|
||||
func_808908FC(&dustPos, &posOffset, this->dyna.actor.world.rot.y);
|
||||
Math_Vec3f_Sum(&dustPos, icePos, &dustPos);
|
||||
// Convert the position offset from relative to the ice wall to absolute.
|
||||
BgIceShelter_RotateY(&steamPos, &posOffset, this->dyna.actor.world.rot.y);
|
||||
Math_Vec3f_Sum(&steamPos, icePos, &steamPos);
|
||||
|
||||
dustVel.x = (Rand_ZeroOne() * 3.0f) - 1.5f;
|
||||
dustVel.y = 0.0f;
|
||||
dustVel.z = (Rand_ZeroOne() * 3.0f) - 1.5f;
|
||||
steamVel.x = (Rand_ZeroOne() * 3.0f) - 1.5f;
|
||||
steamVel.y = 0.0f;
|
||||
steamVel.z = (Rand_ZeroOne() * 3.0f) - 1.5f;
|
||||
|
||||
dustAccel.x = (Rand_ZeroOne() * 0.14f) - 0.07f;
|
||||
dustAccel.y = 0.8f;
|
||||
dustAccel.z = (Rand_ZeroOne() * 0.14f) - 0.07f;
|
||||
steamAccel.x = (Rand_ZeroOne() * 0.14f) - 0.07f;
|
||||
steamAccel.y = 0.8f;
|
||||
steamAccel.z = (Rand_ZeroOne() * 0.14f) - 0.07f;
|
||||
|
||||
func_8002829C(play, &dustPos, &dustVel, &dustAccel, &sDustPrimColor, &sDustEnvColor, 450,
|
||||
func_8002829C(play, &steamPos, &steamVel, &steamAccel, &sSteamPrimColor, &sSteamEnvColor, 450,
|
||||
(Rand_ZeroOne() * 40.0f) + 40.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80891064(BgIceShelter* this) {
|
||||
this->actionFunc = func_8089107C;
|
||||
void BgIceShelter_SetupIdle(BgIceShelter* this) {
|
||||
this->actionFunc = BgIceShelter_Idle;
|
||||
this->alpha = 255;
|
||||
}
|
||||
|
||||
void func_8089107C(BgIceShelter* this, PlayState* play) {
|
||||
/**
|
||||
* Checks for collision with blue fire. Also used to freeze King Zora's actor.
|
||||
*/
|
||||
void BgIceShelter_Idle(BgIceShelter* this, PlayState* play) {
|
||||
s32 pad;
|
||||
s16 type = (this->dyna.actor.params >> 8) & 7;
|
||||
s16 type = BGICESHELTER_GET_TYPE(&this->dyna.actor);
|
||||
|
||||
if (type == 4) {
|
||||
// Freeze King Zora
|
||||
if (type == RED_ICE_KING_ZORA) {
|
||||
if (this->dyna.actor.parent != NULL) {
|
||||
this->dyna.actor.parent->freezeTimer = 10000;
|
||||
}
|
||||
}
|
||||
|
||||
// Detect blue fire
|
||||
if (this->cylinder1.base.acFlags & AC_HIT) {
|
||||
this->cylinder1.base.acFlags &= ~AC_HIT;
|
||||
|
||||
if ((this->cylinder1.base.ac != NULL) && (this->cylinder1.base.ac->id == ACTOR_EN_ICE_HONO)) {
|
||||
if (type == 4) {
|
||||
if (type == RED_ICE_KING_ZORA) {
|
||||
if (this->dyna.actor.parent != NULL) {
|
||||
this->dyna.actor.parent->freezeTimer = 50;
|
||||
}
|
||||
}
|
||||
|
||||
func_808911BC(this);
|
||||
BgIceShelter_SetupMelt(this);
|
||||
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_ICE_MELT);
|
||||
}
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 4:
|
||||
case RED_ICE_LARGE:
|
||||
case RED_ICE_SMALL:
|
||||
case RED_ICE_KING_ZORA:
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->cylinder1.base);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->cylinder2.base);
|
||||
break;
|
||||
|
@ -319,57 +365,73 @@ void func_8089107C(BgIceShelter* this, PlayState* play) {
|
|||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->cylinder1.base);
|
||||
}
|
||||
|
||||
void func_808911BC(BgIceShelter* this) {
|
||||
this->actionFunc = func_808911D4;
|
||||
void BgIceShelter_SetupMelt(BgIceShelter* this) {
|
||||
this->actionFunc = BgIceShelter_Melt;
|
||||
this->alpha = 255;
|
||||
}
|
||||
|
||||
static f32 D_808917BC[] = { -0.0015f, -0.0009f, -0.0016f, -0.0016f, -0.00375f };
|
||||
static f32 D_808917D0[] = { 1.0f, 0.6f, 1.2f, 1.0f, 1.8f };
|
||||
/**
|
||||
* Values added to the ice block's height every frame while it's melting.
|
||||
*/
|
||||
static f32 sMeltingRates[] = { -0.0015f, -0.0009f, -0.0016f, -0.0016f, -0.00375f };
|
||||
|
||||
static void (*sEffSpawnFuncs[])(BgIceShelter* this, PlayState* play, f32 chance, f32 scale) = {
|
||||
func_80890B8C, func_80890B8C, func_80890B8C, func_80890E00, func_80890B8C,
|
||||
/**
|
||||
* Values used to scale and position the steam effects so they match the ice block's size.
|
||||
*/
|
||||
static f32 sSteamEffectScales[] = { 1.0f, 0.6f, 1.2f, 1.0f, 1.8f };
|
||||
|
||||
/**
|
||||
* Functions used to spawn steam effects at the base of the red ice.
|
||||
*/
|
||||
static void (*sSteamSpawnFuncs[])(BgIceShelter* this, PlayState* play, f32 particleSpawningChance,
|
||||
f32 steamEffectScale) = {
|
||||
BgIceShelter_SpawnSteamAround, BgIceShelter_SpawnSteamAround, BgIceShelter_SpawnSteamAround,
|
||||
BgIceShelter_SpawnSteamAlong, BgIceShelter_SpawnSteamAround,
|
||||
};
|
||||
|
||||
void func_808911D4(BgIceShelter* this, PlayState* play) {
|
||||
/**
|
||||
* Progressively reduces the height and opacity of the red ice, while spawning steam effects at its base.
|
||||
*/
|
||||
void BgIceShelter_Melt(BgIceShelter* this, PlayState* play) {
|
||||
|
||||
s32 pad;
|
||||
s32 type = (this->dyna.actor.params >> 8) & 7;
|
||||
f32 phi_f0;
|
||||
s32 type = BGICESHELTER_GET_TYPE(&this->dyna.actor);
|
||||
f32 particleSpawningChance;
|
||||
|
||||
this->alpha -= 5;
|
||||
this->alpha = CLAMP(this->alpha, 0, 255);
|
||||
|
||||
this->dyna.actor.scale.y += D_808917BC[type];
|
||||
this->dyna.actor.scale.y += sMeltingRates[type];
|
||||
this->dyna.actor.scale.y = CLAMP_MIN(this->dyna.actor.scale.y, 0.0001f);
|
||||
|
||||
if (this->alpha > 80) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 4:
|
||||
case RED_ICE_LARGE:
|
||||
case RED_ICE_SMALL:
|
||||
case RED_ICE_KING_ZORA:
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->cylinder1.base);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->cylinder2.base);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// As the ice melts, the steam intensity is reduced by lowering the chance of each steam particle to appear
|
||||
if (this->alpha > 180) {
|
||||
phi_f0 = 1.0f;
|
||||
particleSpawningChance = 1.0f;
|
||||
} else if (this->alpha > 60) {
|
||||
phi_f0 = 0.5f;
|
||||
particleSpawningChance = 0.5f;
|
||||
} else {
|
||||
phi_f0 = 0.0f;
|
||||
particleSpawningChance = 0.0f;
|
||||
}
|
||||
|
||||
sEffSpawnFuncs[type](this, play, phi_f0, D_808917D0[type]);
|
||||
sSteamSpawnFuncs[type](this, play, particleSpawningChance, sSteamEffectScales[type]);
|
||||
|
||||
if (this->alpha <= 0) {
|
||||
if (!((this->dyna.actor.params >> 6) & 1)) {
|
||||
if (!BGICESHELTER_NO_SWITCH_FLAG(&this->dyna.actor)) {
|
||||
Flags_SetSwitch(play, this->dyna.actor.params & 0x3F);
|
||||
}
|
||||
|
||||
if (type == 4) {
|
||||
if (type == RED_ICE_KING_ZORA) {
|
||||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||
}
|
||||
|
||||
|
@ -394,29 +456,29 @@ void BgIceShelter_Draw(Actor* thisx, PlayState* play2) {
|
|||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_ice_shelter.c", 751),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
switch ((this->dyna.actor.params >> 8) & 7) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 4:
|
||||
switch (BGICESHELTER_GET_TYPE(&this->dyna.actor)) {
|
||||
case RED_ICE_LARGE:
|
||||
case RED_ICE_SMALL:
|
||||
case RED_ICE_PLATFORM:
|
||||
case RED_ICE_KING_ZORA:
|
||||
func_8002ED80(&this->dyna.actor, play, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, this->alpha);
|
||||
|
||||
switch ((this->dyna.actor.params >> 8) & 7) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 4:
|
||||
switch (BGICESHELTER_GET_TYPE(&this->dyna.actor)) {
|
||||
case RED_ICE_LARGE:
|
||||
case RED_ICE_SMALL:
|
||||
case RED_ICE_KING_ZORA:
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, -play->gameplayFrames & 0x7F,
|
||||
-play->gameplayFrames & 0x7F, 0x20, 0x20, 1, -play->gameplayFrames & 0x7F,
|
||||
play->gameplayFrames & 0x7F, 0x20, 0x20));
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_ice_objects_DL_0006F0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gRedIceBlockDL);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case RED_ICE_PLATFORM:
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, play->gameplayFrames & 0xFF, 0x40, 0x40,
|
||||
1, 0, -play->gameplayFrames & 0xFF, 0x40, 0x40));
|
||||
|
@ -424,11 +486,11 @@ void BgIceShelter_Draw(Actor* thisx, PlayState* play2) {
|
|||
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, -play->gameplayFrames & 0xFF,
|
||||
play->gameplayFrames & 0xFF, 0x40, 0x40, 1, play->gameplayFrames & 0xFF,
|
||||
play->gameplayFrames & 0xFF, 0x40, 0x40));
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_ice_objects_DL_0012A0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gRedIcePlatformDL);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_ice_objects_DL_002640);
|
||||
case RED_ICE_WALL:
|
||||
gSPDisplayList(POLY_XLU_DISP++, gRedIceWallDL);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,11 +8,19 @@ struct BgIceShelter;
|
|||
|
||||
typedef void (*BgIceShelterActionFunc)(struct BgIceShelter*, PlayState*);
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ RED_ICE_LARGE, // Large red ice block
|
||||
/* 1 */ RED_ICE_SMALL, // Small red ice block
|
||||
/* 2 */ RED_ICE_PLATFORM, // Complex structure that can be climbed and walked on. Unused in vanilla OoT, used in MQ to cover the Ice Cavern Map chest
|
||||
/* 3 */ RED_ICE_WALL, // Vertical ice sheets blocking corridors
|
||||
/* 4 */ RED_ICE_KING_ZORA // Giant red ice block covering King Zora
|
||||
} RedIceType;
|
||||
|
||||
typedef struct BgIceShelter {
|
||||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
/* 0x0164 */ BgIceShelterActionFunc actionFunc;
|
||||
/* 0x0168 */ ColliderCylinder cylinder1;
|
||||
/* 0x01B4 */ ColliderCylinder cylinder2;
|
||||
/* 0x0168 */ ColliderCylinder cylinder1; // Used to detect blue fire and also as OC for no-dynapoly types
|
||||
/* 0x01B4 */ ColliderCylinder cylinder2; // Only used by no-dynapoly types to make weapons bounce off
|
||||
/* 0x0200 */ s16 alpha;
|
||||
} BgIceShelter; // size = 0x0204
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ void func_80899950(BgJyaKanaami* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_80899A08(BgJyaKanaami* this) {
|
||||
this->actionFunc = 0;
|
||||
this->actionFunc = NULL;
|
||||
this->dyna.actor.world.rot.x = 0x4000;
|
||||
}
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ void BgMizuShutter_Move(BgMizuShutter* this, PlayState* play) {
|
|||
if ((this->dyna.actor.world.pos.x == this->closedPos.x) &&
|
||||
(this->dyna.actor.world.pos.y == this->closedPos.y) &&
|
||||
(this->dyna.actor.world.pos.z == this->closedPos.z)) {
|
||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
|
||||
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
|
||||
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
|
||||
this->actionFunc = BgMizuShutter_WaitForSwitch;
|
||||
}
|
||||
|
|
|
@ -282,10 +282,10 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, PlayState* play) {
|
|||
}
|
||||
|
||||
if (this->targetY < this->actor.world.pos.y) {
|
||||
func_800AA000(0.0f, 0x78, 0x14, 0xA);
|
||||
Rumble_Request(0.0f, 120, 20, 10);
|
||||
func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
|
||||
} else if (this->targetY > this->actor.world.pos.y) {
|
||||
func_800AA000(0.0f, 0x78, 0x14, 0xA);
|
||||
Rumble_Request(0.0f, 120, 20, 10);
|
||||
func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, PlayState* play) {
|
|||
if (this->bounceCount == 0) {
|
||||
this->fallCount++;
|
||||
func_800788CC(NA_SE_EV_STONE_BOUND);
|
||||
func_800AA000(SQ(thisx->yDistToPlayer), 0xFF, 0x14, 0x96);
|
||||
Rumble_Request(SQ(thisx->yDistToPlayer), 255, 20, 150);
|
||||
}
|
||||
thisx->world.pos.y =
|
||||
403.0f - (thisx->world.pos.y - 403.0f) * bounceVel[this->bounceCount] / fabsf(thisx->velocity.y);
|
||||
|
|
|
@ -145,7 +145,7 @@ void func_808A91AC(BgRelayObjects* this, PlayState* play) {
|
|||
void func_808A9234(BgRelayObjects* this, PlayState* play) {
|
||||
this->dyna.actor.velocity.y += this->dyna.actor.gravity;
|
||||
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) {
|
||||
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100);
|
||||
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100);
|
||||
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
|
||||
if (this->unk_169 != play->roomCtx.curRoom.num) {
|
||||
func_800788CC(NA_SE_EN_PO_LAUGH);
|
||||
|
|
|
@ -107,8 +107,8 @@ void func_808BAF40(BgTokiSwd* this, PlayState* play) {
|
|||
} else {
|
||||
play->csCtx.segment = D_808BB7A0;
|
||||
}
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_STOP);
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_MASTER_SWORD);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_MASTER_SWORD);
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
this->actor.parent = NULL;
|
||||
BgTokiSwd_SetupAction(this, func_808BB0AC);
|
||||
|
|
|
@ -45,7 +45,7 @@ const ActorInit Boss_Dodongo_InitVars = {
|
|||
(ActorFunc)BossDodongo_Draw,
|
||||
};
|
||||
|
||||
#include "z_boss_dodongo_data.c"
|
||||
#include "z_boss_dodongo_data.inc.c"
|
||||
|
||||
static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE),
|
||||
|
@ -319,7 +319,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, PlayState* play) {
|
|||
BossDodongo_Walk(this, play);
|
||||
|
||||
if (this->unk_196 == 1) {
|
||||
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1);
|
||||
}
|
||||
|
||||
if (this->unk_196 == 0) {
|
||||
|
@ -407,7 +407,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, PlayState* play) {
|
|||
SEGMENTED_TO_VIRTUAL(&object_kingdodongo_Blob_017410), 0xA0, 0xB4, 0x80,
|
||||
0x28);
|
||||
}
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_FIRE_BOSS);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_FIRE_BOSS);
|
||||
}
|
||||
|
||||
if (this->unk_198 == 0) {
|
||||
|
@ -680,7 +680,7 @@ void BossDodongo_Walk(BossDodongo* this, PlayState* play) {
|
|||
func_80033E88(&this->actor, play, 4, 10);
|
||||
} else {
|
||||
this->unk_1B6 = 10;
|
||||
func_800A9F6C(0.0f, 180, 20, 100);
|
||||
Rumble_Override(0.0f, 180, 20, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1284,7 +1284,7 @@ void BossDodongo_SetupDeathCutscene(BossDodongo* this) {
|
|||
this->csState = 0;
|
||||
this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2);
|
||||
this->unk_1BC = 1;
|
||||
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1);
|
||||
}
|
||||
|
||||
void BossDodongo_DeathCutscene(BossDodongo* this, PlayState* play) {
|
||||
|
@ -1598,7 +1598,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, PlayState* play) {
|
|||
}
|
||||
|
||||
if (this->unk_1DA == 820) {
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS_CLEAR);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_BOSS_CLEAR);
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART,
|
||||
Math_SinS(this->actor.shape.rot.y) * -50.0f + this->actor.world.pos.x,
|
||||
this->actor.world.pos.y,
|
||||
|
|
|
@ -56,7 +56,7 @@ const ActorInit Boss_Fd_InitVars = {
|
|||
(ActorFunc)BossFd_Draw,
|
||||
};
|
||||
|
||||
#include "z_boss_fd_colchk.c"
|
||||
#include "z_boss_fd_colchk.inc.c"
|
||||
|
||||
static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE),
|
||||
|
@ -185,7 +185,7 @@ void BossFd_Init(Actor* thisx, PlayState* play) {
|
|||
SkelAnime_Init(play, &this->skelAnimeLeftArm, &gVolvagiaLeftArmSkel, &gVolvagiaLeftArmEmergeAnim, NULL, NULL, 0);
|
||||
this->introState = BFD_CS_WAIT;
|
||||
if (this->introState == BFD_CS_NONE) {
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_FIRE_BOSS);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_FIRE_BOSS);
|
||||
}
|
||||
|
||||
this->actor.world.pos.x = this->actor.world.pos.z = 0.0f;
|
||||
|
@ -486,7 +486,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
|
|||
this->subCamAtYOffset = Math_CosS(this->work[BFD_MOVE_TIMER] * 0x8000) * this->subCamShake;
|
||||
}
|
||||
if (this->timers[3] == 160) {
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_FIRE_BOSS);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_FIRE_BOSS);
|
||||
}
|
||||
if ((this->timers[3] == 130) && !GET_EVENTCHKINF(EVENTCHKINF_73)) {
|
||||
TitleCard_InitBossName(play, &play->actorCtx.titleCtx,
|
||||
|
@ -743,7 +743,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
|
|||
if (this->skinSegments != 0) {
|
||||
this->skinSegments--;
|
||||
if (this->skinSegments == 0) {
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS_CLEAR);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_BOSS_CLEAR);
|
||||
}
|
||||
} else {
|
||||
this->work[BFD_ACTION_STATE] = BOSSFD_BONES_FALL;
|
||||
|
|
|
@ -58,7 +58,7 @@ const ActorInit Boss_Fd2_InitVars = {
|
|||
(ActorFunc)BossFd2_Draw,
|
||||
};
|
||||
|
||||
#include "z_boss_fd2_colchk.c"
|
||||
#include "z_boss_fd2_colchk.inc.c"
|
||||
|
||||
static Vec3f sHoleLocations[] = {
|
||||
{ 0.0f, 90.0f, -243.0f }, { 0.0f, 90.0f, 0.0f }, { 0.0f, 90.0f, 243.0f },
|
||||
|
@ -884,7 +884,7 @@ void BossFd2_CollisionCheck(BossFd2* this, PlayState* play) {
|
|||
BossFd2_SetupDeath(this, play);
|
||||
this->work[FD2_DAMAGE_FLASH_TIMER] = 10;
|
||||
this->work[FD2_INVINC_TIMER] = 30000;
|
||||
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1);
|
||||
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_VALVAISA_DEAD);
|
||||
Enemy_StartFinishingBlow(play, &this->actor);
|
||||
} else if (damage) {
|
||||
|
|
|
@ -575,7 +575,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
|
|||
this->unk_198 = 2;
|
||||
this->timers[2] = 110;
|
||||
gSaveContext.healthAccumulator = 0x140;
|
||||
Audio_QueueSeqCmd(NA_BGM_STOP);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0);
|
||||
} else {
|
||||
this->useOpenHand = true;
|
||||
BossGanon_SetIntroCsCamera(this, 0);
|
||||
|
@ -807,7 +807,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
|
|||
BossGanon_SetIntroCsCamera(this, 9);
|
||||
|
||||
if (this->csTimer == 30) {
|
||||
Audio_QueueSeqCmd(0x100100FF);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1);
|
||||
this->fwork[GDF_FWORK_1] = Animation_GetLastFrame(&gGanondorfStopPlayingOrganAnim);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &gGanondorfStopPlayingOrganAnim, -5.0f);
|
||||
}
|
||||
|
@ -1074,7 +1074,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
|
|||
sCape->attachShouldersTimer = 18.0f;
|
||||
Audio_PlayActorSfx2(&this->actor, NA_SE_EV_GANON_MANTLE);
|
||||
this->unk_198 = 0;
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_GANONDORF_BOSS);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_GANONDORF_BOSS);
|
||||
}
|
||||
|
||||
if (this->csTimer == 50) {
|
||||
|
@ -2738,7 +2738,7 @@ void BossGanon_UpdateDamage(BossGanon* this, PlayState* play) {
|
|||
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GANON_DEAD);
|
||||
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GANON_DD_THUNDER);
|
||||
func_80078914(&sZeroVec, NA_SE_EN_LAST_DAMAGE);
|
||||
Audio_QueueSeqCmd(0x100100FF);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1);
|
||||
this->screenFlashTimer = 4;
|
||||
} else {
|
||||
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GANON_DAMAGE2);
|
||||
|
@ -3944,7 +3944,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) {
|
|||
Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_REFLECT_MG, &player->actor.projectedPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
func_800AA000(this->actor.xyzDistToPlayerSq, 0xFF, 0x14, 0x96);
|
||||
Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150);
|
||||
} else {
|
||||
spBA = 1;
|
||||
this->actor.world.rot.y = Math_Atan2S(zDistFromGanondorf, xDistFromGanondorf);
|
||||
|
@ -3955,7 +3955,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) {
|
|||
Audio_PlaySfxGeneral(NA_SE_IT_SWORD_REFLECT_MG, &player->actor.projectedPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
func_800AA000(this->actor.xyzDistToPlayerSq, 0xB4, 0x14, 0x64);
|
||||
Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100);
|
||||
|
||||
if (hitWithBottle == false) {
|
||||
// if ganondorf is 250 units away from link, at least 3 volleys are required
|
||||
|
@ -4424,7 +4424,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
|
|||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
|
||||
if (!(acHitInfo->toucher.dmgFlags & DMG_SHIELD) || Player_HasMirrorShieldEquipped(play)) {
|
||||
func_800AA000(this->actor.xyzDistToPlayerSq, 0xB4, 0x14, 0x64);
|
||||
Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100);
|
||||
this->unk_1C2 = 0xC;
|
||||
this->actor.speedXZ = -30.0f;
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ const ActorInit Boss_Ganon2_InitVars = {
|
|||
(ActorFunc)BossGanon2_Draw,
|
||||
};
|
||||
|
||||
#include "z_boss_ganon2_data.c"
|
||||
#include "z_boss_ganon2_data.inc.c"
|
||||
|
||||
void BossGanon2_InitRand(s32 seedInit0, s32 seedInit1, s32 seedInit2) {
|
||||
sSeed1 = seedInit0;
|
||||
|
@ -296,7 +296,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
|
|||
this->unk_339 = 4;
|
||||
if (this->unk_398 == 10) {
|
||||
func_80078914(&D_80906D6C, NA_SE_EV_STONE_BOUND);
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_STOP);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0);
|
||||
}
|
||||
if (this->unk_398 == 20) {
|
||||
sZelda->unk_3C8 = 3;
|
||||
|
@ -431,7 +431,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
|
|||
if (this->unk_398 == 30) {
|
||||
D_80906D78 = 1;
|
||||
this->unk_314 = 1;
|
||||
func_800A9F6C(0.0f, 0xC8, 0x14, 0x14);
|
||||
Rumble_Override(0.0f, 200, 20, 20);
|
||||
}
|
||||
if (this->unk_398 == 30) {
|
||||
func_80078884(NA_SE_EV_GRAVE_EXPLOSION);
|
||||
|
@ -447,7 +447,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
|
|||
this->actor.world.pos.x = -200.0f;
|
||||
this->actor.world.pos.y = this->actor.world.pos.y - 30.0f;
|
||||
this->actor.world.pos.z = -200.0f;
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_OPENING_GANON);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_OPENING_GANON);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
|
|||
case 18:
|
||||
this->unk_339 = 6;
|
||||
if (this->unk_398 == 30) {
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_GANON_BOSS);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_GANON_BOSS);
|
||||
}
|
||||
Math_ApproachF(&this->unk_30C, 7.0f, 1.0f, 0.1f);
|
||||
Math_ApproachF(&this->subCamEye.x, (this->actor.world.pos.x + 500.0f) - 350.0f, 0.1f, 1.0f);
|
||||
|
@ -643,7 +643,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
|
|||
this->actor.velocity.y = 0.0f;
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &gGanonUncurlAndFlailAnim, 0.0f);
|
||||
func_808FD4D4(this, play, 0, 3);
|
||||
func_800A9F6C(0.0f, 0xC8, 0x14, 0x14);
|
||||
Rumble_Override(0.0f, 200, 20, 20);
|
||||
}
|
||||
break;
|
||||
case 21:
|
||||
|
@ -720,7 +720,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
|
|||
if (this->unk_398 == 228) {
|
||||
func_80078884(NA_SE_IT_SHIELD_REFLECT_SW);
|
||||
func_8002DF54(play, &this->actor, 0x56);
|
||||
func_800A9F6C(0.0f, 0xFF, 0xA, 0x32);
|
||||
Rumble_Override(0.0f, 255, 10, 50);
|
||||
}
|
||||
if (this->unk_398 >= 229) {
|
||||
play->envCtx.fillScreen = true;
|
||||
|
@ -924,7 +924,7 @@ void func_808FF898(BossGanon2* this, PlayState* play) {
|
|||
sp28.z = 1.0f;
|
||||
Matrix_MultVec3f(&sp28, &gj->unk_26C);
|
||||
gj->killFlag = true;
|
||||
func_800A9F6C(0.0f, 0x96, 0x14, 0x32);
|
||||
Rumble_Override(0.0f, 150, 20, 50);
|
||||
this->unk_392 = 6;
|
||||
return;
|
||||
}
|
||||
|
@ -1694,7 +1694,7 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
|
|||
this->subCamAt.z = D_80907050[phi_a1].z + player->actor.world.pos.z;
|
||||
}
|
||||
if (this->unk_398 > 80) {
|
||||
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1);
|
||||
this->unk_39C = 75;
|
||||
this->unk_398 = 0;
|
||||
this->subCamEye.x = 112.0f;
|
||||
|
@ -2374,7 +2374,7 @@ void func_809034E4(Vec3f* arg0, Vec3f* arg1) {
|
|||
}
|
||||
}
|
||||
|
||||
vtx = SEGMENTED_TO_VIRTUAL(ovl_Boss_Ganon2_Vtx_00BA20);
|
||||
vtx = SEGMENTED_TO_VIRTUAL(gGanonSwordTrailVtx);
|
||||
for (i = 0; i < 11; i++) {
|
||||
if ((temp_s4 - i) > 0) {
|
||||
vtx[D_80907084[i]].n.ob[0] = sp18C[temp_s4 - i - 1].x;
|
||||
|
@ -2406,7 +2406,7 @@ void func_80903F38(BossGanon2* this, PlayState* play) {
|
|||
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_NEW);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_ganon2.c", 5117),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, ovl_Boss_Ganon2_DL_00BB80);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGanonSwordTrailDL);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganon2.c", 5122);
|
||||
|
@ -2429,7 +2429,7 @@ void func_80904108(BossGanon2* this, PlayState* play) {
|
|||
Matrix_Scale(0.098000005f, 0.1f, 0.098000005f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_ganon2.c", 5183),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(ovl_Boss_Ganon2_DL_00E1C0));
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonFireRingDL));
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganon2.c", 5186);
|
||||
|
@ -2479,7 +2479,7 @@ void func_80904340(BossGanon2* this, PlayState* play) {
|
|||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_ganon2.c", 5250),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(ovl_Boss_Ganon2_DL_00D798));
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonLightningDL));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2503,7 +2503,7 @@ void func_8090464C(BossGanon2* this, PlayState* play) {
|
|||
Matrix_Scale(0.6f, 0.6f, 1.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_ganon2.c", 5290),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(ovl_Boss_Ganon2_DL_00CCD8));
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonTriforceDL));
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganon2.c", 5293);
|
||||
|
@ -2624,7 +2624,7 @@ void func_80904D88(BossGanon2* this, PlayState* play) {
|
|||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 100, 255, 255, 0);
|
||||
}
|
||||
gSPDisplayList(POLY_XLU_DISP++, ovl_Boss_Ganon2_DL_00B308);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGanonLightOrbMaterialDL);
|
||||
|
||||
for (i = 0; i < 15; i++) {
|
||||
Matrix_Translate(this->unk_234[i].x, this->unk_234[i].y, this->unk_234[i].z, MTXMODE_NEW);
|
||||
|
@ -2633,7 +2633,7 @@ void func_80904D88(BossGanon2* this, PlayState* play) {
|
|||
Matrix_RotateZ(Rand_CenteredFloat(M_PI), MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_ganon2.c", 5618),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, ovl_Boss_Ganon2_DL_00B378);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGanonLightOrbModelDL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2649,7 +2649,7 @@ void func_80904FC8(BossGanon2* this, PlayState* play) {
|
|||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 200);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 200, 0, 0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, ovl_Boss_Ganon2_DL_00B308);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGanonLightOrbMaterialDL);
|
||||
Matrix_Translate(sZelda->actor.world.pos.x, sZelda->actor.world.pos.y + 80.0f, sZelda->actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
|
@ -2657,11 +2657,11 @@ void func_80904FC8(BossGanon2* this, PlayState* play) {
|
|||
Matrix_RotateZ(this->unk_388, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_ganon2.c", 5661),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(ovl_Boss_Ganon2_DL_00B378));
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonLightOrbModelDL));
|
||||
Matrix_RotateZ(this->unk_388 * -2.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_ganon2.c", 5664),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(ovl_Boss_Ganon2_DL_00B378));
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonLightOrbModelDL));
|
||||
}
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganon2.c", 5667);
|
||||
|
@ -2680,7 +2680,7 @@ void func_8090523C(BossGanon2* this, PlayState* play) {
|
|||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s16)this->unk_38C);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 255, 255, 0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, ovl_Boss_Ganon2_DL_00B308);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGanonLightOrbMaterialDL);
|
||||
|
||||
for (i = 0; i < 11; i++) {
|
||||
Matrix_Mult(&player->mf_9E0, MTXMODE_NEW);
|
||||
|
@ -2697,7 +2697,7 @@ void func_8090523C(BossGanon2* this, PlayState* play) {
|
|||
Matrix_RotateZ(Rand_ZeroFloat(2.0f * M_PI), MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_ganon2.c", 5721),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(ovl_Boss_Ganon2_DL_00B378));
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonLightOrbModelDL));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2744,7 +2744,7 @@ void func_80905674(BossGanon2* this, PlayState* play) {
|
|||
Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_ganon2.c", 5814),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(ovl_Boss_Ganon2_DL_00EC40));
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGanonZeldaMagicDL));
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganon2.c", 5817);
|
||||
|
@ -2922,7 +2922,8 @@ void BossGanon2_DrawEffects(PlayState* play) {
|
|||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08,
|
||||
Gfx_TexScroll(play->state.gfxCtx, 0, 0 - (play->gameplayFrames & 0x7F), 32, 32));
|
||||
gSPDisplayList(POLY_OPA_DISP++, ovl_Boss_Ganon2_DL_0103A8);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gGanonMasterSwordDL);
|
||||
|
||||
if ((play->envCtx.lightSetting == 1) || (play->envCtx.lightSetting == 2)) {
|
||||
alpha = (s16)(play->envCtx.lightBlend * 150.0f) + 50;
|
||||
angle = M_PI / 5.0f;
|
||||
|
@ -2937,7 +2938,7 @@ void BossGanon2_DrawEffects(PlayState* play) {
|
|||
Matrix_Scale(1.0f, 0.0f, 1.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_ganon2.c", 6155),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, ovl_Boss_Ganon2_DL_00F188);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGanonMasterSwordShadowDL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3076,10 +3077,10 @@ void BossGanon2_DrawShadowTexture(void* shadowTexture, BossGanon2* this, PlaySta
|
|||
Matrix_Scale(1.65f, 1.0f, 1.65f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_ganon2.c", 6457),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, ovl_Boss_Ganon2_DL_00B3D0);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gGanonShadowMaterialDL);
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, shadowTexture, G_IM_FMT_I, G_IM_SIZ_8b, 64, 64, 0, G_TX_NOMIRROR | G_TX_CLAMP,
|
||||
G_TX_NOMIRROR | G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, ovl_Boss_Ganon2_DL_00B3F0);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gGanonShadowModelDL);
|
||||
|
||||
CLOSE_DISPS(gfxCtx, "../z_boss_ganon2.c", 6479);
|
||||
}
|
||||
|
|
|
@ -928,7 +928,7 @@ void BossGanondrof_SetupDeath(BossGanondrof* this, PlayState* play) {
|
|||
Animation_PlayOnce(&this->skelAnime, &gPhantomGanonDeathBlowAnim);
|
||||
this->fwork[GND_END_FRAME] = Animation_GetLastFrame(&gPhantomGanonDeathBlowAnim);
|
||||
this->actionFunc = BossGanondrof_Death;
|
||||
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF);
|
||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1);
|
||||
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FANTOM_DEAD);
|
||||
this->deathState = DEATH_START;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
|
@ -1101,7 +1101,7 @@ void BossGanondrof_Death(BossGanondrof* this, PlayState* play) {
|
|||
holdCamera = true;
|
||||
bodyDecayLevel = 10;
|
||||
if (this->timers[0] == 150) {
|
||||
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS_CLEAR);
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_BOSS_CLEAR);
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_DOOR_WARP1, GND_BOSSROOM_CENTER_X, GND_BOSSROOM_CENTER_Y,
|
||||
GND_BOSSROOM_CENTER_Z, 0, 0, 0, WARP_DUNGEON_ADULT);
|
||||
}
|
||||
|
@ -1463,7 +1463,7 @@ void BossGanondrof_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
|
|||
}
|
||||
|
||||
Gfx* BossGanondrof_GetClearPixelDList(GraphicsContext* gfxCtx) {
|
||||
Gfx* dList = (Gfx*)Graph_Alloc(gfxCtx, sizeof(Gfx) * 4);
|
||||
Gfx* dList = Graph_Alloc(gfxCtx, sizeof(Gfx) * 4);
|
||||
Gfx* dListHead = dList;
|
||||
|
||||
gDPPipeSync(dListHead++);
|
||||
|
@ -1475,7 +1475,7 @@ Gfx* BossGanondrof_GetClearPixelDList(GraphicsContext* gfxCtx) {
|
|||
}
|
||||
|
||||
Gfx* BossGanondrof_EmptyDList(GraphicsContext* gfxCtx) {
|
||||
Gfx* dList = (Gfx*)Graph_Alloc(gfxCtx, sizeof(Gfx) * 1);
|
||||
Gfx* dList = Graph_Alloc(gfxCtx, sizeof(Gfx) * 1);
|
||||
Gfx* dListHead = dList;
|
||||
|
||||
gSPEndDisplayList(dListHead++);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue