1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 14:34:32 +00:00

Merge branch 'master' into doc_pause_menu

This commit is contained in:
Dragorn421 2022-10-15 16:22:10 +02:00
commit 631f6d203d
No known key found for this signature in database
GPG key ID: 32B53D2D16FC4118
130 changed files with 2747 additions and 2299 deletions

View file

@ -4,7 +4,7 @@
<DList Name="gBrownFragmentDL" Offset="0x530"/> <DList Name="gBrownFragmentDL" Offset="0x530"/>
<Texture Name="gUnusedStoneTex" OutName="unused_stone" Format="rgba16" Width="32" Height="32" Offset="0x7C0"/> <Texture Name="gUnusedStoneTex" OutName="unused_stone" Format="rgba16" Width="32" Height="32" Offset="0x7C0"/>
<DList Name="gDoorLockDL" Offset="0x1100"/> <DList Name="gDoorLockDL" Offset="0x1100"/>
<DList Name="gDoorChainsDL" Offset="0x11F0"/> <DList Name="gDoorChainDL" Offset="0x11F0"/>
<Texture Name="gUnusedGoldLockTex" OutName="unused_gold_lock" Format="rgba16" Width="32" Height="32" Offset="0x1A80"/> <Texture Name="gUnusedGoldLockTex" OutName="unused_gold_lock" Format="rgba16" Width="32" Height="32" Offset="0x1A80"/>
<Texture Name="gDoorChainTex" OutName="door_chain" Format="rgba16" Width="16" Height="128" Offset="0x2280"/> <Texture Name="gDoorChainTex" OutName="door_chain" Format="rgba16" Width="16" Height="128" Offset="0x2280"/>
<DList Name="gUnusedBombBagDL" Offset="0x32C0"/> <DList Name="gUnusedBombBagDL" Offset="0x32C0"/>

View file

@ -1,15 +1,22 @@
<Root> <Root>
<ExternalFile XmlPath="objects/gameplay_dangeon_keep.xml" OutPath="assets/objects/gameplay_dangeon_keep/"/> <ExternalFile XmlPath="objects/gameplay_dangeon_keep.xml" OutPath="assets/objects/gameplay_dangeon_keep/"/>
<File Name="object_bdoor" Segment="6"> <File Name="object_bdoor" Segment="6">
<Texture Name="object_bdoor_Tex_000000" OutName="tex_00000000" Format="rgba16" Width="32" Height="64" Offset="0x0"/> <!-- One of the Boss Door Textures -->
<DList Name="object_bdoor_DL_0010C0" Offset="0x10C0"/> <Texture Name="gBossDoorGanonsCastleTex" OutName="boss_door_ganons_castle" Format="rgba16" Width="32" Height="64" Offset="0x0"/>
<DList Name="object_bdoor_DL_001400" Offset="0x1400"/>
<DList Name="object_bdoor_DL_001530" Offset="0x1530"/> <!-- Boss Door, Lock, and Chain DisplayLists -->
<Texture Name="object_bdoor_Tex_0015C0" OutName="tex_000015C0" Format="rgba16" Width="32" Height="64" Offset="0x15C0"/> <DList Name="gBossDoorDL" Offset="0x10C0"/> <!-- Original name is "bossdoor_model" -->
<Texture Name="object_bdoor_Tex_0025C0" OutName="tex_000025C0" Format="rgba16" Width="32" Height="64" Offset="0x25C0"/> <DList Name="gBossDoorLockDL" Offset="0x1400"/> <!-- Original name is "doorkagiboss_model" -->
<Texture Name="object_bdoor_Tex_0035C0" OutName="tex_000035C0" Format="rgba16" Width="32" Height="64" Offset="0x35C0"/> <DList Name="gBossDoorChainDL" Offset="0x1530"/> <!-- Original name is "doorkusariboss_model" -->
<Texture Name="object_bdoor_Tex_0045C0" OutName="tex_000045C0" Format="rgba16" Width="32" Height="64" Offset="0x45C0"/>
<Texture Name="object_bdoor_Tex_0055C0" OutName="tex_000055C0" Format="rgba16" Width="32" Height="64" Offset="0x55C0"/> <!-- The rest of the Boss Door Textures -->
<Texture Name="object_bdoor_Tex_0065C0" OutName="tex_000065C0" Format="rgba16" Width="32" Height="64" Offset="0x65C0"/> <Texture Name="gBossDoorSpiritTex" OutName="boss_door_spirit" Format="rgba16" Width="32" Height="64" Offset="0x15C0"/>
<Texture Name="gBossDoorForestTex" OutName="boss_door_forest" Format="rgba16" Width="32" Height="64" Offset="0x25C0"/>
<Texture Name="gBossDoorFireTex" OutName="boss_door_fire" Format="rgba16" Width="32" Height="64" Offset="0x35C0"/>
<Texture Name="gBossDoorShadowTex" OutName="boss_door_shadow" Format="rgba16" Width="32" Height="64" Offset="0x45C0"/>
<Texture Name="gBossDoorWaterTex" OutName="boss_door_water" Format="rgba16" Width="32" Height="64" Offset="0x55C0"/>
<!-- A default texture only used if a Boss Door is present outside of the six adult dungeons, which is never the case in the final game. -->
<Texture Name="gBossDoorDefaultTex" OutName="boss_door_unused" Format="rgba16" Width="32" Height="64" Offset="0x65C0"/>
</File> </File>
</Root> </Root>

View file

@ -1,17 +1,18 @@
<Root> <Root>
<File Name="object_tw" Segment="6"> <File Name="object_tw" Segment="6">
<Animation Name="object_tw_Anim_0004A4" Offset="0x4A4"/> <Animation Name="object_tw_Anim_0004A4" Offset="0x4A4"/> <!-- Original name is "btT_DEMOwait" -->
<Animation Name="object_tw_Anim_000AAC" Offset="0xAAC"/> <Animation Name="object_tw_Anim_000AAC" Offset="0xAAC"/> <!-- Original name is "btT_DEMOwait_to_fly" -->
<Animation Name="object_tw_Anim_0012A4" Offset="0x12A4"/> <Animation Name="object_tw_Anim_0012A4" Offset="0x12A4"/> <!-- Original name is "btT_EDikari" ("anger; rage; fury") -->
<Animation Name="object_tw_Anim_0017E0" Offset="0x17E0"/> <Animation Name="object_tw_Anim_0017E0" Offset="0x17E0"/> <!-- Original name is "btT_EDmiage" ("to look up at; to raise one's eyes") -->
<Animation Name="object_tw_Anim_001D10" Offset="0x1D10"/> <Animation Name="object_tw_Anim_001D10" Offset="0x1D10"/> <!-- Original name is "btT_EDwait" -->
<Animation Name="object_tw_Anim_00230C" Offset="0x230C"/> <Animation Name="object_tw_Anim_00230C" Offset="0x230C"/> <!-- Original name is "btT_EDyaruki" ("drive; motivation; enthusiasm") -->
<Animation Name="object_tw_Anim_003614" Offset="0x3614"/> <Animation Name="object_tw_Anim_003614" Offset="0x3614"/> <!-- Original name is "btT_atack" -->
<Animation Name="object_tw_Anim_003E34" Offset="0x3E34"/> <Animation Name="object_tw_Anim_003E34" Offset="0x3E34"/> <!-- Original name is "btT_beeem" -->
<Animation Name="object_tw_Anim_004548" Offset="0x4548"/> <Animation Name="object_tw_Anim_004548" Offset="0x4548"/> <!-- Original name is "btT_beeem_to_fly" -->
<Animation Name="object_tw_Anim_00578C" Offset="0x578C"/> <Animation Name="object_tw_Anim_00578C" Offset="0x578C"/> <!-- Original name is "btT_damage01" -->
<Animation Name="object_tw_Anim_006530" Offset="0x6530"/> <Animation Name="object_tw_Anim_006530" Offset="0x6530"/> <!-- Original name is "btT_damage02" -->
<Animation Name="object_tw_Anim_006F28" Offset="0x6F28"/> <Animation Name="object_tw_Anim_006F28" Offset="0x6F28"/> <!-- Original name is "btT_fly" -->
<Limb Name="object_tw_Limb_006F40" LimbType="Standard" Offset="0x6F40"/> <Limb Name="object_tw_Limb_006F40" LimbType="Standard" Offset="0x6F40"/>
<Limb Name="object_tw_Limb_006F4C" LimbType="Standard" Offset="0x6F4C"/> <Limb Name="object_tw_Limb_006F4C" LimbType="Standard" Offset="0x6F4C"/>
<Limb Name="object_tw_Limb_006F58" LimbType="Standard" Offset="0x6F58"/> <Limb Name="object_tw_Limb_006F58" LimbType="Standard" Offset="0x6F58"/>
@ -38,37 +39,40 @@
<Limb Name="object_tw_Limb_007054" LimbType="Standard" Offset="0x7054"/> <Limb Name="object_tw_Limb_007054" LimbType="Standard" Offset="0x7054"/>
<Limb Name="object_tw_Limb_007060" LimbType="Standard" Offset="0x7060"/> <Limb Name="object_tw_Limb_007060" LimbType="Standard" Offset="0x7060"/>
<Limb Name="object_tw_Limb_00706C" LimbType="Standard" Offset="0x706C"/> <Limb Name="object_tw_Limb_00706C" LimbType="Standard" Offset="0x706C"/>
<Skeleton Name="object_tw_Skel_0070E0" Type="Flex" LimbType="Standard" Offset="0x70E0"/> <Skeleton Name="object_tw_Skel_0070E0" Type="Flex" LimbType="Standard" Offset="0x70E0"/>
<Animation Name="object_tw_Anim_007688" Offset="0x7688"/>
<Animation Name="object_tw_Anim_007CA8" Offset="0x7CA8"/> <Animation Name="object_tw_Anim_007688" Offset="0x7688"/> <!-- Original name is "btT_fly_to_tame" -->
<Animation Name="object_tw_Anim_0088C8" Offset="0x88C8"/> <Animation Name="object_tw_Anim_007CA8" Offset="0x7CA8"/> <!-- Original name is "btT_guard" -->
<Animation Name="object_tw_Anim_009398" Offset="0x9398"/> <Animation Name="object_tw_Anim_0088C8" Offset="0x88C8"/> <!-- Original name is "btT_hihihi" -->
<Animation Name="object_tw_Anim_009398" Offset="0x9398"/> <!-- Original name is "btT_tame" ("to amass; to accumulate") -->
<Animation Name="object_tw_Anim_00947C" Offset="0x947C"/> <Animation Name="object_tw_Anim_00947C" Offset="0x947C"/>
<!--Blob Name="object_tw_Blob_00948C" Size="0x4" Offset="0x948C" /-->
<Texture Name="object_tw_TLUT_009490" OutName="tlut_009490" Format="rgba16" Width="53" Height="4" Offset="0x9490"/> <Texture Name="object_tw_TLUT_009490" OutName="tlut_009490" Format="rgba16" Width="53" Height="4" Offset="0x9490"/>
<Texture Name="object_tw_Tex_009638" OutName="tex_009638" Format="rgba16" Width="32" Height="32" Offset="0x9638"/> <Texture Name="gTwinrovaKotakeGerudoFabricTex" OutName="twinrova_kotake_gerudo_fabric" Format="rgba16" Width="32" Height="32" Offset="0x9638"/>
<Texture Name="object_tw_Tex_009E38" OutName="tex_009E38" Format="rgba16" Width="16" Height="16" Offset="0x9E38"/> <Texture Name="gTwinrovaKotakeRobeTex" OutName="twinrova_kotake_robe" Format="rgba16" Width="16" Height="16" Offset="0x9E38"/>
<Texture Name="object_tw_Tex_00A038" OutName="tex_00A038" Format="rgba16" Width="16" Height="16" Offset="0xA038"/> <Texture Name="gTwinrovaRobePatternTex" OutName="twinrova_robe_pattern" Format="rgba16" Width="16" Height="16" Offset="0xA038"/>
<Texture Name="object_tw_Tex_00A238" OutName="tex_00A238" Format="rgba16" Width="16" Height="16" Offset="0xA238"/> <Texture Name="gTwinrovaRobeTrimTex" OutName="twinrova_robe_trim" Format="rgba16" Width="16" Height="16" Offset="0xA238"/>
<Texture Name="object_tw_Tex_00A438" OutName="tex_00A438" Format="ci8" Width="32" Height="32" Offset="0xA438" TlutOffset="0x9490"/> <Texture Name="object_tw_Tex_00A438" OutName="tex_00A438" Format="ci8" Width="32" Height="32" Offset="0xA438" TlutOffset="0x9490"/>
<Texture Name="object_tw_Tex_00A838" OutName="tex_00A838" Format="ci8" Width="16" Height="8" Offset="0xA838" TlutOffset="0x9490"/> <Texture Name="object_tw_Tex_00A838" OutName="tex_00A838" Format="ci8" Width="16" Height="8" Offset="0xA838" TlutOffset="0x9490"/>
<Texture Name="object_tw_Tex_00A8B8" OutName="tex_00A8B8" Format="ci8" Width="8" Height="8" Offset="0xA8B8" TlutOffset="0x9490"/> <Texture Name="object_tw_Tex_00A8B8" OutName="tex_00A8B8" Format="ci8" Width="8" Height="8" Offset="0xA8B8" TlutOffset="0x9490"/>
<Texture Name="object_tw_Tex_00A8F8" OutName="tex_00A8F8" Format="rgba16" Width="8" Height="32" Offset="0xA8F8"/> <Texture Name="gTwinrovaHairTex" OutName="twinrova_hair" Format="rgba16" Width="8" Height="32" Offset="0xA8F8"/>
<Texture Name="object_tw_Tex_00AAF8" OutName="tex_00AAF8" Format="ci8" Width="8" Height="8" Offset="0xAAF8" TlutOffset="0x9490"/> <Texture Name="object_tw_Tex_00AAF8" OutName="tex_00AAF8" Format="ci8" Width="8" Height="8" Offset="0xAAF8" TlutOffset="0x9490"/>
<Texture Name="object_tw_Tex_00AB38" OutName="tex_00AB38" Format="ci8" Width="8" Height="16" Offset="0xAB38" TlutOffset="0x9490"/> <Texture Name="object_tw_Tex_00AB38" OutName="tex_00AB38" Format="ci8" Width="8" Height="16" Offset="0xAB38" TlutOffset="0x9490"/>
<Texture Name="object_tw_Tex_00ABB8" OutName="tex_00ABB8" Format="rgba16" Width="8" Height="8" Offset="0xABB8"/> <Texture Name="gTwinrovaBroomHandleTex" OutName="twinrova_broom_handle" Format="rgba16" Width="8" Height="8" Offset="0xABB8"/>
<Texture Name="object_tw_Tex_00AC38" OutName="tex_00AC38" Format="rgba16" Width="16" Height="32" Offset="0xAC38"/> <Texture Name="gTwinrovaBroomHeadTex" OutName="twinrova_broom_head" Format="rgba16" Width="16" Height="32" Offset="0xAC38"/>
<Texture Name="object_tw_Tex_00B038" OutName="tex_00B038" Format="rgba16" Width="16" Height="8" Offset="0xB038"/> <Texture Name="object_tw_Tex_00B038" OutName="tex_00B038" Format="rgba16" Width="16" Height="8" Offset="0xB038"/>
<Texture Name="object_tw_Tex_00B138" OutName="tex_00B138" Format="rgba16" Width="8" Height="8" Offset="0xB138"/> <Texture Name="gTwinrovaKotakeJewelTex" OutName="twinrova_kotake_jewel" Format="rgba16" Width="8" Height="8" Offset="0xB138"/>
<Texture Name="object_tw_Tex_00B1B8" OutName="tex_00B1B8" Format="ci8" Width="8" Height="8" Offset="0xB1B8" TlutOffset="0x9490"/> <Texture Name="object_tw_Tex_00B1B8" OutName="tex_00B1B8" Format="ci8" Width="8" Height="8" Offset="0xB1B8" TlutOffset="0x9490"/>
<Texture Name="object_tw_Tex_00B1F8" OutName="tex_00B1F8" Format="ci8" Width="8" Height="8" Offset="0xB1F8" TlutOffset="0x9490"/> <Texture Name="object_tw_Tex_00B1F8" OutName="tex_00B1F8" Format="ci8" Width="8" Height="8" Offset="0xB1F8" TlutOffset="0x9490"/>
<Texture Name="object_tw_Tex_00B238" OutName="tex_00B238" Format="ci8" Width="32" Height="32" Offset="0xB238" TlutOffset="0x9490"/> <Texture Name="object_tw_Tex_00B238" OutName="tex_00B238" Format="ci8" Width="32" Height="32" Offset="0xB238" TlutOffset="0x9490"/>
<Texture Name="object_tw_Tex_00B638" OutName="tex_00B638" Format="ci8" Width="32" Height="32" Offset="0xB638" TlutOffset="0x9490"/> <Texture Name="object_tw_Tex_00B638" OutName="tex_00B638" Format="ci8" Width="32" Height="32" Offset="0xB638" TlutOffset="0x9490"/>
<Texture Name="object_tw_Tex_00BA38" OutName="tex_00BA38" Format="i8" Width="32" Height="32" Offset="0xBA38"/> <Texture Name="gTwinrovaEffectTex" OutName="twinrova_effect" Format="i8" Width="32" Height="32" Offset="0xBA38"/>
<Texture Name="object_tw_Tex_00BE38" OutName="tex_00BE38" Format="i4" Width="32" Height="64" Offset="0xBE38"/> <Texture Name="gTwinrovaEffectMaskTex" OutName="twinrova_effect_mask" Format="i4" Width="32" Height="64" Offset="0xBE38"/>
<Texture Name="object_tw_Tex_00C238" OutName="tex_00C238" Format="rgba16" Width="32" Height="32" Offset="0xC238"/> <Texture Name="gTwinrovaKoumeGerudoFabricTex" OutName="twinrova_koume_gerudo_fabric" Format="rgba16" Width="32" Height="32" Offset="0xC238"/>
<Texture Name="object_tw_Tex_00CA38" OutName="tex_00CA38" Format="rgba16" Width="8" Height="8" Offset="0xCA38"/> <Texture Name="gTwinrovaKoumeJewelTex" OutName="twinrova_koume_jewel" Format="rgba16" Width="8" Height="8" Offset="0xCA38"/>
<Texture Name="object_tw_Tex_00CAB8" OutName="tex_00CAB8" Format="rgba16" Width="16" Height="16" Offset="0xCAB8"/> <Texture Name="gTwinrovaKoumeRobeTex" OutName="twinrova_koume_robe" Format="rgba16" Width="16" Height="16" Offset="0xCAB8"/>
<DList Name="object_tw_DL_0110A8" Offset="0x110A8"/> <DList Name="object_tw_DL_0110A8" Offset="0x110A8"/>
<DList Name="object_tw_DL_0116A0" Offset="0x116A0"/> <DList Name="object_tw_DL_0116A0" Offset="0x116A0"/>
<DList Name="object_tw_DL_011C98" Offset="0x11C98"/> <DList Name="object_tw_DL_011C98" Offset="0x11C98"/>
@ -115,8 +119,8 @@
<DList Name="object_tw_DL_0164C0" Offset="0x164C0"/> <DList Name="object_tw_DL_0164C0" Offset="0x164C0"/>
<DList Name="object_tw_DL_0164C8" Offset="0x164C8"/> <DList Name="object_tw_DL_0164C8" Offset="0x164C8"/>
<DList Name="object_tw_DL_0164D0" Offset="0x164D0"/> <DList Name="object_tw_DL_0164D0" Offset="0x164D0"/>
<Texture Name="object_tw_Tex_016650" OutName="tex_016650" Format="rgba16" Width="8" Height="8" Offset="0x16650"/> <Texture Name="gTwinrovaBraidEndTex" OutName="twinrova_braid_end" Format="rgba16" Width="8" Height="8" Offset="0x16650"/>
<Texture Name="object_tw_Tex_0166D0" OutName="tex_0166D0" Format="rgba16" Width="4" Height="8" Offset="0x166D0"/> <Texture Name="gTwinrovaLeftFootTex" OutName="twinrova_left_foot" Format="rgba16" Width="4" Height="8" Offset="0x166D0"/>
<!--Blob Name="object_tw_Blob_0176D0" Size="0x60" Offset="0x176D0" /--> <!--Blob Name="object_tw_Blob_0176D0" Size="0x60" Offset="0x176D0" /-->
<DList Name="object_tw_DL_017910" Offset="0x17910"/> <DList Name="object_tw_DL_017910" Offset="0x17910"/>
<DList Name="object_tw_DL_017A08" Offset="0x17A08"/> <DList Name="object_tw_DL_017A08" Offset="0x17A08"/>
@ -135,51 +139,96 @@
<DList Name="object_tw_DL_018990" Offset="0x18990"/> <DList Name="object_tw_DL_018990" Offset="0x18990"/>
<DList Name="object_tw_DL_018998" Offset="0x18998"/> <DList Name="object_tw_DL_018998" Offset="0x18998"/>
<DList Name="object_tw_DL_0189A0" Offset="0x189A0"/> <DList Name="object_tw_DL_0189A0" Offset="0x189A0"/>
<Texture Name="object_tw_Tex_018B20" OutName="tex_018B20" Format="rgba16" Width="4" Height="8" Offset="0x18B20"/> <Texture Name="gTwinrovaRightFootTex" OutName="twinrova_right_foot" Format="rgba16" Width="4" Height="8" Offset="0x18B20"/>
<Texture Name="object_tw_Tex_018B60" OutName="tex_018B60" Format="i4" Width="32" Height="64" Offset="0x18B60"/>
<DList Name="object_tw_DL_018FC0" Offset="0x18FC0"/> <!-- Koume Ground Smoke --> <!-- Assets for the smoke that comes off of the big flame -->
<Texture Name="object_tw_Tex_019078" OutName="tex_019078" Format="i8" Width="32" Height="32" Offset="0x19078"/> <Texture Name="gTwinrovaFireSmokeTex" OutName="twinrova_fire_smoke" Format="i4" Width="32" Height="64" Offset="0x18B60"/>
<Texture Name="object_tw_Tex_019478" OutName="tex_019478" Format="i4" Width="32" Height="64" Offset="0x19478"/> <DList Name="gTwinrovaFireSmokeDL" Offset="0x18FC0"/> <!-- Original name is "bt_firesmoke_modelT" -->
<DList Name="object_tw_DL_019938" Offset="0x19938"/> <!-- koume Ground Flame -->
<Texture Name="object_tw_Tex_019A20" OutName="tex_019A20" Format="i4" Width="32" Height="32" Offset="0x19A20"/> <!-- Assets for the big flame that appears when Koume's beam or Twinrova's fire attack hits the ground -->
<DList Name="object_tw_DL_019D40" Offset="0x19D40"/> <!-- Koume Ground Crater --> <Texture Name="gTwinrovaBigFlameTex" OutName="twinrova_big_flame" Format="i8" Width="32" Height="32" Offset="0x19078"/>
<Texture Name="object_tw_Tex_019E00" OutName="tex_019E00" Format="i4" Width="32" Height="64" Offset="0x19E00"/> <Texture Name="gTwinrovaBigFlameMaskTex" OutName="twinrova_big_flame_mask" Format="i4" Width="32" Height="64" Offset="0x19478"/>
<Texture Name="object_tw_Tex_01A200" OutName="tex_01A200" Format="i4" Width="32" Height="32" Offset="0x1A200"/> <DList Name="gTwinrovaBigFlameDL" Offset="0x19938"/> <!-- Original name is "bt_firewall_modelT" -->
<DList Name="object_tw_DL_01A430" Offset="0x1A430"/>
<DList Name="object_tw_DL_01A528" Offset="0x1A528"/> <!-- Texture for both the pool of fire and the effect when the Mirror Shield has absorbed an attack. -->
<DList Name="object_tw_DL_01A5A8" Offset="0x1A5A8"/> <Texture Name="gTwinrovaFirePoolAndShieldChargeCenterTex" OutName="twinrova_fire_pool_and_shield_charge_center" Format="i4" Width="32" Height="32" Offset="0x19A20"/>
<Texture Name="object_tw_Tex_01A5C0" OutName="tex_01A5C0" Format="i8" Width="16" Height="16" Offset="0x1A5C0"/>
<DList Name="object_tw_DL_01A790" Offset="0x1A790"/> <!-- DisplayList for the pool of fire that forms when Koume's beam or Twinrova's fire attack hits the ground -->
<DList Name="object_tw_DL_01A8A0" Offset="0x1A8A0"/> <DList Name="gTwinrovaFirePoolDL" Offset="0x19D40"/> <!-- Original name is "bt_firefloor_modelT" -->
<DList Name="object_tw_DL_01A998" Offset="0x1A998"/>
<DList Name="object_tw_DL_01AA50" Offset="0x1AA50"/> <!-- Assets for the fire effect that appears in various places -->
<DList Name="object_tw_DL_01AB00" Offset="0x1AB00"/> <Texture Name="gTwinrovaFireTex" OutName="twinrova_fire" Format="i4" Width="32" Height="64" Offset="0x19E00"/>
<Texture Name="object_tw_Tex_01AB20" OutName="tex_01AB20" Format="i8" Width="64" Height="64" Offset="0x1AB20"/> <Texture Name="gTwinrovaFireMaskTex" OutName="twinrova_fire_mask" Format="i4" Width="32" Height="32" Offset="0x1A200"/>
<!--Blob Name="object_tw_Blob_01BB20" Size="0x40" Offset="0x1BB20" /--> <DList Name="gTwinrovaFireDL" Offset="0x1A430"/> <!-- Original name is "bt_fireball_modelT" -->
<DList Name="object_tw_DL_01BC00" Offset="0x1BC00"/>
<Texture Name="object_tw_Tex_01BCA0" OutName="tex_01BCA0" Format="i4" Width="32" Height="64" Offset="0x1BCA0"/> <!-- Assets for the magic particles that fly off of Koume, Kotake, and Twinrova's head -->
<Texture Name="object_tw_Tex_01C0A0" OutName="tex_01C0A0" Format="i4" Width="16" Height="16" Offset="0x1C0A0"/> <DList Name="gTwinrovaMagicParticleMaterialDL" Offset="0x1A528"/>
<DList Name="object_tw_DL_01C1C0" Offset="0x1C1C0"/> <DList Name="gTwinrovaMagicParticleModelDL" Offset="0x1A5A8"/> <!-- Original name is "bt_hinoko_modelT" ("sparks") -->
<Texture Name="object_tw_Tex_01C2A0" OutName="tex_01C2A0" Format="i4" Width="32" Height="64" Offset="0x1C2A0"/> <Texture Name="gTwinrovaMagicParticleTex" OutName="twinrova_magic_particle" Format="i8" Width="16" Height="16" Offset="0x1A5C0"/>
<Texture Name="object_tw_Tex_01C6A0" OutName="tex_01C6A0" Format="i4" Width="64" Height="64" Offset="0x1C6A0"/>
<DList Name="object_tw_DL_01CEE0" Offset="0x1CEE0"/> <!-- DisplayList for the wave of cold air that comes from the ice pool and the effect that appears on the shield when the player reflects a beam -->
<Texture Name="object_tw_Tex_01CFA8" OutName="tex_01CFA8" Format="i4" Width="32" Height="64" Offset="0x1CFA8"/> <DList Name="gTwinrovaEffectHaloDL" Offset="0x1A790"/> <!-- Original name is "bt_coolwave_modelT" -->
<Texture Name="object_tw_Tex_01D3A8" OutName="tex_01D3A8" Format="i4" Width="64" Height="64" Offset="0x1D3A8"/>
<DList Name="object_tw_DL_01DBE8" Offset="0x1DBE8"/> <!-- DisplayLists for various ice effects -->
<DList Name="object_tw_DL_01DDF0" Offset="0x1DDF0"/> <DList Name="gTwinrovaUnusedIceSteamCloudDL" Offset="0x1A8A0"/>
<DList Name="object_tw_DL_01E020" Offset="0x1E020"/> <DList Name="gTwinrovaIceMaterialDL" Offset="0x1A998"/>
<DList Name="object_tw_DL_01E0E0" Offset="0x1E0E0"/> <DList Name="gTwinrovaIceSurroundingPlayerMaterialDL" Offset="0x1AA50"/>
<DList Name="object_tw_DL_01E2C0" Offset="0x1E2C0"/> <DList Name="gTwinrovaIceModelDL" Offset="0x1AB00"/> <!-- Original name is "bt_coolball_modelT" -->
<DList Name="object_tw_DL_01E3A0" Offset="0x1E3A0"/>
<Texture Name="object_tw_Tex_01E430" OutName="tex_01E430" Format="i4" Width="32" Height="32" Offset="0x1E430"/> <!-- Texture for the ice pool -->
<DList Name="object_tw_DL_01E9F0" Offset="0x1E9F0"/> <Texture Name="gTwinrovaIcePoolTex" OutName="twinrova_ice_pool" Format="i8" Width="64" Height="64" Offset="0x1AB20"/>
<Texture Name="object_tw_Tex_01EB28" OutName="tex_01EB28" Format="i8" Width="16" Height="16" Offset="0x1EB28"/>
<DList Name="object_tw_DL_01EC68" Offset="0x1EC68"/> <!-- Unused vertices. Based on its placement, this may have been originally used with the ice pool. -->
<Texture Name="object_tw_Tex_01ECF0" OutName="tex_01ECF0" Format="i4" Width="16" Height="16" Offset="0x1ECF0"/> <Array Name="gTwinrovaUnusedVtx" Count="4" Offset="0x1BB20">
<DList Name="object_tw_DL_01EEB0" Offset="0x1EEB0"/> <Vtx/>
<DList Name="object_tw_DL_01F238" Offset="0x1F238"/> </Array>
<DList Name="object_tw_DL_01F390" Offset="0x1F390"/>
<DList Name="object_tw_DL_01F608" Offset="0x1F608"/> <!-- DisplayList for the ice pool -->
<DList Name="gTwinrovaIcePoolDL" Offset="0x1BC00"/> <!-- Not present in OoT3D, but MM's Wizrobe has an identical DList called "wiz_icefloor03_modelT" -->
<!-- Assets for the gleam on top of the ice pool-->
<Texture Name="gTwinrovaIcePoolShineTex" OutName="twinrova_ice_pool_shine" Format="i4" Width="32" Height="64" Offset="0x1BCA0"/>
<Texture Name="gTwinrovaIcePoolShineMaskTex" OutName="twinrova_ice_pool_shine_mask" Format="i4" Width="16" Height="16" Offset="0x1C0A0"/>
<DList Name="gTwinrovaIcePoolShineDL" Offset="0x1C1C0"/> <!-- Original name is "bt_icefloor03_pika_modelT" ("pika" = onomatopoeic for "sparkle, glisten") -->
<!-- Assets for the magical sigils that appear when Kotake/Koume spawn or charge up an attack. -->
<Texture Name="gTwinrovaKotakeMagicSigilMaskTex" OutName="twinrova_kotake_magic_sigil_mask" Format="i4" Width="32" Height="64" Offset="0x1C2A0"/>
<Texture Name="gTwinrovaKotakeMagicSigilTex" OutName="twinrova_kotake_magic_sigil" Format="i4" Width="64" Height="64" Offset="0x1C6A0"/>
<DList Name="gTwinrovaKotakeMagicSigilDL" Offset="0x1CEE0"/> <!-- Original name is "btT_mahoujin_modelT" ("summoning circle; magic circle") -->
<Texture Name="gTwinrovaKoumeMagicSigilMaskTex" OutName="twinrova_koume_magic_sigil_mask" Format="i4" Width="32" Height="64" Offset="0x1CFA8"/>
<Texture Name="gTwinrovaKoumeMagicSigilTex" OutName="twinrova_koume_magic_sigil" Format="i4" Width="64" Height="64" Offset="0x1D3A8"/>
<DList Name="gTwinrovaKoumeMagicSigilDL" Offset="0x1DBE8"/> <!-- Original name is "btU_mahoujin_modelT" -->
<!-- DisplayList for Koume and Kotake's beam -->
<DList Name="gTwinrovaBeamDL" Offset="0x1DDF0"/> <!-- Original name is "bt_firebeam_modelT" -->
<!-- DisplayLists for various Mirror Shield effects -->
<DList Name="gTwinrovaMirrorShieldFireChargeCenterDL" Offset="0x1E020"/>
<DList Name="gTwinrovaMirrorShieldFireChargeSidesDL" Offset="0x1E0E0"/>
<DList Name="gTwinrovaMirrorShieldIceChargeCenterDL" Offset="0x1E2C0"/>
<DList Name="gTwinrovaMirrorShieldIceChargeSidesDL" Offset="0x1E3A0"/>
<!-- Texture for the clouds of ice -->
<Texture Name="gTwinrovaCloudMaskTex" OutName="twinrova_cloud_mask" Format="i4" Width="32" Height="32" Offset="0x1E430"/>
<!-- DisplayList for the effect that appears when the Mirror Shield absorbs Twinrova's attack, or when it unleashes a charged attack -->
<DList Name="gTwinrovaShieldAbsorbAndReflectEffectDL" Offset="0x1E9F0"/> <!-- Original name is "btW_bacuuuum_modelT" -->
<!-- Texture of a circle, used for the spawn portal shadow and the circle of light -->
<Texture Name="gTwinrovaCircleTex" OutName="twinrova_circle" Format="i8" Width="16" Height="16" Offset="0x1EB28"/>
<!-- DisplayList for the "shadow" under Koume and Kotake's spawn portal -->
<DList Name="gTwinrovaSpawnPortalShadowDL" Offset="0x1EC68"/> <!-- Original name is "bt_under_mjin_modelT" -->
<!-- Texture for the light pillar and the halo that appear when Twinrova is defeated -->
<Texture Name="gTwinrovaLightPillarAndHaloTex" OutName="twinrova_light_pillar_and_halo" Format="i4" Width="16" Height="16" Offset="0x1ECF0"/>
<!-- DisplayLists for various effects that appear when Twinrova is defeated -->
<DList Name="gTwinrovaLightPillarDL" Offset="0x1EEB0"/> <!-- Original name is "bt_heavenroad_modelT" -->
<DList Name="gTwinrovaLightRaysDL" Offset="0x1F238"/> <!-- Original name is "bt_gokou_modelT" ("halo; aureole; aureola") -->
<DList Name="gTwinrovaLightCircleDL" Offset="0x1F390"/> <!-- Original name is "bt_heavensgate_modelT" -->
<DList Name="gTwinrovaHaloDL" Offset="0x1F608"/> <!-- Original name is "bt_angelring_model" -->
<Limb Name="object_tw_Limb_01F6E8" LimbType="Standard" Offset="0x1F6E8"/> <Limb Name="object_tw_Limb_01F6E8" LimbType="Standard" Offset="0x1F6E8"/>
<Limb Name="object_tw_Limb_01F6F4" LimbType="Standard" Offset="0x1F6F4"/> <Limb Name="object_tw_Limb_01F6F4" LimbType="Standard" Offset="0x1F6F4"/>
<Limb Name="object_tw_Limb_01F700" LimbType="Standard" Offset="0x1F700"/> <Limb Name="object_tw_Limb_01F700" LimbType="Standard" Offset="0x1F700"/>
@ -206,127 +255,150 @@
<Limb Name="object_tw_Limb_01F7FC" LimbType="Standard" Offset="0x1F7FC"/> <Limb Name="object_tw_Limb_01F7FC" LimbType="Standard" Offset="0x1F7FC"/>
<Limb Name="object_tw_Limb_01F808" LimbType="Standard" Offset="0x1F808"/> <Limb Name="object_tw_Limb_01F808" LimbType="Standard" Offset="0x1F808"/>
<Limb Name="object_tw_Limb_01F814" LimbType="Standard" Offset="0x1F814"/> <Limb Name="object_tw_Limb_01F814" LimbType="Standard" Offset="0x1F814"/>
<Skeleton Name="object_tw_Skel_01F888" Type="Flex" LimbType="Standard" Offset="0x1F888"/> <Skeleton Name="object_tw_Skel_01F888" Type="Flex" LimbType="Standard" Offset="0x1F888"/>
<Texture Name="object_tw_Tex_02A070" OutName="tex_02A070" Format="ci8" Width="32" Height="32" Offset="0x2A070" TlutOffset="0x29E50"/>
<Animation Name="object_tw_Anim_0216DC" Offset="0x216DC"/> <!-- Twinrova Texture -->
<Animation Name="object_tw_Anim_022700" Offset="0x22700"/> <Texture Name="gTwinrovaEyeHalfTex" OutName="twinrova_eye_half" Format="ci8" Width="32" Height="32" Offset="0x2A070" TlutOffset="0x29E50"/>
<Animation Name="object_tw_Anim_023750" Offset="0x23750"/>
<Animation Name="object_tw_Anim_024374" Offset="0x24374"/> <!-- Twinrova Animations -->
<Animation Name="object_tw_Anim_0244B4" Offset="0x244B4"/> <Animation Name="gTwinrovaDeathAnim" Offset="0x216DC"/> <!-- Original name is "btW_EDdamage" -->
<Texture Name="object_tw_Tex_0244D0" OutName="tex_0244D0" Format="rgba16" Width="4" Height="8" Offset="0x244D0"/> <Animation Name="gTwinrovaIceAttackAnim" Offset="0x22700"/> <!-- Original name is "btW_atackL" -->
<Texture Name="object_tw_Tex_024510" OutName="tex_024510" Format="rgba16" Width="16" Height="16" Offset="0x24510"/> <Animation Name="gTwinrovaFireAttackAnim" Offset="0x23750"/> <!-- Original name is "btW_atackR" -->
<Texture Name="object_tw_Tex_024710" OutName="tex_024710" Format="rgba16" Width="16" Height="16" Offset="0x24710"/> <Animation Name="gTwinrovaDamageAnim" Offset="0x24374"/> <!-- Original name is "btW_damage" -->
<Texture Name="object_tw_Tex_024910" OutName="tex_024910" Format="rgba16" Width="16" Height="16" Offset="0x24910"/> <Animation Name="gTwinrovaTPoseAnim" Offset="0x244B4"/> <!-- Original name is "btW_default" -->
<Texture Name="object_tw_Tex_024B10" OutName="tex_024B10" Format="rgba16" Width="16" Height="16" Offset="0x24B10"/>
<DList Name="object_tw_DL_027720" Offset="0x27720"/> <!-- Twinrova Textures -->
<DList Name="object_tw_DL_027820" Offset="0x27820"/> <Texture Name="gTwinrovaSkinAndBangleTex" OutName="twinrova_skin_and_bangle" Format="rgba16" Width="4" Height="8" Offset="0x244D0"/>
<DList Name="object_tw_DL_027970" Offset="0x27970"/> <Texture Name="gTwinrovaEmblemTex" OutName="twinrova_emblem" Format="rgba16" Width="16" Height="16" Offset="0x24510"/>
<DList Name="object_tw_DL_027A60" Offset="0x27A60"/> <Texture Name="gTwinrovaBreastTex" OutName="twinrova_breast" Format="rgba16" Width="16" Height="16" Offset="0x24710"/>
<DList Name="object_tw_DL_027B78" Offset="0x27B78"/> <Texture Name="gTwinrovaRightPantLegTex" OutName="twinrova_right_pant_leg" Format="rgba16" Width="16" Height="16" Offset="0x24910"/>
<DList Name="object_tw_DL_027C98" Offset="0x27C98"/> <Texture Name="gTwinrovaLeftPantLegTex" OutName="twinrova_left_pant_leg" Format="rgba16" Width="16" Height="16" Offset="0x24B10"/>
<DList Name="object_tw_DL_027DE8" Offset="0x27DE8"/>
<DList Name="object_tw_DL_027EE0" Offset="0x27EE0"/> <!-- Twinrova Limb DisplayLists -->
<DList Name="object_tw_DL_027FE8" Offset="0x27FE8"/> <DList Name="gTwinrovaRightFootDL" Offset="0x27720"/>
<DList Name="object_tw_DL_028100" Offset="0x28100"/> <DList Name="gTwinrovaRightShinDL" Offset="0x27820"/>
<DList Name="object_tw_DL_028220" Offset="0x28220"/> <DList Name="gTwinrovaRightThighDL" Offset="0x27970"/>
<DList Name="object_tw_DL_028370" Offset="0x28370"/> <DList Name="gTwinrovaRightSleeveEndDL" Offset="0x27A60"/>
<DList Name="object_tw_DL_028468" Offset="0x28468"/> <DList Name="gTwinrovaRightSleeveStartDL" Offset="0x27B78"/>
<DList Name="object_tw_DL_028570" Offset="0x28570"/> <DList Name="gTwinrovaRightForearmDL" Offset="0x27C98"/>
<DList Name="object_tw_DL_028668" Offset="0x28668"/> <DList Name="gTwinrovaRightUpperArmDL" Offset="0x27DE8"/>
<DList Name="object_tw_DL_028778" Offset="0x28778"/> <DList Name="gTwinrovaRightShoulderDL" Offset="0x27EE0"/>
<DList Name="object_tw_DL_028870" Offset="0x28870"/> <DList Name="gTwinrovaLeftSleeveEndDL" Offset="0x27FE8"/>
<DList Name="object_tw_DL_028980" Offset="0x28980"/> <DList Name="gTwinrovaLeftSleeveStartDL" Offset="0x28100"/>
<DList Name="object_tw_DL_028B78" Offset="0x28B78"/> <DList Name="gTwinrovaLeftForearmDL" Offset="0x28220"/>
<DList Name="object_tw_DL_028D70" Offset="0x28D70"/> <DList Name="gTwinrovaLeftUpperArmDL" Offset="0x28370"/>
<DList Name="object_tw_DL_029268" Offset="0x29268"/> <DList Name="gTwinrovaLeftShoulderDL" Offset="0x28468"/>
<DList Name="object_tw_DL_0293E0" Offset="0x293E0"/> <DList Name="gTwinrovaLeftBraidEndDL" Offset="0x28570"/>
<DList Name="object_tw_DL_029530" Offset="0x29530"/> <DList Name="gTwinrovaLeftBraidStartDL" Offset="0x28668"/>
<DList Name="object_tw_DL_029620" Offset="0x29620"/> <DList Name="gTwinrovaRightBraidEndDL" Offset="0x28778"/>
<DList Name="object_tw_DL_029738" Offset="0x29738"/> <DList Name="gTwinrovaRightBraidStartDL" Offset="0x28870"/>
<DList Name="object_tw_DL_029900" Offset="0x29900"/> <DList Name="gTwinrovaRightBreastDL" Offset="0x28980"/>
<DList Name="object_tw_DL_0299F8" Offset="0x299F8"/> <DList Name="gTwinrovaLeftBreastDL" Offset="0x28B78"/>
<DList Name="object_tw_DL_029B10" Offset="0x29B10"/> <DList Name="gTwinrovaTorsoDL" Offset="0x28D70"/>
<Texture Name="object_tw_TLUT_029E50" OutName="tlut_029E50" Format="rgba16" Width="29" Height="8" Offset="0x29E50"/> <DList Name="gTwinrovaLeftFootDL" Offset="0x29268"/>
<Texture Name="object_tw_TLUT_02A020" OutName="tlut_02A020" Format="rgba16" Width="8" Height="5" Offset="0x2A020"/> <DList Name="gTwinrovaLeftShinDL" Offset="0x293E0"/>
<Texture Name="object_tw_Tex_02A470" OutName="tex_02A470" Format="ci8" Width="32" Height="32" Offset="0x2A470" TlutOffset="0x29E50"/> <DList Name="gTwinrovaLeftThighDL" Offset="0x29530"/>
<Texture Name="object_tw_Tex_02A870" OutName="tex_02A870" Format="ci8" Width="16" Height="16" Offset="0x2A870" TlutOffset="0x29e50"/> <DList Name="gTwinrovaSash4DL" Offset="0x29620"/>
<Texture Name="object_tw_Tex_02A970" OutName="tex_02A970" Format="rgba16" Width="8" Height="4" Offset="0x2A970"/> <DList Name="gTwinrovaSash3DL" Offset="0x29738"/>
<Texture Name="object_tw_Tex_02A9B0" OutName="tex_02A9B0" Format="ci8" Width="32" Height="32" Offset="0x2A9B0" TlutOffset="0x29E50"/> <DList Name="gTwinrovaSash2DL" Offset="0x29900"/>
<Texture Name="object_tw_Tex_02ADB0" OutName="tex_02ADB0" Format="i8" Width="8" Height="8" Offset="0x2ADB0"/> <DList Name="gTwinrovaSash1DL" Offset="0x299F8"/>
<Texture Name="object_tw_Tex_02ADF0" OutName="tex_02ADF0" Format="ci8" Width="8" Height="8" Offset="0x2ADF0" TlutOffset="0x2A020"/> <DList Name="gTwinrovaPelvisDL" Offset="0x29B10"/>
<Texture Name="object_tw_Tex_02AE30" OutName="tex_02AE30" Format="ci8" Width="16" Height="16" Offset="0x2AE30" TlutOffset="0x29e50"/>
<Texture Name="object_tw_Tex_02AF30" OutName="tex_02AF30" Format="ci8" Width="8" Height="16" Offset="0x2AF30" TlutOffset="0x2A020"/> <!-- Twinrova Textures -->
<DList Name="object_tw_DL_02CAF0" Offset="0x2CAF0"/> <Texture Name="gTwinrovaEyeAndMouthTLUT" OutName="twinrova_eye_and_mouth_tlut" Format="rgba16" Width="29" Height="8" Offset="0x29E50"/>
<DList Name="object_tw_DL_02CB50" Offset="0x2CB50"/> <Texture Name="gTwinrovaEarAndFingerTLUT" OutName="twinrova_ear_and_finger_tlut" Format="rgba16" Width="8" Height="5" Offset="0x2A020"/>
<DList Name="object_tw_DL_02CBB0" Offset="0x2CBB0"/> <Texture Name="gTwinrovaEyeClosedTex" OutName="twinrova_eye_closed" Format="ci8" Width="32" Height="32" Offset="0x2A470" TlutOffset="0x29E50"/>
<DList Name="object_tw_DL_02D320" Offset="0x2D320"/> <Texture Name="gTwinrovaGrimaceTex" OutName="twinrova_grimace" Format="ci8" Width="16" Height="16" Offset="0x2A870" TlutOffset="0x29E50"/>
<DList Name="object_tw_DL_02D4A0" Offset="0x2D4A0"/> <Texture Name="gTwinrovaEyebrowTex" OutName="twinrova_eyebrow" Format="rgba16" Width="8" Height="4" Offset="0x2A970"/>
<DList Name="object_tw_DL_02D5D8" Offset="0x2D5D8"/> <Texture Name="gTwinrovaEyeOpenTex" OutName="twinrova_eye_open" Format="ci8" Width="32" Height="32" Offset="0x2A9B0" TlutOffset="0x29E50"/>
<DList Name="object_tw_DL_02D710" Offset="0x2D710"/> <Texture Name="gTwinrovaNoseTex" OutName="twinrova_nose" Format="i8" Width="8" Height="8" Offset="0x2ADB0"/>
<DList Name="object_tw_DL_02D890" Offset="0x2D890"/> <Texture Name="gTwinrovaEarTex" OutName="twinrova_ear" Format="ci8" Width="8" Height="8" Offset="0x2ADF0" TlutOffset="0x2A020"/>
<DList Name="object_tw_DL_02D940" Offset="0x2D940"/> <Texture Name="gTwinrovaSmileTex" OutName="twinrova_smile" Format="ci8" Width="16" Height="16" Offset="0x2AE30" TlutOffset="0x29E50"/>
<DList Name="object_tw_DL_02D9F0" Offset="0x2D9F0"/> <Texture Name="gTwinrovaFingerTex" OutName="twinrova_finger" Format="ci8" Width="8" Height="16" Offset="0x2AF30" TlutOffset="0x2A020"/>
<DList Name="object_tw_DL_02DAE0" Offset="0x2DAE0"/>
<DList Name="object_tw_DL_02DBC8" Offset="0x2DBC8"/> <!-- Twinrova Limb DisplayLists -->
<DList Name="object_tw_DL_02DCB8" Offset="0x2DCB8"/> <DList Name="gTwinrovaInvisibleLeftHairBunDL" Offset="0x2CAF0"/>
<DList Name="object_tw_DL_02DDD8" Offset="0x2DDD8"/> <DList Name="gTwinrovaInvisibleRightHairBunDL" Offset="0x2CB50"/>
<DList Name="object_tw_DL_02DEB0" Offset="0x2DEB0"/> <DList Name="gTwinrovaHeadDL" Offset="0x2CBB0"/>
<DList Name="object_tw_DL_02DFB0" Offset="0x2DFB0"/> <DList Name="gTwinrovaLeftHandDL" Offset="0x2D320"/>
<DList Name="object_tw_DL_02E098" Offset="0x2E098"/> <DList Name="gTwinrovaRightBroomDL" Offset="0x2D4A0"/>
<Blob Name="object_tw_Blob_02E170" Size="0x3C00" Offset="0x2E170"/> <!-- boss title card --> <DList Name="gTwinrovaLeftBroomDL" Offset="0x2D5D8"/>
<Limb Name="object_tw_Limb_031D70" LimbType="Standard" Offset="0x31D70"/> <DList Name="gTwinrovaRightHandDL" Offset="0x2D710"/>
<Limb Name="object_tw_Limb_031D7C" LimbType="Standard" Offset="0x31D7C"/> <DList Name="gTwinrovaRightHairBunDL" Offset="0x2D890"/>
<Limb Name="object_tw_Limb_031D88" LimbType="Standard" Offset="0x31D88"/> <DList Name="gTwinrovaLeftHairBunDL" Offset="0x2D940"/>
<Limb Name="object_tw_Limb_031D94" LimbType="Standard" Offset="0x31D94"/> <DList Name="gTwinrovaHairIceJetDL" Offset="0x2D9F0"/>
<Limb Name="object_tw_Limb_031DA0" LimbType="Standard" Offset="0x31DA0"/> <DList Name="gTwinrovaHairIceTrailDL" Offset="0x2DAE0"/>
<Limb Name="object_tw_Limb_031DAC" LimbType="Standard" Offset="0x31DAC"/> <DList Name="gTwinrovaHairFireJetDL" Offset="0x2DBC8"/>
<Limb Name="object_tw_Limb_031DB8" LimbType="Standard" Offset="0x31DB8"/> <DList Name="gTwinrovaHairFireTrailDL" Offset="0x2DCB8"/>
<Limb Name="object_tw_Limb_031DC4" LimbType="Standard" Offset="0x31DC4"/> <DList Name="gTwinrovaBroomIceJetDL" Offset="0x2DDD8"/>
<Limb Name="object_tw_Limb_031DD0" LimbType="Standard" Offset="0x31DD0"/> <DList Name="gTwinrovaBroomIceTrailDL" Offset="0x2DEB0"/>
<Limb Name="object_tw_Limb_031DDC" LimbType="Standard" Offset="0x31DDC"/> <DList Name="gTwinrovaBroomFireJetDL" Offset="0x2DFB0"/>
<Limb Name="object_tw_Limb_031DE8" LimbType="Standard" Offset="0x31DE8"/> <DList Name="gTwinrovaBroomFireTrailDL" Offset="0x2E098"/>
<Limb Name="object_tw_Limb_031DF4" LimbType="Standard" Offset="0x31DF4"/>
<Limb Name="object_tw_Limb_031E00" LimbType="Standard" Offset="0x31E00"/> <!-- Twinrova Title Card -->
<Limb Name="object_tw_Limb_031E0C" LimbType="Standard" Offset="0x31E0C"/> <Texture Name="gTwinrovaTitleCardTex" OutName="twinrova_title_card" Format="i8" Width="128" Height="120" Offset="0x2E170"/>
<Limb Name="object_tw_Limb_031E18" LimbType="Standard" Offset="0x31E18"/>
<Limb Name="object_tw_Limb_031E24" LimbType="Standard" Offset="0x31E24"/> <!-- Twinrova Limbs -->
<Limb Name="object_tw_Limb_031E30" LimbType="Standard" Offset="0x31E30"/> <Limb Name="gTwinrovaPelvisLimb" LimbType="Standard" Offset="0x31D70"/>
<Limb Name="object_tw_Limb_031E3C" LimbType="Standard" Offset="0x31E3C"/> <Limb Name="gTwinrovaSash1Limb" LimbType="Standard" Offset="0x31D7C"/>
<Limb Name="object_tw_Limb_031E48" LimbType="Standard" Offset="0x31E48"/> <Limb Name="gTwinrovaSash2Limb" LimbType="Standard" Offset="0x31D88"/>
<Limb Name="object_tw_Limb_031E54" LimbType="Standard" Offset="0x31E54"/> <Limb Name="gTwinrovaSash3Limb" LimbType="Standard" Offset="0x31D94"/>
<Limb Name="object_tw_Limb_031E60" LimbType="Standard" Offset="0x31E60"/> <Limb Name="gTwinrovaSash4Limb" LimbType="Standard" Offset="0x31DA0"/>
<Limb Name="object_tw_Limb_031E6C" LimbType="Standard" Offset="0x31E6C"/> <Limb Name="gTwinrovaLeftThighLimb" LimbType="Standard" Offset="0x31DAC"/>
<Limb Name="object_tw_Limb_031E78" LimbType="Standard" Offset="0x31E78"/> <Limb Name="gTwinrovaLeftShinLimb" LimbType="Standard" Offset="0x31DB8"/>
<Limb Name="object_tw_Limb_031E84" LimbType="Standard" Offset="0x31E84"/> <Limb Name="gTwinrovaLeftFootLimb" LimbType="Standard" Offset="0x31DC4"/>
<Limb Name="object_tw_Limb_031E90" LimbType="Standard" Offset="0x31E90"/> <Limb Name="gTwinrovaRightThighLimb" LimbType="Standard" Offset="0x31DD0"/>
<Limb Name="object_tw_Limb_031E9C" LimbType="Standard" Offset="0x31E9C"/> <Limb Name="gTwinrovaRightShinLimb" LimbType="Standard" Offset="0x31DDC"/>
<Limb Name="object_tw_Limb_031EA8" LimbType="Standard" Offset="0x31EA8"/> <Limb Name="gTwinrovaRightFootLimb" LimbType="Standard" Offset="0x31DE8"/>
<Limb Name="object_tw_Limb_031EB4" LimbType="Standard" Offset="0x31EB4"/> <Limb Name="gTwinrovaTorsoLimb" LimbType="Standard" Offset="0x31DF4"/>
<Limb Name="object_tw_Limb_031EC0" LimbType="Standard" Offset="0x31EC0"/> <Limb Name="gTwinrovaLeftBreastLimb" LimbType="Standard" Offset="0x31E00"/>
<Limb Name="object_tw_Limb_031ECC" LimbType="Standard" Offset="0x31ECC"/> <Limb Name="gTwinrovaRightBreastLimb" LimbType="Standard" Offset="0x31E0C"/>
<Limb Name="object_tw_Limb_031ED8" LimbType="Standard" Offset="0x31ED8"/> <Limb Name="gTwinrovaHairIceTrailLimb" LimbType="Standard" Offset="0x31E18"/>
<Limb Name="object_tw_Limb_031EE4" LimbType="Standard" Offset="0x31EE4"/> <Limb Name="gTwinrovaHairIceJetLimb" LimbType="Standard" Offset="0x31E24"/>
<Limb Name="object_tw_Limb_031EF0" LimbType="Standard" Offset="0x31EF0"/> <Limb Name="gTwinrovaHairFireJetLimb" LimbType="Standard" Offset="0x31E30"/>
<Limb Name="object_tw_Limb_031EFC" LimbType="Standard" Offset="0x31EFC"/> <Limb Name="gTwinrovaHairFireTrailLimb" LimbType="Standard" Offset="0x31E3C"/>
<Limb Name="object_tw_Limb_031F08" LimbType="Standard" Offset="0x31F08"/> <Limb Name="gTwinrovaLeftHairBunLimb" LimbType="Standard" Offset="0x31E48"/>
<Limb Name="object_tw_Limb_031F14" LimbType="Standard" Offset="0x31F14"/> <Limb Name="gTwinrovaRightHairBunLimb" LimbType="Standard" Offset="0x31E54"/>
<Limb Name="object_tw_Limb_031F20" LimbType="Standard" Offset="0x31F20"/> <Limb Name="gTwinrovaHeadLimb" LimbType="Standard" Offset="0x31E60"/>
<Limb Name="object_tw_Limb_031F2C" LimbType="Standard" Offset="0x31F2C"/> <Limb Name="gTwinrovaRightBraidStartLimb" LimbType="Standard" Offset="0x31E6C"/>
<Limb Name="object_tw_Limb_031F38" LimbType="Standard" Offset="0x31F38"/> <Limb Name="gTwinrovaRightBraidEndLimb" LimbType="Standard" Offset="0x31E78"/>
<Limb Name="object_tw_Limb_031F44" LimbType="Standard" Offset="0x31F44"/> <Limb Name="gTwinrovaLeftBraidStartLimb" LimbType="Standard" Offset="0x31E84"/>
<Limb Name="object_tw_Limb_031F50" LimbType="Standard" Offset="0x31F50"/> <Limb Name="gTwinrovaLeftBraidEndLimb" LimbType="Standard" Offset="0x31E90"/>
<Limb Name="object_tw_Limb_031F5C" LimbType="Standard" Offset="0x31F5C"/> <Limb Name="gTwinrovaLeftShoulderLimb" LimbType="Standard" Offset="0x31E9C"/>
<Limb Name="object_tw_Limb_031F68" LimbType="Standard" Offset="0x31F68"/> <Limb Name="gTwinrovaLeftUpperArmLimb" LimbType="Standard" Offset="0x31EA8"/>
<Skeleton Name="object_tw_Skel_032020" Type="Flex" LimbType="Standard" Offset="0x32020"/> <Limb Name="gTwinrovaLeftForearmLimb" LimbType="Standard" Offset="0x31EB4"/>
<Animation Name="object_tw_Anim_032BF8" Offset="0x32BF8"/> <Limb Name="gTwinrovaLeftSleeveStartLimb" LimbType="Standard" Offset="0x31EC0"/>
<Animation Name="object_tw_Anim_0338F0" Offset="0x338F0"/> <Limb Name="gTwinrovaLeftSleeveEndLimb" LimbType="Standard" Offset="0x31ECC"/>
<Animation Name="object_tw_Anim_0343B4" Offset="0x343B4"/> <Limb Name="gTwinrovaBroomIceTrailLimb" LimbType="Standard" Offset="0x31ED8"/>
<Animation Name="object_tw_Anim_035030" Offset="0x35030"/> <Limb Name="gTwinrovaBroomIceJetLimb" LimbType="Standard" Offset="0x31EE4"/>
<Animation Name="object_tw_Anim_035988" Offset="0x35988"/> <Limb Name="gTwinrovaLeftHandLimb" LimbType="Standard" Offset="0x31EF0"/>
<Animation Name="object_tw_Anim_036FBC" Offset="0x36FBC"/> <Limb Name="gTwinrovaLeftBroomLimb" LimbType="Standard" Offset="0x31EFC"/>
<Animation Name="object_tw_Anim_038E2C" Offset="0x38E2C"/> <Limb Name="gTwinrovaRightShoulderLimb" LimbType="Standard" Offset="0x31F08"/>
<Animation Name="object_tw_Anim_03A2D0" Offset="0x3A2D0"/> <Limb Name="gTwinrovaRightUpperArmLimb" LimbType="Standard" Offset="0x31F14"/>
<DList Name="object_tw_DL_03A680" Offset="0x3A680"/> <Limb Name="gTwinrovaRightForearmLimb" LimbType="Standard" Offset="0x31F20"/>
<Texture Name="object_tw_Tex_03A7B0" OutName="tex_03A7B0" Format="rgba16" Width="32" Height="32" Offset="0x3A7B0"/> <Limb Name="gTwinrovaRightSleeveStartLimb" LimbType="Standard" Offset="0x31F2C"/>
<Limb Name="gTwinrovaRightSleeveEndLimb" LimbType="Standard" Offset="0x31F38"/>
<Limb Name="gTwinrovaRightBroomLimb" LimbType="Standard" Offset="0x31F44"/>
<Limb Name="gTwinrovaBroomFireJetLimb" LimbType="Standard" Offset="0x31F50"/>
<Limb Name="gTwinrovaBroomFireTrailLimb" LimbType="Standard" Offset="0x31F5C"/>
<Limb Name="gTwinrovaRightHandLimb" LimbType="Standard" Offset="0x31F68"/>
<!-- Twinrova Skeleton -->
<Skeleton Name="gTwinrovaSkel" Type="Flex" LimbType="Standard" Offset="0x32020"/>
<!-- Twinrova Animations -->
<Animation Name="gTwinrovaHoverAnim" Offset="0x32BF8"/> <!-- Original name is "btW_fly" -->
<Animation Name="gTwinrovaChargedAttackHitAnim" Offset="0x338F0"/> <!-- Original name is "btW_hit" -->
<Animation Name="gTwinrovaStunStartAnim" Offset="0x343B4"/> <!-- Original name is "btW_hit_to_mahi" -->
<Animation Name="gTwinrovaStunLoopAnim" Offset="0x35030"/> <!-- Original name is "btW_mahi" ("paralysis, stupor") -->
<Animation Name="gTwinrovaStunEndAnim" Offset="0x35988"/> <!-- Original name is "btW_mahi_to_fly" -->
<Animation Name="gTwinrovaWindUpAnim" Offset="0x36FBC"/> <!-- Original name is "btW_preatack" -->
<Animation Name="gTwinrovaIntroAnim" Offset="0x38E2C"/> <!-- Original name is "btW_start" -->
<Animation Name="gTwinrovaLaughAnim" Offset="0x3A2D0"/> <!-- Original name is "btW_ufufu" ("tee-hee") -->
<!-- Assets for an unused red boulder -->
<DList Name="gTwinrovaUnusedBoulderDL" Offset="0x3A680"/>
<Texture Name="gTwinrovaUnusedBoulderTex" OutName="twinrova_unused_boulder" Format="rgba16" Width="32" Height="32" Offset="0x3A7B0"/>
</File> </File>
</Root> </Root>

View file

@ -160,15 +160,15 @@ on the address from the `D_address` containing the cutscene data.
## regconvert ## regconvert
This converts the direct memory references, of the form `gGameInfo->data[index]` or `gGameInfo + 0x<offset>`, into the corresponding REG macros defined in [regs.h](../include/regs.h). Run This converts the direct memory references, of the form `gRegEditor->data[index]` or `gRegEditor + 0x<offset>`, into the corresponding REG macros defined in [regs.h](../include/regs.h). Run
```sh ```sh
./tools/regconvert.py <index> ./tools/regconvert.py <index>
``` ```
if you have it in the form `gGameInfo->data[index]`, or if you have it in the form `gRegEditor->data[index]`, or
```sh ```sh
./tools/regconvert.py --offset <offset> ./tools/regconvert.py --offset <offset>
``` ```
if you have it in the form `gGameInfo + 0x<offset>`. You can also run it on a whole file using `--file <path/to/file>`. if you have it in the form `gRegEditor + 0x<offset>`. You can also run it on a whole file using `--file <path/to/file>`.
## assist ## assist

View file

@ -488,9 +488,9 @@ s32 Actor_IsTargeted(PlayState* play, Actor* actor);
s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor); s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor);
f32 func_80033AEC(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5); f32 func_80033AEC(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5);
void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play); void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play);
void func_80033DB8(PlayState* play, s16 arg1, s16 arg2); void Actor_RequestQuake(PlayState* play, s16 y, s16 duration);
void func_80033E1C(PlayState* play, s16 arg1, s16 arg2, s16 arg3); void Actor_RequestQuakeWithSpeed(PlayState* play, s16 y, s16 duration, s16 speed);
void func_80033E88(Actor* actor, PlayState* play, s16 arg2, s16 arg3); void Actor_RequestQuakeAndRumble(Actor* actor, PlayState* play, s16 quakeY, s16 quakeDuration);
f32 Rand_ZeroFloat(f32 f); f32 Rand_ZeroFloat(f32 f);
f32 Rand_CenteredFloat(f32 f); f32 Rand_CenteredFloat(f32 f);
void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type); void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type);
@ -666,7 +666,7 @@ s16 Camera_GetInputDirYaw(Camera* camera);
Vec3s* Camera_GetCamDir(Vec3s* dst, Camera* camera); Vec3s* Camera_GetCamDir(Vec3s* dst, Camera* camera);
s16 Camera_GetCamDirPitch(Camera* camera); s16 Camera_GetCamDirPitch(Camera* camera);
s16 Camera_GetCamDirYaw(Camera* camera); s16 Camera_GetCamDirYaw(Camera* camera);
s32 Camera_AddQuake(Camera* camera, s32 arg1, s16 y, s32 countdown); s32 Camera_RequestQuake(Camera* camera, s32 unused, s16 y, s32 duration);
s32 Camera_SetParam(Camera* camera, s32 param, void* value); s32 Camera_SetParam(Camera* camera, s32 param, void* value);
s32 func_8005AC48(Camera* camera, s16 arg1); s32 func_8005AC48(Camera* camera, s16 arg1);
s16 func_8005ACFC(Camera* camera, s16 arg1); s16 func_8005ACFC(Camera* camera, s16 arg1);
@ -677,7 +677,7 @@ s32 Camera_SetCSParams(Camera* camera, CutsceneCameraPoint* atPoints, CutsceneCa
s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2, s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2,
s16 timer3); s16 timer3);
s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera); s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera);
Vec3f* Camera_GetSkyboxOffset(Vec3f* dst, Camera* camera); Vec3f* Camera_GetQuakeOffset(Vec3f* quakeOffset, Camera* camera);
void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* data1, s16 data2, s16 data3, void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* data1, s16 data2, s16 data3,
UNK_TYPE arg6); UNK_TYPE arg6);
s32 func_8005B198(void); s32 func_8005B198(void);
@ -774,12 +774,10 @@ s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* a
u8 CollisionCheck_GetSwordDamage(s32 dmgFlags); u8 CollisionCheck_GetSwordDamage(s32 dmgFlags);
void SaveContext_Init(void); void SaveContext_Init(void);
s32 func_800635D0(s32); s32 func_800635D0(s32);
void func_800636C0(void); void Regs_Init(void);
void func_8006375C(s32 arg0, s32 arg1, const char* text); void func_8006375C(s32 arg0, s32 arg1, const char* text);
void func_8006376C(u8 x, u8 y, u8 colorIndex, const char* text); void func_8006376C(u8 x, u8 y, u8 colorIndex, const char* text);
// ? func_80063828(?); void Regs_UpdateEditor(Input* input);
void func_8006390C(Input* input);
// ? func_80063C04(?);
void func_80063D7C(GraphicsContext* gfxCtx); void func_80063D7C(GraphicsContext* gfxCtx);
void DebugDisplay_Init(void); void DebugDisplay_Init(void);
DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, f32 scaleX, DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, f32 scaleX,
@ -952,10 +950,10 @@ f32 OLib_Vec3fDistXZ(Vec3f* a, Vec3f* b);
f32 OLib_ClampMinDist(f32 val, f32 min); f32 OLib_ClampMinDist(f32 val, f32 min);
f32 OLib_ClampMaxDist(f32 val, f32 max); f32 OLib_ClampMaxDist(f32 val, f32 max);
Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b); Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b);
Vec3f* OLib_VecSphGeoToVec3f(Vec3f* dest, VecSph* sph); Vec3f* OLib_VecGeoToVec3f(Vec3f* dest, VecGeo* geo);
VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec); VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec);
VecSph* OLib_Vec3fToVecSphGeo(VecSph* dest, Vec3f* vec); VecGeo* OLib_Vec3fToVecGeo(VecGeo* dest, Vec3f* vec);
VecSph* OLib_Vec3fDiffToVecSphGeo(VecSph* dest, Vec3f* a, Vec3f* b); VecGeo* OLib_Vec3fDiffToVecGeo(VecGeo* dest, Vec3f* a, Vec3f* b);
Vec3f* OLib_Vec3fDiffRad(Vec3f* dest, Vec3f* a, Vec3f* b); Vec3f* OLib_Vec3fDiffRad(Vec3f* dest, Vec3f* a, Vec3f* b);
s16 OnePointCutscene_Init(PlayState* play, s16 csId, s16 timer, Actor* actor, s16 parentCamId); s16 OnePointCutscene_Init(PlayState* play, s16 csId, s16 timer, Actor* actor, s16 parentCamId);
s16 OnePointCutscene_EndCutscene(PlayState* play, s16 subCamId); s16 OnePointCutscene_EndCutscene(PlayState* play, s16 subCamId);
@ -1061,28 +1059,6 @@ u32 Player_InitDrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime);
void Player_DrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot, f32 scale, void Player_DrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot, f32 scale,
s32 sword, s32 tunic, s32 shield, s32 boots); s32 sword, s32 tunic, s32 shield, s32 boots);
void PreNMI_Init(GameState* thisx); void PreNMI_Init(GameState* thisx);
Vec3f* Quake_AddVec(Vec3f* dst, Vec3f* arg1, VecSph* arg2);
void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x);
s16 Quake_Callback1(QuakeRequest* req, ShakeInfo* shake);
s16 Quake_Callback2(QuakeRequest* req, ShakeInfo* shake);
s16 Quake_Callback3(QuakeRequest* req, ShakeInfo* shake);
s16 Quake_Callback4(QuakeRequest* req, ShakeInfo* shake);
s16 Quake_Callback5(QuakeRequest* req, ShakeInfo* shake);
s16 Quake_Callback6(QuakeRequest* req, ShakeInfo* shake);
s16 Quake_GetFreeIndex(void);
QuakeRequest* Quake_AddImpl(Camera* camera, u32 callbackIdx);
void Quake_Remove(QuakeRequest* req);
QuakeRequest* Quake_GetRequest(s16 idx);
QuakeRequest* Quake_SetValue(s16 idx, s16 valueType, s16 value);
u32 Quake_SetSpeed(s16 idx, s16 value);
u32 Quake_SetCountdown(s16 idx, s16 value);
s16 Quake_GetCountdown(s16 idx);
u32 Quake_SetQuakeValues(s16 idx, s16 y, s16 x, s16 zoom, s16 rotZ);
u32 Quake_SetUnkValues(s16 idx, s16 arg1, SubQuakeRequest14 arg2);
void Quake_Init(void);
s16 Quake_Add(Camera* camera, u32 callbackIdx);
u32 Quake_RemoveFromIdx(s16 idx);
s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData);
Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far); Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far); Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far); Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
@ -1384,7 +1360,7 @@ u32 Letterbox_GetSize(void);
void Letterbox_Init(void); void Letterbox_Init(void);
void Letterbox_Destroy(void); void Letterbox_Destroy(void);
void Letterbox_Update(s32 updateRate); void Letterbox_Update(s32 updateRate);
// ? DbCamera_AddVecSph(?); // ? DbCamera_AddVecGeoToVec3f(?);
// ? DbCamera_CalcUpFromPitchYawRoll(?); // ? DbCamera_CalcUpFromPitchYawRoll(?);
// ? DbCamera_SetTextValue(?); // ? DbCamera_SetTextValue(?);
// ? DbCamera_Vec3SToF(?); // ? DbCamera_Vec3SToF(?);
@ -1522,11 +1498,9 @@ void AudioMgr_Unlock(AudioMgr* audioMgr);
void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, Scheduler* sched, IrqMgr* irqMgr); void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, Scheduler* sched, IrqMgr* irqMgr);
void GameState_FaultPrint(void); void GameState_FaultPrint(void);
void GameState_SetFBFilter(Gfx** gfx); void GameState_SetFBFilter(Gfx** gfx);
// ? func_800C4344(?);
void GameState_DrawInputDisplay(u16 input, Gfx** gfx); void GameState_DrawInputDisplay(u16 input, Gfx** gfx);
void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx); void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx);
void GameState_SetFrameBuffer(GraphicsContext* gfxCtx); void GameState_SetFrameBuffer(GraphicsContext* gfxCtx);
// ? func_800C49F4(?);
void GameState_ReqPadData(GameState* gameState); void GameState_ReqPadData(GameState* gameState);
void GameState_Update(GameState* gameState); void GameState_Update(GameState* gameState);
void GameState_InitArena(GameState* gameState, size_t size); void GameState_InitArena(GameState* gameState, size_t size);
@ -2191,7 +2165,7 @@ void GameOver_Update(PlayState* play);
void Interface_Destroy(PlayState* play); void Interface_Destroy(PlayState* play);
void Interface_Init(PlayState* play); void Interface_Init(PlayState* play);
void Message_Init(PlayState* play); void Message_Init(PlayState* play);
void func_80112098(PlayState* play); void Regs_InitData(PlayState* play);
void Setup_Init(GameState* thisx); void Setup_Init(GameState* thisx);
void Setup_Destroy(GameState* thisx); void Setup_Destroy(GameState* thisx);

44
include/quake.h Normal file
View file

@ -0,0 +1,44 @@
#ifndef QUAKE_H
#define QUAKE_H
#include "z64camera.h"
#include "z64math.h"
typedef struct {
/* 0x00 */ Vec3f atOffset;
/* 0x0C */ Vec3f eyeOffset;
/* 0x18 */ s16 upPitchOffset; // gives a "roll" effect by offsetting the Up vector
/* 0x1A */ s16 upYawOffset; // gives a "roll" effect by offsetting the Up vector
/* 0x1C */ s16 fovOffset; // binary angle
/* 0x20 */ f32 maxOffset;
} ShakeInfo; // size = 0x24
typedef enum {
/* 0 */ QUAKE_TYPE_NONE,
/* 1 */ QUAKE_TYPE_1, // Periodic, sustaining, random X perturbations
/* 2 */ QUAKE_TYPE_2, // Aperiodic, sustaining, random X perturbations
/* 3 */ QUAKE_TYPE_3, // Periodic, decaying
/* 4 */ QUAKE_TYPE_4, // Aperiodic, decaying, random X perturbations
/* 5 */ QUAKE_TYPE_5, // Periodic, sustaining
/* 6 */ QUAKE_TYPE_6 // See below
} QuakeType;
// Quake type 6 is Jump-Periodic, sustaining, random X perturbations,
// resets period every 16 frames (jumps, similar to sawtooth),
// continues indefinitely i.e. does not terminate when the timer reaches 0
// must be manually removed
s16 Quake_Request(Camera* camera, u32 type);
u32 Quake_SetSpeed(s16 index, s16 speed);
u32 Quake_SetPerturbations(s16 index, s16 y, s16 x, s16 fov, s16 roll);
u32 Quake_SetDuration(s16 index, s16 duration);
u32 Quake_SetOrientation(s16 index, s16 isRelativeToScreen, Vec3s orientation);
s16 Quake_GetTimeLeft(s16 index);
u32 Quake_RemoveRequest(s16 index);
void Quake_Init(void);
s16 Quake_Update(Camera* camera, ShakeInfo* camShake);
#endif

View file

@ -6,7 +6,7 @@
#define REGS_PER_PAGE 16 #define REGS_PER_PAGE 16
#define REGS_PER_GROUP (REG_PAGES * REGS_PER_PAGE) #define REGS_PER_GROUP (REG_PAGES * REGS_PER_PAGE)
#define BASE_REG(n, r) gGameInfo->data[(n) * REGS_PER_GROUP + (r)] #define BASE_REG(n, r) gRegEditor->data[(n) * REGS_PER_GROUP + (r)]
#define REG(r) BASE_REG(0, (r)) #define REG(r) BASE_REG(0, (r))
#define SREG(r) BASE_REG(1, (r)) #define SREG(r) BASE_REG(1, (r))

View file

@ -1,6 +1,6 @@
/** /**
* Matching dmadata layout for PAL MQ Debug * Matching dmadata layout for PAL MQ Debug
* *
* DEFINE_DMA_ENTRY should be used for all dmadata entries * DEFINE_DMA_ENTRY should be used for all dmadata entries
* - Argument 1: Name of the spec segment * - Argument 1: Name of the spec segment
* - Argument 2: String matching the original name of the segment * - Argument 2: String matching the original name of the segment

View file

@ -7,7 +7,7 @@
* - Argument 3: Spawn number for this entrance * - Argument 3: Spawn number for this entrance
* - Argument 4: Toggle if bgm should continue during the transition using this entrance (true or false) * - Argument 4: Toggle if bgm should continue during the transition using this entrance (true or false)
* NOTE: For non-cutscene layers, this field is only read from the `SCENE_LAYER_CHILD_DAY` layer. * NOTE: For non-cutscene layers, this field is only read from the `SCENE_LAYER_CHILD_DAY` layer.
* Meaning, the setting only matters for the first entry within a group of layers and that * Meaning, the setting only matters for the first entry within a group of layers and that
* setting will apply to the other 3 non-cutscene layers. * setting will apply to the other 3 non-cutscene layers.
* - Argument 5: Toggle if a title card should display when using this entrance (true or false) * - Argument 5: Toggle if a title card should display when using this entrance (true or false)
* - Argument 6: Transition type when entering using this entrance (second half of a scene transition) * - Argument 6: Transition type when entering using this entrance (second half of a scene transition)

View file

@ -28,7 +28,7 @@
#define RDB_TYPE_HtoG_DEBUG 14 #define RDB_TYPE_HtoG_DEBUG 14
#define RDB_TYPE_HtoG_DEBUG_CT 15 #define RDB_TYPE_HtoG_DEBUG_CT 15
#define RDB_TYPE_HtoG_DATA 16 #define RDB_TYPE_HtoG_DATA 16
#define RDB_TYPE_HtoG_DATA_DONE 17 #define RDB_TYPE_HtoG_DATA_DONE 17
#define RDB_TYPE_HtoG_REQ_RAMROM 18 #define RDB_TYPE_HtoG_REQ_RAMROM 18
#define RDB_TYPE_HtoG_FREE_RAMROM 19 #define RDB_TYPE_HtoG_FREE_RAMROM 19
#define RDB_TYPE_HtoG_KDEBUG 20 #define RDB_TYPE_HtoG_KDEBUG 20

View file

@ -9,7 +9,7 @@
#define SP_UCODE_SIZE 0x1000 #define SP_UCODE_SIZE 0x1000
#define SP_UCODE_DATA_SIZE 0x800 #define SP_UCODE_DATA_SIZE 0x800
extern u64 rspbootTextStart[], rspbootTextEnd[]; extern u64 rspbootTextStart[], rspbootTextEnd[];
extern u64 aspMainTextStart[], aspMainTextEnd[]; extern u64 aspMainTextStart[], aspMainTextEnd[];

View file

@ -173,7 +173,7 @@ extern u8 gSequenceTable[];
extern u8 gSampleBankTable[]; extern u8 gSampleBankTable[];
extern SaveContext gSaveContext; extern SaveContext gSaveContext;
extern GameInfo* gGameInfo; extern RegEditor* gRegEditor;
extern u16 D_8015FCC0; extern u16 D_8015FCC0;
extern u16 D_8015FCC2; extern u16 D_8015FCC2;
extern u16 D_8015FCC4; extern u16 D_8015FCC4;

View file

@ -94,7 +94,7 @@ typedef struct {
/* 0x0C */ s32 dPadInputPrev; /* 0x0C */ s32 dPadInputPrev;
/* 0x10 */ s32 inputRepeatTimer; /* 0x10 */ s32 inputRepeatTimer;
/* 0x14 */ s16 data[REG_GROUPS * REGS_PER_GROUP]; // Accessed through *REG macros, see regs.h /* 0x14 */ s16 data[REG_GROUPS * REGS_PER_GROUP]; // Accessed through *REG macros, see regs.h
} GameInfo; // size = 0x15D4 } RegEditor; // size = 0x15D4
typedef struct { typedef struct {
/* 0x00000 */ u16 headMagic; // GFXPOOL_HEAD_MAGIC /* 0x00000 */ u16 headMagic; // GFXPOOL_HEAD_MAGIC
@ -1037,7 +1037,7 @@ typedef enum {
/* 6 */ TRANS_TYPE_FADE_BLACK_SLOW, /* 6 */ TRANS_TYPE_FADE_BLACK_SLOW,
/* 7 */ TRANS_TYPE_FADE_WHITE_SLOW, /* 7 */ TRANS_TYPE_FADE_WHITE_SLOW,
/* 8 */ TRANS_TYPE_WIPE_FAST, /* 8 */ TRANS_TYPE_WIPE_FAST,
/* 9 */ TRANS_TYPE_FILL_WHITE2, /* 9 */ TRANS_TYPE_FILL_WHITE2,
/* 10 */ TRANS_TYPE_FILL_WHITE, /* 10 */ TRANS_TYPE_FILL_WHITE,
/* 11 */ TRANS_TYPE_INSTANT, /* 11 */ TRANS_TYPE_INSTANT,
/* 12 */ TRANS_TYPE_FILL_BROWN, /* 12 */ TRANS_TYPE_FILL_BROWN,
@ -1688,46 +1688,6 @@ typedef struct {
/* 0x10 */ OSTime resetTime; /* 0x10 */ OSTime resetTime;
} PreNmiBuff; // size = 0x18 (actually osAppNMIBuffer is 0x40 bytes large but the rest is unused) } PreNmiBuff; // size = 0x18 (actually osAppNMIBuffer is 0x40 bytes large but the rest is unused)
typedef struct {
/* 0x00 */ s16 unk_00;
/* 0x02 */ s16 unk_02;
/* 0x04 */ s16 unk_04;
} SubQuakeRequest14;
typedef struct {
/* 0x00 */ s16 randIdx;
/* 0x02 */ s16 countdownMax;
/* 0x04 */ Camera* cam;
/* 0x08 */ u32 callbackIdx;
/* 0x0C */ s16 y;
/* 0x0E */ s16 x;
/* 0x10 */ s16 zoom;
/* 0x12 */ s16 rotZ;
/* 0x14 */ SubQuakeRequest14 unk_14;
/* 0x1A */ s16 speed;
/* 0x1C */ s16 unk_1C;
/* 0x1E */ s16 countdown;
/* 0x20 */ s16 camPtrIdx;
} QuakeRequest; // size = 0x24
typedef struct {
/* 0x00 */ Vec3f vec1;
/* 0x0C */ Vec3f vec2;
/* 0x18 */ s16 rotZ;
/* 0x1A */ s16 unk_1A;
/* 0x1C */ s16 zoom;
} ShakeInfo; // size = 0x1E
typedef struct {
/* 0x00 */ Vec3f atOffset;
/* 0x0C */ Vec3f eyeOffset;
/* 0x18 */ s16 rotZ;
/* 0x1A */ s16 unk_1A;
/* 0x1C */ s16 zoom;
/* 0x20 */ f32 unk_20;
} QuakeCamCalc; // size = 0x24
#define UCODE_NULL 0 #define UCODE_NULL 0
#define UCODE_F3DZEX 1 #define UCODE_F3DZEX 1
#define UCODE_UNK 2 #define UCODE_UNK 2

View file

@ -151,7 +151,7 @@ typedef struct {
#define ACTOR_FLAG_9 (1 << 9) #define ACTOR_FLAG_9 (1 << 9)
#define ACTOR_FLAG_10 (1 << 10) #define ACTOR_FLAG_10 (1 << 10)
#define ACTOR_FLAG_ENKUSA_CUT (1 << 11) #define ACTOR_FLAG_ENKUSA_CUT (1 << 11)
#define ACTOR_FLAG_12 (1 << 12) #define ACTOR_FLAG_IGNORE_QUAKE (1 << 12) // actor will not shake when a quake occurs
#define ACTOR_FLAG_13 (1 << 13) #define ACTOR_FLAG_13 (1 << 13)
#define ACTOR_FLAG_14 (1 << 14) #define ACTOR_FLAG_14 (1 << 14)
#define ACTOR_FLAG_15 (1 << 15) #define ACTOR_FLAG_15 (1 << 15)

View file

@ -607,7 +607,7 @@ typedef struct {
/** /**
* The high-level audio specifications requested when initializing or resetting the audio heap. * The high-level audio specifications requested when initializing or resetting the audio heap.
* The audio heap can be reset on various occasions, including on most scene transitions. * The audio heap can be reset on various occasions, including on most scene transitions.
*/ */
typedef struct { typedef struct {
/* 0x00 */ u32 samplingFrequency; // Target sampling rate in Hz /* 0x00 */ u32 samplingFrequency; // Target sampling rate in Hz
/* 0x04 */ u8 unk_04; /* 0x04 */ u8 unk_04;
@ -909,7 +909,7 @@ typedef struct {
/* 0x2990 */ AudioAllocPool sessionPool; // A sub-pool to main pool, contains all sub-pools and data that changes every audio reset /* 0x2990 */ AudioAllocPool sessionPool; // A sub-pool to main pool, contains all sub-pools and data that changes every audio reset
/* 0x29A0 */ AudioAllocPool externalPool; // pool allocated externally to the audio heap. Never used in game /* 0x29A0 */ AudioAllocPool externalPool; // pool allocated externally to the audio heap. Never used in game
/* 0x29B0 */ AudioAllocPool initPool;// A sub-pool to the main pool, contains all sub-pools and data that persists every audio reset /* 0x29B0 */ AudioAllocPool initPool;// A sub-pool to the main pool, contains all sub-pools and data that persists every audio reset
/* 0x29C0 */ AudioAllocPool miscPool; // A sub-pool to the session pool. /* 0x29C0 */ AudioAllocPool miscPool; // A sub-pool to the session pool.
/* 0x29D0 */ char unk_29D0[0x20]; // probably two unused pools /* 0x29D0 */ char unk_29D0[0x20]; // probably two unused pools
/* 0x29F0 */ AudioAllocPool cachePool; // The common pool for cache entries /* 0x29F0 */ AudioAllocPool cachePool; // The common pool for cache entries
/* 0x2A00 */ AudioAllocPool persistentCommonPool; // A sub-pool to the cache pool, contains caches for data stored persistently /* 0x2A00 */ AudioAllocPool persistentCommonPool; // A sub-pool to the cache pool, contains caches for data stored persistently

View file

@ -27,7 +27,7 @@
#define PARENT_CAM(cam) ((cam)->play->cameraPtrs[(cam)->parentCamId]) #define PARENT_CAM(cam) ((cam)->play->cameraPtrs[(cam)->parentCamId])
#define CHILD_CAM(cam) ((cam)->play->cameraPtrs[(cam)->childCamId]) #define CHILD_CAM(cam) ((cam)->play->cameraPtrs[(cam)->childCamId])
// All scenes using `SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT` or `SCENE_CAM_TYPE_FIXED_TOGGLE_VIEWPOINT` are expected // All scenes using `SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT` or `SCENE_CAM_TYPE_FIXED_TOGGLE_VIEWPOINT` are expected
// to have their first two bgCamInfo entries be the following: // to have their first two bgCamInfo entries be the following:
#define BGCAM_INDEX_TOGGLE_LOCKED 0 #define BGCAM_INDEX_TOGGLE_LOCKED 0
#define BGCAM_INDEX_TOGGLE_PIVOT 1 #define BGCAM_INDEX_TOGGLE_PIVOT 1
@ -102,7 +102,7 @@ typedef enum {
/* 0x3A */ CAM_SET_NORMAL2, /* 0x3A */ CAM_SET_NORMAL2,
/* 0x3B */ CAM_SET_FISHING, // Fishing pond by the lake /* 0x3B */ CAM_SET_FISHING, // Fishing pond by the lake
/* 0x3C */ CAM_SET_CS_C, // Various cutscenes "DEMOC" /* 0x3C */ CAM_SET_CS_C, // Various cutscenes "DEMOC"
/* 0x3D */ CAM_SET_JABU_TENTACLE, // Jabu-Jabu Parasitic Tenticle Rooms "UO_FIBER" /* 0x3D */ CAM_SET_JABU_TENTACLE, // Jabu-Jabu Parasitic Tentacle Rooms "UO_FIBER"
/* 0x3E */ CAM_SET_DUNGEON2, /* 0x3E */ CAM_SET_DUNGEON2,
/* 0x3F */ CAM_SET_DIRECTED_YAW, // Does not auto-update yaw, tends to keep the camera pointed at a certain yaw (used by biggoron and final spirit lowering platform) "TEPPEN" /* 0x3F */ CAM_SET_DIRECTED_YAW, // Does not auto-update yaw, tends to keep the camera pointed at a certain yaw (used by biggoron and final spirit lowering platform) "TEPPEN"
/* 0x40 */ CAM_SET_PIVOT_FROM_SIDE, // Fixed side view, allows rotation of camera (eg. Potion Shop, Meadow at fairy grotto) "CIRCLE7" /* 0x40 */ CAM_SET_PIVOT_FROM_SIDE, // Fixed side view, allows rotation of camera (eg. Potion Shop, Meadow at fairy grotto) "CIRCLE7"
@ -439,7 +439,9 @@ typedef struct {
typedef struct { typedef struct {
/* 0x00 */ SwingAnimation swing; /* 0x00 */ SwingAnimation swing;
/* 0x1C */ f32 unk_1C; /* 0x1C */ f32 unk_1C;
/* 0x20 */ VecSph unk_20; /* 0x20 */ f32 unk_20;
/* 0x24 */ s16 unk_24;
/* 0x26 */ s16 unk_26;
} Jump1ReadWriteData; // size = 0x28 } Jump1ReadWriteData; // size = 0x28
typedef struct { typedef struct {
@ -670,7 +672,9 @@ typedef struct {
} KeepOn3ReadOnlyData; // size = 0x2C } KeepOn3ReadOnlyData; // size = 0x2C
typedef struct { typedef struct {
/* 0x00 */ Vec3f eyeToAtTarget; // esentially a VecSph, but all floats. /* 0x00 */ f32 eyeToAtTargetR;
/* 0x08 */ f32 eyeToAtTargetYaw;
/* 0x04 */ f32 eyeToAtTargetPitch;
/* 0x0C */ Actor* target; /* 0x0C */ Actor* target;
/* 0x10 */ Vec3f atTarget; /* 0x10 */ Vec3f atTarget;
/* 0x1C */ s16 animTimer; /* 0x1C */ s16 animTimer;
@ -1098,7 +1102,7 @@ typedef struct {
/* 0x10 */ Vec3f eyeTarget; /* 0x10 */ Vec3f eyeTarget;
/* 0x1C */ Vec3f playerPos; /* 0x1C */ Vec3f playerPos;
/* 0x28 */ f32 fovTarget; /* 0x28 */ f32 fovTarget;
/* 0x2C */ VecSph atEyeOffsetTarget; /* 0x2C */ VecGeo atEyeOffsetTarget;
/* 0x34 */ s16 rollTarget; /* 0x34 */ s16 rollTarget;
/* 0x36 */ s16 curKeyFrameIdx; /* 0x36 */ s16 curKeyFrameIdx;
/* 0x38 */ s16 unk_38; /* 0x38 */ s16 unk_38;
@ -1344,17 +1348,17 @@ typedef struct {
/* 0x00 */ Vec3f pos; /* 0x00 */ Vec3f pos;
/* 0x0C */ Vec3f norm; /* 0x0C */ Vec3f norm;
/* 0x18 */ CollisionPoly* poly; /* 0x18 */ CollisionPoly* poly;
/* 0x1C */ VecSph sphNorm; /* 0x1C */ VecGeo geoNorm;
/* 0x24 */ s32 bgId; /* 0x24 */ s32 bgId;
} CamColChk; // size = 0x28 } CamColChk; // size = 0x28
typedef struct { typedef struct Camera {
/* 0x000 */ CamParamData paramData; /* 0x000 */ CamParamData paramData;
/* 0x050 */ Vec3f at; /* 0x050 */ Vec3f at;
/* 0x05C */ Vec3f eye; /* 0x05C */ Vec3f eye;
/* 0x068 */ Vec3f up; /* 0x068 */ Vec3f up;
/* 0x074 */ Vec3f eyeNext; /* 0x074 */ Vec3f eyeNext;
/* 0x080 */ Vec3f skyboxOffset; /* 0x080 */ Vec3f quakeOffset;
/* 0x08C */ struct PlayState* play; /* 0x08C */ struct PlayState* play;
/* 0x090 */ struct Player* player; /* 0x090 */ struct Player* player;
/* 0x094 */ PosRot playerPosRot; /* 0x094 */ PosRot playerPosRot;
@ -1378,7 +1382,7 @@ typedef struct {
/* 0x114 */ f32 waterYPos; /* 0x114 */ f32 waterYPos;
/* 0x118 */ s32 bgCamIndexBeforeUnderwater; /* 0x118 */ s32 bgCamIndexBeforeUnderwater;
/* 0x11C */ s32 waterCamSetting; /* 0x11C */ s32 waterCamSetting;
/* 0x120 */ s32 waterQuakeId; /* 0x120 */ s32 waterQuakeIndex;
/* 0x124 */ void* data0; /* 0x124 */ void* data0;
/* 0x128 */ void* data1; /* 0x128 */ void* data1;
/* 0x12C */ s16 data2; /* 0x12C */ s16 data2;

View file

@ -26,12 +26,12 @@
#define LIGHT_BLEND_OVERRIDE_NONE 0 #define LIGHT_BLEND_OVERRIDE_NONE 0
#define LIGHT_BLEND_OVERRIDE_ON 1 #define LIGHT_BLEND_OVERRIDE_ON 1
// This mode disables the light system's automatic blending between // This mode disables the light system's automatic blending between
// light settings for `LIGHT_MODE_SETTINGS` (or using a light setting override). // light settings for `LIGHT_MODE_SETTINGS` (or using a light setting override).
// This is a bit of a hack used only by bosses in the original game. // This is a bit of a hack used only by bosses in the original game.
#define LIGHT_BLEND_OVERRIDE_FULL_CONTROL 2 #define LIGHT_BLEND_OVERRIDE_FULL_CONTROL 2
typedef enum { typedef enum {
/* 0 */ LIGHT_MODE_TIME, // environment lights use `lightConfig` and change based on time of day /* 0 */ LIGHT_MODE_TIME, // environment lights use `lightConfig` and change based on time of day
/* 1 */ LIGHT_MODE_SETTINGS // environment lights use `lightSetting` /* 1 */ LIGHT_MODE_SETTINGS // environment lights use `lightSetting`
} LightMode; } LightMode;
@ -76,7 +76,7 @@ typedef enum {
typedef enum { typedef enum {
/* 0 */ PRECIP_RAIN_MAX, // max number of raindrops that can draw; uses this or SOS_MAX, whichever is larger /* 0 */ PRECIP_RAIN_MAX, // max number of raindrops that can draw; uses this or SOS_MAX, whichever is larger
/* 1 */ PRECIP_RAIN_CUR, // current number of rain drops being drawn on screen /* 1 */ PRECIP_RAIN_CUR, // current number of rain drops being drawn on screen
/* 2 */ PRECIP_SNOW_CUR, // current number of snowflakes being drawn on screen /* 2 */ PRECIP_SNOW_CUR, // current number of snowflakes being drawn on screen
/* 3 */ PRECIP_SNOW_MAX, // max number of snowflakes that can draw /* 3 */ PRECIP_SNOW_MAX, // max number of snowflakes that can draw
/* 4 */ PRECIP_SOS_MAX, // max number of rain drops requested from song of storms specifically /* 4 */ PRECIP_SOS_MAX, // max number of rain drops requested from song of storms specifically

View file

@ -69,12 +69,19 @@ typedef struct {
/* 0x000C */ Vec3f b; /* 0x000C */ Vec3f b;
} Linef; // size = 0x18 } Linef; // size = 0x18
// Defines a point in the spherical coordinate system
typedef struct { typedef struct {
/* 0x00 */ f32 r; // radius /* 0x0 */ f32 r; // radius
/* 0x04 */ s16 pitch; // polar (zenith) angle /* 0x4 */ s16 pitch; // depends on coordinate system. See below.
/* 0x06 */ s16 yaw; // azimuthal angle /* 0x6 */ s16 yaw; // azimuthal angle
} VecSph; // size = 0x08 } VecSphGeo; // size = 0x8
// Defines a point in the spherical coordinate system.
// Pitch is 0 along the positive y-axis (up)
typedef VecSphGeo VecSph;
// Defines a point in the geographic coordinate system.
// Pitch is 0 along the xz-plane (horizon)
typedef VecSphGeo VecGeo;
#define LERP(x, y, scale) (((y) - (x)) * (scale) + (x)) #define LERP(x, y, scale) (((y) - (x)) * (scale) + (x))
#define LERP32(x, y, scale) ((s32)(((y) - (x)) * (scale)) + (x)) #define LERP32(x, y, scale) ((s32)(((y) - (x)) * (scale)) + (x))

View file

@ -148,14 +148,14 @@ typedef enum {
/** /**
* bFlat4Flag Note: * bFlat4Flag Note:
* Flag for resolving whether (pitch = OCARINA_PITCH_BFLAT4) * Flag for resolving whether (pitch = OCARINA_PITCH_BFLAT4)
* gets mapped to either C_RIGHT and C_LEFT * gets mapped to either C_RIGHT and C_LEFT
* *
* This is required as C_RIGHT and C_LEFT are the only notes * This is required as C_RIGHT and C_LEFT are the only notes
* that map to two semitones apart (OCARINA_PITCH_A4 and OCARINA_PITCH_B4) * that map to two semitones apart (OCARINA_PITCH_A4 and OCARINA_PITCH_B4)
* 0x40 - BTN_Z is pressed to lower note by a semitone * 0x40 - BTN_Z is pressed to lower note by a semitone
* 0x80 - BTN_R is pressed to raise note by a semitone * 0x80 - BTN_R is pressed to raise note by a semitone
*/ */
typedef struct { typedef struct {
/* 0x0 */ u8 pitch; // number of semitones above middle C /* 0x0 */ u8 pitch; // number of semitones above middle C

View file

@ -12,7 +12,7 @@ typedef enum {
/* 0x4 */ MAGIC_STATE_METER_FLASH_2, // Flashes border and draws yellow magic to preview target consumption /* 0x4 */ MAGIC_STATE_METER_FLASH_2, // Flashes border and draws yellow magic to preview target consumption
/* 0x5 */ MAGIC_STATE_RESET, // Reset colors and return to idle /* 0x5 */ MAGIC_STATE_RESET, // Reset colors and return to idle
/* 0x6 */ MAGIC_STATE_METER_FLASH_3, // Flashes border with no additional behaviour /* 0x6 */ MAGIC_STATE_METER_FLASH_3, // Flashes border with no additional behaviour
/* 0x7 */ MAGIC_STATE_CONSUME_LENS, // Magic slowly consumed by lens. /* 0x7 */ MAGIC_STATE_CONSUME_LENS, // Magic slowly consumed by lens.
/* 0x8 */ MAGIC_STATE_STEP_CAPACITY, // Step `magicCapacity` to full capacity /* 0x8 */ MAGIC_STATE_STEP_CAPACITY, // Step `magicCapacity` to full capacity
/* 0x9 */ MAGIC_STATE_FILL, // Add magic until magicFillTarget is reached. /* 0x9 */ MAGIC_STATE_FILL, // Add magic until magicFillTarget is reached.
/* 0xA */ MAGIC_STATE_ADD // Add requested magic /* 0xA */ MAGIC_STATE_ADD // Add requested magic
@ -257,7 +257,7 @@ typedef enum {
/* 1 */ SCENE_LAYER_CHILD_NIGHT, /* 1 */ SCENE_LAYER_CHILD_NIGHT,
/* 2 */ SCENE_LAYER_ADULT_DAY, /* 2 */ SCENE_LAYER_ADULT_DAY,
/* 3 */ SCENE_LAYER_ADULT_NIGHT, /* 3 */ SCENE_LAYER_ADULT_NIGHT,
/* 4 */ SCENE_LAYER_CUTSCENE_FIRST /* 4 */ SCENE_LAYER_CUTSCENE_FIRST
} SceneLayer; } SceneLayer;
#define IS_CUTSCENE_LAYER (gSaveContext.sceneLayer >= SCENE_LAYER_CUTSCENE_FIRST) #define IS_CUTSCENE_LAYER (gSaveContext.sceneLayer >= SCENE_LAYER_CUTSCENE_FIRST)
@ -293,11 +293,11 @@ typedef enum {
#define EVENTCHKINF_10 0x10 #define EVENTCHKINF_10 0x10
#define EVENTCHKINF_11 0x11 #define EVENTCHKINF_11 0x11
#define EVENTCHKINF_12 0x12 #define EVENTCHKINF_12 0x12
#define EVENTCHKINF_13 0x13 #define EVENTCHKINF_TALON_WOKEN_IN_CASTLE 0x13
#define EVENTCHKINF_14 0x14 #define EVENTCHKINF_TALON_RETURNED_FROM_CASTLE 0x14
#define EVENTCHKINF_15 0x15 #define EVENTCHKINF_15 0x15
#define EVENTCHKINF_16 0x16 #define EVENTCHKINF_16 0x16
#define EVENTCHKINF_18 0x18 #define EVENTCHKINF_EPONA_OBTAINED 0x18
#define EVENTCHKINF_1B 0x1B #define EVENTCHKINF_1B 0x1B
#define EVENTCHKINF_1C 0x1C #define EVENTCHKINF_1C 0x1C
#define EVENTCHKINF_1D 0x1D #define EVENTCHKINF_1D 0x1D
@ -354,13 +354,13 @@ typedef enum {
#define EVENTCHKINF_67 0x67 #define EVENTCHKINF_67 0x67
#define EVENTCHKINF_68 0x68 #define EVENTCHKINF_68 0x68
#define EVENTCHKINF_69 0x69 #define EVENTCHKINF_69 0x69
#define EVENTCHKINF_6A 0x6A #define EVENTCHKINF_TALON_WOKEN_IN_KAKARIKO 0x6A
// 0x6B // 0x6B
#define EVENTCHKINF_6B_INDEX 6 #define EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_INDEX 6
#define EVENTCHKINF_6B_SHIFT 11 #define EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_SHIFT 11
#define EVENTCHKINF_6B_MASK (1 << EVENTCHKINF_6B_SHIFT) #define EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_MASK (1 << EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_SHIFT)
#define EVENTCHKINF_6B ((EVENTCHKINF_6B_INDEX << 4) | EVENTCHKINF_6B_SHIFT) #define EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO ((EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_INDEX << 4) | EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_SHIFT)
#define EVENTCHKINF_6E 0x6E #define EVENTCHKINF_6E 0x6E
#define EVENTCHKINF_6F 0x6F #define EVENTCHKINF_6F 0x6F
@ -473,7 +473,7 @@ typedef enum {
* SaveContext.itemGetInf * SaveContext.itemGetInf
*/ */
#define ITEMGETINF_02 0x02 #define ITEMGETINF_TALON_BOTTLE 0x02
#define ITEMGETINF_03 0x03 #define ITEMGETINF_03 0x03
#define ITEMGETINF_04 0x04 #define ITEMGETINF_04 0x04
#define ITEMGETINF_05 0x05 #define ITEMGETINF_05 0x05
@ -563,7 +563,7 @@ typedef enum {
#define INFTABLE_71 0x71 #define INFTABLE_71 0x71
#define INFTABLE_76 0x76 #define INFTABLE_76 0x76
#define INFTABLE_77 0x77 #define INFTABLE_77 0x77
#define INFTABLE_7E 0x7E #define INFTABLE_TALKED_TO_TALON_IN_RANCH_HOUSE 0x7E
#define INFTABLE_84 0x84 #define INFTABLE_84 0x84
#define INFTABLE_85 0x85 #define INFTABLE_85 0x85
#define INFTABLE_8B 0x8B #define INFTABLE_8B 0x8B
@ -709,8 +709,13 @@ typedef enum {
#define EVENTINF_HORSES_0F_MASK (1 << EVENTINF_HORSES_0F_SHIFT) #define EVENTINF_HORSES_0F_MASK (1 << EVENTINF_HORSES_0F_SHIFT)
#define EVENTINF_HORSES_05 ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_05_SHIFT) #define EVENTINF_HORSES_05 ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_05_SHIFT)
#define EVENTINF_HORSES_06 ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_06_SHIFT) #define EVENTINF_HORSES_06 ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_06_SHIFT)
// Used in z_en_ta (Talon) to store Cucco game winning status
// and in z_en_ge1 (Gerudo) to store archery in-progress status
#define EVENTINF_HORSES_08 ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_08_SHIFT) #define EVENTINF_HORSES_08 ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_08_SHIFT)
#define EVENTINF_CUCCO_GAME_WON EVENTINF_HORSES_08
// Used in z_en_ta (Talon) and z_en_ma3 (Malon) to store minigame finishing status
#define EVENTINF_HORSES_0A ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_0A_SHIFT) #define EVENTINF_HORSES_0A ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_0A_SHIFT)
#define EVENTINF_CUCCO_GAME_FINISHED EVENTINF_HORSES_0A
typedef enum { typedef enum {
/* 0 */ EVENTINF_HORSES_STATE_0, /* 0 */ EVENTINF_HORSES_STATE_0,

View file

@ -96,17 +96,19 @@ static DbCamera* sDbCamPtr;
static s16 D_8016110C; static s16 D_8016110C;
static DbCameraAnim sDbCamAnim; static DbCameraAnim sDbCamAnim;
Vec3f* DbCamera_AddVecSph(Vec3f* out, Vec3f* in, VecSph* sph) { Vec3f* DbCamera_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo) {
Vec3f ret; Vec3f sum;
Vec3f vec; Vec3f b;
OLib_VecSphGeoToVec3f(&vec, sph); OLib_VecGeoToVec3f(&b, geo);
ret.x = in->x + vec.x; sum.x = a->x + b.x;
ret.y = in->y + vec.y; sum.y = a->y + b.y;
ret.z = in->z + vec.z; sum.z = a->z + b.z;
*out = ret;
return out; *dest = sum;
return dest;
} }
Vec3f* DbCamera_CalcUpFromPitchYawRoll(Vec3f* dest, s16 pitch, s16 yaw, s16 roll) { Vec3f* DbCamera_CalcUpFromPitchYawRoll(Vec3f* dest, s16 pitch, s16 yaw, s16 roll) {
@ -224,25 +226,28 @@ void DbCamera_Vec3SToF2(Vec3s* in, Vec3f* out) {
} }
void func_800B3F94(PosRot* posRot, Vec3f* vec, Vec3s* out) { void func_800B3F94(PosRot* posRot, Vec3f* vec, Vec3s* out) {
VecSph sph; VecGeo geo;
Vec3f tempVec; Vec3f tempVec;
OLib_Vec3fDiffToVecSphGeo(&sph, &posRot->pos, vec);
sph.yaw -= posRot->rot.y; OLib_Vec3fDiffToVecGeo(&geo, &posRot->pos, vec);
OLib_VecSphGeoToVec3f(&tempVec, &sph); geo.yaw -= posRot->rot.y;
OLib_VecGeoToVec3f(&tempVec, &geo);
DbCamera_Vec3FToS(&tempVec, out); DbCamera_Vec3FToS(&tempVec, out);
} }
void func_800B3FF4(PosRot* posRot, Vec3f* vec, Vec3f* out) { void func_800B3FF4(PosRot* posRot, Vec3f* vec, Vec3f* out) {
VecSph sph; VecGeo geo;
Vec3f tempVec; Vec3f tempVec;
DbCamera_CopyVec3f(vec, &tempVec); DbCamera_CopyVec3f(vec, &tempVec);
OLib_Vec3fToVecSphGeo(&sph, &tempVec); OLib_Vec3fToVecGeo(&geo, &tempVec);
sph.yaw += posRot->rot.y; geo.yaw += posRot->rot.y;
DbCamera_AddVecSph(out, &posRot->pos, &sph); DbCamera_AddVecGeoToVec3f(out, &posRot->pos, &geo);
} }
void func_800B404C(PosRot* posRot, Vec3s* vec, Vec3f* out) { void func_800B404C(PosRot* posRot, Vec3s* vec, Vec3f* out) {
Vec3f tempVec; Vec3f tempVec;
DbCamera_Vec3SToF(vec, &tempVec); DbCamera_Vec3SToF(vec, &tempVec);
func_800B3FF4(posRot, &tempVec, out); func_800B3FF4(posRot, &tempVec, out);
} }
@ -318,7 +323,7 @@ s32 func_800B42C0(DbCamera* dbCamera, Camera* cameraPtr) {
s32 func_800B4370(DbCamera* dbCamera, s16 idx, Camera* cam) { s32 func_800B4370(DbCamera* dbCamera, s16 idx, Camera* cam) {
CutsceneCameraPoint* lookAt = &dbCamera->sub.lookAt[idx]; CutsceneCameraPoint* lookAt = &dbCamera->sub.lookAt[idx];
CutsceneCameraPoint* position = &dbCamera->sub.position[idx]; CutsceneCameraPoint* position = &dbCamera->sub.position[idx];
VecSph sph; VecGeo geo;
Vec3f at; Vec3f at;
if (dbCamera->sub.mode != 1) { if (dbCamera->sub.mode != 1) {
@ -335,10 +340,10 @@ s32 func_800B4370(DbCamera* dbCamera, s16 idx, Camera* cam) {
} }
dbCamera->at = at; dbCamera->at = at;
} }
sph.pitch = 0x2000; geo.pitch = 0x2000;
sph.yaw -= 0x7FFF; geo.yaw -= 0x7FFF;
sph.r = 250.0f; geo.r = 250.0f;
DbCamera_AddVecSph(&dbCamera->eye, &dbCamera->at, &sph); DbCamera_AddVecGeoToVec3f(&dbCamera->eye, &dbCamera->at, &geo);
dbCamera->roll = lookAt->cameraRoll; dbCamera->roll = lookAt->cameraRoll;
dbCamera->rollDegrees = dbCamera->roll * (360.0f / 256.0f); dbCamera->rollDegrees = dbCamera->roll * (360.0f / 256.0f);
dbCamera->fov = lookAt->viewAngle; dbCamera->fov = lookAt->viewAngle;
@ -572,9 +577,9 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
char sp111; char sp111;
char sp110; char sp110;
f32 temp_f2_2; f32 temp_f2_2;
VecSph sp104; VecGeo sp104;
VecSph spFC; VecGeo spFC;
VecSph spF4; VecGeo spF4;
PosRot* temp_s6; PosRot* temp_s6;
UNUSED Vec3f* eye; UNUSED Vec3f* eye;
UNUSED Vec3f* at; UNUSED Vec3f* at;
@ -588,7 +593,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
Vec3f spB8; Vec3f spB8;
Vec3f spAC; Vec3f spAC;
s16 spAA; s16 spAA;
VecSph spA0; VecGeo spA0;
sp90 = &dbCamera->unk_54; sp90 = &dbCamera->unk_54;
temp_s6 = &cam->playerPosRot; temp_s6 = &cam->playerPosRot;
@ -671,9 +676,9 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
phi_s0 = sp124; phi_s0 = sp124;
if (!D_80161144) { if (!D_80161144) {
OLib_Vec3fDiffToVecSphGeo(&sp104, sp7C, sp80); OLib_Vec3fDiffToVecGeo(&sp104, sp7C, sp80);
} else { } else {
OLib_Vec3fDiffToVecSphGeo(&sp104, sp80, sp7C); OLib_Vec3fDiffToVecGeo(&sp104, sp80, sp7C);
} }
if (dbCamera->unk_44 > 100) { if (dbCamera->unk_44 > 100) {
@ -709,11 +714,11 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
spFC.r = temp_f2; spFC.r = temp_f2;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
DbCamera_AddVecSph(sp7C, sp7C, &spFC); DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
} else { } else {
spFC.pitch = -spFC.pitch; spFC.pitch = -spFC.pitch;
spFC.yaw = sp104.yaw - 0x7FFF; spFC.yaw = sp104.yaw - 0x7FFF;
DbCamera_AddVecSph(sp80, sp80, &spFC); DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
} }
if (dbCamera->unk_40 == 0xB) { if (dbCamera->unk_40 == 0xB) {
dbCamera->unk_44++; dbCamera->unk_44++;
@ -737,11 +742,11 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
spFC.r = -temp_f2; spFC.r = -temp_f2;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
DbCamera_AddVecSph(sp7C, sp7C, &spFC); DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
} else { } else {
spFC.pitch = -spFC.pitch; spFC.pitch = -spFC.pitch;
spFC.yaw = sp104.yaw - 0x7FFF; spFC.yaw = sp104.yaw - 0x7FFF;
DbCamera_AddVecSph(sp80, sp80, &spFC); DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
} }
if (dbCamera->unk_40 == 0xC) { if (dbCamera->unk_40 == 0xC) {
dbCamera->unk_44++; dbCamera->unk_44++;
@ -760,10 +765,10 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
spFC.pitch = 0; spFC.pitch = 0;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
DbCamera_AddVecSph(sp7C, sp7C, &spFC); DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
} else { } else {
spFC.yaw = sp104.yaw - 0x7FFF; spFC.yaw = sp104.yaw - 0x7FFF;
DbCamera_AddVecSph(sp80, sp80, &spFC); DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
} }
if (dbCamera->unk_40 == 1) { if (dbCamera->unk_40 == 1) {
@ -778,10 +783,10 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
spFC.pitch = 0; spFC.pitch = 0;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
DbCamera_AddVecSph(sp7C, sp7C, &spFC); DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
} else { } else {
spFC.yaw = sp104.yaw - 0x7FFF; spFC.yaw = sp104.yaw - 0x7FFF;
DbCamera_AddVecSph(sp80, sp80, &spFC); DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
} }
if (dbCamera->unk_40 == 2) { if (dbCamera->unk_40 == 2) {
dbCamera->unk_44++; dbCamera->unk_44++;
@ -795,9 +800,9 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
spFC.pitch = 0x3FFF; spFC.pitch = 0x3FFF;
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
if (!D_80161144) { if (!D_80161144) {
DbCamera_AddVecSph(sp7C, sp7C, &spFC); DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
} else { } else {
DbCamera_AddVecSph(sp80, sp80, &spFC); DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
} }
if (dbCamera->unk_40 == 3) { if (dbCamera->unk_40 == 3) {
dbCamera->unk_44++; dbCamera->unk_44++;
@ -811,9 +816,9 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
spFC.pitch = -0x3FFF; spFC.pitch = -0x3FFF;
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
if (!D_80161144) { if (!D_80161144) {
DbCamera_AddVecSph(sp7C, sp7C, &spFC); DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
} else { } else {
DbCamera_AddVecSph(sp80, sp80, &spFC); DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
} }
if (dbCamera->unk_40 == 4) { if (dbCamera->unk_40 == 4) {
dbCamera->unk_44++; dbCamera->unk_44++;
@ -828,10 +833,10 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
spFC.pitch = 0; spFC.pitch = 0;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw + 0x3FFF; spFC.yaw = sp104.yaw + 0x3FFF;
DbCamera_AddVecSph(sp7C, sp7C, &spFC); DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
} else { } else {
spFC.yaw = sp104.yaw - 0x3FFF; spFC.yaw = sp104.yaw - 0x3FFF;
DbCamera_AddVecSph(sp80, sp80, &spFC); DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
} }
if (dbCamera->unk_40 == 5) { if (dbCamera->unk_40 == 5) {
dbCamera->unk_44++; dbCamera->unk_44++;
@ -846,10 +851,10 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
spFC.pitch = 0; spFC.pitch = 0;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw - 0x3FFF; spFC.yaw = sp104.yaw - 0x3FFF;
DbCamera_AddVecSph(sp7C, sp7C, &spFC); DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
} else { } else {
spFC.yaw = sp104.yaw + 0x3FFF; spFC.yaw = sp104.yaw + 0x3FFF;
DbCamera_AddVecSph(sp80, sp80, &spFC); DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
} }
if (dbCamera->unk_40 == 6) { if (dbCamera->unk_40 == 6) {
dbCamera->unk_44++; dbCamera->unk_44++;
@ -873,11 +878,11 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
spFC.r = temp_f2; spFC.r = temp_f2;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
DbCamera_AddVecSph(sp7C, sp7C, &spFC); DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
} else { } else {
spFC.pitch = -spFC.pitch; spFC.pitch = -spFC.pitch;
spFC.yaw = sp104.yaw - 0x7FFF; spFC.yaw = sp104.yaw - 0x7FFF;
DbCamera_AddVecSph(sp80, sp80, &spFC); DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
} }
if (dbCamera->unk_40 == 0xB) { if (dbCamera->unk_40 == 0xB) {
dbCamera->unk_44++; dbCamera->unk_44++;
@ -902,11 +907,11 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
spFC.r = -temp_f2; spFC.r = -temp_f2;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
DbCamera_AddVecSph(sp7C, sp7C, &spFC); DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC);
} else { } else {
spFC.pitch = -spFC.pitch; spFC.pitch = -spFC.pitch;
spFC.yaw = sp104.yaw - 0x7FFF; spFC.yaw = sp104.yaw - 0x7FFF;
DbCamera_AddVecSph(sp80, sp80, &spFC); DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC);
} }
if (dbCamera->unk_40 == 0xC) { if (dbCamera->unk_40 == 0xC) {
dbCamera->unk_44++; dbCamera->unk_44++;
@ -964,18 +969,18 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
if (!D_80161144) { if (!D_80161144) {
sp104.pitch += (s16)((temp_f0_5 >= 0.0f) ? pitch : -pitch); sp104.pitch += (s16)((temp_f0_5 >= 0.0f) ? pitch : -pitch);
sp104.yaw += (s16)((temp_f2_2 >= 0.0f) ? yaw : -yaw); sp104.yaw += (s16)((temp_f2_2 >= 0.0f) ? yaw : -yaw);
DbCamera_AddVecSph(sp80, sp7C, &sp104); DbCamera_AddVecGeoToVec3f(sp80, sp7C, &sp104);
dbCamera->sub.unk_104A.x = -sp104.pitch; dbCamera->sub.unk_104A.x = -sp104.pitch;
dbCamera->sub.unk_104A.y = sp104.yaw - 0x7FFF; dbCamera->sub.unk_104A.y = sp104.yaw - 0x7FFF;
} else { } else {
sp104.pitch += (s16)((temp_f0_5 >= 0.0f) ? -pitch : pitch); sp104.pitch += (s16)((temp_f0_5 >= 0.0f) ? -pitch : pitch);
sp104.yaw += (s16)((temp_f2_2 >= 0.0f) ? -yaw : yaw); sp104.yaw += (s16)((temp_f2_2 >= 0.0f) ? -yaw : yaw);
DbCamera_AddVecSph(sp7C, sp80, &sp104); DbCamera_AddVecGeoToVec3f(sp7C, sp80, &sp104);
dbCamera->sub.unk_104A.x = sp104.pitch; dbCamera->sub.unk_104A.x = sp104.pitch;
dbCamera->sub.unk_104A.y = sp104.yaw; dbCamera->sub.unk_104A.y = sp104.yaw;
} }
OLib_Vec3fDiffToVecSphGeo(&spF4, sp80, sp7C); OLib_Vec3fDiffToVecGeo(&spF4, sp80, sp7C);
DbCamera_CalcUpFromPitchYawRoll(&dbCamera->unk_1C, spF4.pitch, spF4.yaw, DbCamera_CalcUpFromPitchYawRoll(&dbCamera->unk_1C, spF4.pitch, spF4.yaw,
CAM_DEG_TO_BINANG(dbCamera->rollDegrees)); CAM_DEG_TO_BINANG(dbCamera->rollDegrees));
if (dbCamera->unk_00 == 1) { if (dbCamera->unk_00 == 1) {
@ -985,7 +990,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
cam->at = *sp7C; cam->at = *sp7C;
spFC = sp104; spFC = sp104;
spFC.r = new_var2; spFC.r = new_var2;
DbCamera_AddVecSph(&cam->eye, &cam->at, &spFC); DbCamera_AddVecGeoToVec3f(&cam->eye, &cam->at, &spFC);
} }
} }
} }
@ -1370,7 +1375,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
func_8006376C(0x1E, 0x19, 2, &sp110); func_8006376C(0x1E, 0x19, 2, &sp110);
} else { } else {
if (D_8012CEE0[0]) {} if (D_8012CEE0[0]) {}
OLib_Vec3fDiffToVecSphGeo(&spFC, sp90, sp7C); OLib_Vec3fDiffToVecGeo(&spFC, sp90, sp7C);
spFC.yaw -= cam->playerPosRot.rot.y; spFC.yaw -= cam->playerPosRot.rot.y;
func_8006376C(3, 0x16, func_8006376C(3, 0x16,
((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && !D_80161144) ? 7 ((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && !D_80161144) ? 7
@ -1383,7 +1388,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
func_8006376C(3, 0x18, 3, D_8012D0F8); func_8006376C(3, 0x18, 3, D_8012D0F8);
DbCamera_SetTextValue(spFC.r, &D_8012D0D4[7], 6); DbCamera_SetTextValue(spFC.r, &D_8012D0D4[7], 6);
func_8006376C(3, 0x19, 3, D_8012D0D4); func_8006376C(3, 0x19, 3, D_8012D0D4);
OLib_Vec3fDiffToVecSphGeo(&spFC, sp90, sp80); OLib_Vec3fDiffToVecGeo(&spFC, sp90, sp80);
spFC.yaw -= cam->playerPosRot.rot.y; spFC.yaw -= cam->playerPosRot.rot.y;
func_8006376C(0x1E, 0x16, func_8006376C(0x1E, 0x16,
((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && D_80161144) ? 7 ((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && D_80161144) ? 7
@ -1413,7 +1418,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
func_800B404C(temp_s6, &(dbCamera->sub.lookAt + i)->pos, &spB8); func_800B404C(temp_s6, &(dbCamera->sub.lookAt + i)->pos, &spB8);
func_800B404C(temp_s6, &(dbCamera->sub.position + i)->pos, &spAC); func_800B404C(temp_s6, &(dbCamera->sub.position + i)->pos, &spAC);
} }
OLib_Vec3fDiffToVecSphGeo(&spFC, &spAC, &spB8); OLib_Vec3fDiffToVecGeo(&spFC, &spAC, &spB8);
spAA = dbCamera->sub.lookAt[i].cameraRoll * 0xB6; spAA = dbCamera->sub.lookAt[i].cameraRoll * 0xB6;
if (i == dbCamera->sub.unkIdx) { if (i == dbCamera->sub.unkIdx) {
DebugDisplay_AddObject(spAC.x, spAC.y, spAC.z, spFC.pitch * -1, spFC.yaw, spAA, .5f, .5f, .5f, DebugDisplay_AddObject(spAC.x, spAC.y, spAC.z, spFC.pitch * -1, spFC.yaw, spAA, .5f, .5f, .5f,
@ -1481,7 +1486,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
D_8012D110++; D_8012D110++;
D_8012D110 %= 50; D_8012D110 %= 50;
OLib_Vec3fDiffToVecSphGeo(&spA0, &cam->eye, &cam->at); OLib_Vec3fDiffToVecGeo(&spA0, &cam->eye, &cam->at);
DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 0.02f, 2.0f, 0.02f, 0xFF, DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 0.02f, 2.0f, 0.02f, 0xFF,
0xFF, 0x7F, 0x2D, 0, cam->play->view.gfxCtx); 0xFF, 0x7F, 0x2D, 0, cam->play->view.gfxCtx);
DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 2.0f, 0.02f, 0.02f, 0x7F, DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 2.0f, 0.02f, 0.02f, 0x7F,
@ -1492,7 +1497,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
0x7F, 0x7F, 0x80, 5, cam->play->view.gfxCtx); 0x7F, 0x7F, 0x80, 5, cam->play->view.gfxCtx);
DebugDisplay_AddObject(cam->at.x, cam->at.y, cam->at.z, spA0.pitch * -1, spA0.yaw, 0, 1.5f, 2.0f, 1.0f, 0xFF, DebugDisplay_AddObject(cam->at.x, cam->at.y, cam->at.z, spA0.pitch * -1, spA0.yaw, 0, 1.5f, 2.0f, 1.0f, 0xFF,
0x7F, 0x7F, 0x80, 4, cam->play->view.gfxCtx); 0x7F, 0x7F, 0x80, 4, cam->play->view.gfxCtx);
OLib_Vec3fDiffToVecSphGeo(&spA0, &cam->eyeNext, &cam->at); OLib_Vec3fDiffToVecGeo(&spA0, &cam->eyeNext, &cam->at);
DebugDisplay_AddObject(cam->eyeNext.x, cam->eyeNext.y, cam->eyeNext.z, spA0.pitch * -1, spA0.yaw, 0, .5f, .5f, DebugDisplay_AddObject(cam->eyeNext.x, cam->eyeNext.y, cam->eyeNext.z, spA0.pitch * -1, spA0.yaw, 0, .5f, .5f,
.5f, 0xFF, 0xC0, 0x7F, 0x50, 5, cam->play->view.gfxCtx); .5f, 0xFF, 0xC0, 0x7F, 0x50, 5, cam->play->view.gfxCtx);
} }
@ -1845,7 +1850,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
s16 idx3; s16 idx3;
char sp74[(ARRAY_COUNT(sDbCameraCuts) - 1 + 4) * 2]; char sp74[(ARRAY_COUNT(sDbCameraCuts) - 1 + 4) * 2];
DbCameraCut sp64; DbCameraCut sp64;
VecSph sp5C; VecGeo sp5C;
s32 (*callbacks[])(char*) = { DbCamera_SaveCallback, DbCamera_LoadCallback, DbCamera_ClearCallback }; s32 (*callbacks[])(char*) = { DbCamera_SaveCallback, DbCamera_LoadCallback, DbCamera_ClearCallback };
func_8006376C(0xE, 5, 0, D_8012CF44); // DEMO CONTROL func_8006376C(0xE, 5, 0, D_8012CF44); // DEMO CONTROL
@ -2148,7 +2153,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
OLib_Vec3fDiffToVecSphGeo(&sp5C, &dbCamera->eye, &dbCamera->at); OLib_Vec3fDiffToVecGeo(&sp5C, &dbCamera->eye, &dbCamera->at);
DbCamera_CalcUpFromPitchYawRoll(&dbCamera->unk_1C, sp5C.pitch, sp5C.yaw, DbCamera_CalcUpFromPitchYawRoll(&dbCamera->unk_1C, sp5C.pitch, sp5C.yaw,
CAM_DEG_TO_BINANG(dbCamera->rollDegrees)); CAM_DEG_TO_BINANG(dbCamera->rollDegrees));
return 2; return 2;

View file

@ -84,7 +84,7 @@ void func_800C4344(GameState* gameState) {
} }
if (gIsCtrlr2Valid) { if (gIsCtrlr2Valid) {
func_8006390C(&gameState->input[1]); Regs_UpdateEditor(&gameState->input[1]);
} }
gDmaMgrVerbose = HREG(60); gDmaMgrVerbose = HREG(60);

View file

@ -16,7 +16,7 @@
* A nice Shift-JIS codepoint table: https://uic.io/en/charset/show/shift_jis/ * A nice Shift-JIS codepoint table: https://uic.io/en/charset/show/shift_jis/
* The file `kanji` contains the 'Level 1' kanji (0x889F-0x9872), and a reworked * The file `kanji` contains the 'Level 1' kanji (0x889F-0x9872), and a reworked
* version of the non-kanji section that includes extra English and Hylian glyphs. * version of the non-kanji section that includes extra English and Hylian glyphs.
* *
* @note This function assumes that its argument is a valid Shift-JIS codepoint; * @note This function assumes that its argument is a valid Shift-JIS codepoint;
* there is no range protection at all. * there is no range protection at all.
* *
@ -26,15 +26,15 @@
* @remark Original name: "LeoGetKadr" * @remark Original name: "LeoGetKadr"
*/ */
LEAF(Kanji_OffsetFromShiftJIS) LEAF(Kanji_OffsetFromShiftJIS)
// Characters with codepoints >= 0x8800 are kanji. Arrangement is regular, // Characters with codepoints >= 0x8800 are kanji. Arrangement is regular,
// so convert index directly. // so convert index directly.
li $at, 0x8800 li $at, 0x8800
slt $at, $a0, $at slt $at, $a0, $at
bnez $at, .nonkanji bnez $at, .nonkanji
// 0xBC is number of glyphs in one block in the `kanji` file: // 0xBC is number of glyphs in one block in the `kanji` file:
// 0x100 possible codepoints with the same byte1 // 0x100 possible codepoints with the same byte1
// - 0x40 unused at beginning // - 0x40 unused at beginning
// - 1 unused at 0x7F // - 1 unused at 0x7F
// - 3 unused at 0xFD, 0xFE, 0xFF // - 3 unused at 0xFD, 0xFE, 0xFF
li $a2, 0xBC li $a2, 0xBC
// Get byte1 and adjust so starts at 0 // Get byte1 and adjust so starts at 0
@ -99,7 +99,7 @@ END(Kanji_OffsetFromShiftJIS)
* if (byte2 >= 0x40) { * if (byte2 >= 0x40) {
* byte2--; * byte2--;
* } * }
* *
* if (sjis >= 0x8800) { * if (sjis >= 0x8800) {
* byte1 -= 0x88; * byte1 -= 0x88;
* return (0x30A + byte2 + byte1 * 0xBC) * FONT_CHAR_TEX_SIZE; * return (0x30A + byte2 + byte1 * 0xBC) * FONT_CHAR_TEX_SIZE;
@ -134,7 +134,7 @@ DATA(sNonKanjiIndices)
/* 0x824_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0092 /* 0x824_ */ .half 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0092
/* 0x825_ */ .half 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 /* 0x825_ */ .half 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
/* 0x826_ */ .half 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB /* 0x826_ */ .half 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB
/* 0x827_ */ .half 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 /* 0x827_ */ .half 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
/* 0x828_ */ .half 0x0000, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4 /* 0x828_ */ .half 0x0000, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4
/* 0x829_ */ .half 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x0000, 0x0000, 0x0000, 0x0000, 0x00D0 /* 0x829_ */ .half 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x0000, 0x0000, 0x0000, 0x0000, 0x00D0
/* 0x82A_ */ .half 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0 /* 0x82A_ */ .half 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0

View file

@ -65,7 +65,7 @@ void Main(void* arg) {
} }
osSyncPrintf("debug_InitArena(%08x, %08x)\n", debugHeapStart, debugHeapSize); osSyncPrintf("debug_InitArena(%08x, %08x)\n", debugHeapStart, debugHeapSize);
DebugArena_Init(debugHeapStart, debugHeapSize); DebugArena_Init(debugHeapStart, debugHeapSize);
func_800636C0(); Regs_Init();
R_ENABLE_ARENA_DBG = 0; R_ENABLE_ARENA_DBG = 0;

View file

@ -1,4 +1,5 @@
#include "global.h" #include "global.h"
#include "quake.h"
#include "vt.h" #include "vt.h"
#include "overlays/actors/ovl_Arms_Hook/z_arms_hook.h" #include "overlays/actors/ovl_Arms_Hook/z_arms_hook.h"
@ -2179,11 +2180,11 @@ void Actor_Draw(PlayState* play, Actor* actor) {
Lights_BindAll(lights, play->lightCtx.listHead, (actor->flags & ACTOR_FLAG_22) ? NULL : &actor->world.pos); Lights_BindAll(lights, play->lightCtx.listHead, (actor->flags & ACTOR_FLAG_22) ? NULL : &actor->world.pos);
Lights_Draw(lights, play->state.gfxCtx); Lights_Draw(lights, play->state.gfxCtx);
if (actor->flags & ACTOR_FLAG_12) { if (actor->flags & ACTOR_FLAG_IGNORE_QUAKE) {
Matrix_SetTranslateRotateYXZ(actor->world.pos.x + play->mainCamera.skyboxOffset.x, Matrix_SetTranslateRotateYXZ(actor->world.pos.x + play->mainCamera.quakeOffset.x,
actor->world.pos.y + actor->world.pos.y +
((actor->shape.yOffset * actor->scale.y) + play->mainCamera.skyboxOffset.y), ((actor->shape.yOffset * actor->scale.y) + play->mainCamera.quakeOffset.y),
actor->world.pos.z + play->mainCamera.skyboxOffset.z, &actor->shape.rot); actor->world.pos.z + play->mainCamera.quakeOffset.z, &actor->shape.rot);
} else { } else {
Matrix_SetTranslateRotateYXZ(actor->world.pos.x, actor->world.pos.y + (actor->shape.yOffset * actor->scale.y), Matrix_SetTranslateRotateYXZ(actor->world.pos.x, actor->world.pos.y + (actor->shape.yOffset * actor->scale.y),
actor->world.pos.z, &actor->shape.rot); actor->world.pos.z, &actor->shape.rot);
@ -3505,30 +3506,29 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 8155); CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 8155);
} }
void func_80033DB8(PlayState* play, s16 arg1, s16 arg2) { void Actor_RequestQuake(PlayState* play, s16 y, s16 duration) {
s16 var = Quake_Add(&play->mainCamera, 3); s16 quakeIndex = Quake_Request(&play->mainCamera, QUAKE_TYPE_3);
Quake_SetSpeed(var, 20000); Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(var, arg1, 0, 0, 0); Quake_SetPerturbations(quakeIndex, y, 0, 0, 0);
Quake_SetCountdown(var, arg2); Quake_SetDuration(quakeIndex, duration);
} }
void func_80033E1C(PlayState* play, s16 arg1, s16 arg2, s16 arg3) { void Actor_RequestQuakeWithSpeed(PlayState* play, s16 y, s16 duration, s16 speed) {
s16 var = Quake_Add(&play->mainCamera, 3); s16 quakeIndex = Quake_Request(&play->mainCamera, QUAKE_TYPE_3);
Quake_SetSpeed(var, arg3); Quake_SetSpeed(quakeIndex, speed);
Quake_SetQuakeValues(var, arg1, 0, 0, 0); Quake_SetPerturbations(quakeIndex, y, 0, 0, 0);
Quake_SetCountdown(var, arg2); Quake_SetDuration(quakeIndex, duration);
} }
void func_80033E88(Actor* actor, PlayState* play, s16 arg2, s16 arg3) { void Actor_RequestQuakeAndRumble(Actor* actor, PlayState* play, s16 quakeY, s16 quakeDuration) {
if (arg2 >= 5) { if (quakeY >= 5) {
Rumble_Request(actor->xyzDistToPlayerSq, 255, 20, 150); Rumble_Request(actor->xyzDistToPlayerSq, 255, 20, 150);
} else { } else {
Rumble_Request(actor->xyzDistToPlayerSq, 180, 20, 100); Rumble_Request(actor->xyzDistToPlayerSq, 180, 20, 100);
} }
Actor_RequestQuake(play, quakeY, quakeDuration);
func_80033DB8(play, arg2, arg3);
} }
f32 Rand_ZeroFloat(f32 f) { f32 Rand_ZeroFloat(f32 f) {
@ -3550,9 +3550,9 @@ typedef struct {
} DoorLockInfo; // size = 0x1C } DoorLockInfo; // size = 0x1C
static DoorLockInfo sDoorLocksInfo[] = { static DoorLockInfo sDoorLocksInfo[] = {
/* DOORLOCK_NORMAL */ { 0.54f, 6000.0f, 5000.0f, 1.0f, 0.0f, gDoorChainsDL, gDoorLockDL }, /* DOORLOCK_NORMAL */ { 0.54f, 6000.0f, 5000.0f, 1.0f, 0.0f, gDoorChainDL, gDoorLockDL },
/* DOORLOCK_BOSS */ { 0.644f, 12000.0f, 8000.0f, 1.0f, 0.0f, object_bdoor_DL_001530, object_bdoor_DL_001400 }, /* DOORLOCK_BOSS */ { 0.644f, 12000.0f, 8000.0f, 1.0f, 0.0f, gBossDoorChainDL, gBossDoorLockDL },
/* DOORLOCK_NORMAL_SPIRIT */ { 0.64000005f, 8500.0f, 8000.0f, 1.75f, 0.1f, gDoorChainsDL, gDoorLockDL }, /* DOORLOCK_NORMAL_SPIRIT */ { 0.64000005f, 8500.0f, 8000.0f, 1.75f, 0.1f, gDoorChainDL, gDoorLockDL },
}; };
/** /**
@ -4602,7 +4602,7 @@ u32 func_80035BFC(PlayState* play, s16 arg1) {
if (Flags_GetEventChkInf(EVENTCHKINF_09) && Flags_GetEventChkInf(EVENTCHKINF_25) && if (Flags_GetEventChkInf(EVENTCHKINF_09) && Flags_GetEventChkInf(EVENTCHKINF_25) &&
Flags_GetEventChkInf(EVENTCHKINF_37)) { Flags_GetEventChkInf(EVENTCHKINF_37)) {
retTextId = 0x7047; retTextId = 0x7047;
} else if (Flags_GetEventChkInf(EVENTCHKINF_14)) { } else if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
retTextId = 0x701A; retTextId = 0x701A;
} else if (Flags_GetEventChkInf(EVENTCHKINF_11)) { } else if (Flags_GetEventChkInf(EVENTCHKINF_11)) {
if (Flags_GetInfTable(INFTABLE_C6)) { if (Flags_GetInfTable(INFTABLE_C6)) {
@ -4911,9 +4911,10 @@ u32 func_80035BFC(PlayState* play, s16 arg1) {
retTextId = 0x2049; retTextId = 0x2049;
} else if (Flags_GetEventChkInf(EVENTCHKINF_15)) { } else if (Flags_GetEventChkInf(EVENTCHKINF_15)) {
retTextId = 0x2048; retTextId = 0x2048;
} else if (Flags_GetEventChkInf(EVENTCHKINF_14)) { } else if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
retTextId = 0x2047; retTextId = 0x2047;
} else if (Flags_GetEventChkInf(EVENTCHKINF_12) && !Flags_GetEventChkInf(EVENTCHKINF_14)) { } else if (Flags_GetEventChkInf(EVENTCHKINF_12) &&
!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
retTextId = 0x2044; retTextId = 0x2044;
} else if (Flags_GetEventChkInf(EVENTCHKINF_10)) { } else if (Flags_GetEventChkInf(EVENTCHKINF_10)) {
if (Flags_GetEventChkInf(EVENTCHKINF_11)) { if (Flags_GetEventChkInf(EVENTCHKINF_11)) {
@ -4927,7 +4928,7 @@ u32 func_80035BFC(PlayState* play, s16 arg1) {
break; break;
case 72: case 72:
if (!LINK_IS_ADULT) { if (!LINK_IS_ADULT) {
if (Flags_GetEventChkInf(EVENTCHKINF_14)) { if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
retTextId = 0x2040; retTextId = 0x2040;
} else if (Flags_GetInfTable(INFTABLE_94)) { } else if (Flags_GetInfTable(INFTABLE_94)) {
retTextId = 0x2040; retTextId = 0x2040;
@ -4935,7 +4936,7 @@ u32 func_80035BFC(PlayState* play, s16 arg1) {
retTextId = 0x203F; retTextId = 0x203F;
} }
} else { } else {
if (!Flags_GetEventChkInf(EVENTCHKINF_18)) { if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) {
if (!IS_DAY) { if (!IS_DAY) {
retTextId = 0x204E; retTextId = 0x204E;
} else if (Flags_GetInfTable(INFTABLE_9A)) { } else if (Flags_GetInfTable(INFTABLE_9A)) {

View file

@ -4239,22 +4239,21 @@ s32 WaterBox_GetSurface1(PlayState* play, CollisionContext* colCtx, f32 x, f32 z
s32 WaterBox_GetSurfaceImpl(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, s32 WaterBox_GetSurfaceImpl(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface,
WaterBox** outWaterBox) { WaterBox** outWaterBox) {
CollisionHeader* colHeader = colCtx->colHeader; CollisionHeader* colHeader = colCtx->colHeader;
u32 room; s32 room;
WaterBox* curWaterBox; WaterBox* waterBox;
if (colHeader->numWaterBoxes == 0 || colHeader->waterBoxes == SEGMENTED_TO_VIRTUAL(NULL)) { if (colHeader->numWaterBoxes == 0 || colHeader->waterBoxes == SEGMENTED_TO_VIRTUAL(NULL)) {
return false; return false;
} }
for (curWaterBox = colHeader->waterBoxes; curWaterBox < colHeader->waterBoxes + colHeader->numWaterBoxes; for (waterBox = colHeader->waterBoxes; waterBox < colHeader->waterBoxes + colHeader->numWaterBoxes; waterBox++) {
curWaterBox++) { room = WATERBOX_ROOM(waterBox->properties);
room = WATERBOX_ROOM(curWaterBox->properties); if (room == play->roomCtx.curRoom.num || room == WATERBOX_ROOM_ALL) {
if (room == (u32)play->roomCtx.curRoom.num || room == WATERBOX_ROOM_ALL) { if (!(waterBox->properties & WATERBOX_FLAG_19)) {
if (!(curWaterBox->properties & WATERBOX_FLAG_19)) { if (waterBox->xMin < x && x < waterBox->xMin + waterBox->xLength) {
if (curWaterBox->xMin < x && x < curWaterBox->xMin + curWaterBox->xLength) { if (waterBox->zMin < z && z < waterBox->zMin + waterBox->zLength) {
if (curWaterBox->zMin < z && z < curWaterBox->zMin + curWaterBox->zLength) { *outWaterBox = waterBox;
*outWaterBox = curWaterBox; *ySurface = waterBox->ySurface;
*ySurface = curWaterBox->ySurface;
return true; return true;
} }
} }
@ -4287,21 +4286,18 @@ s32 WaterBox_GetSurface2(PlayState* play, CollisionContext* colCtx, Vec3f* pos,
waterBox = &colHeader->waterBoxes[i]; waterBox = &colHeader->waterBoxes[i];
room = WATERBOX_ROOM(waterBox->properties); room = WATERBOX_ROOM(waterBox->properties);
if (!(room == play->roomCtx.curRoom.num || room == WATERBOX_ROOM_ALL)) { if (room == play->roomCtx.curRoom.num || room == WATERBOX_ROOM_ALL) {
continue; if (!(waterBox->properties & WATERBOX_FLAG_19)) {
} if (waterBox->xMin < pos->x && pos->x < waterBox->xMin + waterBox->xLength) {
if (waterBox->properties & WATERBOX_FLAG_19) { if (waterBox->zMin < pos->z && pos->z < waterBox->zMin + waterBox->zLength) {
continue; if (pos->y - surfaceChkDist < waterBox->ySurface &&
} waterBox->ySurface < pos->y + surfaceChkDist) {
if (!(waterBox->xMin < pos->x && pos->x < waterBox->xMin + waterBox->xLength)) { *outWaterBox = waterBox;
continue; return i;
} }
if (!(waterBox->zMin < pos->z && pos->z < waterBox->zMin + waterBox->zLength)) { }
continue; }
} }
if (pos->y - surfaceChkDist < waterBox->ySurface && waterBox->ySurface < pos->y + surfaceChkDist) {
*outWaterBox = waterBox;
return i;
} }
} }
@ -4349,22 +4345,21 @@ u32 WaterBox_GetLightIndex(CollisionContext* colCtx, WaterBox* waterBox) {
*/ */
s32 func_800425B0(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox) { s32 func_800425B0(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox) {
CollisionHeader* colHeader = colCtx->colHeader; CollisionHeader* colHeader = colCtx->colHeader;
u32 room; s32 room;
WaterBox* curWaterBox; WaterBox* waterBox;
if (colHeader->numWaterBoxes == 0 || colHeader->waterBoxes == SEGMENTED_TO_VIRTUAL(NULL)) { if (colHeader->numWaterBoxes == 0 || colHeader->waterBoxes == SEGMENTED_TO_VIRTUAL(NULL)) {
return false; return false;
} }
for (curWaterBox = colHeader->waterBoxes; curWaterBox < colHeader->waterBoxes + colHeader->numWaterBoxes; for (waterBox = colHeader->waterBoxes; waterBox < colHeader->waterBoxes + colHeader->numWaterBoxes; waterBox++) {
curWaterBox++) { room = WATERBOX_ROOM(waterBox->properties);
room = WATERBOX_ROOM(curWaterBox->properties); if ((room == play->roomCtx.curRoom.num) || (room == WATERBOX_ROOM_ALL)) {
if ((room == (u32)play->roomCtx.curRoom.num) || (room == WATERBOX_ROOM_ALL)) { if (waterBox->properties & WATERBOX_FLAG_19) {
if (curWaterBox->properties & WATERBOX_FLAG_19) { if (waterBox->xMin < x && x < (waterBox->xMin + waterBox->xLength)) {
if (curWaterBox->xMin < x && x < (curWaterBox->xMin + curWaterBox->xLength)) { if (waterBox->zMin < z && z < (waterBox->zMin + waterBox->zLength)) {
if (curWaterBox->zMin < z && z < (curWaterBox->zMin + curWaterBox->zLength)) { *outWaterBox = waterBox;
*outWaterBox = curWaterBox; *ySurface = waterBox->ySurface;
*ySurface = curWaterBox->ySurface;
return true; return true;
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -191,7 +191,7 @@ void Message_Init(PlayState* play) {
YREG(31) = 0; YREG(31) = 0;
} }
void func_80111070(void) { void Regs_InitDataImpl(void) {
YREG(8) = 10; YREG(8) = 10;
YREG(14) = 0; YREG(14) = 0;
R_SCENE_CAM_TYPE = SCENE_CAM_TYPE_DEFAULT; R_SCENE_CAM_TYPE = SCENE_CAM_TYPE_DEFAULT;
@ -603,6 +603,6 @@ void func_80111070(void) {
R_GAME_OVER_RUMBLE_DECREASE_RATE = -63; R_GAME_OVER_RUMBLE_DECREASE_RATE = -63;
} }
void func_80112098(PlayState* play) { void Regs_InitData(PlayState* play) {
func_80111070(); Regs_InitDataImpl();
} }

View file

@ -12,7 +12,7 @@ typedef struct {
u16 press; u16 press;
} InputCombo; // size = 0x4 } InputCombo; // size = 0x4
GameInfo* gGameInfo; RegEditor* gRegEditor;
PrintTextBufferEntry sDebugPrintTextBuffer[22]; PrintTextBufferEntry sDebugPrintTextBuffer[22];
s16 sDebugPrintTextBufferNumUsed = 0; s16 sDebugPrintTextBufferNumUsed = 0;
@ -92,18 +92,17 @@ char sRegGroupChars[REG_GROUPS] = {
'b', // bREG 'b', // bREG
}; };
// Initialize GameInfo void Regs_Init(void) {
void func_800636C0(void) {
s32 i; s32 i;
gGameInfo = SystemArena_MallocDebug(sizeof(GameInfo), "../z_debug.c", 260); gRegEditor = SystemArena_MallocDebug(sizeof(RegEditor), "../z_debug.c", 260);
gGameInfo->regPage = 0; gRegEditor->regPage = 0;
gGameInfo->regGroup = 0; gRegEditor->regGroup = 0;
gGameInfo->regCur = 0; gRegEditor->regCur = 0;
gGameInfo->dPadInputPrev = 0; gRegEditor->dPadInputPrev = 0;
gGameInfo->inputRepeatTimer = 0; gRegEditor->inputRepeatTimer = 0;
for (i = 0; i < ARRAY_COUNT(gGameInfo->data); i++) { for (i = 0; i < ARRAY_COUNT(gRegEditor->data); i++) {
gGameInfo->data[i] = 0; gRegEditor->data[i] = 0;
} }
} }
@ -154,9 +153,9 @@ void func_80063828(GfxPrint* printer) {
} }
// Process inputs to control the reg editor // Process inputs to control the reg editor
void func_8006390C(Input* input) { void Regs_UpdateEditor(Input* input) {
s32 dPadInputCur; s32 dPadInputCur;
s32 pageDataStart = ((gGameInfo->regGroup * REG_PAGES) + gGameInfo->regPage - 1) * REGS_PER_PAGE; s32 pageDataStart = ((gRegEditor->regGroup * REG_PAGES) + gRegEditor->regPage - 1) * REGS_PER_PAGE;
s32 increment; s32 increment;
s32 i; s32 i;
@ -173,16 +172,16 @@ void func_8006390C(Input* input) {
// If a combo corresponding to a reg group was found // If a combo corresponding to a reg group was found
if (i < REG_GROUPS) { if (i < REG_GROUPS) {
if (i == gGameInfo->regGroup) { if (i == gRegEditor->regGroup) {
// Same reg group as current, advance page index // Same reg group as current, advance page index
gGameInfo->regPage = (gGameInfo->regPage + 1) % (REG_PAGES + 1); gRegEditor->regPage = (gRegEditor->regPage + 1) % (REG_PAGES + 1);
} else { } else {
gGameInfo->regGroup = i; // Switch current reg group gRegEditor->regGroup = i; // Switch current reg group
gGameInfo->regPage = 0; // Disable reg editor gRegEditor->regPage = 0; // Disable reg editor
} }
} }
} else { } else {
switch (gGameInfo->regPage) { switch (gRegEditor->regPage) {
case 1: case 1:
case 2: case 2:
case 3: case 3:
@ -190,16 +189,16 @@ void func_8006390C(Input* input) {
case 5: case 5:
case 6: case 6:
if (dPadInputCur == gGameInfo->dPadInputPrev) { if (dPadInputCur == gRegEditor->dPadInputPrev) {
gGameInfo->inputRepeatTimer--; gRegEditor->inputRepeatTimer--;
if (gGameInfo->inputRepeatTimer < 0) { if (gRegEditor->inputRepeatTimer < 0) {
gGameInfo->inputRepeatTimer = 1; gRegEditor->inputRepeatTimer = 1;
} else { } else {
dPadInputCur ^= gGameInfo->dPadInputPrev; dPadInputCur ^= gRegEditor->dPadInputPrev;
} }
} else { } else {
gGameInfo->inputRepeatTimer = 16; gRegEditor->inputRepeatTimer = 16;
gGameInfo->dPadInputPrev = dPadInputCur; gRegEditor->dPadInputPrev = dPadInputCur;
} }
increment = increment =
@ -213,17 +212,17 @@ void func_8006390C(Input* input) {
: -1) : -1)
: 0; : 0;
gGameInfo->data[gGameInfo->regCur + pageDataStart] += increment; gRegEditor->data[gRegEditor->regCur + pageDataStart] += increment;
if (CHECK_BTN_ANY(dPadInputCur, BTN_DUP)) { if (CHECK_BTN_ANY(dPadInputCur, BTN_DUP)) {
gGameInfo->regCur--; gRegEditor->regCur--;
if (gGameInfo->regCur < 0) { if (gRegEditor->regCur < 0) {
gGameInfo->regCur = REGS_PER_PAGE - 1; gRegEditor->regCur = REGS_PER_PAGE - 1;
} }
} else if (CHECK_BTN_ANY(dPadInputCur, BTN_DDOWN)) { } else if (CHECK_BTN_ANY(dPadInputCur, BTN_DDOWN)) {
gGameInfo->regCur++; gRegEditor->regCur++;
if (gGameInfo->regCur >= REGS_PER_PAGE) { if (gRegEditor->regCur >= REGS_PER_PAGE) {
gGameInfo->regCur = 0; gRegEditor->regCur = 0;
} }
} }
@ -241,28 +240,28 @@ void func_8006390C(Input* input) {
} }
// Draw the reg editor // Draw the reg editor
void func_80063C04(GfxPrint* printer) { void Regs_DrawEditor(GfxPrint* printer) {
s32 i; s32 i;
s32 pageStart = (gGameInfo->regPage - 1) * REGS_PER_PAGE; s32 pageStart = (gRegEditor->regPage - 1) * REGS_PER_PAGE;
s32 pageDataStart = ((gGameInfo->regGroup * REG_PAGES) + gGameInfo->regPage - 1) * REGS_PER_PAGE; s32 pageDataStart = ((gRegEditor->regGroup * REG_PAGES) + gRegEditor->regPage - 1) * REGS_PER_PAGE;
s32 pad; s32 pad;
char regGroupName[3]; char regGroupName[3];
regGroupName[0] = 'R'; regGroupName[0] = 'R';
regGroupName[1] = sRegGroupChars[gGameInfo->regGroup]; regGroupName[1] = sRegGroupChars[gRegEditor->regGroup];
regGroupName[2] = '\0'; regGroupName[2] = '\0';
GfxPrint_SetColor(printer, 0, 128, 128, 128); GfxPrint_SetColor(printer, 0, 128, 128, 128);
for (i = 0; i < REGS_PER_PAGE; i++) { for (i = 0; i < REGS_PER_PAGE; i++) {
if (i == gGameInfo->regCur) { if (i == gRegEditor->regCur) {
GfxPrint_SetColor(printer, 0, 255, 255, 255); GfxPrint_SetColor(printer, 0, 255, 255, 255);
} }
GfxPrint_SetPos(printer, 3, i + 5); GfxPrint_SetPos(printer, 3, i + 5);
GfxPrint_Printf(printer, "%s%02d%6d", regGroupName, pageStart + i, gGameInfo->data[i + pageDataStart]); GfxPrint_Printf(printer, "%s%02d%6d", regGroupName, pageStart + i, gRegEditor->data[i + pageDataStart]);
if (i == gGameInfo->regCur) { if (i == gRegEditor->regCur) {
GfxPrint_SetColor(printer, 0, 128, 128, 128); GfxPrint_SetColor(printer, 0, 128, 128, 128);
} }
} }
@ -286,8 +285,8 @@ void func_80063D7C(GraphicsContext* gfxCtx) {
func_80063828(&printer); func_80063828(&printer);
} }
if (gGameInfo->regPage != 0) { if (gRegEditor->regPage != 0) {
func_80063C04(&printer); Regs_DrawEditor(&printer);
} }
sDebugPrintTextBufferNumUsed = 0; sDebugPrintTextBufferNumUsed = 0;

View file

@ -1,4 +1,5 @@
#include "global.h" #include "global.h"
#include "quake.h"
#include "z64camera.h" #include "z64camera.h"
#include "assets/scenes/indoors/tokinoma/tokinoma_scene.h" #include "assets/scenes/indoors/tokinoma/tokinoma_scene.h"
@ -60,10 +61,10 @@ EntranceCutscene sEntranceCutsceneTable[] = {
{ ENTR_SPOT18_0, 2, EVENTCHKINF_A6, gGoronCityIntroCs }, { ENTR_SPOT18_0, 2, EVENTCHKINF_A6, gGoronCityIntroCs },
{ ENTR_TOKINOMA_0, 2, EVENTCHKINF_A7, gTempleOfTimeIntroCs }, { ENTR_TOKINOMA_0, 2, EVENTCHKINF_A7, gTempleOfTimeIntroCs },
{ ENTR_YDAN_0, 2, EVENTCHKINF_A8, gDekuTreeIntroCs }, { ENTR_YDAN_0, 2, EVENTCHKINF_A8, gDekuTreeIntroCs },
{ ENTR_SPOT00_11, 0, EVENTCHKINF_18, gHyruleFieldSouthEponaJumpCs }, { ENTR_SPOT00_11, 0, EVENTCHKINF_EPONA_OBTAINED, gHyruleFieldSouthEponaJumpCs },
{ ENTR_SPOT00_13, 0, EVENTCHKINF_18, gHyruleFieldEastEponaJumpCs }, { ENTR_SPOT00_13, 0, EVENTCHKINF_EPONA_OBTAINED, gHyruleFieldEastEponaJumpCs },
{ ENTR_SPOT00_12, 0, EVENTCHKINF_18, gHyruleFieldWestEponaJumpCs }, { ENTR_SPOT00_12, 0, EVENTCHKINF_EPONA_OBTAINED, gHyruleFieldWestEponaJumpCs },
{ ENTR_SPOT00_15, 0, EVENTCHKINF_18, gHyruleFieldGateEponaJumpCs }, { ENTR_SPOT00_15, 0, EVENTCHKINF_EPONA_OBTAINED, gHyruleFieldGateEponaJumpCs },
{ ENTR_SPOT00_16, 1, EVENTCHKINF_A9, gHyruleFieldGetOoTCs }, { ENTR_SPOT00_16, 1, EVENTCHKINF_A9, gHyruleFieldGetOoTCs },
{ ENTR_SPOT06_0, 2, EVENTCHKINF_B1, gLakeHyliaIntroCs }, { ENTR_SPOT06_0, 2, EVENTCHKINF_B1, gLakeHyliaIntroCs },
{ ENTR_SPOT09_0, 2, EVENTCHKINF_B2, gGerudoValleyIntroCs }, { ENTR_SPOT09_0, 2, EVENTCHKINF_B2, gGerudoValleyIntroCs },
@ -311,15 +312,15 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
break; break;
case 16: case 16:
if (sp3F != 0) { if (sp3F != 0) {
sQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 6); sQuakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
Quake_SetSpeed(sQuakeIndex, 0x7FFF); Quake_SetSpeed(sQuakeIndex, 0x7FFF);
Quake_SetQuakeValues(sQuakeIndex, 4, 0, 1000, 0); Quake_SetPerturbations(sQuakeIndex, 4, 0, 1000, 0);
Quake_SetCountdown(sQuakeIndex, 800); Quake_SetDuration(sQuakeIndex, 800);
} }
break; break;
case 17: case 17:
if (sp3F != 0) { if (sp3F != 0) {
Quake_RemoveFromIdx(sQuakeIndex); Quake_RemoveRequest(sQuakeIndex);
} }
break; break;
case 18: case 18:
@ -2060,7 +2061,7 @@ void Cutscene_HandleEntranceTriggers(PlayState* play) {
} }
if ((gSaveContext.entranceIndex == entranceCutscene->entrance) && if ((gSaveContext.entranceIndex == entranceCutscene->entrance) &&
(!Flags_GetEventChkInf(entranceCutscene->flag) || (entranceCutscene->flag == EVENTCHKINF_18)) && (!Flags_GetEventChkInf(entranceCutscene->flag) || (entranceCutscene->flag == EVENTCHKINF_EPONA_OBTAINED)) &&
(gSaveContext.cutsceneIndex < 0xFFF0) && ((u8)gSaveContext.linkAge == requiredAge) && (gSaveContext.cutsceneIndex < 0xFFF0) && ((u8)gSaveContext.linkAge == requiredAge) &&
(gSaveContext.respawnFlag <= 0)) { (gSaveContext.respawnFlag <= 0)) {
Flags_SetEventChkInf(entranceCutscene->flag); Flags_SetEventChkInf(entranceCutscene->flag);

View file

@ -48,7 +48,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
{ SCENE_SPOT20, 928, 0, -2280, 0, 2 }, { SCENE_SPOT20, 928, 0, -2280, 0, 2 },
}; };
if ((AREG(6) != 0) && (Flags_GetEventChkInf(EVENTCHKINF_18) || (DREG(1) != 0))) { if ((AREG(6) != 0) && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0))) {
player->rideActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, player->actor.world.pos.x, player->rideActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, player->actor.world.pos.x,
player->actor.world.pos.y, player->actor.world.pos.z, player->actor.shape.rot.x, player->actor.world.pos.y, player->actor.world.pos.z, player->actor.shape.rot.x,
player->actor.shape.rot.y, player->actor.shape.rot.z, 9); player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
@ -67,15 +67,15 @@ void func_8006D0EC(PlayState* play, Player* player) {
gSaveContext.minigameState = 0; gSaveContext.minigameState = 0;
horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1); horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1);
horseActor->room = -1; horseActor->room = -1;
} else if ((gSaveContext.entranceIndex == ENTR_SPOT20_7) && GET_EVENTCHKINF(EVENTCHKINF_18)) { } else if ((gSaveContext.entranceIndex == ENTR_SPOT20_7) && GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
Actor* horseActor = Actor* horseActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1); Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1);
ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 389); ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 389);
} else if ((play->sceneId == gSaveContext.horseData.sceneId) && } else if ((play->sceneId == gSaveContext.horseData.sceneId) &&
(Flags_GetEventChkInf(EVENTCHKINF_18) || DREG(1) != 0)) { (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || DREG(1) != 0)) {
// "Set by existence of horse %d %d %d" // "Set by existence of horse %d %d %d"
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.sceneId, osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.sceneId,
Flags_GetEventChkInf(EVENTCHKINF_18), DREG(1)); Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED), DREG(1));
if (func_8006CFC0(gSaveContext.horseData.sceneId)) { if (func_8006CFC0(gSaveContext.horseData.sceneId)) {
Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, gSaveContext.horseData.pos.x, Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, gSaveContext.horseData.pos.x,
@ -92,10 +92,10 @@ void func_8006D0EC(PlayState* play, Player* player) {
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
func_8006D074(play); func_8006D074(play);
} }
} else if ((play->sceneId == SCENE_SPOT20) && !Flags_GetEventChkInf(EVENTCHKINF_18) && (DREG(1) == 0)) { } else if ((play->sceneId == SCENE_SPOT20) && !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0)) {
Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1); Actor* horseActor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1);
ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 443); ASSERT(horseActor != NULL, "horse_actor != NULL", "../z_horse.c", 443);
} else if (Flags_GetEventChkInf(EVENTCHKINF_18) || (DREG(1) != 0)) { } else if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0)) {
for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) { for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) {
HorseSpawn* horseSpawn = &horseSpawns[i]; HorseSpawn* horseSpawn = &horseSpawns[i];
if (horseSpawn->sceneId == play->sceneId) { if (horseSpawn->sceneId == play->sceneId) {
@ -110,7 +110,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
break; break;
} }
} }
} else if (!Flags_GetEventChkInf(EVENTCHKINF_18)) { } else if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) {
if ((DREG(1) == 0) && (play->sceneId == SCENE_SOUKO) && !IS_DAY) { if ((DREG(1) == 0) && (play->sceneId == SCENE_SOUKO) && !IS_DAY) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1); Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1);
} }
@ -158,7 +158,7 @@ void func_8006D684(PlayState* play, Player* player) {
func_8002DE74(play, player); func_8002DE74(play, player);
gSaveContext.horseData.sceneId = play->sceneId; gSaveContext.horseData.sceneId = play->sceneId;
} else if ((play->sceneId == SCENE_SPOT20) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) && } else if ((play->sceneId == SCENE_SPOT20) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) &&
!Flags_GetEventChkInf(EVENTCHKINF_18) && (DREG(1) == 0)) { !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0)) {
player->rideActor = player->rideActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5); Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5);
ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", "../z_horse.c", 582); ASSERT(player->rideActor != NULL, "player->ride.actor != NULL", "../z_horse.c", 582);
@ -252,7 +252,7 @@ void func_8006DC68(PlayState* play, Player* player) {
gSaveContext.entranceIndex == ENTR_SPOT00_13 || gSaveContext.entranceIndex == ENTR_SPOT00_15) && gSaveContext.entranceIndex == ENTR_SPOT00_13 || gSaveContext.entranceIndex == ENTR_SPOT00_15) &&
(gSaveContext.respawnFlag == 0)) || (gSaveContext.respawnFlag == 0)) ||
((play->sceneId == SCENE_SPOT20) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) && ((play->sceneId == SCENE_SPOT20) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6) &&
!Flags_GetEventChkInf(EVENTCHKINF_18) && (DREG(1) == 0))) { !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0))) {
func_8006D684(play, player); func_8006D684(play, player);
} else { } else {
func_8006D0EC(play, player); func_8006D0EC(play, player);

View file

@ -147,7 +147,7 @@ void Lights_BindDirectional(Lights* lights, LightParams* params, Vec3f* vec) {
* a light to it. Then apply color and positional/directional info for each light * a light to it. Then apply color and positional/directional info for each light
* based on the parameters supplied by the node. * based on the parameters supplied by the node.
* *
* Note: Lights in a given list can only be binded to however many free slots are * Note: Lights in a given list can only be bound to however many free slots are
* available in the Lights group. This is at most 7 slots for a new group, but could be less. * available in the Lights group. This is at most 7 slots for a new group, but could be less.
*/ */
void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* vec) { void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* vec) {
@ -217,7 +217,7 @@ void LightContext_SetFog(LightContext* lightCtx, u8 r, u8 g, u8 b, s16 fogNear,
} }
/** /**
* Allocate a new Lights group and initilize the ambient color with that provided by LightContext * Allocate a new Lights group and initialize the ambient color with that provided by LightContext
*/ */
Lights* LightContext_NewLights(LightContext* lightCtx, GraphicsContext* gfxCtx) { Lights* LightContext_NewLights(LightContext* lightCtx, GraphicsContext* gfxCtx) {
return Lights_New(gfxCtx, lightCtx->ambientColor[0], lightCtx->ambientColor[1], lightCtx->ambientColor[2]); return Lights_New(gfxCtx, lightCtx->ambientColor[0], lightCtx->ambientColor[1], lightCtx->ambientColor[2]);

View file

@ -93,16 +93,16 @@ Vec3f* OLib_VecSphToVec3f(Vec3f* dest, VecSph* sph) {
} }
/** /**
* Takes the geographic point `sph` and converts it into a x,y,z position * Takes the geographic point `geo` and converts it into a x,y,z position
*/ */
Vec3f* OLib_VecSphGeoToVec3f(Vec3f* dest, VecSph* sph) { Vec3f* OLib_VecGeoToVec3f(Vec3f* dest, VecGeo* geo) {
VecSph geo; VecSph sph;
geo.r = sph->r; sph.r = geo->r;
geo.pitch = 0x3FFF - sph->pitch; sph.pitch = 0x3FFF - geo->pitch;
geo.yaw = sph->yaw; sph.yaw = geo->yaw;
return OLib_VecSphToVec3f(dest, &geo); return OLib_VecSphToVec3f(dest, &sph);
} }
/** /**
@ -110,17 +110,16 @@ Vec3f* OLib_VecSphGeoToVec3f(Vec3f* dest, VecSph* sph) {
*/ */
VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) { VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) {
VecSph sph; VecSph sph;
f32 distXZSq = SQ(vec->x) + SQ(vec->z);
f32 distXZ = sqrtf(distXZSq);
f32 distSquared = SQ(vec->x) + SQ(vec->z); if ((distXZ == 0.0f) && (vec->y == 0.0f)) {
f32 dist = sqrtf(distSquared);
if ((dist == 0.0f) && (vec->y == 0.0f)) {
sph.pitch = 0; sph.pitch = 0;
} else { } else {
sph.pitch = CAM_DEG_TO_BINANG(RAD_TO_DEG(Math_FAtan2F(dist, vec->y))); sph.pitch = CAM_DEG_TO_BINANG(RAD_TO_DEG(Math_FAtan2F(distXZ, vec->y)));
} }
sph.r = sqrtf(SQ(vec->y) + distSquared); sph.r = sqrtf(SQ(vec->y) + distXZSq);
if ((vec->x == 0.0f) && (vec->z == 0.0f)) { if ((vec->x == 0.0f) && (vec->z == 0.0f)) {
sph.yaw = 0; sph.yaw = 0;
} else { } else {
@ -135,7 +134,7 @@ VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) {
/** /**
* Takes the point `vec`, and converts it to a geographic coordinate * Takes the point `vec`, and converts it to a geographic coordinate
*/ */
VecSph* OLib_Vec3fToVecSphGeo(VecSph* dest, Vec3f* vec) { VecGeo* OLib_Vec3fToVecGeo(VecGeo* dest, Vec3f* vec) {
VecSph sph; VecSph sph;
OLib_Vec3fToVecSph(&sph, vec); OLib_Vec3fToVecSph(&sph, vec);
@ -150,26 +149,26 @@ VecSph* OLib_Vec3fToVecSphGeo(VecSph* dest, Vec3f* vec) {
* Takes the differences of positions `a` and `b`, and converts them to spherical coordinates * Takes the differences of positions `a` and `b`, and converts them to spherical coordinates
*/ */
VecSph* OLib_Vec3fDiffToVecSph(VecSph* dest, Vec3f* a, Vec3f* b) { VecSph* OLib_Vec3fDiffToVecSph(VecSph* dest, Vec3f* a, Vec3f* b) {
Vec3f sph; Vec3f diff;
sph.x = b->x - a->x; diff.x = b->x - a->x;
sph.y = b->y - a->y; diff.y = b->y - a->y;
sph.z = b->z - a->z; diff.z = b->z - a->z;
return OLib_Vec3fToVecSph(dest, &sph); return OLib_Vec3fToVecSph(dest, &diff);
} }
/** /**
* Takes the difference of positions `a` and `b`, and converts them to geographic coordinates * Takes the difference of positions `a` and `b`, and converts them to geographic coordinates
*/ */
VecSph* OLib_Vec3fDiffToVecSphGeo(VecSph* dest, Vec3f* a, Vec3f* b) { VecGeo* OLib_Vec3fDiffToVecGeo(VecGeo* dest, Vec3f* a, Vec3f* b) {
Vec3f sph; Vec3f diff;
sph.x = b->x - a->x; diff.x = b->x - a->x;
sph.y = b->y - a->y; diff.y = b->y - a->y;
sph.z = b->z - a->z; diff.z = b->z - a->z;
return OLib_Vec3fToVecSphGeo(dest, &sph); return OLib_Vec3fToVecGeo(dest, &diff);
} }
/** /**

View file

@ -1,4 +1,5 @@
#include "global.h" #include "global.h"
#include "quake.h"
#include "vt.h" #include "vt.h"
#include "overlays/actors/ovl_En_Sw/z_en_sw.h" #include "overlays/actors/ovl_En_Sw/z_en_sw.h"
@ -8,17 +9,19 @@ static s32 sPrevFrameCs1100 = -4096;
#include "z_onepointdemo_data.inc.c" #include "z_onepointdemo_data.inc.c"
void OnePointCutscene_AddVecSphToVec3f(Vec3f* dst, Vec3f* src, VecSph* vecSph) { Vec3f* OnePointCutscene_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo) {
Vec3f out; Vec3f sum;
Vec3f vec; Vec3f b;
OLib_VecSphGeoToVec3f(&vec, vecSph); OLib_VecGeoToVec3f(&b, geo);
out.x = src->x + vec.x; sum.x = a->x + b.x;
out.y = src->y + vec.y; sum.y = a->y + b.y;
out.z = src->z + vec.z; sum.z = a->z + b.z;
if (dst) {}
*dst = out; *dest = sum;
return dest;
} }
s16 OnePointCutscene_Vec3fYaw(Vec3f* vec1, Vec3f* vec2) { s16 OnePointCutscene_Vec3fYaw(Vec3f* vec1, Vec3f* vec2) {
@ -61,7 +64,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
Camera* childCam = play->cameraPtrs[subCam->childCamId]; Camera* childCam = play->cameraPtrs[subCam->childCamId];
Camera* mainCam = play->cameraPtrs[CAM_ID_MAIN]; Camera* mainCam = play->cameraPtrs[CAM_ID_MAIN];
Player* player = mainCam->player; Player* player = mainCam->player;
VecSph spD0; VecGeo spD0;
s32 i; s32 i;
Vec3f spC0; Vec3f spC0;
Vec3f spB4; Vec3f spB4;
@ -94,7 +97,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
D_80120964[0].atTargetInit = play->view.at; D_80120964[0].atTargetInit = play->view.at;
D_80120964[0].eyeTargetInit = play->view.eye; D_80120964[0].eyeTargetInit = play->view.eye;
D_80120964[0].fovTargetInit = play->view.fovy; D_80120964[0].fovTargetInit = play->view.fovy;
OLib_Vec3fDiffToVecSphGeo(&spD0, &mainCam->at, &mainCam->eye); OLib_Vec3fDiffToVecGeo(&spD0, &mainCam->at, &mainCam->eye);
D_80120964[1].eyeTargetInit.y = CAM_BINANG_TO_DEG(spD0.yaw); D_80120964[1].eyeTargetInit.y = CAM_BINANG_TO_DEG(spD0.yaw);
D_80120964[1].timerInit = timer - 1; D_80120964[1].timerInit = timer - 1;
@ -107,9 +110,9 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
D_801209B4[0].atTargetInit = D_801209B4[1].atTargetInit = play->view.at; D_801209B4[0].atTargetInit = D_801209B4[1].atTargetInit = play->view.at;
D_801209B4[0].eyeTargetInit = play->view.eye; D_801209B4[0].eyeTargetInit = play->view.eye;
D_801209B4[0].fovTargetInit = D_801209B4[2].fovTargetInit = play->view.fovy; D_801209B4[0].fovTargetInit = D_801209B4[2].fovTargetInit = play->view.fovy;
OLib_Vec3fDiffToVecSphGeo(&spD0, &actor->focus.pos, &mainCam->at); OLib_Vec3fDiffToVecGeo(&spD0, &actor->focus.pos, &mainCam->at);
spD0.r = mainCam->dist; spD0.r = mainCam->dist;
OnePointCutscene_AddVecSphToVec3f(&D_801209B4[1].eyeTargetInit, &D_801209B4[1].atTargetInit, &spD0); OnePointCutscene_AddVecGeoToVec3f(&D_801209B4[1].eyeTargetInit, &D_801209B4[1].atTargetInit, &spD0);
D_801209B4[1].atTargetInit.y += 20.0f; D_801209B4[1].atTargetInit.y += 20.0f;
csInfo->keyFrames = D_801209B4; csInfo->keyFrames = D_801209B4;
@ -156,10 +159,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
((mainCam->play->state.frames & 1) ? 3.0f : -3.0f) + Rand_ZeroOne(); ((mainCam->play->state.frames & 1) ? 3.0f : -3.0f) + Rand_ZeroOne();
func_800C0808(play, subCamId, player, CAM_SET_CS_C); func_800C0808(play, subCamId, player, CAM_SET_CS_C);
i = Quake_Add(subCam, 5); i = Quake_Request(subCam, QUAKE_TYPE_5);
Quake_SetSpeed(i, 400); Quake_SetSpeed(i, 400);
Quake_SetQuakeValues(i, 4, 5, 40, 0x3C); Quake_SetPerturbations(i, 4, 5, 40, 0x3C);
Quake_SetCountdown(i, 1600); Quake_SetDuration(i, 1600);
break; break;
case 2280: case 2280:
csInfo->keyFrames = D_80120D4C; csInfo->keyFrames = D_80120D4C;
@ -177,10 +180,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
((mainCam->play->state.frames & 1) ? 3.0f : -3.0f) + Rand_ZeroOne(); ((mainCam->play->state.frames & 1) ? 3.0f : -3.0f) + Rand_ZeroOne();
func_800C0808(play, subCamId, player, CAM_SET_CS_C); func_800C0808(play, subCamId, player, CAM_SET_CS_C);
i = Quake_Add(subCam, 5); i = Quake_Request(subCam, QUAKE_TYPE_5);
Quake_SetSpeed(i, 400); Quake_SetSpeed(i, 400);
Quake_SetQuakeValues(i, 2, 3, 200, 0x32); Quake_SetPerturbations(i, 2, 3, 200, 0x32);
Quake_SetCountdown(i, 9999); Quake_SetDuration(i, 9999);
break; break;
case 2220: case 2220:
csInfo->keyFrames = D_80120E64; csInfo->keyFrames = D_80120E64;
@ -188,10 +191,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
func_800C0808(play, subCamId, player, CAM_SET_CS_C); func_800C0808(play, subCamId, player, CAM_SET_CS_C);
i = Quake_Add(subCam, 5); i = Quake_Request(subCam, QUAKE_TYPE_5);
Quake_SetSpeed(i, 400); Quake_SetSpeed(i, 400);
Quake_SetQuakeValues(i, 2, 2, 50, 0); Quake_SetPerturbations(i, 2, 2, 50, 0);
Quake_SetCountdown(i, 280); Quake_SetDuration(i, 280);
break; break;
case 2230: case 2230:
if (player->actor.world.pos.z < 1000.0f) { if (player->actor.world.pos.z < 1000.0f) {
@ -210,10 +213,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
func_800C0808(play, subCamId, player, CAM_SET_CS_C); func_800C0808(play, subCamId, player, CAM_SET_CS_C);
i = Quake_Add(subCam, 5); i = Quake_Request(subCam, QUAKE_TYPE_5);
Quake_SetSpeed(i, 400); Quake_SetSpeed(i, 400);
Quake_SetQuakeValues(i, 2, 2, 50, 0); Quake_SetPerturbations(i, 2, 2, 50, 0);
Quake_SetCountdown(i, 60); Quake_SetDuration(i, 60);
break; break;
case 2350: case 2350:
csInfo->keyFrames = D_8012110C; csInfo->keyFrames = D_8012110C;
@ -297,7 +300,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spD0.yaw = spA0.rot.y; spD0.yaw = spA0.rot.y;
spD0.pitch = 0x3E8; spD0.pitch = 0x3E8;
OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
Play_CameraChangeSetting(play, subCamId, CAM_SET_FREE2); Play_CameraChangeSetting(play, subCamId, CAM_SET_FREE2);
Play_CameraSetAtEye(play, subCamId, &spC0, &spB4); Play_CameraSetAtEye(play, subCamId, &spC0, &spB4);
func_8002DF54(play, NULL, 8); func_8002DF54(play, NULL, 8);
@ -308,7 +311,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
} }
break; break;
case 2210: case 2210:
OLib_Vec3fDiffToVecSphGeo(&spD0, &player->actor.world.pos, &actor->world.pos); OLib_Vec3fDiffToVecGeo(&spD0, &player->actor.world.pos, &actor->world.pos);
D_801213B4[0].eyeTargetInit.y = D_801213B4[1].eyeTargetInit.y = D_801213B4[2].eyeTargetInit.y = D_801213B4[0].eyeTargetInit.y = D_801213B4[1].eyeTargetInit.y = D_801213B4[2].eyeTargetInit.y =
D_801213B4[2].atTargetInit.y = CAM_BINANG_TO_DEG(spD0.yaw); D_801213B4[2].atTargetInit.y = CAM_BINANG_TO_DEG(spD0.yaw);
if (Rand_ZeroOne() < 0.0f) { if (Rand_ZeroOne() < 0.0f) {
@ -397,10 +400,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
func_800C0808(play, subCamId, player, CAM_SET_CS_C); func_800C0808(play, subCamId, player, CAM_SET_CS_C);
i = Quake_Add(subCam, 3); i = Quake_Request(subCam, QUAKE_TYPE_3);
Quake_SetSpeed(i, 22000); Quake_SetSpeed(i, 22000);
Quake_SetQuakeValues(i, 2, 0, 200, 0); Quake_SetPerturbations(i, 2, 0, 200, 0);
Quake_SetCountdown(i, 10); Quake_SetDuration(i, 10);
break; break;
case 3080: case 3080:
csInfo->keyFrames = D_80121774; csInfo->keyFrames = D_80121774;
@ -435,10 +438,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
func_8002DF54(play, NULL, 8); func_8002DF54(play, NULL, 8);
func_800C0808(play, subCamId, player, CAM_SET_CS_C); func_800C0808(play, subCamId, player, CAM_SET_CS_C);
i = Quake_Add(subCam, 1); i = Quake_Request(subCam, QUAKE_TYPE_1);
Quake_SetSpeed(i, 24000); Quake_SetSpeed(i, 24000);
Quake_SetQuakeValues(i, 2, 0, 0, 0); Quake_SetPerturbations(i, 2, 0, 0, 0);
Quake_SetCountdown(i, 160); Quake_SetDuration(i, 160);
break; break;
case 3060: case 3060:
csInfo->keyFrames = D_80121904; csInfo->keyFrames = D_80121904;
@ -467,10 +470,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
D_8012021C[D_801202FC - 3].pos.z += D_8012021C[D_801202FC - 3].pos.z +=
(D_8012021C[D_801202FC - 2].pos.z - D_8012021C[D_801202FC - 3].pos.z) / 2; (D_8012021C[D_801202FC - 2].pos.z - D_8012021C[D_801202FC - 3].pos.z) / 2;
i = Quake_Add(mainCam, 3); i = Quake_Request(mainCam, QUAKE_TYPE_3);
Quake_SetSpeed(i, 30000); Quake_SetSpeed(i, 30000);
Quake_SetQuakeValues(i, 2, 1, 1, 0); Quake_SetPerturbations(i, 2, 1, 1, 0);
Quake_SetCountdown(i, 200); Quake_SetDuration(i, 200);
break; break;
case 3120: case 3120:
csInfo->keyFrames = D_80121954[-(timer + 101)]; csInfo->keyFrames = D_80121954[-(timer + 101)];
@ -520,7 +523,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spD0.r = 250.0f; spD0.r = 250.0f;
Actor_GetWorld(&spA0, &player->actor); Actor_GetWorld(&spA0, &player->actor);
spD0.yaw = OnePointCutscene_Vec3fYaw(&spC0, &spA0.pos) - 0x7D0; spD0.yaw = OnePointCutscene_Vec3fYaw(&spC0, &spA0.pos) - 0x7D0;
OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
Play_CameraChangeSetting(play, subCamId, CAM_SET_FREE2); Play_CameraChangeSetting(play, subCamId, CAM_SET_FREE2);
Play_CameraSetAtEye(play, subCamId, &spC0, &spB4); Play_CameraSetAtEye(play, subCamId, &spC0, &spB4);
Play_CopyCamera(play, CAM_ID_MAIN, subCamId); Play_CopyCamera(play, CAM_ID_MAIN, subCamId);
@ -534,7 +537,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spD0.pitch = 0; spD0.pitch = 0;
spD0.yaw = spA0.rot.y; spD0.yaw = spA0.rot.y;
spD0.r = 150.0f; spD0.r = 150.0f;
OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
Play_CameraChangeSetting(play, subCamId, CAM_SET_FREE2); Play_CameraChangeSetting(play, subCamId, CAM_SET_FREE2);
Play_CameraSetAtEye(play, subCamId, &spC0, &spB4); Play_CameraSetAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0; subCam->roll = 0;
@ -548,7 +551,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spD0.r = 300.0f; spD0.r = 300.0f;
spD0.yaw = spA0.rot.y; spD0.yaw = spA0.rot.y;
spD0.pitch = -0xAF0; spD0.pitch = -0xAF0;
OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
Play_CameraChangeSetting(play, subCamId, CAM_SET_FREE2); Play_CameraChangeSetting(play, subCamId, CAM_SET_FREE2);
Play_CameraSetAtEye(play, subCamId, &spC0, &spB4); Play_CameraSetAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0; subCam->roll = 0;
@ -577,16 +580,16 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spC0.x = sp8C.pos.x; spC0.x = sp8C.pos.x;
spC0.y = sp8C.pos.y + 70.0f; spC0.y = sp8C.pos.y + 70.0f;
spC0.z = sp8C.pos.z; spC0.z = sp8C.pos.z;
OLib_Vec3fDiffToVecSphGeo(&spD0, &spA0.pos, &sp8C.pos); OLib_Vec3fDiffToVecGeo(&spD0, &spA0.pos, &sp8C.pos);
spD0.pitch = 0x5DC; spD0.pitch = 0x5DC;
spD0.r = 120.0f; spD0.r = 120.0f;
OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
Play_CameraSetAtEye(play, CAM_ID_MAIN, &spC0, &spB4); Play_CameraSetAtEye(play, CAM_ID_MAIN, &spC0, &spB4);
i = Quake_Add(subCam, 3); i = Quake_Request(subCam, QUAKE_TYPE_3);
Quake_SetSpeed(i, 22000); Quake_SetSpeed(i, 22000);
Quake_SetQuakeValues(i, 1, 0, 0, 0); Quake_SetPerturbations(i, 1, 0, 0, 0);
Quake_SetCountdown(i, 90); Quake_SetDuration(i, 90);
break; break;
case 6010: case 6010:
Actor_GetWorld(&spA0, actor); Actor_GetWorld(&spA0, actor);
@ -595,7 +598,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spC0.y += 70.0f; spC0.y += 70.0f;
spD0.yaw = spA0.rot.y + 0x7FFF; spD0.yaw = spA0.rot.y + 0x7FFF;
spD0.r = 300.0f; spD0.r = 300.0f;
OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
Play_CameraChangeSetting(play, subCamId, CAM_SET_FREE2); Play_CameraChangeSetting(play, subCamId, CAM_SET_FREE2);
Play_CameraSetAtEye(play, subCamId, &spC0, &spB4); Play_CameraSetAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0; subCam->roll = 0;
@ -607,10 +610,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spC0 = spA0.pos; spC0 = spA0.pos;
func_800C0808(play, subCamId, player, CAM_SET_PIVOT_VERTICAL); func_800C0808(play, subCamId, player, CAM_SET_PIVOT_VERTICAL);
Actor_GetWorld(&spA0, &player->actor); Actor_GetWorld(&spA0, &player->actor);
OLib_Vec3fDiffToVecSphGeo(&spD0, &spC0, &spA0.pos); OLib_Vec3fDiffToVecGeo(&spD0, &spC0, &spA0.pos);
spD0.yaw += 0x3E8; spD0.yaw += 0x3E8;
spD0.r = 400.0f; spD0.r = 400.0f;
OnePointCutscene_AddVecSphToVec3f(&spB4, &spC0, &spD0); OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0);
spB4.y = spA0.pos.y + 60.0f; spB4.y = spA0.pos.y + 60.0f;
Play_CameraSetAtEye(play, subCamId, &spC0, &spB4); Play_CameraSetAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0; subCam->roll = 0;
@ -637,10 +640,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
OnePointCutscene_SetCsCamPoints(subCam, D_801208E8, D_801208E4, D_801206A0, D_80120760); OnePointCutscene_SetCsCamPoints(subCam, D_801208E8, D_801208E4, D_801206A0, D_80120760);
} }
i = Quake_Add(subCam, 1); i = Quake_Request(subCam, QUAKE_TYPE_1);
Quake_SetSpeed(i, 32000); Quake_SetSpeed(i, 32000);
Quake_SetQuakeValues(i, 0, 0, 20, 0); Quake_SetPerturbations(i, 0, 0, 20, 0);
Quake_SetCountdown(i, D_801208E4 - 10); Quake_SetDuration(i, D_801208E4 - 10);
break; break;
case 3400: case 3400:
Play_CameraChangeSetting(play, subCamId, CAM_SET_CS_3); Play_CameraChangeSetting(play, subCamId, CAM_SET_CS_3);
@ -649,10 +652,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
OnePointCutscene_Vec3sToVec3f(&mainCam->eye, &D_801205B4[D_80120694 - 2].pos); OnePointCutscene_Vec3sToVec3f(&mainCam->eye, &D_801205B4[D_80120694 - 2].pos);
OnePointCutscene_Vec3sToVec3f(&mainCam->at, &D_801204D4[D_80120694 - 2].pos); OnePointCutscene_Vec3sToVec3f(&mainCam->at, &D_801204D4[D_80120694 - 2].pos);
i = Quake_Add(subCam, 1); i = Quake_Request(subCam, QUAKE_TYPE_1);
Quake_SetSpeed(i, 0x4E20); Quake_SetSpeed(i, 0x4E20);
Quake_SetQuakeValues(i, 1, 0, 50, 0); Quake_SetPerturbations(i, 1, 0, 50, 0);
Quake_SetCountdown(i, D_80120698 - 20); Quake_SetDuration(i, D_80120698 - 20);
break; break;
case 3390: case 3390:
player->actor.shape.rot.y = player->actor.world.rot.y = player->currentYaw = -0x3FD9; player->actor.shape.rot.y = player->actor.world.rot.y = player->currentYaw = -0x3FD9;
@ -668,10 +671,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
func_8002DF54(play, NULL, 8); func_8002DF54(play, NULL, 8);
Play_CopyCamera(play, subCamId, CAM_ID_MAIN); Play_CopyCamera(play, subCamId, CAM_ID_MAIN);
i = Quake_Add(subCam, 1); i = Quake_Request(subCam, QUAKE_TYPE_1);
Quake_SetSpeed(i, 32000); Quake_SetSpeed(i, 32000);
Quake_SetQuakeValues(i, 2, 0, 0, 0); Quake_SetPerturbations(i, 2, 0, 0, 0);
Quake_SetCountdown(i, timer); Quake_SetDuration(i, timer);
break; break;
case 3290: case 3290:
D_80121F1C[0].atTargetInit = play->view.at; D_80121F1C[0].atTargetInit = play->view.at;
@ -685,10 +688,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
func_800C0808(play, subCamId, player, CAM_SET_CS_C); func_800C0808(play, subCamId, player, CAM_SET_CS_C);
i = Quake_Add(subCam, 3); i = Quake_Request(subCam, QUAKE_TYPE_3);
Quake_SetSpeed(i, 12000); Quake_SetSpeed(i, 12000);
Quake_SetQuakeValues(i, 0, 0, 1000, 0); Quake_SetPerturbations(i, 0, 0, 1000, 0);
Quake_SetCountdown(i, 5); Quake_SetDuration(i, 5);
break; break;
case 3340: case 3340:
D_80121FBC[0].atTargetInit = play->view.at; D_80121FBC[0].atTargetInit = play->view.at;
@ -701,10 +704,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
func_8002DF54(play, NULL, 8); func_8002DF54(play, NULL, 8);
func_800C0808(play, subCamId, player, CAM_SET_CS_C); func_800C0808(play, subCamId, player, CAM_SET_CS_C);
i = Quake_Add(subCam, 3); i = Quake_Request(subCam, QUAKE_TYPE_3);
Quake_SetSpeed(i, 12000); Quake_SetSpeed(i, 12000);
Quake_SetQuakeValues(i, 0, 0, 1000, 0); Quake_SetPerturbations(i, 0, 0, 1000, 0);
Quake_SetCountdown(i, 5); Quake_SetDuration(i, 5);
break; break;
case 3360: case 3360:
csInfo->keyFrames = D_8012205C; csInfo->keyFrames = D_8012205C;
@ -746,10 +749,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
func_8002DF54(play, NULL, 8); func_8002DF54(play, NULL, 8);
func_800C0808(play, subCamId, player, CAM_SET_CS_C); func_800C0808(play, subCamId, player, CAM_SET_CS_C);
i = Quake_Add(subCam, 1); i = Quake_Request(subCam, QUAKE_TYPE_1);
Quake_SetSpeed(i, 32000); Quake_SetSpeed(i, 32000);
Quake_SetQuakeValues(i, 4, 0, 0, 0); Quake_SetPerturbations(i, 4, 0, 0, 0);
Quake_SetCountdown(i, 20); Quake_SetDuration(i, 20);
break; break;
case 3450: case 3450:
csInfo->keyFrames = D_8012237C; csInfo->keyFrames = D_8012237C;
@ -758,10 +761,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
func_8002DF38(play, &player->actor, 8); func_8002DF38(play, &player->actor, 8);
func_800C0808(play, subCamId, player, CAM_SET_CS_C); func_800C0808(play, subCamId, player, CAM_SET_CS_C);
i = Quake_Add(subCam, 1); i = Quake_Request(subCam, QUAKE_TYPE_1);
Quake_SetSpeed(i, 32000); Quake_SetSpeed(i, 32000);
Quake_SetQuakeValues(i, 2, 0, 0, 0); Quake_SetPerturbations(i, 2, 0, 0, 0);
Quake_SetCountdown(i, 10); Quake_SetDuration(i, 10);
break; break;
case 3440: case 3440:
csInfo->keyFrames = D_801223CC; csInfo->keyFrames = D_801223CC;
@ -772,10 +775,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
player->stateFlags1 |= PLAYER_STATE1_29; player->stateFlags1 |= PLAYER_STATE1_29;
player->actor.freezeTimer = 90; player->actor.freezeTimer = 90;
i = Quake_Add(subCam, 1); i = Quake_Request(subCam, QUAKE_TYPE_1);
Quake_SetSpeed(i, 32000); Quake_SetSpeed(i, 32000);
Quake_SetQuakeValues(i, 2, 0, 0, 0); Quake_SetPerturbations(i, 2, 0, 0, 0);
Quake_SetCountdown(i, 10); Quake_SetDuration(i, 10);
break; break;
case 3430: case 3430:
csInfo->keyFrames = D_801224BC; csInfo->keyFrames = D_801224BC;
@ -784,10 +787,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
func_8002DF54(play, NULL, 8); func_8002DF54(play, NULL, 8);
func_800C0808(play, subCamId, player, CAM_SET_CS_C); func_800C0808(play, subCamId, player, CAM_SET_CS_C);
i = Quake_Add(subCam, 1); i = Quake_Request(subCam, QUAKE_TYPE_1);
Quake_SetSpeed(i, 32000); Quake_SetSpeed(i, 32000);
Quake_SetQuakeValues(i, 1, 0, 10, 0); Quake_SetPerturbations(i, 1, 0, 10, 0);
Quake_SetCountdown(i, 20); Quake_SetDuration(i, 20);
break; break;
case 4100: case 4100:
csInfo->keyFrames = D_801225D4; csInfo->keyFrames = D_801225D4;
@ -867,10 +870,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
func_800C0808(play, subCamId, player, CAM_SET_CS_C); func_800C0808(play, subCamId, player, CAM_SET_CS_C);
i = Quake_Add(subCam, 3); i = Quake_Request(subCam, QUAKE_TYPE_3);
Quake_SetSpeed(i, 12000); Quake_SetSpeed(i, 12000);
Quake_SetQuakeValues(i, 0, 1, 100, 0); Quake_SetPerturbations(i, 0, 1, 100, 0);
Quake_SetCountdown(i, timer - 80); Quake_SetDuration(i, timer - 80);
break; break;
case 4220: case 4220:
csInfo->keyFrames = (player->actor.world.pos.z < -15.0f) ? D_80122C3C : D_80122C64; csInfo->keyFrames = (player->actor.world.pos.z < -15.0f) ? D_80122C3C : D_80122C64;
@ -879,10 +882,10 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
func_800C0808(play, subCamId, player, CAM_SET_CS_C); func_800C0808(play, subCamId, player, CAM_SET_CS_C);
func_8002DF38(play, &player->actor, 1); func_8002DF38(play, &player->actor, 1);
i = Quake_Add(subCam, 3); i = Quake_Request(subCam, QUAKE_TYPE_3);
Quake_SetSpeed(i, 12000); Quake_SetSpeed(i, 12000);
Quake_SetQuakeValues(i, 0, 1, 10, 0); Quake_SetPerturbations(i, 0, 1, 10, 0);
Quake_SetCountdown(i, timer - 10); Quake_SetDuration(i, timer - 10);
break; break;
case 4221: case 4221:
csInfo->keyFrames = D_80122C8C; csInfo->keyFrames = D_80122C8C;
@ -970,12 +973,12 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
D_801231B4[2].atTargetInit.z = 0.0f; D_801231B4[2].atTargetInit.z = 0.0f;
} }
Actor_GetWorldPosShapeRot(&spA0, &player->actor); Actor_GetWorldPosShapeRot(&spA0, &player->actor);
OLib_Vec3fDiffToVecSphGeo(&spD0, &spA0.pos, &mainCam->at); OLib_Vec3fDiffToVecGeo(&spD0, &spA0.pos, &mainCam->at);
spD0.yaw -= spA0.rot.y; spD0.yaw -= spA0.rot.y;
OLib_VecSphGeoToVec3f(&D_801231B4[3].atTargetInit, &spD0); OLib_VecGeoToVec3f(&D_801231B4[3].atTargetInit, &spD0);
OLib_Vec3fDiffToVecSphGeo(&spD0, &spA0.pos, &mainCam->eye); OLib_Vec3fDiffToVecGeo(&spD0, &spA0.pos, &mainCam->eye);
spD0.yaw -= spA0.rot.y; spD0.yaw -= spA0.rot.y;
OLib_VecSphGeoToVec3f(&D_801231B4[3].eyeTargetInit, &spD0); OLib_VecGeoToVec3f(&D_801231B4[3].eyeTargetInit, &spD0);
D_801231B4[3].fovTargetInit = mainCam->fov; D_801231B4[3].fovTargetInit = mainCam->fov;
D_801231B4[3].timerInit = timer - 50; D_801231B4[3].timerInit = timer - 50;

View file

@ -1,4 +1,5 @@
#include "global.h" #include "global.h"
#include "quake.h"
#include "vt.h" #include "vt.h"
void* D_8012D1F0 = NULL; void* D_8012D1F0 = NULL;
@ -256,7 +257,7 @@ void Play_Init(GameState* thisx) {
this->activeCamId = CAM_ID_MAIN; this->activeCamId = CAM_ID_MAIN;
func_8005AC48(&this->mainCamera, 0xFF); func_8005AC48(&this->mainCamera, 0xFF);
Sram_Init(this, &this->sramCtx); Sram_Init(this, &this->sramCtx);
func_80112098(this); Regs_InitData(this);
Message_Init(this); Message_Init(this);
GameOver_Init(this); GameOver_Init(this);
SfxSource_InitAll(this); SfxSource_InitAll(this);
@ -1182,11 +1183,11 @@ void Play_Draw(PlayState* this) {
if ((HREG(80) != 10) || (HREG(83) != 0)) { if ((HREG(80) != 10) || (HREG(83) != 0)) {
if ((this->skyboxCtx.unk_140 != 0) && (GET_ACTIVE_CAM(this)->setting != CAM_SET_PREREND_FIXED)) { if ((this->skyboxCtx.unk_140 != 0) && (GET_ACTIVE_CAM(this)->setting != CAM_SET_PREREND_FIXED)) {
Vec3f sp74; Vec3f quakeOffset;
Camera_GetSkyboxOffset(&sp74, GET_ACTIVE_CAM(this)); Camera_GetQuakeOffset(&quakeOffset, GET_ACTIVE_CAM(this));
SkyboxDraw_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x + sp74.x, SkyboxDraw_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x + quakeOffset.x,
this->view.eye.y + sp74.y, this->view.eye.z + sp74.z); this->view.eye.y + quakeOffset.y, this->view.eye.z + quakeOffset.z);
} }
} }

View file

@ -1,280 +1,362 @@
#include "global.h" #include "global.h"
#include "quake.h"
#include "vt.h" #include "vt.h"
QuakeRequest sQuakeRequest[4]; typedef struct {
s16 D_80126250 = 1; /* 0x00 */ s16 index;
/* 0x02 */ s16 duration;
/* 0x04 */ Camera* cam;
/* 0x08 */ u32 type;
/* 0x0C */ s16 y;
/* 0x0E */ s16 x;
/* 0x10 */ s16 fov;
/* 0x12 */ s16 upPitchOffset;
/* 0x14 */ Vec3s orientation; // alters the orientation of the xy perturbation. Only x (pitch) and y (yaw) are used
/* 0x1A */ s16 speed;
/* 0x1C */ s16 isRelativeToScreen; // is the quake relative to the screen or on world coordinates
/* 0x1E */ s16 timer;
/* 0x20 */ s16 camId;
} QuakeRequest; // size = 0x24
QuakeRequest sQuakeRequests[4];
s16 sQuakeUnused = 1;
s16 sQuakeRequestCount = 0; s16 sQuakeRequestCount = 0;
s16 (*sQuakeCallbacks[])(QuakeRequest*, ShakeInfo*) = { Vec3f* Quake_AddVecGeoToVec3f(Vec3f* dst, Vec3f* a, VecGeo* geo) {
NULL, Quake_Callback1, Quake_Callback2, Quake_Callback3, Quake_Callback4, Quake_Callback5, Quake_Callback6, Vec3f vec;
}; Vec3f b;
Vec3f* Quake_AddVec(Vec3f* dst, Vec3f* arg1, VecSph* arg2) { OLib_VecGeoToVec3f(&b, geo);
Vec3f vec1; vec.x = a->x + b.x;
Vec3f vec2; vec.y = a->y + b.y;
vec.z = a->z + b.z;
*dst = vec;
OLib_VecSphGeoToVec3f(&vec2, arg2);
vec1.x = arg1->x + vec2.x;
vec1.y = arg1->y + vec2.y;
vec1.z = arg1->z + vec2.z;
*dst = vec1;
return dst; return dst;
} }
void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) { void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) {
Vec3f* unk50 = &req->cam->at; Vec3f* at = &req->cam->at;
Vec3f* unk5C = &req->cam->eye; Vec3f* eye = &req->cam->eye;
Vec3f offset;
VecGeo geo;
VecGeo eyeToAtGeo;
Vec3f vec; if (req->isRelativeToScreen) {
VecSph struc2; offset.x = 0;
VecSph struc1; offset.y = 0;
Vec3f vec2; offset.z = 0;
OLib_Vec3fDiffToVecGeo(&eyeToAtGeo, eye, at);
if (req->unk_1C) { // y shake
vec.x = 0; geo.r = req->y * y;
vec.y = 0; // point unit vector up, then add on `req->orientation`
vec.z = 0; geo.pitch = eyeToAtGeo.pitch + req->orientation.x + 0x4000;
OLib_Vec3fDiffToVecSphGeo(&struc1, unk5C, unk50); geo.yaw = eyeToAtGeo.yaw + req->orientation.y;
struc2.r = req->y * y; // apply y shake
struc2.pitch = struc1.pitch + req->unk_14.unk_00 + 0x4000; Quake_AddVecGeoToVec3f(&offset, &offset, &geo);
struc2.yaw = struc1.yaw + req->unk_14.unk_02;
Quake_AddVec(&vec, &vec, &struc2); // x shake
struc2.r = req->x * x; geo.r = req->x * x;
struc2.pitch = struc1.pitch + req->unk_14.unk_00; // point unit vector left, then add on `req->orientation`
struc2.yaw = struc1.yaw + req->unk_14.unk_02 + 0x4000; geo.pitch = eyeToAtGeo.pitch + req->orientation.x;
Quake_AddVec(&vec, &vec, &struc2); geo.yaw = eyeToAtGeo.yaw + req->orientation.y + 0x4000;
// apply x shake
Quake_AddVecGeoToVec3f(&offset, &offset, &geo);
} else { } else {
vec.x = 0; offset.x = 0;
vec.y = req->y * y; offset.y = req->y * y;
vec.z = 0; offset.z = 0;
struc2.r = req->x * x; geo.r = req->x * x;
struc2.pitch = req->unk_14.unk_00; geo.pitch = req->orientation.x;
struc2.yaw = req->unk_14.unk_02; geo.yaw = req->orientation.y;
Quake_AddVec(&vec, &vec, &struc2); Quake_AddVecGeoToVec3f(&offset, &offset, &geo);
} }
vec2 = vec; shake->atOffset = shake->eyeOffset = offset;
shake->vec2 = vec2; shake->upYawOffset = 0x8000 * y;
shake->vec1 = vec2; shake->upPitchOffset = req->upPitchOffset * y;
shake->unk_1A = (f32)0x8000 * y; shake->fovOffset = req->fov * y;
shake->rotZ = req->rotZ * y;
shake->zoom = req->zoom * y;
} }
s16 Quake_Callback1(QuakeRequest* req, ShakeInfo* shake) { s16 Quake_CallbackType1(QuakeRequest* req, ShakeInfo* shake) {
s32 pad; s32 pad;
if (req->countdown > 0) { if (req->timer > 0) {
f32 a = Math_SinS(req->speed * req->countdown); f32 xyOffset = Math_SinS(req->speed * req->timer);
Quake_UpdateShakeInfo(req, shake, a, Rand_ZeroOne() * a); Quake_UpdateShakeInfo(req, shake, xyOffset, Rand_ZeroOne() * xyOffset);
req->countdown--; req->timer--;
} }
return req->countdown; return req->timer;
} }
s16 Quake_Callback5(QuakeRequest* req, ShakeInfo* shake) { s16 Quake_CallbackType5(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) { if (req->timer > 0) {
f32 a = Math_SinS(req->speed * req->countdown); f32 xyOffset = Math_SinS(req->speed * req->timer);
Quake_UpdateShakeInfo(req, shake, a, a); Quake_UpdateShakeInfo(req, shake, xyOffset, xyOffset);
req->countdown--; req->timer--;
} }
return req->countdown; return req->timer;
} }
s16 Quake_Callback6(QuakeRequest* req, ShakeInfo* shake) { s16 Quake_CallbackType6(QuakeRequest* req, ShakeInfo* shake) {
s32 pad; s32 pad;
f32 a; f32 xyOffset;
req->countdown--; req->timer--;
a = Math_SinS(req->speed * ((req->countdown & 0xF) + 500)); xyOffset = Math_SinS(req->speed * ((req->timer & 0xF) + 500));
Quake_UpdateShakeInfo(req, shake, a, Rand_ZeroOne() * a); Quake_UpdateShakeInfo(req, shake, xyOffset, Rand_ZeroOne() * xyOffset);
// Not returning the timer ensures quake type 6 continues indefinitely until manually removed
return 1; return 1;
} }
s16 Quake_Callback3(QuakeRequest* req, ShakeInfo* shake) { s16 Quake_CallbackType3(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) { if (req->timer > 0) {
f32 a = Math_SinS(req->speed * req->countdown) * ((f32)req->countdown / (f32)req->countdownMax); f32 xyOffset = Math_SinS(req->speed * req->timer) * ((f32)req->timer / req->duration);
Quake_UpdateShakeInfo(req, shake, a, a); Quake_UpdateShakeInfo(req, shake, xyOffset, xyOffset);
req->countdown--; req->timer--;
} }
return req->countdown; return req->timer;
} }
s16 Quake_Callback2(QuakeRequest* req, ShakeInfo* shake) { s16 Quake_CallbackType2(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) { if (req->timer > 0) {
f32 a = Rand_ZeroOne(); f32 xyOffset = Rand_ZeroOne();
Quake_UpdateShakeInfo(req, shake, a, Rand_ZeroOne() * a); Quake_UpdateShakeInfo(req, shake, xyOffset, Rand_ZeroOne() * xyOffset);
req->countdown--; req->timer--;
} }
return req->countdown; return req->timer;
} }
s16 Quake_Callback4(QuakeRequest* req, ShakeInfo* shake) { s16 Quake_CallbackType4(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) { if (req->timer > 0) {
f32 a = Rand_ZeroOne() * ((f32)req->countdown / (f32)req->countdownMax); f32 xyOffset = Rand_ZeroOne() * ((f32)req->timer / req->duration);
Quake_UpdateShakeInfo(req, shake, a, Rand_ZeroOne() * a); Quake_UpdateShakeInfo(req, shake, xyOffset, Rand_ZeroOne() * xyOffset);
req->countdown--; req->timer--;
} }
return req->countdown; return req->timer;
} }
s16 Quake_GetFreeIndex(void) { s16 Quake_GetFreeIndex(void) {
s32 i; s32 i;
s32 ret; s32 index;
s32 min = 0x10000; s32 timerMin = 0x10000; // UINT16_MAX + 1
for (i = 0; i < ARRAY_COUNT(sQuakeRequest); i++) { for (i = 0; i < ARRAY_COUNT(sQuakeRequests); i++) {
if (sQuakeRequest[i].callbackIdx == 0) { if (sQuakeRequests[i].type == QUAKE_TYPE_NONE) {
ret = i; index = i;
min = 0x20000; timerMin = 0x20000; // Magic Number to indicate there was an unused quake index
break; break;
} }
if (sQuakeRequest[i].countdown < min) { if (timerMin > sQuakeRequests[i].timer) {
min = sQuakeRequest[i].countdown; timerMin = sQuakeRequests[i].timer;
ret = i; index = i;
} }
} }
if (min != 0x20000) { if (timerMin != 0x20000) {
osSyncPrintf(VT_COL(YELLOW, BLACK) "quake: too many request %d is changed new one !!\n" VT_RST, ret); osSyncPrintf(VT_COL(YELLOW, BLACK) "quake: too many request %d is changed new one !!\n" VT_RST, index);
} }
return ret; return index;
} }
QuakeRequest* Quake_AddImpl(Camera* camera, u32 callbackIdx) { QuakeRequest* Quake_RequestImpl(Camera* camera, u32 type) {
s16 idx = Quake_GetFreeIndex(); s16 index = Quake_GetFreeIndex();
QuakeRequest* req = &sQuakeRequest[idx]; QuakeRequest* req = &sQuakeRequests[index];
__osMemset(req, 0, sizeof(QuakeRequest)); __osMemset(req, 0, sizeof(QuakeRequest));
req->cam = camera; req->cam = camera;
req->camPtrIdx = camera->camId; req->camId = camera->camId;
req->callbackIdx = callbackIdx; req->type = type;
req->unk_1C = 1; req->isRelativeToScreen = true;
req->randIdx = ((s16)(Rand_ZeroOne() * (f32)0x10000) & ~3) + idx;
// Add a unique random identifier to the upper bits of the index
// The `~3` assumes there are only 4 requests
req->index = index + ((s16)(Rand_ZeroOne() * 0x10000) & ~3);
sQuakeRequestCount++; sQuakeRequestCount++;
return req; return req;
} }
void Quake_Remove(QuakeRequest* req) { void Quake_Remove(QuakeRequest* req) {
req->callbackIdx = 0; req->type = QUAKE_TYPE_NONE;
req->countdown = -1; req->timer = -1;
sQuakeRequestCount--; sQuakeRequestCount--;
} }
QuakeRequest* Quake_GetRequest(s16 idx) { QuakeRequest* Quake_GetRequest(s16 index) {
QuakeRequest* req = &sQuakeRequest[idx & 3]; QuakeRequest* req = &sQuakeRequests[index & 3];
if (req->callbackIdx == 0) { if (req->type == QUAKE_TYPE_NONE) {
return NULL; return NULL;
} }
if (idx != req->randIdx) { if (index != req->index) {
return NULL; return NULL;
} }
return req; return req;
} }
QuakeRequest* Quake_SetValue(s16 idx, s16 valueType, s16 value) { #define QUAKE_SPEED (1 << 0)
QuakeRequest* req = Quake_GetRequest(idx); #define QUAKE_Y_OFFSET (1 << 1)
#define QUAKE_X_OFFSET (1 << 2)
#define QUAKE_FOV (1 << 3)
#define QUAKE_ROLL (1 << 4)
#define QUAKE_ORIENTATION_PITCH (1 << 5)
#define QUAKE_ORIENTATION_YAW (1 << 6)
#define QUAKE_ORIENTATION_ROLL (1 << 7)
#define QUAKE_DURATION (1 << 8)
#define QUAKE_IS_RELATIVE_TO_SCREEN (1 << 9)
QuakeRequest* Quake_SetValue(s16 index, s16 valueType, s16 value) {
QuakeRequest* req = Quake_GetRequest(index);
if (req == NULL) { if (req == NULL) {
return NULL; return NULL;
} else {
switch (valueType) {
case 1:
req->speed = value;
break;
case 2:
req->y = value;
break;
case 4:
req->x = value;
break;
case 8:
req->zoom = value;
break;
case 0x10:
req->rotZ = value;
break;
case 0x20:
req->unk_14.unk_00 = value;
break;
case 0x40:
req->unk_14.unk_02 = value;
break;
case 0x80:
req->unk_14.unk_04 = value;
break;
case 0x100:
req->countdown = value;
req->countdownMax = req->countdown;
break;
case 0x200:
req->unk_1C = value;
break;
}
} }
switch (valueType) {
case QUAKE_SPEED:
req->speed = value;
break;
case QUAKE_Y_OFFSET:
req->y = value;
break;
case QUAKE_X_OFFSET:
req->x = value;
break;
case QUAKE_FOV:
req->fov = value;
break;
case QUAKE_ROLL:
req->upPitchOffset = value;
break;
case QUAKE_ORIENTATION_PITCH:
req->orientation.x = value;
break;
case QUAKE_ORIENTATION_YAW:
req->orientation.y = value;
break;
case QUAKE_ORIENTATION_ROLL:
req->orientation.z = value;
break;
case QUAKE_DURATION:
req->timer = value;
req->duration = req->timer;
break;
case QUAKE_IS_RELATIVE_TO_SCREEN:
req->isRelativeToScreen = value;
break;
default:
break;
}
//! @bug UB: missing return. "req" is in v0 at this point, but doing an
//! explicit return uses an additional register.
#ifdef AVOID_UB
return req;
#endif
} }
u32 Quake_SetSpeed(s16 idx, s16 value) { /**
QuakeRequest* req = Quake_GetRequest(idx); * @param index
* @param speed For periodic types only, the angular frequency of the sine wave (binang / frame)
* @return true if successfully applied, false if the request does not exist
*/
u32 Quake_SetSpeed(s16 index, s16 speed) {
QuakeRequest* req = Quake_GetRequest(index);
if (req != NULL) { if (req != NULL) {
req->speed = value; req->speed = speed;
return true; return true;
} }
return false; return false;
} }
u32 Quake_SetCountdown(s16 idx, s16 value) { /**
QuakeRequest* req = Quake_GetRequest(idx); * @param index quake request index to apply
* @param duration Number of frames to apply the quake
* @return true if successfully applied, false if the request does not exist
*/
u32 Quake_SetDuration(s16 index, s16 duration) {
QuakeRequest* req = Quake_GetRequest(index);
if (req != NULL) { if (req != NULL) {
req->countdown = value; req->duration = req->timer = duration;
req->countdownMax = req->countdown;
return true; return true;
} }
return false; return false;
} }
s16 Quake_GetCountdown(s16 idx) { /**
QuakeRequest* req = Quake_GetRequest(idx); * @param index quake request index to get
* @return Number of frames until the quake is finished
*/
s16 Quake_GetTimeLeft(s16 index) {
QuakeRequest* req = Quake_GetRequest(index);
if (req != NULL) { if (req != NULL) {
return req->countdown; return req->timer;
} }
return 0; return 0;
} }
u32 Quake_SetQuakeValues(s16 idx, s16 y, s16 x, s16 zoom, s16 rotZ) { /**
QuakeRequest* req = Quake_GetRequest(idx); * @param index quake request index to apply
* @param y Apply up/down shake
* @param x Apply left/right shake
* @param fov Apply zooming in/out shake (binang)
* @param roll Apply rolling shake (binang)
* @return true if successfully applied, false if the request does not exist
*/
u32 Quake_SetPerturbations(s16 index, s16 y, s16 x, s16 fov, s16 roll) {
QuakeRequest* req = Quake_GetRequest(index);
if (req != NULL) { if (req != NULL) {
req->y = y; req->y = y;
req->x = x; req->x = x;
req->zoom = zoom; req->fov = fov;
req->rotZ = rotZ; // Visual roll is indirectly achieved by offsetting the pitch in calculating the camera "Up" vector
req->upPitchOffset = roll;
return true; return true;
} }
return false; return false;
} }
u32 Quake_SetUnkValues(s16 idx, s16 arg1, SubQuakeRequest14 arg2) { /**
QuakeRequest* req = Quake_GetRequest(idx); * @param index quake request index to apply
* @param isRelativeToScreen Is the quake applied relative to the screen or in absolute world coordinates
* @param orientation orient the x/y shake to a different direction
* @return true if successfully applied, false if the request does not exist
*/
u32 Quake_SetOrientation(s16 index, s16 isRelativeToScreen, Vec3s orientation) {
QuakeRequest* req = Quake_GetRequest(index);
if (req != NULL) { if (req != NULL) {
req->unk_1C = arg1; req->isRelativeToScreen = isRelativeToScreen;
req->orientation = orientation;
req->unk_14 = arg2;
return true; return true;
} }
return false; return false;
@ -283,20 +365,20 @@ u32 Quake_SetUnkValues(s16 idx, s16 arg1, SubQuakeRequest14 arg2) {
void Quake_Init(void) { void Quake_Init(void) {
s16 i; s16 i;
for (i = 0; i < ARRAY_COUNT(sQuakeRequest); i++) { for (i = 0; i < ARRAY_COUNT(sQuakeRequests); i++) {
sQuakeRequest[i].callbackIdx = 0; sQuakeRequests[i].type = QUAKE_TYPE_NONE;
sQuakeRequest[i].countdown = 0; sQuakeRequests[i].timer = 0;
} }
D_80126250 = 1; sQuakeUnused = 1;
sQuakeRequestCount = 0; sQuakeRequestCount = 0;
} }
s16 Quake_Add(Camera* camera, u32 callbackIdx) { s16 Quake_Request(Camera* camera, u32 type) {
return Quake_AddImpl(camera, callbackIdx)->randIdx; return Quake_RequestImpl(camera, type)->index;
} }
u32 Quake_RemoveFromIdx(s16 idx) { u32 Quake_RemoveRequest(s16 index) {
QuakeRequest* req = Quake_GetRequest(idx); QuakeRequest* req = Quake_GetRequest(index);
if (req != NULL) { if (req != NULL) {
Quake_Remove(req); Quake_Remove(req);
@ -305,101 +387,120 @@ u32 Quake_RemoveFromIdx(s16 idx) {
return false; return false;
} }
s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData) { s16 (*sQuakeCallbacks[])(QuakeRequest*, ShakeInfo*) = {
f32 max; NULL, // QUAKE_TYPE_NONE
f32 max2; Quake_CallbackType1, // QUAKE_TYPE_1
QuakeRequest* req; Quake_CallbackType2, // QUAKE_TYPE_2
ShakeInfo shake; Quake_CallbackType3, // QUAKE_TYPE_3
f32 absSpeedDiv; Quake_CallbackType4, // QUAKE_TYPE_4
s16* temp; Quake_CallbackType5, // QUAKE_TYPE_5
u32 pad2; Quake_CallbackType6, // QUAKE_TYPE_6
s32 idx; };
s32 ret;
u32 eq;
Vec3f vec;
PlayState* play;
play = camera->play; s16 Quake_Update(Camera* camera, ShakeInfo* camShake) {
vec.x = 0.0f; f32 maxCurr;
vec.y = 0.0f; f32 maxNext;
vec.z = 0.0f; ShakeInfo shake;
camData->rotZ = 0; QuakeRequest* req;
camData->unk_1A = 0; f32 absSpeedDiv;
camData->zoom = 0; s16* camId;
camData->atOffset.x = 0.0f; s32 index;
camData->atOffset.y = 0.0f; s32 numQuakesApplied;
camData->atOffset.z = 0.0f; u32 isDifferentCamId;
camData->eyeOffset.x = 0.0f; Vec3f zeroVec;
camData->eyeOffset.y = 0.0f; PlayState* play = camera->play;
camData->eyeOffset.z = 0.0f;
camData->unk_20 = 0.0f; zeroVec.x = 0.0f;
zeroVec.y = 0.0f;
zeroVec.z = 0.0f;
camShake->upPitchOffset = 0;
camShake->upYawOffset = 0;
camShake->fovOffset = 0;
camShake->atOffset.x = 0.0f;
camShake->atOffset.y = 0.0f;
camShake->atOffset.z = 0.0f;
camShake->eyeOffset.x = 0.0f;
camShake->eyeOffset.y = 0.0f;
camShake->eyeOffset.z = 0.0f;
camShake->maxOffset = 0.0f;
if (sQuakeRequestCount == 0) { if (sQuakeRequestCount == 0) {
return 0; return 0;
} }
ret = 0; numQuakesApplied = 0;
for (idx = 0; idx < ARRAY_COUNT(sQuakeRequest); idx++) { for (index = 0; index < ARRAY_COUNT(sQuakeRequests); index++) {
req = &sQuakeRequest[idx]; req = &sQuakeRequests[index];
if (req->callbackIdx != 0) { if (req->type == QUAKE_TYPE_NONE) {
if (play->cameraPtrs[req->camPtrIdx] == NULL) { continue;
osSyncPrintf(VT_COL(YELLOW, BLACK) "quake: stopped! 'coz camera [%d] killed!!\n" VT_RST,
req->camPtrIdx);
Quake_Remove(req);
} else {
temp = &camera->camId;
eq = req->cam->camId != *temp;
absSpeedDiv = ABS(req->speed) / (f32)0x8000;
if (sQuakeCallbacks[req->callbackIdx](req, &shake) == 0) {
Quake_Remove(req);
} else if (eq == 0) {
if (fabsf(camData->atOffset.x) < fabsf(shake.vec1.x)) {
camData->atOffset.x = shake.vec1.x;
}
if (fabsf(camData->atOffset.y) < fabsf(shake.vec1.y)) {
camData->atOffset.y = shake.vec1.y;
}
if (fabsf(camData->atOffset.z) < fabsf(shake.vec1.z)) {
camData->atOffset.z = shake.vec1.z;
}
if (fabsf(camData->eyeOffset.x) < fabsf(shake.vec2.x)) {
camData->eyeOffset.x = shake.vec2.x;
}
if (fabsf(camData->eyeOffset.y) < fabsf(shake.vec2.y)) {
camData->eyeOffset.y = shake.vec2.y;
}
if (fabsf(camData->eyeOffset.z) < fabsf(shake.vec2.z)) {
camData->eyeOffset.z = shake.vec2.z;
}
if (camData->rotZ < shake.rotZ) {
camData->rotZ = shake.rotZ;
camData->unk_1A = shake.unk_1A;
}
if (camData->zoom < shake.zoom) {
camData->zoom = shake.zoom;
}
max = OLib_Vec3fDist(&shake.vec1, &vec) * absSpeedDiv;
max2 = OLib_Vec3fDist(&shake.vec2, &vec) * absSpeedDiv;
if (max < max2) {
max = max2;
}
max2 = (camData->rotZ * 0.005f) * absSpeedDiv;
if (max < max2) {
max = max2;
}
max2 = (camData->zoom * 0.005f) * absSpeedDiv;
if (max < max2) {
max = max2;
}
if (camData->unk_20 < max) {
camData->unk_20 = max;
}
ret++;
}
}
} }
if (play->cameraPtrs[req->camId] == NULL) {
osSyncPrintf(VT_COL(YELLOW, BLACK) "quake: stopped! 'coz camera [%d] killed!!\n" VT_RST, req->camId);
Quake_Remove(req);
continue;
}
camId = &camera->camId;
isDifferentCamId = req->cam->camId != *camId;
absSpeedDiv = (f32)ABS(req->speed) / 0x8000;
if (sQuakeCallbacks[req->type](req, &shake) == 0) {
// Quake has reached the end of its timer.
Quake_Remove(req);
continue;
}
if (isDifferentCamId) {
// Quake is attached to a different camId
continue;
}
if (fabsf(camShake->atOffset.x) < fabsf(shake.atOffset.x)) {
camShake->atOffset.x = shake.atOffset.x;
}
if (fabsf(camShake->atOffset.y) < fabsf(shake.atOffset.y)) {
camShake->atOffset.y = shake.atOffset.y;
}
if (fabsf(camShake->atOffset.z) < fabsf(shake.atOffset.z)) {
camShake->atOffset.z = shake.atOffset.z;
}
if (fabsf(camShake->eyeOffset.x) < fabsf(shake.eyeOffset.x)) {
camShake->eyeOffset.x = shake.eyeOffset.x;
}
if (fabsf(camShake->eyeOffset.y) < fabsf(shake.eyeOffset.y)) {
camShake->eyeOffset.y = shake.eyeOffset.y;
}
if (fabsf(camShake->eyeOffset.z) < fabsf(shake.eyeOffset.z)) {
camShake->eyeOffset.z = shake.eyeOffset.z;
}
if (camShake->upPitchOffset < shake.upPitchOffset) {
camShake->upPitchOffset = shake.upPitchOffset;
camShake->upYawOffset = shake.upYawOffset;
}
if (camShake->fovOffset < shake.fovOffset) {
camShake->fovOffset = shake.fovOffset;
}
maxCurr = OLib_Vec3fDist(&shake.atOffset, &zeroVec) * absSpeedDiv;
maxNext = OLib_Vec3fDist(&shake.eyeOffset, &zeroVec) * absSpeedDiv;
maxCurr = CLAMP_MIN(maxCurr, maxNext);
maxNext = camShake->upPitchOffset * (1.0f / 200.0f) * absSpeedDiv;
maxCurr = CLAMP_MIN(maxCurr, maxNext);
maxNext = camShake->fovOffset * (1.0f / 200.0f) * absSpeedDiv;
maxCurr = CLAMP_MIN(maxCurr, maxNext);
if (camShake->maxOffset < maxCurr) {
camShake->maxOffset = maxCurr;
}
numQuakesApplied++;
} }
return ret; return numQuakesApplied;
} }

View file

@ -389,7 +389,7 @@ void Room_DrawImageSingle(PlayState* play, Room* room, u32 flags) {
Vec3f quakeOffset; Vec3f quakeOffset;
gfx = POLY_OPA_DISP; gfx = POLY_OPA_DISP;
Camera_GetSkyboxOffset(&quakeOffset, activeCam); Camera_GetQuakeOffset(&quakeOffset, activeCam);
Room_DrawBackground2D(&gfx, roomShape->source, roomShape->tlut, roomShape->width, roomShape->height, Room_DrawBackground2D(&gfx, roomShape->source, roomShape->tlut, roomShape->width, roomShape->height,
roomShape->fmt, roomShape->siz, roomShape->tlutMode, roomShape->tlutCount, roomShape->fmt, roomShape->siz, roomShape->tlutMode, roomShape->tlutCount,
(quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f, (quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f,
@ -487,7 +487,7 @@ void Room_DrawImageMulti(PlayState* play, Room* room, u32 flags) {
Vec3f quakeOffset; Vec3f quakeOffset;
gfx = POLY_OPA_DISP; gfx = POLY_OPA_DISP;
Camera_GetSkyboxOffset(&quakeOffset, activeCam); Camera_GetQuakeOffset(&quakeOffset, activeCam);
Room_DrawBackground2D(&gfx, bgEntry->source, bgEntry->tlut, bgEntry->width, bgEntry->height, Room_DrawBackground2D(&gfx, bgEntry->source, bgEntry->tlut, bgEntry->width, bgEntry->height,
bgEntry->fmt, bgEntry->siz, bgEntry->tlutMode, bgEntry->tlutCount, bgEntry->fmt, bgEntry->siz, bgEntry->tlutMode, bgEntry->tlutCount,
(quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f, (quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f,

View file

@ -1,4 +1,5 @@
#include "global.h" #include "global.h"
#include "quake.h"
#include "assets/scenes/overworld/spot00/spot00_scene.h" #include "assets/scenes/overworld/spot00/spot00_scene.h"
#include "assets/scenes/overworld/spot00/spot00_room_0.h" #include "assets/scenes/overworld/spot00/spot00_room_0.h"
@ -585,20 +586,20 @@ void Scene_DrawConfigGanonCastleExterior(PlayState* play) {
// Screen Shake for Ganon's Tower Collapse // Screen Shake for Ganon's Tower Collapse
void func_8009BEEC(PlayState* play) { void func_8009BEEC(PlayState* play) {
s32 var; s32 quakeIndex;
if (play->gameplayFrames % 128 == 13) { if (play->gameplayFrames % 128 == 13) {
var = Quake_Add(GET_ACTIVE_CAM(play), 2); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_2);
Quake_SetSpeed(var, 10000); Quake_SetSpeed(quakeIndex, 10000);
Quake_SetQuakeValues(var, 4, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 4, 0, 0, 0);
Quake_SetCountdown(var, 127); Quake_SetDuration(quakeIndex, 127);
} }
if ((play->gameplayFrames % 64 == 0) && (Rand_ZeroOne() > 0.6f)) { if ((play->gameplayFrames % 64 == 0) && (Rand_ZeroOne() > 0.6f)) {
var = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(var, 32000.0f + (Rand_ZeroOne() * 3000.0f)); Quake_SetSpeed(quakeIndex, 32000.0f + (Rand_ZeroOne() * 3000.0f));
Quake_SetQuakeValues(var, 10.0f - (Rand_ZeroOne() * 9.0f), 0, 0, 0); Quake_SetPerturbations(quakeIndex, 10.0f - (Rand_ZeroOne() * 9.0f), 0, 0, 0);
Quake_SetCountdown(var, 48.0f - (Rand_ZeroOne() * 15.0f)); Quake_SetDuration(quakeIndex, 48.0f - (Rand_ZeroOne() * 15.0f));
} }
} }

View file

@ -312,7 +312,7 @@ static s16 sDungeonEntrances[] = {
* - If health is less than 3 hearts, give 3 hearts * - If health is less than 3 hearts, give 3 hearts
* - If either scarecrow song is set, copy them from save context to the proper location * - If either scarecrow song is set, copy them from save context to the proper location
* - Handle a case where the player saved and quit after zelda cutscene but didnt get the song * - Handle a case where the player saved and quit after zelda cutscene but didnt get the song
* - Give and equip master sword if player is adult and doesnt have kokiri sword (bug?) * - Give and equip master sword if player is adult and doesn't have master sword
* - Revert any trade items that spoil * - Revert any trade items that spoil
*/ */
void Sram_OpenSave(SramContext* sramCtx) { void Sram_OpenSave(SramContext* sramCtx) {

View file

@ -12,11 +12,11 @@ void View_ViewportToVp(Vp* dest, Viewport* src) {
dest->vp.vscale[0] = width * 2; dest->vp.vscale[0] = width * 2;
dest->vp.vscale[1] = height * 2; dest->vp.vscale[1] = height * 2;
dest->vp.vscale[2] = 0x01FF; dest->vp.vscale[2] = G_MAXZ / 2;
dest->vp.vscale[3] = 0; dest->vp.vscale[3] = 0;
dest->vp.vtrans[0] = ((src->leftX * 2) + width) * 2; dest->vp.vtrans[0] = ((src->leftX * 2) + width) * 2;
dest->vp.vtrans[1] = ((src->topY * 2) + height) * 2; dest->vp.vtrans[1] = ((src->topY * 2) + height) * 2;
dest->vp.vtrans[2] = 0x01FF; dest->vp.vtrans[2] = G_MAXZ / 2;
dest->vp.vtrans[3] = 0; dest->vp.vtrans[3] = 0;
} }

View file

@ -5,7 +5,7 @@ ElfMessage gOverworldNaviMsgs[] = {
ELF_MSG_FLAG(CHECK, 0x40, false, EVENTCHKINF_05), ELF_MSG_FLAG(CHECK, 0x40, false, EVENTCHKINF_05),
ELF_MSG_FLAG(CHECK, 0x41, false, EVENTCHKINF_09), ELF_MSG_FLAG(CHECK, 0x41, false, EVENTCHKINF_09),
ELF_MSG_FLAG(CHECK, 0x42, false, EVENTCHKINF_12), ELF_MSG_FLAG(CHECK, 0x42, false, EVENTCHKINF_12),
ELF_MSG_FLAG(CHECK, 0x43, false, EVENTCHKINF_14), ELF_MSG_FLAG(CHECK, 0x43, false, EVENTCHKINF_TALON_RETURNED_FROM_CASTLE),
ELF_MSG_FLAG(CHECK, 0x44, false, EVENTCHKINF_40), ELF_MSG_FLAG(CHECK, 0x44, false, EVENTCHKINF_40),
ELF_MSG_SONG(CHECK, 0x45, false, ITEM_SONG_SARIA), ELF_MSG_SONG(CHECK, 0x45, false, ITEM_SONG_SARIA),
ELF_MSG_STRENGTH_UPG(CHECK, 0x46, true, 0), ELF_MSG_STRENGTH_UPG(CHECK, 0x46, true, 0),

View file

@ -33,6 +33,7 @@ void guPerspectiveF(f32 mf[4][4], u16* perspNorm, f32 fovy, f32 aspect, f32 near
} }
} }
} }
void guPerspective(Mtx* m, u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale) { void guPerspective(Mtx* m, u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale) {
f32 mf[4][4]; f32 mf[4][4];

View file

@ -5,6 +5,7 @@
*/ */
#include "z_bg_bdan_objects.h" #include "z_bg_bdan_objects.h"
#include "quake.h"
#include "assets/objects/object_bdan_objects/object_bdan_objects.h" #include "assets/objects/object_bdan_objects/object_bdan_objects.h"
#define FLAGS ACTOR_FLAG_4 #define FLAGS ACTOR_FLAG_4
@ -221,15 +222,15 @@ void func_8086C1A0(BgBdanObjects* this, PlayState* play) {
} }
void func_8086C29C(BgBdanObjects* this, PlayState* play) { void func_8086C29C(BgBdanObjects* this, PlayState* play) {
s32 temp; s32 quakeIndex;
if (this->timer != 0) { if (this->timer != 0) {
this->timer--; this->timer--;
if (this->timer == 0) { if (this->timer == 0) {
temp = Quake_Add(GET_ACTIVE_CAM(play), 1); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_1);
Quake_SetSpeed(temp, 0x3A98); Quake_SetSpeed(quakeIndex, 0x3A98);
Quake_SetQuakeValues(temp, 0, 1, 0xFA, 1); Quake_SetPerturbations(quakeIndex, 0, 1, 250, 1);
Quake_SetCountdown(temp, 0xA); Quake_SetDuration(quakeIndex, 10);
} }
} }

View file

@ -8,6 +8,7 @@
#include "overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h" #include "overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "assets/objects/object_bowl/object_bowl.h" #include "assets/objects/object_bowl/object_bowl.h"
#include "quake.h"
#include "vt.h" #include "vt.h"
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5)
@ -151,10 +152,10 @@ void BgBowlWall_FallDoEffects(BgBowlWall* this, PlayState* play) {
EffectSsHahen_SpawnBurst(play, &effectPos, 10.0f, 0, 50, 15, 3, HAHEN_OBJECT_DEFAULT, 10, NULL); EffectSsHahen_SpawnBurst(play, &effectPos, 10.0f, 0, 50, 15, 3, HAHEN_OBJECT_DEFAULT, 10, NULL);
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_IT_BOMB_EXPLOSION); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_IT_BOMB_EXPLOSION);
} }
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 1); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_1);
Quake_SetSpeed(quakeIndex, 0x7FFF); Quake_SetSpeed(quakeIndex, 0x7FFF);
Quake_SetQuakeValues(quakeIndex, 300, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 300, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 30); Quake_SetDuration(quakeIndex, 30);
this->timer = 20; this->timer = 20;
this->actionFunc = BgBowlWall_FinishFall; this->actionFunc = BgBowlWall_FinishFall;
} }

View file

@ -169,7 +169,7 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, PlayState* play) {
func_80033480(play, &pos1, 20.0f, 1, effectStrength * 135.0f, 60, 1); func_80033480(play, &pos1, 20.0f, 1, effectStrength * 135.0f, 60, 1);
func_8003555C(play, &pos1, &velocity, &accel); func_8003555C(play, &pos1, &velocity, &accel);
} }
Camera_AddQuake(&play->mainCamera, 0, effectStrength * 0.6f, 3); Camera_RequestQuake(&play->mainCamera, 0, effectStrength * 0.6f, 3);
Audio_PlaySfxGeneral(NA_SE_EV_PILLAR_SINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, Audio_PlaySfxGeneral(NA_SE_EV_PILLAR_SINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }

View file

@ -211,7 +211,7 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, PlayState* play) {
(s16)Rand_ZeroFloat(100.0f) + 250, 5, (s16)Rand_ZeroFloat(5.0f) + 15); (s16)Rand_ZeroFloat(100.0f) + 250, 5, (s16)Rand_ZeroFloat(5.0f) + 15);
} }
func_80033DB8(play, 10, 15); Actor_RequestQuake(play, 10, 15);
SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_BOX_BREAK); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_BOX_BREAK);
} }
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);

View file

@ -7,6 +7,7 @@
#include "z_bg_haka_huta.h" #include "z_bg_haka_huta.h"
#include "assets/objects/object_hakach_objects/object_hakach_objects.h" #include "assets/objects/object_hakach_objects/object_hakach_objects.h"
#include "overlays/actors/ovl_En_Rd/z_en_rd.h" #include "overlays/actors/ovl_En_Rd/z_en_rd.h"
#include "quake.h"
#define FLAGS ACTOR_FLAG_4 #define FLAGS ACTOR_FLAG_4
@ -179,10 +180,10 @@ void func_8087D720(BgHakaHuta* this, PlayState* play) {
this->counter++; this->counter++;
if (this->counter == 6) { if (this->counter == 6) {
this->actionFunc = BgHakaHuta_DoNothing; this->actionFunc = BgHakaHuta_DoNothing;
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 0x7530); Quake_SetSpeed(quakeIndex, 0x7530);
Quake_SetQuakeValues(quakeIndex, 4, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 4, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 2); Quake_SetDuration(quakeIndex, 2);
} else if (this->counter == 0) { } else if (this->counter == 0) {
this->counter = 6; this->counter = 6;
this->actionFunc = BgHakaHuta_DoNothing; this->actionFunc = BgHakaHuta_DoNothing;

View file

@ -6,6 +6,7 @@
#include "z_bg_heavy_block.h" #include "z_bg_heavy_block.h"
#include "assets/objects/object_heavy_object/object_heavy_object.h" #include "assets/objects/object_heavy_object/object_heavy_object.h"
#include "quake.h"
#include "vt.h" #include "vt.h"
#define FLAGS 0 #define FLAGS 0
@ -331,10 +332,10 @@ void BgHeavyBlock_Wait(BgHeavyBlock* this, PlayState* play) {
break; break;
} }
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 25000); Quake_SetSpeed(quakeIndex, 25000);
Quake_SetQuakeValues(quakeIndex, 1, 1, 5, 0); Quake_SetPerturbations(quakeIndex, 1, 1, 5, 0);
Quake_SetCountdown(quakeIndex, 10); Quake_SetDuration(quakeIndex, 10);
this->actionFunc = BgHeavyBlock_LiftedUp; this->actionFunc = BgHeavyBlock_LiftedUp;
} }
} }
@ -398,25 +399,25 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) {
Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F);
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 28000); Quake_SetSpeed(quakeIndex, 28000);
Quake_SetQuakeValues(quakeIndex, 14, 2, 100, 0); Quake_SetPerturbations(quakeIndex, 14, 2, 100, 0);
Quake_SetCountdown(quakeIndex, 30); Quake_SetDuration(quakeIndex, 30);
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 2); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_2);
Quake_SetSpeed(quakeIndex, 12000); Quake_SetSpeed(quakeIndex, 12000);
Quake_SetQuakeValues(quakeIndex, 5, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 5, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 999); Quake_SetDuration(quakeIndex, 999);
SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 30, NA_SE_EV_ELECTRIC_EXPLOSION); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 30, NA_SE_EV_ELECTRIC_EXPLOSION);
return; return;
case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE:
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 28000); Quake_SetSpeed(quakeIndex, 28000);
Quake_SetQuakeValues(quakeIndex, 16, 2, 120, 0); Quake_SetPerturbations(quakeIndex, 16, 2, 120, 0);
Quake_SetCountdown(quakeIndex, 40); Quake_SetDuration(quakeIndex, 40);
this->actionFunc = BgHeavyBlock_Land; this->actionFunc = BgHeavyBlock_Land;
Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F);
@ -424,18 +425,18 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) {
case HEAVYBLOCK_UNBREAKABLE: case HEAVYBLOCK_UNBREAKABLE:
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U);
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 28000); Quake_SetSpeed(quakeIndex, 28000);
Quake_SetQuakeValues(quakeIndex, 14, 2, 100, 0); Quake_SetPerturbations(quakeIndex, 14, 2, 100, 0);
Quake_SetCountdown(quakeIndex, 40); Quake_SetDuration(quakeIndex, 40);
this->actionFunc = BgHeavyBlock_Land; this->actionFunc = BgHeavyBlock_Land;
break; break;
default: default:
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 28000); Quake_SetSpeed(quakeIndex, 28000);
Quake_SetQuakeValues(quakeIndex, 14, 2, 100, 0); Quake_SetPerturbations(quakeIndex, 14, 2, 100, 0);
Quake_SetCountdown(quakeIndex, 40); Quake_SetDuration(quakeIndex, 40);
this->actionFunc = BgHeavyBlock_Land; this->actionFunc = BgHeavyBlock_Land;
} }

View file

@ -6,6 +6,7 @@
#include "z_bg_hidan_hamstep.h" #include "z_bg_hidan_hamstep.h"
#include "assets/objects/object_hidan_objects/object_hidan_objects.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h"
#include "quake.h"
#define FLAGS 0 #define FLAGS 0
@ -308,10 +309,10 @@ void func_80888860(BgHidanHamstep* this, PlayState* play) {
if (1) {} if (1) {}
if (this->unk_244 == 1) { if (this->unk_244 == 1) {
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, -15536); Quake_SetSpeed(quakeIndex, -15536);
Quake_SetQuakeValues(quakeIndex, 0, 0, 500, 0); Quake_SetPerturbations(quakeIndex, 0, 0, 500, 0);
Quake_SetCountdown(quakeIndex, 20); Quake_SetDuration(quakeIndex, 20);
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 255, 20, 150); Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 255, 20, 150);
func_80888638(this, play); func_80888638(this, play);
@ -367,10 +368,10 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) {
if (1) {} if (1) {}
if (this->unk_244 == 1) { if (this->unk_244 == 1) {
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, -15536); Quake_SetSpeed(quakeIndex, -15536);
Quake_SetQuakeValues(quakeIndex, 20, 1, 0, 0); Quake_SetPerturbations(quakeIndex, 20, 1, 0, 0);
Quake_SetCountdown(quakeIndex, 7); Quake_SetDuration(quakeIndex, 7);
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
Rumble_Request(SQ(100.0f), 255, 20, 150); Rumble_Request(SQ(100.0f), 255, 20, 150);

View file

@ -45,7 +45,7 @@ void BgInGate_Init(Actor* thisx, PlayState* play) {
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
if ((play->sceneId != SCENE_SPOT20 || !LINK_IS_ADULT) || if ((play->sceneId != SCENE_SPOT20 || !LINK_IS_ADULT) ||
(GET_EVENTCHKINF(EVENTCHKINF_18) && (gSaveContext.cutsceneIndex != 0xFFF0))) { (GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED) && (gSaveContext.cutsceneIndex != 0xFFF0))) {
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);
return; return;
} }

View file

@ -6,6 +6,7 @@
#include "z_bg_jya_kanaami.h" #include "z_bg_jya_kanaami.h"
#include "assets/objects/object_jya_obj/object_jya_obj.h" #include "assets/objects/object_jya_obj/object_jya_obj.h"
#include "quake.h"
#define FLAGS 0 #define FLAGS 0
@ -96,16 +97,17 @@ void func_8089993C(BgJyaKanaami* this) {
void func_80899950(BgJyaKanaami* this, PlayState* play) { void func_80899950(BgJyaKanaami* this, PlayState* play) {
s32 pad[2]; s32 pad[2];
s32 quakeId; s32 quakeIndex;
this->unk_168 += 0x20; this->unk_168 += 0x20;
if (Math_ScaledStepToS(&this->dyna.actor.world.rot.x, 0x4000, this->unk_168)) { if (Math_ScaledStepToS(&this->dyna.actor.world.rot.x, 0x4000, this->unk_168)) {
func_80899A08(this); func_80899A08(this);
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_TRAP_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_TRAP_BOUND);
quakeId = Quake_Add(GET_ACTIVE_CAM(play), 3);
Quake_SetSpeed(quakeId, 25000); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetQuakeValues(quakeId, 2, 0, 0, 0); Quake_SetSpeed(quakeIndex, 25000);
Quake_SetCountdown(quakeId, 16); Quake_SetPerturbations(quakeIndex, 2, 0, 0, 0);
Quake_SetDuration(quakeIndex, 16);
} }
} }

View file

@ -6,6 +6,7 @@
#include "z_bg_mori_bigst.h" #include "z_bg_mori_bigst.h"
#include "assets/objects/object_mori_objects/object_mori_objects.h" #include "assets/objects/object_mori_objects/object_mori_objects.h"
#include "quake.h"
#define FLAGS ACTOR_FLAG_4 #define FLAGS ACTOR_FLAG_4
@ -169,14 +170,15 @@ void BgMoriBigst_Fall(BgMoriBigst* this, PlayState* play) {
void BgMoriBigst_SetupLanding(BgMoriBigst* this, PlayState* play) { void BgMoriBigst_SetupLanding(BgMoriBigst* this, PlayState* play) {
s32 pad; s32 pad;
s32 quake; s32 quakeIndex;
BgMoriBigst_SetupAction(this, BgMoriBigst_Landing); BgMoriBigst_SetupAction(this, BgMoriBigst_Landing);
this->waitTimer = 18; this->waitTimer = 18;
quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
Quake_SetSpeed(quake, 25000); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetQuakeValues(quake, 5, 0, 0, 0); Quake_SetSpeed(quakeIndex, 25000);
Quake_SetCountdown(quake, 16); Quake_SetPerturbations(quakeIndex, 5, 0, 0, 0);
Quake_SetDuration(quakeIndex, 16);
} }
void BgMoriBigst_Landing(BgMoriBigst* this, PlayState* play) { void BgMoriBigst_Landing(BgMoriBigst* this, PlayState* play) {

View file

@ -6,6 +6,7 @@
#include "z_bg_mori_rakkatenjo.h" #include "z_bg_mori_rakkatenjo.h"
#include "assets/objects/object_mori_objects/object_mori_objects.h" #include "assets/objects/object_mori_objects/object_mori_objects.h"
#include "quake.h"
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5)
@ -146,7 +147,7 @@ void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, PlayState* play) {
static f32 bounceVel[] = { 4.0f, 1.5f, 0.4f, 0.1f }; static f32 bounceVel[] = { 4.0f, 1.5f, 0.4f, 0.1f };
s32 pad; s32 pad;
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
s32 quake; s32 quakeIndex;
Actor_MoveForward(thisx); Actor_MoveForward(thisx);
if ((thisx->velocity.y < 0.0f) && (thisx->world.pos.y <= 403.0f)) { if ((thisx->velocity.y < 0.0f) && (thisx->world.pos.y <= 403.0f)) {
@ -162,10 +163,11 @@ void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, PlayState* play) {
403.0f - (thisx->world.pos.y - 403.0f) * bounceVel[this->bounceCount] / fabsf(thisx->velocity.y); 403.0f - (thisx->world.pos.y - 403.0f) * bounceVel[this->bounceCount] / fabsf(thisx->velocity.y);
thisx->velocity.y = bounceVel[this->bounceCount]; thisx->velocity.y = bounceVel[this->bounceCount];
this->bounceCount++; this->bounceCount++;
quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
Quake_SetSpeed(quake, 50000); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetQuakeValues(quake, 5, 0, 0, 0); Quake_SetSpeed(quakeIndex, 50000);
Quake_SetCountdown(quake, 5); Quake_SetPerturbations(quakeIndex, 5, 0, 0, 0);
Quake_SetDuration(quakeIndex, 5);
} }
} }
} }

View file

@ -315,7 +315,7 @@ void BgPoEvent_BlockFall(BgPoEvent* this, PlayState* play) {
BgPoEvent_CheckBlock(this); BgPoEvent_CheckBlock(this);
} else { } else {
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
func_80033E88(&this->dyna.actor, play, 5, 5); Actor_RequestQuakeAndRumble(&this->dyna.actor, play, 5, 5);
func_80088B34(this->timer); func_80088B34(this->timer);
if (firstFall == 0) { if (firstFall == 0) {
firstFall = 1; firstFall = 1;

View file

@ -6,6 +6,7 @@
#include "z_bg_spot12_gate.h" #include "z_bg_spot12_gate.h"
#include "assets/objects/object_spot12_obj/object_spot12_obj.h" #include "assets/objects/object_spot12_obj/object_spot12_obj.h"
#include "quake.h"
#define FLAGS 0 #define FLAGS 0
@ -104,16 +105,18 @@ void func_808B317C(BgSpot12Gate* this) {
void func_808B318C(BgSpot12Gate* this, PlayState* play) { void func_808B318C(BgSpot12Gate* this, PlayState* play) {
s32 pad; s32 pad;
s32 var; s32 quakeIndex;
Math_StepToF(&this->dyna.actor.velocity.y, 1.6f, 0.03f); Math_StepToF(&this->dyna.actor.velocity.y, 1.6f, 0.03f);
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 200.0f, if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 200.0f,
this->dyna.actor.velocity.y)) { this->dyna.actor.velocity.y)) {
func_808B3274(this); func_808B3274(this);
var = Quake_Add(GET_ACTIVE_CAM(play), 3);
Quake_SetSpeed(var, -0x3CB0); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetQuakeValues(var, 3, 0, 0, 0); Quake_SetSpeed(quakeIndex, -0x3CB0);
Quake_SetCountdown(var, 0xC); Quake_SetPerturbations(quakeIndex, 3, 0, 0, 0);
Quake_SetDuration(quakeIndex, 12);
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP);
} else { } else {
func_8002F974(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); func_8002F974(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG);

View file

@ -110,7 +110,7 @@ s32 func_808B3AAC(BgSpot15Rrbox* this, PlayState* play) {
} }
if (rotY < 0x2000 && rotY > -0x6000) { if (rotY < 0x2000 && rotY > -0x6000) {
return GET_EVENTCHKINF(EVENTCHKINF_14); return GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE);
} }
return true; return true;
} }

View file

@ -41,7 +41,7 @@ void BgUmaJump_Init(Actor* thisx, PlayState* play) {
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
if (this->dyna.actor.params == 1) { if (this->dyna.actor.params == 1) {
if (!Flags_GetEventChkInf(EVENTCHKINF_18) && (DREG(1) == 0)) { if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0)) {
Actor_Kill(&this->dyna.actor); Actor_Kill(&this->dyna.actor);
return; return;
} }

View file

@ -552,7 +552,7 @@ void BossDodongo_Explode(BossDodongo* this, PlayState* play) {
this->actionFunc = BossDodongo_LayDown; this->actionFunc = BossDodongo_LayDown;
Audio_PlayActorSfx2(&this->actor, NA_SE_IT_BOMB_EXPLOSION); Audio_PlayActorSfx2(&this->actor, NA_SE_IT_BOMB_EXPLOSION);
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_DODO_K_DAMAGE); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_DODO_K_DAMAGE);
func_80033E88(&this->actor, play, 4, 10); Actor_RequestQuakeAndRumble(&this->actor, play, 4, 10);
this->health -= 2; this->health -= 2;
// make sure not to die from the bomb explosion // make sure not to die from the bomb explosion
@ -677,7 +677,7 @@ void BossDodongo_Walk(BossDodongo* this, PlayState* play) {
} }
if (this->subCamId == SUB_CAM_ID_DONE) { if (this->subCamId == SUB_CAM_ID_DONE) {
func_80033E88(&this->actor, play, 4, 10); Actor_RequestQuakeAndRumble(&this->actor, play, 4, 10);
} else { } else {
this->unk_1B6 = 10; this->unk_1B6 = 10;
Rumble_Override(0.0f, 180, 20, 100); Rumble_Override(0.0f, 180, 20, 100);
@ -758,7 +758,7 @@ void BossDodongo_Roll(BossDodongo* this, PlayState* play) {
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_DODO_K_ROLL - SFX_FLAG); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_DODO_K_ROLL - SFX_FLAG);
if ((this->unk_19E & 7) == 0) { if ((this->unk_19E & 7) == 0) {
Camera_AddQuake(&play->mainCamera, 2, 1, 8); Camera_RequestQuake(&play->mainCamera, 2, 1, 8);
} }
if (!(this->unk_19E & 1)) { if (!(this->unk_19E & 1)) {
@ -787,12 +787,12 @@ void BossDodongo_Roll(BossDodongo* this, PlayState* play) {
this->unk_228 = 9200.0f; this->unk_228 = 9200.0f;
this->actor.velocity.y = 20.0f; this->actor.velocity.y = 20.0f;
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_DODO_K_COLI); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_DODO_K_COLI);
Camera_AddQuake(&play->mainCamera, 2, 6, 8); Camera_RequestQuake(&play->mainCamera, 2, 6, 8);
sp50.x = this->actor.world.pos.x; sp50.x = this->actor.world.pos.x;
sp50.y = this->actor.world.pos.y + 60.0f; sp50.y = this->actor.world.pos.y + 60.0f;
sp50.z = this->actor.world.pos.z; sp50.z = this->actor.world.pos.z;
func_80033480(play, &sp50, 250.0f, 40, 800, 10, 0); func_80033480(play, &sp50, 250.0f, 40, 800, 10, 0);
func_80033E88(&this->actor, play, 6, 15); Actor_RequestQuakeAndRumble(&this->actor, play, 6, 15);
} else { } else {
this->actor.velocity.y = 15.0f; this->actor.velocity.y = 15.0f;
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_DODO_K_COLI2); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_DODO_K_COLI2);
@ -1395,7 +1395,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.world.pos.z, cornerPos->z + sp184.z, 1.0f, this->unk_1E4, 0.0f); Math_SmoothStepToF(&this->actor.world.pos.z, cornerPos->z + sp184.z, 1.0f, this->unk_1E4, 0.0f);
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_DODO_K_ROLL - SFX_FLAG); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_DODO_K_ROLL - SFX_FLAG);
if ((this->unk_19E & 7) == 0) { if ((this->unk_19E & 7) == 0) {
Camera_AddQuake(&play->mainCamera, 2, 1, 8); Camera_RequestQuake(&play->mainCamera, 2, 1, 8);
} }
if (!(this->unk_19E & 1)) { if (!(this->unk_19E & 1)) {
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 40.0f, 3, 8.0f, 500, 10, Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 40.0f, 3, 8.0f, 500, 10,

View file

@ -629,7 +629,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
this->holePosition.x = this->targetPosition.x; this->holePosition.x = this->targetPosition.x;
this->holePosition.z = this->targetPosition.z; this->holePosition.z = this->targetPosition.z;
func_80033E1C(play, 1, 0x50, 0x5000); Actor_RequestQuakeWithSpeed(play, 1, 80, 0x5000);
if (this->introState != BFD_CS_NONE) { if (this->introState != BFD_CS_NONE) {
this->timers[0] = 50; this->timers[0] = 50;
} else { } else {
@ -673,7 +673,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
this->timers[1] = 10; this->timers[1] = 10;
Audio_PlaySfxGeneral(NA_SE_EV_EXPLOSION, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_EV_EXPLOSION, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
func_80033E1C(play, 3, 0xA, 0x7530); Actor_RequestQuakeWithSpeed(play, 3, 10, 0x7530);
this->work[BFD_ROCK_TIMER] = 300; this->work[BFD_ROCK_TIMER] = 300;
} }
} else { } else {
@ -979,14 +979,14 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
if (this->work[BFD_ACTION_STATE] < BOSSFD_SKULL_FALL) { if (this->work[BFD_ACTION_STATE] < BOSSFD_SKULL_FALL) {
if ((this->actor.prevPos.y < 90.0f) && (90.0f <= this->actor.world.pos.y)) { if ((this->actor.prevPos.y < 90.0f) && (90.0f <= this->actor.world.pos.y)) {
this->timers[4] = 80; this->timers[4] = 80;
func_80033E1C(play, 1, 80, 0x5000); Actor_RequestQuakeWithSpeed(play, 1, 80, 0x5000);
this->work[BFD_ROAR_TIMER] = 40; this->work[BFD_ROAR_TIMER] = 40;
this->work[BFD_MANE_EMBERS_TIMER] = 30; this->work[BFD_MANE_EMBERS_TIMER] = 30;
this->work[BFD_SPLASH_TIMER] = 10; this->work[BFD_SPLASH_TIMER] = 10;
} }
if ((this->actor.prevPos.y > 90.0f) && (90.0f >= this->actor.world.pos.y)) { if ((this->actor.prevPos.y > 90.0f) && (90.0f >= this->actor.world.pos.y)) {
this->timers[4] = 80; this->timers[4] = 80;
func_80033E1C(play, 1, 80, 0x5000); Actor_RequestQuakeWithSpeed(play, 1, 80, 0x5000);
this->work[BFD_MANE_EMBERS_TIMER] = 30; this->work[BFD_MANE_EMBERS_TIMER] = 30;
this->work[BFD_SPLASH_TIMER] = 10; this->work[BFD_SPLASH_TIMER] = 10;
} }

View file

@ -243,7 +243,7 @@ void BossFd2_Emerge(BossFd2* this, PlayState* play) {
bossFd->faceExposed = 0; bossFd->faceExposed = 0;
bossFd->holePosition.x = this->actor.world.pos.x; bossFd->holePosition.x = this->actor.world.pos.x;
bossFd->holePosition.z = this->actor.world.pos.z; bossFd->holePosition.z = this->actor.world.pos.z;
func_80033E1C(play, 1, 0x32, 0x5000); Actor_RequestQuakeWithSpeed(play, 1, 50, 0x5000);
this->work[FD2_ACTION_STATE] = 1; this->work[FD2_ACTION_STATE] = 1;
this->work[FD2_HOLE_COUNTER]++; this->work[FD2_HOLE_COUNTER]++;
this->actor.world.pos.y = -200.0f; this->actor.world.pos.y = -200.0f;

View file

@ -1897,7 +1897,7 @@ void BossGanon_PoundFloor(BossGanon* this, PlayState* play) {
this->actor.world.pos.y = 60.0f; this->actor.world.pos.y = 60.0f;
this->unk_1C2 = 2; this->unk_1C2 = 2;
this->timers[0] = 10; this->timers[0] = 10;
func_80033E88(&this->actor, play, 0xA, 0x14); // rumble Actor_RequestQuakeAndRumble(&this->actor, play, 10, 20);
this->unk_19C = 35; this->unk_19C = 35;
this->unk_19E = 0; this->unk_19E = 0;
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GANON_HIT_GND_IMP); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GANON_HIT_GND_IMP);

View file

@ -170,7 +170,7 @@ void func_808FD4D4(BossGanon2* this, PlayState* play, s16 arg2, s16 arg3) {
} }
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_MGANON_WALK); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_MGANON_WALK);
func_80033E88(&this->actor, play, 2, 0xA); Actor_RequestQuakeAndRumble(&this->actor, play, 2, 10);
} }
void func_808FD5C4(BossGanon2* this, PlayState* play) { void func_808FD5C4(BossGanon2* this, PlayState* play) {
@ -2004,7 +2004,7 @@ void BossGanon2_Update(Actor* thisx, PlayState* play) {
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->actor.velocity.y < -5.0f) { if (this->actor.velocity.y < -5.0f) {
func_80033E88(&this->actor, play, 5, 20); Actor_RequestQuakeAndRumble(&this->actor, play, 5, 20);
func_80078884(NA_SE_IT_BOMB_EXPLOSION); func_80078884(NA_SE_IT_BOMB_EXPLOSION);
} }
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;

View file

@ -1309,7 +1309,7 @@ void BossGoma_FloorAttack(BossGoma* this, PlayState* play) {
if (Animation_OnFrame(&this->skelanime, 10.0f)) { if (Animation_OnFrame(&this->skelanime, 10.0f)) {
BossGoma_PlayEffectsAndSfx(this, play, 3, 5); BossGoma_PlayEffectsAndSfx(this, play, 3, 5);
func_80033E88(&this->actor, play, 5, 15); Actor_RequestQuakeAndRumble(&this->actor, play, 5, 15);
} }
if (Animation_OnFrame(&this->skelanime, Animation_GetLastFrame(&gGohmaAttackAnim))) { if (Animation_OnFrame(&this->skelanime, Animation_GetLastFrame(&gGohmaAttackAnim))) {
@ -1434,7 +1434,7 @@ void BossGoma_FallJump(BossGoma* this, PlayState* play) {
BossGoma_SetupFloorLand(this); BossGoma_SetupFloorLand(this);
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
BossGoma_PlayEffectsAndSfx(this, play, 0, 8); BossGoma_PlayEffectsAndSfx(this, play, 0, 8);
func_80033E88(&this->actor, play, 5, 0xF); Actor_RequestQuakeAndRumble(&this->actor, play, 5, 15);
} }
} }
@ -1451,7 +1451,7 @@ void BossGoma_FallStruckDown(BossGoma* this, PlayState* play) {
BossGoma_SetupFloorLandStruckDown(this); BossGoma_SetupFloorLandStruckDown(this);
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
BossGoma_PlayEffectsAndSfx(this, play, 0, 8); BossGoma_PlayEffectsAndSfx(this, play, 0, 8);
func_80033E88(&this->actor, play, 0xA, 0xF); Actor_RequestQuakeAndRumble(&this->actor, play, 10, 15);
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_DAM1); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOMA_DAM1);
} }
} }
@ -1847,7 +1847,7 @@ void BossGoma_UpdateHit(BossGoma* this, PlayState* play) {
} }
this->timer = 4; this->timer = 4;
func_80033E88(&this->actor, play, 4, 0xC); Actor_RequestQuakeAndRumble(&this->actor, play, 4, 12);
} }
} }
} }

View file

@ -550,8 +550,8 @@ void BossTw_Init(Actor* thisx, PlayState* play2) {
this->actor.colChkInfo.health = 24; this->actor.colChkInfo.health = 24;
this->actor.update = BossTw_TwinrovaUpdate; this->actor.update = BossTw_TwinrovaUpdate;
this->actor.draw = BossTw_TwinrovaDraw; this->actor.draw = BossTw_TwinrovaDraw;
SkelAnime_InitFlex(play, &this->skelAnime, &object_tw_Skel_032020, &object_tw_Anim_0244B4, NULL, NULL, 0); SkelAnime_InitFlex(play, &this->skelAnime, &gTwinrovaSkel, &gTwinrovaTPoseAnim, NULL, NULL, 0);
Animation_MorphToLoop(&this->skelAnime, &object_tw_Anim_0244B4, -3.0f); Animation_MorphToLoop(&this->skelAnime, &gTwinrovaTPoseAnim, -3.0f);
if (GET_EVENTCHKINF(EVENTCHKINF_75)) { if (GET_EVENTCHKINF(EVENTCHKINF_75)) {
// began twinrova battle // began twinrova battle
@ -807,7 +807,7 @@ s32 BossTw_BeamHitPlayerCheck(BossTw* this, PlayState* play) {
this->beamDist = sqrtf(SQ(offset.x) + SQ(offset.y) + SQ(offset.z)); this->beamDist = sqrtf(SQ(offset.x) + SQ(offset.y) + SQ(offset.z));
func_8002F6D4(play, &this->actor, 3.0f, this->actor.shape.rot.y, 0.0f, 0x20); func_8002F6D4(play, &this->actor, 3.0f, this->actor.shape.rot.y, 0.0f, 0x20);
if (this->actor.params == 0) { if (this->actor.params == TW_KOTAKE) {
if (sFreezeState == 0) { if (sFreezeState == 0) {
sFreezeState = 1; sFreezeState = 1;
} }
@ -1038,7 +1038,7 @@ void BossTw_ShootBeam(BossTw* this, PlayState* play) {
Math_ApproachF(&this->spawnPortalAlpha, 0, 1.0f, 30.0f); Math_ApproachF(&this->spawnPortalAlpha, 0, 1.0f, 30.0f);
} else { } else {
Math_ApproachF(&this->flameAlpha, 255.0f, 1.0f, 10.0f); Math_ApproachF(&this->flameAlpha, 255.0f, 1.0f, 10.0f);
if (this->actor.params == 1) { if (this->actor.params == TW_KOUME) {
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_TWINROBA_MS_FIRE - SFX_FLAG); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_TWINROBA_MS_FIRE - SFX_FLAG);
} else { } else {
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_TWINROBA_MS_FREEZE - SFX_FLAG); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_TWINROBA_MS_FREEZE - SFX_FLAG);
@ -1132,7 +1132,7 @@ void BossTw_ShootBeam(BossTw* this, PlayState* play) {
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->beamReflectionOrigin, &this->unk_54C, SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->beamReflectionOrigin, &this->unk_54C,
&this->actor.projectedW); &this->actor.projectedW);
if (this->actor.params == 1) { if (this->actor.params == TW_KOUME) {
Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_SHOOT_FIRE - SFX_FLAG, &this->unk_54C, 4, Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_SHOOT_FIRE - SFX_FLAG, &this->unk_54C, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} else { } else {
@ -1162,7 +1162,7 @@ void BossTw_ShootBeam(BossTw* this, PlayState* play) {
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->unk_530, &this->unk_558, SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->unk_530, &this->unk_558,
&this->actor.projectedW); &this->actor.projectedW);
if (this->actor.params == 1) { if (this->actor.params == TW_KOUME) {
Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_SHOOT_FIRE - SFX_FLAG, &this->unk_558, 4U, Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_SHOOT_FIRE - SFX_FLAG, &this->unk_558, 4U,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_REFL_FIRE - SFX_FLAG, &this->unk_558, 4, Audio_PlaySfxGeneral(NA_SE_EN_TWINROBA_REFL_FIRE - SFX_FLAG, &this->unk_558, 4,
@ -1344,7 +1344,7 @@ void BossTw_SetupHitByBeam(BossTw* this, PlayState* play) {
this->timers[0] = 53; this->timers[0] = 53;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
if (this->actor.params == 0) { if (this->actor.params == TW_KOTAKE) {
this->work[FOG_TIMER] = 20; this->work[FOG_TIMER] = 20;
} }
} }
@ -1369,11 +1369,11 @@ void BossTw_HitByBeam(BossTw* this, PlayState* play) {
accel.y = 0.1f; accel.y = 0.1f;
accel.z = 0.0f; accel.z = 0.0f;
BossTw_AddDmgCloud(play, this->actor.params + 2, &pos, &velocity, &accel, Rand_ZeroFloat(10.0f) + 15.0f, 0, 0, BossTw_AddDmgCloud(play, this->actor.params + TWEFF_2, &pos, &velocity, &accel, Rand_ZeroFloat(10.0f) + 15.0f,
150); 0, 0, 150);
} }
if (this->actor.params == 1) { if (this->actor.params == TW_KOUME) {
Math_ApproachF(&this->fogR, 255.0f, 1.0f, 30.0f); Math_ApproachF(&this->fogR, 255.0f, 1.0f, 30.0f);
Math_ApproachF(&this->fogG, 255.0f, 1.0f, 30.0f); Math_ApproachF(&this->fogG, 255.0f, 1.0f, 30.0f);
Math_ApproachF(&this->fogB, 255.0f, 1.0f, 30.0f); Math_ApproachF(&this->fogB, 255.0f, 1.0f, 30.0f);
@ -1636,8 +1636,8 @@ void BossTw_TwinrovaMergeCS(BossTw* this, PlayState* play) {
BossTw_SetupWait(sKotakePtr, play); BossTw_SetupWait(sKotakePtr, play);
BossTw_SetupWait(sKoumePtr, play); BossTw_SetupWait(sKoumePtr, play);
Actor_SetScale(&this->actor, 0.0f); Actor_SetScale(&this->actor, 0.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &object_tw_Anim_038E2C, 0.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaIntroAnim, 0.0f);
this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&object_tw_Anim_038E2C); this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&gTwinrovaIntroAnim);
this->timers[0] = 50; this->timers[0] = 50;
func_8002DF54(play, &this->actor, 2); func_8002DF54(play, &this->actor, 2);
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_TWINROBA_TRANSFORM); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_TWINROBA_TRANSFORM);
@ -1651,7 +1651,7 @@ void BossTw_TwinrovaMergeCS(BossTw* this, PlayState* play) {
case 1: case 1:
if (Animation_OnFrame(&this->skelAnime, this->workf[ANIM_SW_TGT])) { if (Animation_OnFrame(&this->skelAnime, this->workf[ANIM_SW_TGT])) {
Animation_MorphToLoop(&this->skelAnime, &object_tw_Anim_032BF8, -15.0f); Animation_MorphToLoop(&this->skelAnime, &gTwinrovaHoverAnim, -15.0f);
} }
sEnvType = -1; sEnvType = -1;
@ -2214,7 +2214,7 @@ void BossTw_TwinrovaIntroCS(BossTw* this, PlayState* play) {
play->envCtx.prevLightSetting = 1; play->envCtx.prevLightSetting = 1;
play->envCtx.lightSetting = 1; play->envCtx.lightSetting = 1;
play->envCtx.lightBlend = 0.0f; play->envCtx.lightBlend = 0.0f;
TitleCard_InitBossName(play, &play->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(object_tw_Blob_02E170), TitleCard_InitBossName(play, &play->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gTwinrovaTitleCardTex),
0xA0, 0xB4, 0x80, 0x28); 0xA0, 0xB4, 0x80, 0x28);
SET_EVENTCHKINF(EVENTCHKINF_75); SET_EVENTCHKINF(EVENTCHKINF_75);
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_BOSS); SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_BOSS);
@ -2337,7 +2337,7 @@ void BossTw_DeathBall(BossTw* this, PlayState* play) {
} }
} }
if (this->actor.params == 0x69) { if (this->actor.params == TW_DEATHBALL_KOUME) {
this->targetPos.x = sKoumePtr->actor.world.pos.x; this->targetPos.x = sKoumePtr->actor.world.pos.x;
this->targetPos.z = sKoumePtr->actor.world.pos.z; this->targetPos.z = sKoumePtr->actor.world.pos.z;
} else { } else {
@ -2369,7 +2369,7 @@ void BossTw_DeathBall(BossTw* this, PlayState* play) {
void BossTw_TwinrovaSetupDeathCS(BossTw* this, PlayState* play) { void BossTw_TwinrovaSetupDeathCS(BossTw* this, PlayState* play) {
this->actionFunc = BossTw_TwinrovaDeathCS; this->actionFunc = BossTw_TwinrovaDeathCS;
Animation_MorphToLoop(&this->skelAnime, &object_tw_Anim_024374, -3.0f); Animation_MorphToLoop(&this->skelAnime, &gTwinrovaDamageAnim, -3.0f);
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
this->csState2 = this->csState1 = 0; this->csState2 = this->csState1 = 0;
@ -2622,7 +2622,7 @@ void BossTw_TwinrovaDeathCS(BossTw* this, PlayState* play) {
switch (this->csState1) { switch (this->csState1) {
case 0: case 0:
if (this->work[CS_TIMER_1] == 15) { if (this->work[CS_TIMER_1] == 15) {
Animation_MorphToPlayOnce(&this->skelAnime, &object_tw_Anim_0216DC, -3.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaDeathAnim, -3.0f);
} }
if (this->work[CS_TIMER_1] >= 15) { if (this->work[CS_TIMER_1] >= 15) {
@ -2910,7 +2910,7 @@ void BossTw_Update(Actor* thisx, PlayState* play) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
} }
if (this->actor.params == 0) { if (this->actor.params == TW_KOTAKE) {
this->workf[OUTR_CRWN_TX_X2] += 1.0f; this->workf[OUTR_CRWN_TX_X2] += 1.0f;
this->workf[OUTR_CRWN_TX_Y2] -= 7.0f; this->workf[OUTR_CRWN_TX_Y2] -= 7.0f;
this->workf[INNR_CRWN_TX_Y1] += 1.0f; this->workf[INNR_CRWN_TX_Y1] += 1.0f;
@ -3180,7 +3180,7 @@ s32 BossTw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
if (limbIndex == 21) { if (limbIndex == 21) {
if (this->unk_5F8 == 0) { if (this->unk_5F8 == 0) {
if (this->actor.params == 0) { if (this->actor.params == TW_KOTAKE) {
*dList = object_tw_DL_012CE0; *dList = object_tw_DL_012CE0;
} else { } else {
*dList = object_tw_DL_0134B8; *dList = object_tw_DL_0134B8;
@ -3192,7 +3192,7 @@ s32 BossTw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
if (this->actionFunc == BossTw_DeathCS) { if (this->actionFunc == BossTw_DeathCS) {
*dList = NULL; *dList = NULL;
} else if (this->scepterAlpha == 0.0f) { } else if (this->scepterAlpha == 0.0f) {
if (this->actor.params == 0) { if (this->actor.params == TW_KOTAKE) {
*dList = object_tw_DL_012B38; *dList = object_tw_DL_012B38;
} else { } else {
*dList = object_tw_DL_013310; *dList = object_tw_DL_013310;
@ -3222,7 +3222,7 @@ void BossTw_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot
if (this->unk_5F8 != 0) { if (this->unk_5F8 != 0) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6190), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6190),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
if (this->actor.params == 0) { if (this->actor.params == TW_KOTAKE) {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_013AE8)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_013AE8));
} else { } else {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_013D68)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_013D68));
@ -3239,7 +3239,7 @@ void BossTw_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot
if (this->scepterAlpha > 0.0f) { if (this->scepterAlpha > 0.0f) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6221), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6221),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
if (this->actor.params == 0) { if (this->actor.params == TW_KOTAKE) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 225, 255, (s16)this->scepterAlpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 225, 255, (s16)this->scepterAlpha);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_013E98)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_013E98));
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (s16)this->scepterAlpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (s16)this->scepterAlpha);
@ -3270,7 +3270,7 @@ void func_80941BC0(BossTw* this, PlayState* play) {
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s16)this->workf[UNK_F11]); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s16)this->workf[UNK_F11]);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 40, 30, 80); gDPSetEnvColor(POLY_XLU_DISP++, 0, 40, 30, 80);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01BC00)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIcePoolDL));
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 215, 215, 215, (s16)this->workf[UNK_F11] * this->workf[UNK_F14]); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 215, 215, 215, (s16)this->workf[UNK_F11] * this->workf[UNK_F14]);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 128); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 128);
gSPSegment(POLY_XLU_DISP++, 8, gSPSegment(POLY_XLU_DISP++, 8,
@ -3280,7 +3280,7 @@ void func_80941BC0(BossTw* this, PlayState* play) {
Matrix_RotateY(this->workf[UNK_F15], MTXMODE_APPLY); Matrix_RotateY(this->workf[UNK_F15], MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6423), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6423),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01C1C0)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIcePoolShineDL));
Matrix_Pop(); Matrix_Pop();
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6427), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6427),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
@ -3295,7 +3295,7 @@ void func_80941BC0(BossTw* this, PlayState* play) {
GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA), GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA),
G_RM_ZB_OVL_SURF2); G_RM_ZB_OVL_SURF2);
gSPSetGeometryMode(POLY_XLU_DISP++, G_CULL_BACK | G_FOG); gSPSetGeometryMode(POLY_XLU_DISP++, G_CULL_BACK | G_FOG);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A790)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaEffectHaloDL));
Matrix_Pop(); Matrix_Pop();
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6461); CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 6461);
@ -3319,7 +3319,7 @@ void func_80942180(BossTw* this, PlayState* play) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 100, 40, 00, (s16)this->workf[KM_GRND_CRTR_A]); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 100, 40, 00, (s16)this->workf[KM_GRND_CRTR_A]);
gDPPipeSync(POLY_XLU_DISP++); gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 245, 255, 128); gDPSetEnvColor(POLY_XLU_DISP++, 255, 245, 255, 128);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_019D40)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaFirePoolDL));
Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6514), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6514),
@ -3331,7 +3331,7 @@ void func_80942180(BossTw* this, PlayState* play) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 80, 0, 0, (s16)this->workf[KM_GD_SMOKE_A]); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 80, 0, 0, (s16)this->workf[KM_GD_SMOKE_A]);
gDPPipeSync(POLY_XLU_DISP++); gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 100); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 100);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_018FC0)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaFireSmokeDL));
gSPSegment(POLY_XLU_DISP++, 8, gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (-this->work[CS_TIMER_1] * 3) & 0x7F, 0, 0x20, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (-this->work[CS_TIMER_1] * 3) & 0x7F, 0, 0x20,
@ -3342,7 +3342,7 @@ void func_80942180(BossTw* this, PlayState* play) {
Matrix_Scale(this->workf[KM_GD_FLM_SCL], this->workf[KM_GD_FLM_SCL], this->workf[KM_GD_FLM_SCL], MTXMODE_APPLY); Matrix_Scale(this->workf[KM_GD_FLM_SCL], this->workf[KM_GD_FLM_SCL], this->workf[KM_GD_FLM_SCL], MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6575), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6575),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_019938)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaBigFlameDL));
Matrix_Pop(); Matrix_Pop();
@ -3366,19 +3366,19 @@ void func_809426F0(BossTw* this, PlayState* play) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6614), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6614),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
if (this->actor.params == 0) { if (this->actor.params == TW_KOTAKE) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 135, 175, 165, (s16)this->spawnPortalAlpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 135, 175, 165, (s16)this->spawnPortalAlpha);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01CEE0)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaKotakeMagicSigilDL));
} else { } else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 0, (s16)this->spawnPortalAlpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 0, (s16)this->spawnPortalAlpha);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01DBE8)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaKoumeMagicSigilDL));
} }
Matrix_Pop(); Matrix_Pop();
if (this->actor.params == 0) { if (this->actor.params == TW_KOTAKE) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (s16)this->flameAlpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (s16)this->flameAlpha);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A998)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceMaterialDL));
} else { } else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, (s16)this->flameAlpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, (s16)this->flameAlpha);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 215, 255, 128); gDPSetEnvColor(POLY_XLU_DISP++, 255, 215, 255, 128);
@ -3397,7 +3397,7 @@ void func_809426F0(BossTw* this, PlayState* play) {
Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6751), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6751),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A430)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaFireDL));
Matrix_Pop(); Matrix_Pop();
} }
@ -3416,7 +3416,7 @@ void func_80942C70(Actor* thisx, PlayState* play) {
Gfx_TexScroll(play->state.gfxCtx, 0, (u8)(this->work[CS_TIMER_1] * -0xF), 0x20, 0x40)); Gfx_TexScroll(play->state.gfxCtx, 0, (u8)(this->work[CS_TIMER_1] * -0xF), 0x20, 0x40));
alpha = this->beamScale * 100.0f * 255.0f; alpha = this->beamScale * 100.0f * 255.0f;
if (this->actor.params == 1) { if (this->actor.params == TW_KOUME) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 60, alpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 60, alpha);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128);
} else { } else {
@ -3431,7 +3431,7 @@ void func_80942C70(Actor* thisx, PlayState* play) {
Matrix_Scale(this->beamScale, this->beamScale, (this->beamDist * 0.01f * 98.0f) / 20000.0f, MTXMODE_APPLY); Matrix_Scale(this->beamScale, this->beamScale, (this->beamDist * 0.01f * 98.0f) / 20000.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6846), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6846),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01DDF0)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaBeamDL));
if (this->beamReflectionDist > 10.0f) { if (this->beamReflectionDist > 10.0f) {
Matrix_Translate(this->beamReflectionOrigin.x, this->beamReflectionOrigin.y, this->beamReflectionOrigin.z, Matrix_Translate(this->beamReflectionOrigin.x, this->beamReflectionOrigin.y, this->beamReflectionOrigin.z,
@ -3443,7 +3443,7 @@ void func_80942C70(Actor* thisx, PlayState* play) {
MTXMODE_APPLY); MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6870), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6870),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01DDF0)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaBeamDL));
} }
Matrix_Pop(); Matrix_Pop();
@ -3463,7 +3463,7 @@ void func_80943028(Actor* thisx, PlayState* play) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6908), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 6908),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01F608)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaHaloDL));
Gfx_SetupDL_44Xlu(play->state.gfxCtx); Gfx_SetupDL_44Xlu(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 200); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 200);
Matrix_Translate(this->actor.world.pos.x, 240.0f, this->actor.world.pos.z, MTXMODE_NEW); Matrix_Translate(this->actor.world.pos.x, 240.0f, this->actor.world.pos.z, MTXMODE_NEW);
@ -3564,10 +3564,10 @@ void BossTw_Draw(Actor* thisx, PlayState* play2) {
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 7123); CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 7123);
} }
void* D_8094A9B0[] = { void* sTwinrovaEyeTextures[] = {
object_tw_Tex_02A9B0, gTwinrovaEyeOpenTex,
object_tw_Tex_02A070, gTwinrovaEyeHalfTex,
object_tw_Tex_02A470, gTwinrovaEyeClosedTex,
}; };
s32 BossTw_TwinrovaOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { s32 BossTw_TwinrovaOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
@ -3576,53 +3576,53 @@ s32 BossTw_TwinrovaOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList,
OPEN_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 7139); OPEN_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 7139);
switch (limbIndex) { switch (limbIndex) {
case 21: case TWINROVA_LIMB_HEAD:
gSPSegment(POLY_OPA_DISP++, 0xC, gSPSegment(POLY_OPA_DISP++, 0xC,
Gfx_TexScroll(play->state.gfxCtx, 0, (s16)(f32)this->work[CS_TIMER_1], 8, 8)); Gfx_TexScroll(play->state.gfxCtx, 0, (s16)(f32)this->work[CS_TIMER_1], 8, 8));
gSPSegment(POLY_OPA_DISP++, 8, SEGMENTED_TO_VIRTUAL(D_8094A9B0[this->eyeTexIdx])); gSPSegment(POLY_OPA_DISP++, 8, SEGMENTED_TO_VIRTUAL(sTwinrovaEyeTextures[this->eyeTexIdx]));
gSPSegment(POLY_OPA_DISP++, 9, SEGMENTED_TO_VIRTUAL(D_8094A9B0[this->leftEyeTexIdx])); gSPSegment(POLY_OPA_DISP++, 9, SEGMENTED_TO_VIRTUAL(sTwinrovaEyeTextures[this->leftEyeTexIdx]));
gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, this->work[UNK_S8]); gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, this->work[UNK_S8]);
break; break;
case 17: case TWINROVA_LIMB_HAIR_FIRE_JET:
case 41: case TWINROVA_LIMB_BROOM_FIRE_JET:
*dList = NULL; *dList = NULL;
gSPSegment(POLY_XLU_DISP++, 0xA, gSPSegment(POLY_XLU_DISP++, 0xA,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x20, 1, 0, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x20, 1, 0,
-this->work[CS_TIMER_1] * 0xF, 0x20, 0x40)); -this->work[CS_TIMER_1] * 0xF, 0x20, 0x40));
break; break;
case 18: case TWINROVA_LIMB_HAIR_FIRE_TRAIL:
case 42: case TWINROVA_LIMB_BROOM_FIRE_TRAIL:
*dList = NULL; *dList = NULL;
gSPSegment(POLY_XLU_DISP++, 0xB, gSPSegment(POLY_XLU_DISP++, 0xB,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x20, 1, 0, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x20, 1, 0,
-this->work[CS_TIMER_1] * 0xA, 0x20, 0x40)); -this->work[CS_TIMER_1] * 0xA, 0x20, 0x40));
break; break;
case 16: case TWINROVA_LIMB_HAIR_ICE_JET:
case 32: case TWINROVA_LIMB_BROOM_ICE_JET:
*dList = NULL; *dList = NULL;
gSPSegment(POLY_XLU_DISP++, 8, gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x20, 1, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x20, 1,
this->work[CS_TIMER_1], -this->work[CS_TIMER_1] * 7, 0x20, 0x40)); this->work[CS_TIMER_1], -this->work[CS_TIMER_1] * 7, 0x20, 0x40));
break; break;
case 15: case TWINROVA_LIMB_HAIR_ICE_TRAIL:
case 31: case TWINROVA_LIMB_BROOM_ICE_TRAIL:
*dList = NULL; *dList = NULL;
gSPSegment(POLY_XLU_DISP++, 9, Gfx_TexScroll(play->state.gfxCtx, 0, this->work[CS_TIMER_1], 0x20, 0x40)); gSPSegment(POLY_XLU_DISP++, 9, Gfx_TexScroll(play->state.gfxCtx, 0, this->work[CS_TIMER_1], 0x20, 0x40));
break; break;
case 19: case TWINROVA_LIMB_LEFT_HAIR_BUN:
if (this->unk_5F8 != 0) { if (this->unk_5F8 != 0) {
*dList = object_tw_DL_02D940; *dList = gTwinrovaLeftHairBunDL;
} }
break; break;
case 20: case TWINROVA_LIMB_RIGHT_HAIR_BUN:
if (this->unk_5F8 != 0) { if (this->unk_5F8 != 0) {
*dList = object_tw_DL_02D890; *dList = gTwinrovaRightHairBunDL;
} }
break; break;
} }
if (this->unk_5F8 != 0 && ((limbIndex == 34) || (limbIndex == 40))) { if ((this->unk_5F8 != 0) && ((limbIndex == TWINROVA_LIMB_LEFT_BROOM) || (limbIndex == TWINROVA_LIMB_RIGHT_BROOM))) {
*dList = NULL; *dList = NULL;
} }
@ -3642,24 +3642,24 @@ void BossTw_TwinrovaPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve
OPEN_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 7262); OPEN_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 7262);
switch (limbIndex) { switch (limbIndex) {
case 34: case TWINROVA_LIMB_LEFT_BROOM:
Matrix_MultVec3f(&D_8094A9D4, &this->leftScepterPos); Matrix_MultVec3f(&D_8094A9D4, &this->leftScepterPos);
break; break;
case 40: case TWINROVA_LIMB_RIGHT_BROOM:
Matrix_MultVec3f(&D_8094A9E0, &this->rightScepterPos); Matrix_MultVec3f(&D_8094A9E0, &this->rightScepterPos);
break; break;
case 21: case TWINROVA_LIMB_HEAD:
Matrix_MultVec3f(&D_8094A9BC, &this->actor.focus.pos); Matrix_MultVec3f(&D_8094A9BC, &this->actor.focus.pos);
Matrix_MultVec3f(&D_8094A9C8, &this->crownPos); Matrix_MultVec3f(&D_8094A9C8, &this->crownPos);
break; break;
case 15: case TWINROVA_LIMB_HAIR_ICE_TRAIL:
case 16: case TWINROVA_LIMB_HAIR_ICE_JET:
case 17: case TWINROVA_LIMB_HAIR_FIRE_JET:
case 18: case TWINROVA_LIMB_HAIR_FIRE_TRAIL:
case 31: case TWINROVA_LIMB_BROOM_ICE_TRAIL:
case 32: case TWINROVA_LIMB_BROOM_ICE_JET:
case 41: case TWINROVA_LIMB_BROOM_FIRE_JET:
case 42: case TWINROVA_LIMB_BROOM_FIRE_TRAIL:
Matrix_Push(); Matrix_Push();
Matrix_Scale(this->workf[UNK_F12], this->workf[UNK_F12], this->workf[UNK_F12], MTXMODE_APPLY); Matrix_Scale(this->workf[UNK_F12], this->workf[UNK_F12], this->workf[UNK_F12], MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7295), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7295),
@ -3718,21 +3718,21 @@ void BossTw_ShieldChargeDraw(BossTw* this, PlayState* play) {
temp_a0 = (Math_SinS(this->work[CS_TIMER_1] * 2730 * temp_t0) * D_8094C854 * 0.5f) + (D_8094C854 * 0.5f); temp_a0 = (Math_SinS(this->work[CS_TIMER_1] * 2730 * temp_t0) * D_8094C854 * 0.5f) + (D_8094C854 * 0.5f);
if (sShieldFireCharge != 0) { if (sShieldFireCharge != 0) {
gDPSetEnvColor(POLY_XLU_DISP++, 255, 245, 255, temp_a0); gDPSetEnvColor(POLY_XLU_DISP++, 255, 245, 255, temp_a0);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01E0E0)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaMirrorShieldFireChargeSidesDL));
gSPSegment(POLY_XLU_DISP++, 8, gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (this->work[CS_TIMER_1] * 2) * temp_t0, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (this->work[CS_TIMER_1] * 2) * temp_t0,
0, 0x20, 0x20, 1, (-this->work[CS_TIMER_1] * 2) * temp_t0, 0, 0x20, 0x20)); 0, 0x20, 0x20, 1, (-this->work[CS_TIMER_1] * 2) * temp_t0, 0, 0x20, 0x20));
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 100, 20, 0, (s16)D_8094C854); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 100, 20, 0, (s16)D_8094C854);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01E020)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaMirrorShieldFireChargeCenterDL));
} else { } else {
gDPSetEnvColor(POLY_XLU_DISP++, 225, 255, 255, temp_a0); gDPSetEnvColor(POLY_XLU_DISP++, 225, 255, 255, temp_a0);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01E3A0)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaMirrorShieldIceChargeSidesDL));
gSPSegment(POLY_XLU_DISP++, 8, gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0,
(-this->work[CS_TIMER_1] * 5) * temp_t0, 0x20, 0x40, 1, (-this->work[CS_TIMER_1] * 5) * temp_t0, 0x20, 0x40, 1,
(this->work[CS_TIMER_1] * 4) * temp_t0, 0, 0x20, 0x20)); (this->work[CS_TIMER_1] * 4) * temp_t0, 0, 0x20, 0x20));
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 175, 205, 195, (s16)D_8094C854); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 175, 205, 195, (s16)D_8094C854);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01E2C0)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaMirrorShieldIceChargeCenterDL));
} }
} }
} }
@ -3767,7 +3767,7 @@ void BossTw_ShieldChargeDraw(BossTw* this, PlayState* play) {
gSPSegment(POLY_XLU_DISP++, 8, gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, this->work[CS_TIMER_1] * D_8094C872, 0x20, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, this->work[CS_TIMER_1] * D_8094C872, 0x20,
0x40, 1, 0, this->work[CS_TIMER_1] * D_8094C872, 0x20, 0x20)); 0x40, 1, 0, this->work[CS_TIMER_1] * D_8094C872, 0x20, 0x20));
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01E9F0)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaShieldAbsorbAndReflectEffectDL));
} }
Matrix_Pop(); Matrix_Pop();
@ -3792,28 +3792,28 @@ void BossTw_SpawnPortalDraw(BossTw* this, PlayState* play) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, (s16)this->spawnPortalAlpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, (s16)this->spawnPortalAlpha);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7582), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7582),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01EC68)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaSpawnPortalShadowDL));
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 135, 175, 165, (s16)this->spawnPortalAlpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 135, 175, 165, (s16)this->spawnPortalAlpha);
Matrix_Translate(0.0f, 2.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, 2.0f, 0.0f, MTXMODE_APPLY);
Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY); Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7596), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7596),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01CEE0)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaKotakeMagicSigilDL));
Matrix_Translate(0.0f, 232.0f, 600.0f, MTXMODE_NEW); Matrix_Translate(0.0f, 232.0f, 600.0f, MTXMODE_NEW);
Matrix_Scale(this->spawnPortalScale, this->spawnPortalScale, this->spawnPortalScale, MTXMODE_APPLY); Matrix_Scale(this->spawnPortalScale, this->spawnPortalScale, this->spawnPortalScale, MTXMODE_APPLY);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, (s16)this->spawnPortalAlpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, (s16)this->spawnPortalAlpha);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7617), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7617),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01EC68)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaSpawnPortalShadowDL));
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 0, (s16)this->spawnPortalAlpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 0, (s16)this->spawnPortalAlpha);
Matrix_Translate(0.0f, 2.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, 2.0f, 0.0f, MTXMODE_APPLY);
Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY); Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7631), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7631),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01DBE8)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaKoumeMagicSigilDL));
Matrix_Pop(); Matrix_Pop();
@ -3833,7 +3833,7 @@ void func_80944C50(BossTw* this, PlayState* play) {
Matrix_Scale(this->workf[UNK_F19], this->workf[UNK_F19], this->workf[UNK_F19], MTXMODE_APPLY); Matrix_Scale(this->workf[UNK_F19], this->workf[UNK_F19], this->workf[UNK_F19], MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7671), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7671),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01F390)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaLightCircleDL));
Matrix_Pop(); Matrix_Pop();
gSPSegment(POLY_XLU_DISP++, 8, gSPSegment(POLY_XLU_DISP++, 8,
@ -3842,7 +3842,7 @@ void func_80944C50(BossTw* this, PlayState* play) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s16)this->workf[UNK_F18] / 2); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s16)this->workf[UNK_F18] / 2);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7694), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7694),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01F238)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaLightRaysDL));
gSPSegment(POLY_XLU_DISP++, 8, gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, -sKoumePtr->work[CS_TIMER_1] * 5, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, -sKoumePtr->work[CS_TIMER_1] * 5,
@ -3856,7 +3856,7 @@ void func_80944C50(BossTw* this, PlayState* play) {
Matrix_Scale(scale, 1.0f, scale, MTXMODE_APPLY); Matrix_Scale(scale, 1.0f, scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7728), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 7728),
G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH); G_MTX_LOAD | G_MTX_MODELVIEW | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01EEB0)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaLightPillarDL));
Matrix_Pop(); Matrix_Pop();
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 7732); CLOSE_DISPS(play->state.gfxCtx, "../z_boss_tw.c", 7732);
@ -4253,13 +4253,14 @@ void BossTw_BlastIce(BossTw* this, PlayState* play) {
accel.x = 0.0f; accel.x = 0.0f;
accel.y = 0.13f; accel.y = 0.13f;
accel.z = 0.0f; accel.z = 0.0f;
BossTw_AddDmgCloud(play, 3, &pos, &velocity, &accel, Rand_ZeroFloat(5.0f) + 20.0f, 0, 0, 80); BossTw_AddDmgCloud(play, TWEFF_3, &pos, &velocity, &accel, Rand_ZeroFloat(5.0f) + 20.0f, 0, 0, 80);
velocity.x = Rand_CenteredFloat(10.0f); velocity.x = Rand_CenteredFloat(10.0f);
velocity.z = Rand_CenteredFloat(10.0f); velocity.z = Rand_CenteredFloat(10.0f);
velocity.y = Rand_ZeroFloat(3.0f) + 3.0f; velocity.y = Rand_ZeroFloat(3.0f) + 3.0f;
pos.x = sKotakePtr->groundBlastPos2.x + (velocity.x * 0.5f); pos.x = sKotakePtr->groundBlastPos2.x + (velocity.x * 0.5f);
pos.z = sKotakePtr->groundBlastPos2.z + (velocity.z * 0.5f); pos.z = sKotakePtr->groundBlastPos2.z + (velocity.z * 0.5f);
BossTw_AddDmgCloud(play, 3, &pos, &velocity, &accel, Rand_ZeroFloat(5.0f) + 15.0f, 255, 2, 130); BossTw_AddDmgCloud(play, TWEFF_3, &pos, &velocity, &accel, Rand_ZeroFloat(5.0f) + 15.0f, 255, 2,
130);
} }
Math_ApproachF(&sKotakePtr->workf[UNK_F9], 80.0f, 1.0f, 3.0f); Math_ApproachF(&sKotakePtr->workf[UNK_F9], 80.0f, 1.0f, 3.0f);
@ -4292,7 +4293,8 @@ void BossTw_BlastIce(BossTw* this, PlayState* play) {
accel.x = 0.0f; accel.x = 0.0f;
accel.y = 0.13f; accel.y = 0.13f;
accel.z = 0.0f; accel.z = 0.0f;
BossTw_AddDmgCloud(play, 3, &pos, &velocity, &accel, Rand_ZeroFloat(5.0f) + 20, 0, 0, 80); BossTw_AddDmgCloud(play, TWEFF_3, &pos, &velocity, &accel, Rand_ZeroFloat(5.0f) + 20, 0, 0,
80);
} }
} }
sp80 = 3.0f; sp80 = 3.0f;
@ -4456,7 +4458,7 @@ void BossTw_BlastDraw(Actor* thisx, PlayState* play2) {
Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 8865), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 8865),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A430)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaFireDL));
} }
break; break;
@ -4465,7 +4467,7 @@ void BossTw_BlastDraw(Actor* thisx, PlayState* play2) {
case TW_ICE_BLAST: case TW_ICE_BLAST:
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (s8)this->workf[TAIL_ALPHA]); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (s8)this->workf[TAIL_ALPHA]);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A998)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceMaterialDL));
for (i = 9; i >= 0; i--) { for (i = 9; i >= 0; i--) {
gSPSegment(POLY_XLU_DISP++, 8, gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll( Gfx_TwoTexScroll(
@ -4480,7 +4482,7 @@ void BossTw_BlastDraw(Actor* thisx, PlayState* play2) {
Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 9004), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 9004),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01AB00)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceModelDL));
} }
break; break;
@ -4520,11 +4522,11 @@ void BossTw_DrawDeathBall(Actor* thisx, PlayState* play2) {
Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 9071), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 9071),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A430)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaFireDL));
} }
} else { } else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (s8)this->workf[TAIL_ALPHA]); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (s8)this->workf[TAIL_ALPHA]);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A998)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceMaterialDL));
for (i = 9; i >= 0; i--) { for (i = 9; i >= 0; i--) {
gSPSegment(POLY_XLU_DISP++, 8, gSPSegment(POLY_XLU_DISP++, 8,
@ -4540,7 +4542,7 @@ void BossTw_DrawDeathBall(Actor* thisx, PlayState* play2) {
Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 9107), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_tw.c", 9107),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01AB00)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceModelDL));
} }
} }
@ -4573,7 +4575,7 @@ void BossTw_UpdateEffects(PlayState* play) {
Actor* unk44; Actor* unk44;
for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) { for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) {
if (eff->type != 0) { if (eff->type != TWEFF_NONE) {
eff->pos.x += eff->curSpeed.x; eff->pos.x += eff->curSpeed.x;
eff->pos.y += eff->curSpeed.y; eff->pos.y += eff->curSpeed.y;
eff->pos.z += eff->curSpeed.z; eff->pos.z += eff->curSpeed.z;
@ -4582,7 +4584,7 @@ void BossTw_UpdateEffects(PlayState* play) {
eff->curSpeed.y += eff->accel.y; eff->curSpeed.y += eff->accel.y;
eff->curSpeed.z += eff->accel.z; eff->curSpeed.z += eff->accel.z;
if (eff->type == 1) { if (eff->type == TWEFF_DOT) {
colorIdx = eff->frame % 4; colorIdx = eff->frame % 4;
if (eff->work[EFF_ARGS] == 0) { if (eff->work[EFF_ARGS] == 0) {
@ -4599,7 +4601,7 @@ void BossTw_UpdateEffects(PlayState* play) {
eff->type = TWEFF_NONE; eff->type = TWEFF_NONE;
} }
} else if ((eff->type == 3) || (eff->type == 2)) { } else if ((eff->type == TWEFF_3) || (eff->type == TWEFF_2)) {
if (eff->work[EFF_ARGS] == 2) { if (eff->work[EFF_ARGS] == 2) {
eff->alpha -= 20; eff->alpha -= 20;
if (eff->alpha <= 0) { if (eff->alpha <= 0) {
@ -4763,7 +4765,7 @@ void BossTw_UpdateEffects(PlayState* play) {
} }
BossTw_AddFlameEffect(play, &eff->pos, &sZeroVector, &sZeroVector, 10, eff->work[EFF_ARGS]); BossTw_AddFlameEffect(play, &eff->pos, &sZeroVector, &sZeroVector, 10, eff->work[EFF_ARGS]);
} else if (eff->type == 4) { } else if (eff->type == TWEFF_RING) {
if (eff->work[EFF_UNKS1] == 0) { if (eff->work[EFF_UNKS1] == 0) {
Math_ApproachF(&eff->workf[EFF_SCALE], eff->workf[EFF_DIST], 0.05f, 1.0f); Math_ApproachF(&eff->workf[EFF_SCALE], eff->workf[EFF_DIST], 0.05f, 1.0f);
@ -4851,8 +4853,8 @@ void BossTw_UpdateEffects(PlayState* play) {
spA8.y = 0.1f; spA8.y = 0.1f;
spA8.z = 0.0f; spA8.z = 0.0f;
BossTw_AddDmgCloud(play, 3, &spC0, &spB4, &spA8, phi_f22 + Rand_ZeroFloat(phi_f22 * 0.5f), 0, 0, BossTw_AddDmgCloud(play, TWEFF_3, &spC0, &spB4, &spA8, phi_f22 + Rand_ZeroFloat(phi_f22 * 0.5f),
150); 0, 0, 150);
} }
} }
} }
@ -4905,9 +4907,9 @@ void BossTw_DrawEffects(PlayState* play) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) { for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) {
if (currentEffect->type == 1) { if (currentEffect->type == TWEFF_DOT) {
if (materialFlag == 0) { if (materialFlag == 0) {
gSPDisplayList(POLY_XLU_DISP++, object_tw_DL_01A528); gSPDisplayList(POLY_XLU_DISP++, gTwinrovaMagicParticleMaterialDL);
materialFlag++; materialFlag++;
} }
@ -4918,7 +4920,7 @@ void BossTw_DrawEffects(PlayState* play) {
Matrix_Scale(currentEffect->workf[EFF_SCALE], currentEffect->workf[EFF_SCALE], 1.0f, MTXMODE_APPLY); Matrix_Scale(currentEffect->workf[EFF_SCALE], currentEffect->workf[EFF_SCALE], 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_tw.c", 9617), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_tw.c", 9617),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, object_tw_DL_01A5A8); gSPDisplayList(POLY_XLU_DISP++, gTwinrovaMagicParticleModelDL);
} }
currentEffect++; currentEffect++;
@ -4928,9 +4930,9 @@ void BossTw_DrawEffects(PlayState* play) {
currentEffect = effectHead; currentEffect = effectHead;
for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) { for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) {
if (currentEffect->type == 3) { if (currentEffect->type == TWEFF_3) {
if (materialFlag == 0) { if (materialFlag == 0) {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A998)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceMaterialDL));
materialFlag++; materialFlag++;
} }
@ -4943,7 +4945,7 @@ void BossTw_DrawEffects(PlayState* play) {
Matrix_Scale(currentEffect->workf[EFF_SCALE], currentEffect->workf[EFF_SCALE], 1.0f, MTXMODE_APPLY); Matrix_Scale(currentEffect->workf[EFF_SCALE], currentEffect->workf[EFF_SCALE], 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_tw.c", 9660), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_tw.c", 9660),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01AB00)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceModelDL));
} }
currentEffect++; currentEffect++;
} }
@ -4952,7 +4954,7 @@ void BossTw_DrawEffects(PlayState* play) {
currentEffect = effectHead; currentEffect = effectHead;
for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) { for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) {
if (currentEffect->type == 2) { if (currentEffect->type == TWEFF_2) {
if (materialFlag == 0) { if (materialFlag == 0) {
gDPPipeSync(POLY_XLU_DISP++); gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 215, 255, 128); gDPSetEnvColor(POLY_XLU_DISP++, 255, 215, 255, 128);
@ -4968,7 +4970,7 @@ void BossTw_DrawEffects(PlayState* play) {
Matrix_Scale(currentEffect->workf[EFF_SCALE], currentEffect->workf[EFF_SCALE], 1.0f, MTXMODE_APPLY); Matrix_Scale(currentEffect->workf[EFF_SCALE], currentEffect->workf[EFF_SCALE], 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_tw.c", 9709), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_tw.c", 9709),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A430)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaFireDL));
} }
currentEffect++; currentEffect++;
@ -4978,7 +4980,7 @@ void BossTw_DrawEffects(PlayState* play) {
currentEffect = effectHead; currentEffect = effectHead;
for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) { for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) {
if (currentEffect->type == 4) { if (currentEffect->type == TWEFF_RING) {
if (materialFlag == 0) { if (materialFlag == 0) {
materialFlag++; materialFlag++;
} }
@ -5013,7 +5015,7 @@ void BossTw_DrawEffects(PlayState* play) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetRenderMode(POLY_XLU_DISP++, G_RM_PASS, G_RM_AA_ZB_XLU_SURF2); gDPSetRenderMode(POLY_XLU_DISP++, G_RM_PASS, G_RM_AA_ZB_XLU_SURF2);
gSPClearGeometryMode(POLY_XLU_DISP++, G_CULL_BACK | G_FOG); gSPClearGeometryMode(POLY_XLU_DISP++, G_CULL_BACK | G_FOG);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A790)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaEffectHaloDL));
} }
currentEffect++; currentEffect++;
@ -5028,7 +5030,7 @@ void BossTw_DrawEffects(PlayState* play) {
if (currentEffect->type == TWEFF_PLYR_FRZ) { if (currentEffect->type == TWEFF_PLYR_FRZ) {
if (materialFlag == 0) { if (materialFlag == 0) {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01AA50)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceSurroundingPlayerMaterialDL));
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, 255); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, 255);
gSPSegment( gSPSegment(
POLY_XLU_DISP++, 8, POLY_XLU_DISP++, 8,
@ -5059,7 +5061,7 @@ void BossTw_DrawEffects(PlayState* play) {
Matrix_RotateX((BossTw_RandZeroOne() - 0.5f) * M_PI * 0.5f, MTXMODE_APPLY); Matrix_RotateX((BossTw_RandZeroOne() - 0.5f) * M_PI * 0.5f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_tw.c", 9855), gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_tw.c", 9855),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01AB00)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceModelDL));
} }
} }
@ -5070,10 +5072,10 @@ void BossTw_DrawEffects(PlayState* play) {
currentEffect = effectHead; currentEffect = effectHead;
for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) { for (i = 0; i < BOSS_TW_EFFECT_COUNT; i++) {
if (currentEffect->type >= 6) { if (currentEffect->type >= TWEFF_FLAME) {
if (currentEffect->work[EFF_ARGS] == 0) { if (currentEffect->work[EFF_ARGS] == 0) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, currentEffect->alpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, currentEffect->alpha);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A998)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceMaterialDL));
} else { } else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, currentEffect->alpha); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 200, 20, 0, currentEffect->alpha);
gDPPipeSync(POLY_XLU_DISP++); gDPPipeSync(POLY_XLU_DISP++);
@ -5090,9 +5092,9 @@ void BossTw_DrawEffects(PlayState* play) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (currentEffect->work[EFF_ARGS] == 0) { if (currentEffect->work[EFF_ARGS] == 0) {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01AB00)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaIceModelDL));
} else { } else {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(object_tw_DL_01A430)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gTwinrovaFireDL));
} }
} }
@ -5104,7 +5106,7 @@ void BossTw_DrawEffects(PlayState* play) {
void BossTw_TwinrovaSetupArriveAtTarget(BossTw* this, PlayState* play) { void BossTw_TwinrovaSetupArriveAtTarget(BossTw* this, PlayState* play) {
this->actionFunc = BossTw_TwinrovaArriveAtTarget; this->actionFunc = BossTw_TwinrovaArriveAtTarget;
Animation_MorphToLoop(&this->skelAnime, &object_tw_Anim_032BF8, -3.0f); Animation_MorphToLoop(&this->skelAnime, &gTwinrovaHoverAnim, -3.0f);
this->work[CS_TIMER_1] = Rand_ZeroFloat(100.0f); this->work[CS_TIMER_1] = Rand_ZeroFloat(100.0f);
this->timers[1] = 25; this->timers[1] = 25;
this->rotateSpeed = 0.0f; this->rotateSpeed = 0.0f;
@ -5127,8 +5129,8 @@ void BossTw_TwinrovaArriveAtTarget(BossTw* this, PlayState* play) {
void BossTw_TwinrovaSetupChargeBlast(BossTw* this, PlayState* play) { void BossTw_TwinrovaSetupChargeBlast(BossTw* this, PlayState* play) {
this->actionFunc = BossTw_TwinrovaChargeBlast; this->actionFunc = BossTw_TwinrovaChargeBlast;
Animation_MorphToPlayOnce(&this->skelAnime, &object_tw_Anim_036FBC, -5.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaWindUpAnim, -5.0f);
this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&object_tw_Anim_036FBC); this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&gTwinrovaWindUpAnim);
this->csState1 = 0; this->csState1 = 0;
} }
@ -5160,12 +5162,12 @@ void BossTw_TwinrovaSetupShootBlast(BossTw* this, PlayState* play) {
this->actionFunc = BossTw_TwinrovaShootBlast; this->actionFunc = BossTw_TwinrovaShootBlast;
if (sTwinrovaBlastType == 0) { if (sTwinrovaBlastType == 0) {
Animation_MorphToPlayOnce(&this->skelAnime, &object_tw_Anim_022700, 0.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaIceAttackAnim, 0.0f);
} else { } else {
Animation_MorphToPlayOnce(&this->skelAnime, &object_tw_Anim_023750, 0.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaFireAttackAnim, 0.0f);
} }
this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&object_tw_Anim_023750); this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&gTwinrovaFireAttackAnim);
} }
void BossTw_TwinrovaShootBlast(BossTw* this, PlayState* play) { void BossTw_TwinrovaShootBlast(BossTw* this, PlayState* play) {
@ -5222,7 +5224,7 @@ void BossTw_TwinrovaShootBlast(BossTw* this, PlayState* play) {
void BossTw_TwinrovaSetupDoneBlastShoot(BossTw* this, PlayState* play) { void BossTw_TwinrovaSetupDoneBlastShoot(BossTw* this, PlayState* play) {
this->actionFunc = BossTw_TwinrovaDoneBlastShoot; this->actionFunc = BossTw_TwinrovaDoneBlastShoot;
Animation_MorphToLoop(&this->skelAnime, &object_tw_Anim_032BF8, -10.0f); Animation_MorphToLoop(&this->skelAnime, &gTwinrovaHoverAnim, -10.0f);
this->timers[1] = 60; this->timers[1] = 60;
} }
@ -5243,7 +5245,7 @@ void BossTw_TwinrovaDoneBlastShoot(BossTw* this, PlayState* play) {
void BossTw_TwinrovaDamage(BossTw* this, PlayState* play, u8 damage) { void BossTw_TwinrovaDamage(BossTw* this, PlayState* play, u8 damage) {
if (this->actionFunc != BossTw_TwinrovaStun) { if (this->actionFunc != BossTw_TwinrovaStun) {
Animation_MorphToPlayOnce(&this->skelAnime, &object_tw_Anim_0338F0, -15.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaChargedAttackHitAnim, -15.0f);
this->timers[0] = 150; this->timers[0] = 150;
this->timers[1] = 20; this->timers[1] = 20;
this->csState1 = 0; this->csState1 = 0;
@ -5251,8 +5253,8 @@ void BossTw_TwinrovaDamage(BossTw* this, PlayState* play, u8 damage) {
} else { } else {
this->work[FOG_TIMER] = 10; this->work[FOG_TIMER] = 10;
this->work[INVINC_TIMER] = 20; this->work[INVINC_TIMER] = 20;
Animation_MorphToPlayOnce(&this->skelAnime, &object_tw_Anim_024374, -3.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaDamageAnim, -3.0f);
this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&object_tw_Anim_024374); this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&gTwinrovaDamageAnim);
this->csState1 = 1; this->csState1 = 1;
if ((s8)(this->actor.colChkInfo.health -= damage) < 0) { if ((s8)(this->actor.colChkInfo.health -= damage) < 0) {
@ -5279,7 +5281,7 @@ void BossTw_TwinrovaStun(BossTw* this, PlayState* play) {
this->unk_5F8 = 1; this->unk_5F8 = 1;
this->actor.flags |= ACTOR_FLAG_10; this->actor.flags |= ACTOR_FLAG_10;
cloudType = sTwinrovaBlastType == 0 ? 3 : 2; cloudType = sTwinrovaBlastType == 0 ? TWEFF_3 : TWEFF_2;
if ((this->work[CS_TIMER_1] % 8) == 0) { if ((this->work[CS_TIMER_1] % 8) == 0) {
Vec3f pos; Vec3f pos;
@ -5314,12 +5316,12 @@ void BossTw_TwinrovaStun(BossTw* this, PlayState* play) {
if (this->csState1 == 0) { if (this->csState1 == 0) {
if (this->timers[1] == 0) { if (this->timers[1] == 0) {
this->csState1 = 1; this->csState1 = 1;
this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&object_tw_Anim_0343B4); this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&gTwinrovaStunStartAnim);
Animation_Change(&this->skelAnime, &object_tw_Anim_0343B4, 1.0f, 0.0f, this->workf[ANIM_SW_TGT], 3, 0.0f); Animation_Change(&this->skelAnime, &gTwinrovaStunStartAnim, 1.0f, 0.0f, this->workf[ANIM_SW_TGT], 3, 0.0f);
} }
} else if (Animation_OnFrame(&this->skelAnime, this->workf[ANIM_SW_TGT])) { } else if (Animation_OnFrame(&this->skelAnime, this->workf[ANIM_SW_TGT])) {
this->workf[ANIM_SW_TGT] = 1000.0f; this->workf[ANIM_SW_TGT] = 1000.0f;
Animation_MorphToLoop(&this->skelAnime, &object_tw_Anim_035030, 0.0f); Animation_MorphToLoop(&this->skelAnime, &gTwinrovaStunLoopAnim, 0.0f);
} }
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
@ -5332,8 +5334,8 @@ void BossTw_TwinrovaStun(BossTw* this, PlayState* play) {
} }
void BossTw_TwinrovaSetupGetUp(BossTw* this, PlayState* play) { void BossTw_TwinrovaSetupGetUp(BossTw* this, PlayState* play) {
Animation_MorphToPlayOnce(&this->skelAnime, &object_tw_Anim_035988, 0.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaStunEndAnim, 0.0f);
this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&object_tw_Anim_035988); this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&gTwinrovaStunEndAnim);
this->actionFunc = BossTw_TwinrovaGetUp; this->actionFunc = BossTw_TwinrovaGetUp;
this->timers[0] = 50; this->timers[0] = 50;
} }
@ -5344,7 +5346,7 @@ void BossTw_TwinrovaGetUp(BossTw* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, this->workf[ANIM_SW_TGT])) { if (Animation_OnFrame(&this->skelAnime, this->workf[ANIM_SW_TGT])) {
this->workf[ANIM_SW_TGT] = 1000.0f; this->workf[ANIM_SW_TGT] = 1000.0f;
Animation_MorphToLoop(&this->skelAnime, &object_tw_Anim_032BF8, 0.0f); Animation_MorphToLoop(&this->skelAnime, &gTwinrovaHoverAnim, 0.0f);
} }
if (this->timers[0] == 0) { if (this->timers[0] == 0) {
@ -5378,7 +5380,7 @@ void BossTw_TwinrovaSetupFly(BossTw* this, PlayState* play) {
this->actor.world.rot.y = RAD_TO_BINANG(Math_FAtan2F(xDiff, zDiff)); this->actor.world.rot.y = RAD_TO_BINANG(Math_FAtan2F(xDiff, zDiff));
xzDist = sqrtf(SQ(xDiff) + SQ(zDiff)); xzDist = sqrtf(SQ(xDiff) + SQ(zDiff));
this->actor.world.rot.x = RAD_TO_BINANG(Math_FAtan2F(yDiff, xzDist)); this->actor.world.rot.x = RAD_TO_BINANG(Math_FAtan2F(yDiff, xzDist));
Animation_MorphToLoop(&this->skelAnime, &object_tw_Anim_032BF8, -10.0f); Animation_MorphToLoop(&this->skelAnime, &gTwinrovaHoverAnim, -10.0f);
} }
void BossTw_TwinrovaFly(BossTw* this, PlayState* play) { void BossTw_TwinrovaFly(BossTw* this, PlayState* play) {
@ -5414,7 +5416,7 @@ void BossTw_TwinrovaFly(BossTw* this, PlayState* play) {
void BossTw_TwinrovaSetupSpin(BossTw* this, PlayState* play) { void BossTw_TwinrovaSetupSpin(BossTw* this, PlayState* play) {
this->actionFunc = BossTw_TwinrovaSpin; this->actionFunc = BossTw_TwinrovaSpin;
Animation_MorphToLoop(&this->skelAnime, &object_tw_Anim_032BF8, 0.0f); Animation_MorphToLoop(&this->skelAnime, &gTwinrovaHoverAnim, 0.0f);
this->timers[0] = 20; this->timers[0] = 20;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
} }
@ -5435,8 +5437,8 @@ void BossTw_TwinrovaSpin(BossTw* this, PlayState* play) {
void BossTw_TwinrovaSetupLaugh(BossTw* this, PlayState* play) { void BossTw_TwinrovaSetupLaugh(BossTw* this, PlayState* play) {
this->actionFunc = BossTw_TwinrovaLaugh; this->actionFunc = BossTw_TwinrovaLaugh;
Animation_MorphToPlayOnce(&this->skelAnime, &object_tw_Anim_03A2D0, 0.0f); Animation_MorphToPlayOnce(&this->skelAnime, &gTwinrovaLaughAnim, 0.0f);
this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&object_tw_Anim_03A2D0); this->workf[ANIM_SW_TGT] = Animation_GetLastFrame(&gTwinrovaLaughAnim);
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
} }

View file

@ -55,6 +55,54 @@ typedef enum {
/* 26 */ FWORK_MAX /* 26 */ FWORK_MAX
} TwFwork; } TwFwork;
typedef enum {
/* 0 */ TWINROVA_LIMB_NONE,
/* 1 */ TWINROVA_LIMB_PELVIS,
/* 2 */ TWINROVA_LIMB_SASH_1,
/* 3 */ TWINROVA_LIMB_SASH_2,
/* 4 */ TWINROVA_LIMB_SASH_3,
/* 5 */ TWINROVA_LIMB_SASH_4,
/* 6 */ TWINROVA_LIMB_LEFT_THIGH,
/* 7 */ TWINROVA_LIMB_LEFT_SHIN,
/* 8 */ TWINROVA_LIMB_LEFT_FOOT,
/* 9 */ TWINROVA_LIMB_RIGHT_THIGH,
/* 10 */ TWINROVA_LIMB_RIGHT_SHIN,
/* 11 */ TWINROVA_LIMB_RIGHT_FOOT,
/* 12 */ TWINROVA_LIMB_TORSO,
/* 13 */ TWINROVA_LIMB_LEFT_BREAST,
/* 14 */ TWINROVA_LIMB_RIGHT_BREAST,
/* 15 */ TWINROVA_LIMB_HAIR_ICE_TRAIL,
/* 16 */ TWINROVA_LIMB_HAIR_ICE_JET,
/* 17 */ TWINROVA_LIMB_HAIR_FIRE_JET,
/* 18 */ TWINROVA_LIMB_HAIR_FIRE_TRAIL,
/* 19 */ TWINROVA_LIMB_LEFT_HAIR_BUN,
/* 20 */ TWINROVA_LIMB_RIGHT_HAIR_BUN,
/* 21 */ TWINROVA_LIMB_HEAD,
/* 22 */ TWINROVA_LIMB_RIGHT_BRAID_START,
/* 23 */ TWINROVA_LIMB_RIGHT_BRAID_END,
/* 24 */ TWINROVA_LIMB_LEFT_BRAID_START,
/* 25 */ TWINROVA_LIMB_LEFT_BRAID_END,
/* 26 */ TWINROVA_LIMB_LEFT_SHOULDER,
/* 27 */ TWINROVA_LIMB_LEFT_UPPER_ARM,
/* 28 */ TWINROVA_LIMB_LEFT_FOREARM,
/* 29 */ TWINROVA_LIMB_LEFT_SLEEVE_START,
/* 30 */ TWINROVA_LIMB_LEFT_SLEEVE_END,
/* 31 */ TWINROVA_LIMB_BROOM_ICE_TRAIL,
/* 32 */ TWINROVA_LIMB_BROOM_ICE_JET,
/* 33 */ TWINROVA_LIMB_LEFT_HAND,
/* 34 */ TWINROVA_LIMB_LEFT_BROOM,
/* 35 */ TWINROVA_LIMB_RIGHT_SHOULDER,
/* 36 */ TWINROVA_LIMB_RIGHT_UPPER_ARM,
/* 37 */ TWINROVA_LIMB_RIGHT_FOREARM,
/* 38 */ TWINROVA_LIMB_RIGHT_SLEEVE_START,
/* 39 */ TWINROVA_LIMB_RIGHT_SLEEVE_END,
/* 40 */ TWINROVA_LIMB_RIGHT_BROOM,
/* 41 */ TWINROVA_LIMB_BROOM_FIRE_JET,
/* 42 */ TWINROVA_LIMB_BROOM_FIRE_TRAIL,
/* 43 */ TWINROVA_LIMB_RIGHT_HAND,
/* 44 */ TWINROVA_LIMB_MAX
} TwinrovaLimb;
typedef struct BossTw { typedef struct BossTw {
/* 0x0000 */ Actor actor; /* 0x0000 */ Actor actor;
/* 0x014C */ BossTwActionFunc actionFunc; /* 0x014C */ BossTwActionFunc actionFunc;

View file

@ -1758,7 +1758,7 @@ void BossVa_SetupSupportCut(BossVa* this, PlayState* play) {
sFightPhase++; sFightPhase++;
Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_VA, this->armTip.x, this->armTip.y + 20.0f, this->armTip.z, 0, Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_VA, this->armTip.x, this->armTip.y + 20.0f, this->armTip.z, 0,
this->actor.shape.rot.y, 0, stumpParams); this->actor.shape.rot.y, 0, stumpParams);
Camera_AddQuake(&play->mainCamera, 2, 11, 8); Camera_RequestQuake(&play->mainCamera, 2, 11, 8);
this->burst = false; this->burst = false;
this->timer2 = 0; this->timer2 = 0;
BossVa_SetupAction(this, BossVa_SupportCut); BossVa_SetupAction(this, BossVa_SupportCut);

View file

@ -730,26 +730,29 @@ void DemoKankyo_Vec3fCopy(Vec3f* src, Vec3f* dst) {
dst->z = src->z; dst->z = src->z;
} }
Vec3f* DemoKankyo_Vec3fAddVecSph(Vec3f* dst, Vec3f* vec, VecSph* sph) { Vec3f* DemoKankyo_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo) {
Vec3f result; Vec3f sum;
Vec3f sphVec; Vec3f b;
OLib_VecSphGeoToVec3f(&sphVec, sph); OLib_VecGeoToVec3f(&b, geo);
result.x = vec->x + sphVec.x;
result.y = vec->y + sphVec.y; sum.x = a->x + b.x;
result.z = vec->z + sphVec.z; sum.y = a->y + b.y;
*dst = result; sum.z = a->z + b.z;
return dst;
*dest = sum;
return dest;
} }
void DemoKankyo_Vec3fAddPosRot(PosRot* posRot, Vec3f* vec, Vec3f* dst) { void DemoKankyo_Vec3fAddPosRot(PosRot* posRot, Vec3f* vec, Vec3f* dst) {
VecSph sph; VecGeo geo;
Vec3f vecCopy; Vec3f vecCopy;
DemoKankyo_Vec3fCopy(vec, &vecCopy); DemoKankyo_Vec3fCopy(vec, &vecCopy);
OLib_Vec3fToVecSphGeo(&sph, &vecCopy); OLib_Vec3fToVecGeo(&geo, &vecCopy);
sph.yaw += posRot->rot.y; geo.yaw += posRot->rot.y;
DemoKankyo_Vec3fAddVecSph(dst, &posRot->pos, &sph); DemoKankyo_AddVecGeoToVec3f(dst, &posRot->pos, &geo);
} }
void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) {

View file

@ -6,6 +6,7 @@
#include "z_door_shutter.h" #include "z_door_shutter.h"
#include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h" #include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h"
#include "quake.h"
#include "assets/objects/object_gnd/object_gnd.h" #include "assets/objects/object_gnd/object_gnd.h"
#include "assets/objects/object_goma/object_goma.h" #include "assets/objects/object_goma/object_goma.h"
@ -31,7 +32,7 @@ void DoorShutter_Destroy(Actor* thisx, PlayState* play);
void DoorShutter_Update(Actor* thisx, PlayState* play); void DoorShutter_Update(Actor* thisx, PlayState* play);
void DoorShutter_Draw(Actor* thisx, PlayState* play); void DoorShutter_Draw(Actor* thisx, PlayState* play);
void func_8099803C(PlayState* play, s16 y, s16 countdown, s16 camId); void DoorShutter_RequestQuakeAndRumble(PlayState* play, s16 quakeY, s16 quakeDuration, s16 camId);
void DoorShutter_SetupType(DoorShutter* this, PlayState* play); void DoorShutter_SetupType(DoorShutter* this, PlayState* play);
void func_80996A54(DoorShutter* this, PlayState* play); void func_80996A54(DoorShutter* this, PlayState* play);
void func_80996B00(DoorShutter* this, PlayState* play); void func_80996B00(DoorShutter* this, PlayState* play);
@ -102,7 +103,7 @@ static ShutterInfo sShutterInfo[] = {
{ gPhantomGanonBarsDL, NULL, 130, 12, 50, 15 }, { gPhantomGanonBarsDL, NULL, 130, 12, 50, 15 },
{ gGohmaDoorDL, NULL, 130, 12, 50, 15 }, { gGohmaDoorDL, NULL, 130, 12, 50, 15 },
{ gSpiritDoorDL, gJyaDoorMetalBarsDL, 240, 14, 50, 15 }, { gSpiritDoorDL, gJyaDoorMetalBarsDL, 240, 14, 50, 15 },
{ object_bdoor_DL_0010C0, NULL, 130, 12, 50, 15 }, { gBossDoorDL, NULL, 130, 12, 50, 15 },
{ gDungeonDoorDL, gDoorMetalBarsDL, 130, 12, 20, 15 }, { gDungeonDoorDL, gDoorMetalBarsDL, 130, 12, 20, 15 },
{ gFireTempleDoorFrontDL, gDoorMetalBarsDL, 130, 12, 20, 15 }, { gFireTempleDoorFrontDL, gDoorMetalBarsDL, 130, 12, 20, 15 },
{ gFireTempleDoorBackDL, gDoorMetalBarsDL, 130, 12, 20, 15 }, { gFireTempleDoorBackDL, gDoorMetalBarsDL, 130, 12, 20, 15 },
@ -164,8 +165,8 @@ static Gfx* sJabuDoorDLists[] = {
}; };
static void* D_809982D4[] = { static void* D_809982D4[] = {
object_bdoor_Tex_0065C0, object_bdoor_Tex_0035C0, object_bdoor_Tex_0055C0, object_bdoor_Tex_0045C0, gBossDoorDefaultTex, gBossDoorFireTex, gBossDoorWaterTex, gBossDoorShadowTex,
object_bdoor_Tex_000000, object_bdoor_Tex_0025C0, object_bdoor_Tex_0015C0, gBossDoorGanonsCastleTex, gBossDoorForestTex, gBossDoorSpiritTex,
}; };
void DoorShutter_SetupAction(DoorShutter* this, DoorShutterActionFunc actionFunc) { void DoorShutter_SetupAction(DoorShutter* this, DoorShutterActionFunc actionFunc) {
@ -560,7 +561,7 @@ void func_80997220(DoorShutter* this, PlayState* play) {
} }
void func_809973E8(DoorShutter* this, PlayState* play) { void func_809973E8(DoorShutter* this, PlayState* play) {
s32 quakeId; s32 quakeIndex;
if (this->dyna.actor.velocity.y < 20.0f) { if (this->dyna.actor.velocity.y < 20.0f) {
Math_StepToF(&this->dyna.actor.velocity.y, 20.0f, 8.0f); Math_StepToF(&this->dyna.actor.velocity.y, 20.0f, 8.0f);
@ -572,10 +573,10 @@ void func_809973E8(DoorShutter* this, PlayState* play) {
false); false);
} }
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
quakeId = Quake_Add(Play_GetCamera(play, CAM_ID_MAIN), 3); quakeIndex = Quake_Request(Play_GetCamera(play, CAM_ID_MAIN), 3);
Quake_SetSpeed(quakeId, -32536); Quake_SetSpeed(quakeIndex, -32536);
Quake_SetQuakeValues(quakeId, 2, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 2, 0, 0, 0);
Quake_SetCountdown(quakeId, 10); Quake_SetDuration(quakeIndex, 10);
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100); Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100);
func_80997220(this, play); func_80997220(this, play);
} }
@ -604,7 +605,7 @@ void func_809975C0(DoorShutter* this, PlayState* play) {
this->unk_164 = 10; this->unk_164 = 10;
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
func_8099803C(play, 2, 10, parent->subCamId); DoorShutter_RequestQuakeAndRumble(play, 2, 10, parent->subCamId);
Actor_SpawnFloorDustRing(play, &this->dyna.actor, &this->dyna.actor.world.pos, 70.0f, 20, 8.0f, 500, 10, Actor_SpawnFloorDustRing(play, &this->dyna.actor, &this->dyna.actor.world.pos, 70.0f, 20, 8.0f, 500, 10,
true); true);
} }
@ -766,11 +767,11 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) {
} }
} }
void func_8099803C(PlayState* play, s16 y, s16 countdown, s16 camId) { void DoorShutter_RequestQuakeAndRumble(PlayState* play, s16 quakeY, s16 quakeDuration, s16 camId) {
s16 quakeId = Quake_Add(Play_GetCamera(play, camId), 3); s16 quakeIndex = Quake_Request(Play_GetCamera(play, camId), QUAKE_TYPE_3);
Rumble_Override(0.0f, 180, 20, 100); Rumble_Override(0.0f, 180, 20, 100);
Quake_SetSpeed(quakeId, 20000); Quake_SetSpeed(quakeIndex, 20000);
Quake_SetQuakeValues(quakeId, y, 0, 0, 0); Quake_SetPerturbations(quakeIndex, quakeY, 0, 0, 0);
Quake_SetCountdown(quakeId, countdown); Quake_SetDuration(quakeIndex, quakeDuration);
} }

View file

@ -114,10 +114,10 @@ static ColliderQuadInit sQuadInit = {
typedef enum { typedef enum {
/* 00 */ AM_DMGEFF_NONE, // used by anything that cant kill the armos /* 00 */ AM_DMGEFF_NONE, // used by anything that cant kill the armos
/* 01 */ AM_DMGEFF_NUT, /* 01 */ AM_DMGEFF_NUT,
/* 06 */ AM_DMGEFF_STUN = 6, // doesnt include deku nuts /* 06 */ AM_DMGEFF_STUN = 6, // doesn't include deku nuts
/* 13 */ AM_DMGEFF_ICE = 13, /* 13 */ AM_DMGEFF_ICE = 13,
/* 14 */ AM_DMGEFF_MAGIC_FIRE_LIGHT, /* 14 */ AM_DMGEFF_MAGIC_FIRE_LIGHT,
/* 15 */ AM_DMGEFF_KILL // any damage source that can kill the armos (and isnt a special case) /* 15 */ AM_DMGEFF_KILL // any damage source that can kill the armos (and isn't a special case)
} ArmosDamageEffect; } ArmosDamageEffect;
static DamageTable sDamageTable = { static DamageTable sDamageTable = {
@ -246,7 +246,7 @@ void EnAm_Destroy(Actor* thisx, PlayState* play) {
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
Collider_DestroyCylinder(play, &this->hurtCollider); Collider_DestroyCylinder(play, &this->hurtCollider);
Collider_DestroyCylinder(play, &this->blockCollider); Collider_DestroyCylinder(play, &this->blockCollider);
//! @bug Quad collider is not destroyed (though destroy doesnt really do anything anyway) //! @bug Quad collider is not destroyed (though destroy doesn't really do anything anyway)
} }
void EnAm_SpawnEffects(EnAm* this, PlayState* play) { void EnAm_SpawnEffects(EnAm* this, PlayState* play) {

View file

@ -262,7 +262,7 @@ void func_809BD1C8(EnBigokuta* this, PlayState* play) {
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_DAIOCTA_LAND_WATER); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_DAIOCTA_LAND_WATER);
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOLON_LAND_BIG); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_GOLON_LAND_BIG);
func_80033E88(&this->actor, play, 0xA, 8); Actor_RequestQuakeAndRumble(&this->actor, play, 10, 8);
} }
void func_809BD2E4(EnBigokuta* this) { void func_809BD2E4(EnBigokuta* this) {

View file

@ -7,7 +7,7 @@
#include "z_en_bili.h" #include "z_en_bili.h"
#include "assets/objects/object_bl/object_bl.h" #include "assets/objects/object_bl/object_bl.h"
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_12 | ACTOR_FLAG_14) #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_14)
void EnBili_Init(Actor* thisx, PlayState* play); void EnBili_Init(Actor* thisx, PlayState* play);
void EnBili_Destroy(Actor* thisx, PlayState* play); void EnBili_Destroy(Actor* thisx, PlayState* play);

View file

@ -272,7 +272,7 @@ void EnBom_Update(Actor* thisx, PlayState* play2) {
thisx->shape.rot.z = 0; thisx->shape.rot.z = 0;
} else { } else {
// if a lit stick touches the bomb, set timer to 100 // if a lit stick touches the bomb, set timer to 100
// these bombs never have a timer over 70, so this isnt used // these bombs never have a timer over 70, so this isn't used
if ((this->timer > 100) && Player_IsBurningStickInRange(play, &thisx->world.pos, 30.0f, 50.0f)) { if ((this->timer > 100) && Player_IsBurningStickInRange(play, &thisx->world.pos, 30.0f, 50.0f)) {
this->timer = 100; this->timer = 100;
} }
@ -319,7 +319,7 @@ void EnBom_Update(Actor* thisx, PlayState* play2) {
play->envCtx.adjAmbientColor[0] = play->envCtx.adjAmbientColor[1] = play->envCtx.adjAmbientColor[2] = 250; play->envCtx.adjAmbientColor[0] = play->envCtx.adjAmbientColor[1] = play->envCtx.adjAmbientColor[2] = 250;
Camera_AddQuake(&play->mainCamera, 2, 0xB, 8); Camera_RequestQuake(&play->mainCamera, 2, 11, 8);
thisx->params = BOMB_EXPLOSION; thisx->params = BOMB_EXPLOSION;
this->timer = 10; this->timer = 10;
thisx->flags |= ACTOR_FLAG_5; thisx->flags |= ACTOR_FLAG_5;

View file

@ -90,7 +90,7 @@ void EnBombf_Init(Actor* thisx, PlayState* play) {
EnBombf* this = (EnBombf*)thisx; EnBombf* this = (EnBombf*)thisx;
Actor_SetScale(thisx, 0.01f); Actor_SetScale(thisx, 0.01f);
this->unk_200 = 1; this->isFuseEnabled = true;
Collider_InitCylinder(play, &this->bombCollider); Collider_InitCylinder(play, &this->bombCollider);
Collider_InitJntSph(play, &this->explosionCollider); Collider_InitJntSph(play, &this->explosionCollider);
Collider_SetCylinder(play, &this->bombCollider, thisx, &sCylinderInit); Collider_SetCylinder(play, &this->bombCollider, thisx, &sCylinderInit);
@ -172,7 +172,7 @@ void EnBombf_GrowBomb(EnBombf* this, PlayState* play) {
bombFlower = (EnBombf*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOMBF, this->actor.world.pos.x, bombFlower = (EnBombf*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOMBF, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
if (bombFlower != NULL) { if (bombFlower != NULL) {
bombFlower->unk_200 = 1; bombFlower->isFuseEnabled = true;
bombFlower->timer = 0; bombFlower->timer = 0;
this->timer = 180; this->timer = 180;
this->actor.flags &= ~ACTOR_FLAG_0; this->actor.flags &= ~ACTOR_FLAG_0;
@ -320,7 +320,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
s32 pad[2]; s32 pad[2];
EnBombf* this = (EnBombf*)thisx; EnBombf* this = (EnBombf*)thisx;
if ((this->unk_200 != 0) && (this->timer != 0)) { if ((this->isFuseEnabled) && (this->timer != 0)) {
this->timer--; this->timer--;
} }
@ -369,7 +369,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
if ((this->bombCollider.base.acFlags & AC_HIT) || ((this->bombCollider.base.ocFlags1 & OC1_HIT) && if ((this->bombCollider.base.acFlags & AC_HIT) || ((this->bombCollider.base.ocFlags1 & OC1_HIT) &&
(this->bombCollider.base.oc->category == ACTORCAT_ENEMY))) { (this->bombCollider.base.oc->category == ACTORCAT_ENEMY))) {
this->unk_200 = 1; this->isFuseEnabled = true;
this->timer = 0; this->timer = 0;
} else { } else {
// if a lit stick touches the bomb, set timer to 100 // if a lit stick touches the bomb, set timer to 100
@ -378,7 +378,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
} }
} }
if (this->unk_200 != 0) { if (this->isFuseEnabled) {
dustAccel.y = 0.2f; dustAccel.y = 0.2f;
effPos = thisx->world.pos; effPos = thisx->world.pos;
effPos.y += 25.0f; effPos.y += 25.0f;
@ -428,7 +428,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
play->envCtx.adjLight1Color[0] = play->envCtx.adjLight1Color[1] = play->envCtx.adjLight1Color[2] = 250; play->envCtx.adjLight1Color[0] = play->envCtx.adjLight1Color[1] = play->envCtx.adjLight1Color[2] = 250;
play->envCtx.adjAmbientColor[0] = play->envCtx.adjAmbientColor[1] = play->envCtx.adjAmbientColor[2] = play->envCtx.adjAmbientColor[0] = play->envCtx.adjAmbientColor[1] = play->envCtx.adjAmbientColor[2] =
250; 250;
Camera_AddQuake(&play->mainCamera, 2, 0xB, 8); Camera_RequestQuake(&play->mainCamera, 2, 11, 8);
thisx->params = BOMBFLOWER_EXPLOSION; thisx->params = BOMBFLOWER_EXPLOSION;
this->timer = 10; this->timer = 10;
thisx->flags |= ACTOR_FLAG_5; thisx->flags |= ACTOR_FLAG_5;

View file

@ -15,7 +15,7 @@ typedef struct EnBombf {
/* 0x01B8 */ ColliderJntSphElement explosionColliderItems[1]; /* 0x01B8 */ ColliderJntSphElement explosionColliderItems[1];
/* 0x01F8 */ s16 timer; /* 0x01F8 */ s16 timer;
/* 0x01FC */ EnBombfActionFunc actionFunc; /* 0x01FC */ EnBombfActionFunc actionFunc;
/* 0x0200 */ s32 unk_200; /* 0x0200 */ s32 isFuseEnabled; // enables the ability to ignite and tick down to explode
/* 0x0204 */ u8 bumpOn; /* 0x0204 */ u8 bumpOn;
/* 0x0206 */ s16 flashSpeedScale; /* 0x0206 */ s16 flashSpeedScale;
/* 0x0208 */ f32 flashIntensity; /* 0x0208 */ f32 flashIntensity;

View file

@ -1,7 +1,7 @@
#include "z_en_crow.h" #include "z_en_crow.h"
#include "assets/objects/object_crow/object_crow.h" #include "assets/objects/object_crow/object_crow.h"
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_12 | ACTOR_FLAG_14) #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_14)
void EnCrow_Init(Actor* thisx, PlayState* play); void EnCrow_Init(Actor* thisx, PlayState* play);
void EnCrow_Destroy(Actor* thisx, PlayState* play); void EnCrow_Destroy(Actor* thisx, PlayState* play);

View file

@ -197,7 +197,7 @@ void EnDoor_SetupType(EnDoor* this, PlayState* play) {
} }
} else if (doorType == DOOR_CHECKABLE) { } else if (doorType == DOOR_CHECKABLE) {
this->actor.textId = ENDOOR_GET_CHECKABLE_TEXT_ID(&this->actor) + 0x0200; this->actor.textId = ENDOOR_GET_CHECKABLE_TEXT_ID(&this->actor) + 0x0200;
if (this->actor.textId == 0x0229 && !GET_EVENTCHKINF(EVENTCHKINF_14)) { if (this->actor.textId == 0x0229 && !GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
// Talon's house door. If Talon has not been woken up at Hyrule Castle // Talon's house door. If Talon has not been woken up at Hyrule Castle
// this door should be openable at any time of day. // this door should be openable at any time of day.
// Note that there is no check for time of day, as the night layers for Lon Lon // Note that there is no check for time of day, as the night layers for Lon Lon

View file

@ -200,7 +200,7 @@ void EnEiyer_SetupAppearFromGround(EnEiyer* this) {
this->collider.base.atFlags &= ~AT_ON; this->collider.base.atFlags &= ~AT_ON;
this->collider.base.acFlags &= ~AC_ON; this->collider.base.acFlags &= ~AC_ON;
this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_12); this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_IGNORE_QUAKE);
this->actor.shape.shadowScale = 0.0f; this->actor.shape.shadowScale = 0.0f;
this->actor.shape.yOffset = 0.0f; this->actor.shape.yOffset = 0.0f;
this->actionFunc = EnEiyer_AppearFromGround; this->actionFunc = EnEiyer_AppearFromGround;
@ -231,7 +231,7 @@ void EnEiyer_SetupAmbush(EnEiyer* this, PlayState* play) {
this->collider.info.bumper.dmgFlags = DMG_DEFAULT; this->collider.info.bumper.dmgFlags = DMG_DEFAULT;
this->basePos = this->actor.world.pos; this->basePos = this->actor.world.pos;
this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.flags |= ACTOR_FLAG_12; this->actor.flags |= ACTOR_FLAG_IGNORE_QUAKE;
this->collider.base.acFlags &= ~AC_ON; this->collider.base.acFlags &= ~AC_ON;
this->actor.shape.shadowScale = 65.0f; this->actor.shape.shadowScale = 65.0f;
this->actor.shape.yOffset = 600.0f; this->actor.shape.yOffset = 600.0f;

View file

@ -1,5 +1,6 @@
#include "z_en_encount2.h" #include "z_en_encount2.h"
#include "overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h" #include "overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h"
#include "quake.h"
#include "vt.h" #include "vt.h"
#include "assets/objects/object_efc_star_field/object_efc_star_field.h" #include "assets/objects/object_efc_star_field/object_efc_star_field.h"
@ -91,11 +92,11 @@ void EnEncount2_Wait(EnEncount2* this, PlayState* play) {
} }
break; break;
case ENCOUNT2_ACTIVE_DEATH_MOUNTAIN: case ENCOUNT2_ACTIVE_DEATH_MOUNTAIN:
if ((this->deathMountainSpawnerTimer == 1) || (!this->isQuaking)) { if ((this->deathMountainSpawnerTimer == 1) || !this->isQuaking) {
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 1); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_1);
Quake_SetSpeed(quakeIndex, 0x7FFF); Quake_SetSpeed(quakeIndex, 0x7FFF);
Quake_SetQuakeValues(quakeIndex, 50, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 50, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 300); Quake_SetDuration(quakeIndex, 300);
this->isQuaking = true; this->isQuaking = true;
} }
FALLTHROUGH; FALLTHROUGH;

View file

@ -212,7 +212,7 @@ void EnFhgFire_LightningStrike(EnFhgFire* this, PlayState* play) {
(s16)(Rand_ZeroOne() * 100.0f) + 240, FHGFLASH_LIGHTBALL_GREEN); (s16)(Rand_ZeroOne() * 100.0f) + 240, FHGFLASH_LIGHTBALL_GREEN);
} }
} }
func_80033E88(&this->actor, play, 4, 10); Actor_RequestQuakeAndRumble(&this->actor, play, 4, 10);
} }
break; break;

View file

@ -198,7 +198,7 @@ void EnFireRock_Fall(EnFireRock* this, PlayState* play) {
switch (this->type) { switch (this->type) {
case FIRE_ROCK_SPAWNED_FALLING1: case FIRE_ROCK_SPAWNED_FALLING1:
case FIRE_ROCK_SPAWNED_FALLING2: case FIRE_ROCK_SPAWNED_FALLING2:
func_80033E88(&this->actor, play, 5, 2); Actor_RequestQuakeAndRumble(&this->actor, play, 5, 2);
FALLTHROUGH; FALLTHROUGH;
case FIRE_ROCK_BROKEN_PIECE1: case FIRE_ROCK_BROKEN_PIECE1:
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1,

View file

@ -8,7 +8,7 @@
#include "assets/objects/object_firefly/object_firefly.h" #include "assets/objects/object_firefly/object_firefly.h"
#include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h" #include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h"
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_12 | ACTOR_FLAG_14) #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_14)
void EnFirefly_Init(Actor* thisx, PlayState* play); void EnFirefly_Init(Actor* thisx, PlayState* play);
void EnFirefly_Destroy(Actor* thisx, PlayState* play); void EnFirefly_Destroy(Actor* thisx, PlayState* play);

View file

@ -341,11 +341,11 @@ void EnFz_ApplyDamage(EnFz* this, PlayState* play) {
this->collider1.base.acFlags &= ~AC_HIT; this->collider1.base.acFlags &= ~AC_HIT;
} else if (this->collider1.base.acFlags & AC_HIT) { } else if (this->collider1.base.acFlags & AC_HIT) {
this->collider1.base.acFlags &= ~AC_HIT; this->collider1.base.acFlags &= ~AC_HIT;
if (this->actor.colChkInfo.damageEffect != 2) { switch (this->actor.colChkInfo.damageEffect) {
if (this->actor.colChkInfo.damageEffect == 0xF) { case 0xF:
Actor_ApplyDamage(&this->actor); Actor_ApplyDamage(&this->actor);
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8); Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8);
if (this->actor.colChkInfo.health) { if (this->actor.colChkInfo.health != 0) {
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DAMAGE); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DAMAGE);
vec.x = this->actor.world.pos.x; vec.x = this->actor.world.pos.x;
vec.y = this->actor.world.pos.y; vec.y = this->actor.world.pos.y;
@ -361,16 +361,21 @@ void EnFz_ApplyDamage(EnFz* this, PlayState* play) {
EnFz_Damaged(this, play, &vec, 30, 10.0f); EnFz_Damaged(this, play, &vec, 30, 10.0f);
EnFz_SetupDespawn(this, play); EnFz_SetupDespawn(this, play);
} }
} break;
} else {
Actor_ApplyDamage(&this->actor); case 2:
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8); Actor_ApplyDamage(&this->actor);
if (this->actor.colChkInfo.health == 0) { Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8);
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DEAD); if (this->actor.colChkInfo.health == 0) {
EnFz_SetupMelt(this); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DEAD);
} else { EnFz_SetupMelt(this);
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DAMAGE); } else {
} Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DAMAGE);
}
break;
default:
break;
} }
} }
} }

View file

@ -316,7 +316,7 @@ void EnGirlA_SetupAction(EnGirlA* this, EnGirlAActionFunc func) {
s32 EnGirlA_TryChangeShopItem(EnGirlA* this) { s32 EnGirlA_TryChangeShopItem(EnGirlA* this) {
switch (this->actor.params) { switch (this->actor.params) {
case SI_MILK_BOTTLE: case SI_MILK_BOTTLE:
if (GET_ITEMGETINF(ITEMGETINF_02)) { if (GET_ITEMGETINF(ITEMGETINF_TALON_BOTTLE)) {
this->actor.params = SI_RECOVERY_HEART; this->actor.params = SI_RECOVERY_HEART;
return true; return true;
} }

View file

@ -2,6 +2,7 @@
#include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_oF1d_map/object_oF1d_map.h" #include "assets/objects/object_oF1d_map/object_oF1d_map.h"
#include "quake.h"
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_5) #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_5)
@ -1628,14 +1629,14 @@ void EnGo2_Destroy(Actor* thisx, PlayState* play) {
void EnGo2_CurledUp(EnGo2* this, PlayState* play) { void EnGo2_CurledUp(EnGo2* this, PlayState* play) {
u8 index = this->actor.params & 0x1F; u8 index = this->actor.params & 0x1F;
s16 height; s16 height;
s32 quake; s32 quakeIndex;
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
quake = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quake, -0x3CB0); Quake_SetSpeed(quakeIndex, -0x3CB0);
Quake_SetQuakeValues(quake, 8, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 8, 0, 0, 0);
Quake_SetCountdown(quake, 16); Quake_SetDuration(quakeIndex, 16);
} else { } else {
EnGo2_GetDustData(this, 1); EnGo2_GetDustData(this, 1);
} }

View file

@ -791,7 +791,7 @@ void EnGoma_Draw(Actor* thisx, PlayState* play) {
this->actor.naviEnemyId = NAVI_ENEMY_GOHMA_LARVA; this->actor.naviEnemyId = NAVI_ENEMY_GOHMA_LARVA;
Matrix_Translate(this->actor.world.pos.x, Matrix_Translate(this->actor.world.pos.x,
this->actor.world.pos.y + this->actor.world.pos.y +
((this->actor.shape.yOffset * this->actor.scale.y) + play->mainCamera.skyboxOffset.y), ((this->actor.shape.yOffset * this->actor.scale.y) + play->mainCamera.quakeOffset.y),
this->actor.world.pos.z, MTXMODE_NEW); this->actor.world.pos.z, MTXMODE_NEW);
Matrix_RotateX(BINANG_TO_RAD_ALT(this->slopePitch), MTXMODE_APPLY); Matrix_RotateX(BINANG_TO_RAD_ALT(this->slopePitch), MTXMODE_APPLY);
Matrix_RotateZ(BINANG_TO_RAD_ALT(this->slopeRoll), MTXMODE_APPLY); Matrix_RotateZ(BINANG_TO_RAD_ALT(this->slopeRoll), MTXMODE_APPLY);

View file

@ -8,6 +8,7 @@
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_goroiwa/object_goroiwa.h" #include "assets/objects/object_goroiwa/object_goroiwa.h"
#include "quake.h"
#include "vt.h" #include "vt.h"
#define FLAGS ACTOR_FLAG_4 #define FLAGS ACTOR_FLAG_4
@ -358,7 +359,7 @@ s32 EnGoroiwa_MoveDownToNextWaypoint(EnGoroiwa* this, PlayState* play) {
f32 nextPointY; f32 nextPointY;
f32 thisY; f32 thisY;
f32 yDistToFloor; f32 yDistToFloor;
s32 quakeIdx; s32 quakeIndex;
CollisionPoly* floorPoly; CollisionPoly* floorPoly;
Vec3f checkPos; Vec3f checkPos;
f32 floorY; f32 floorY;
@ -379,10 +380,10 @@ s32 EnGoroiwa_MoveDownToNextWaypoint(EnGoroiwa* this, PlayState* play) {
if (this->actor.velocity.y < 0.0f && this->actor.world.pos.y <= nextPointY) { if (this->actor.velocity.y < 0.0f && this->actor.world.pos.y <= nextPointY) {
if (this->bounceCount == 0) { if (this->bounceCount == 0) {
if (this->actor.xzDistToPlayer < 600.0f) { if (this->actor.xzDistToPlayer < 600.0f) {
quakeIdx = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIdx, -0x3CB0); Quake_SetSpeed(quakeIndex, -0x3CB0);
Quake_SetQuakeValues(quakeIdx, 3, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 3, 0, 0, 0);
Quake_SetCountdown(quakeIdx, 7); Quake_SetDuration(quakeIndex, 7);
} }
this->rollRotSpeed = 0.0f; this->rollRotSpeed = 0.0f;
if (!(this->stateFlags & ENGOROIWA_IN_WATER)) { if (!(this->stateFlags & ENGOROIWA_IN_WATER)) {

View file

@ -451,7 +451,7 @@ void EnHeishi1_Update(Actor* thisx, PlayState* play) {
// sidehops onto the next screen and prevent getting caught. // sidehops onto the next screen and prevent getting caught.
if (!(player->actor.velocity.y > -3.9f)) { if (!(player->actor.velocity.y > -3.9f)) {
this->linkDetected = false; this->linkDetected = false;
// this 60 unit height check is so the player doesnt get caught when on the upper path // this 60 unit height check is so the player doesn't get caught when on the upper path
if (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 60.0f) { if (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 60.0f) {
func_80078884(NA_SE_SY_FOUND); func_80078884(NA_SE_SY_FOUND);
// "Discovered!" // "Discovered!"

View file

@ -18,7 +18,7 @@ typedef struct EnHeishi2 {
/* 0x0260 */ Vec3s unk_260; /* 0x0260 */ Vec3s unk_260;
/* 0x0266 */ char unk_266[0x06]; /* 0x0266 */ char unk_266[0x06];
/* 0x026C */ Vec3s unk_26C; // padding inbetween these /* 0x026C */ Vec3s unk_26C; // padding inbetween these
/* 0x0274 */ Vec3f unk_274; /* 0x0274 */ Vec3f unk_274;
/* 0x0280 */ Vec3f subCamEye; /* 0x0280 */ Vec3f subCamEye;
/* 0x028C */ Vec3f subCamAt; /* 0x028C */ Vec3f subCamAt;
/* 0x0298 */ Vec3f subCamAtInit; /* 0x0298 */ Vec3f subCamAtInit;

View file

@ -682,8 +682,9 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) {
player = GET_PLAYER(play); player = GET_PLAYER(play);
if (play->sceneId != SCENE_SPOT20 || if (play->sceneId != SCENE_SPOT20 ||
//! Same flag checked twice //! Same flag checked twice
(Flags_GetEventChkInf(EVENTCHKINF_18) && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) &&
(GET_EVENTINF_HORSES_STATE() != EVENTINF_HORSES_STATE_6 || Flags_GetEventChkInf(EVENTCHKINF_18))) || (GET_EVENTINF_HORSES_STATE() != EVENTINF_HORSES_STATE_6 ||
Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED))) ||
// always load two spawns inside lon lon // always load two spawns inside lon lon
((sHorseSpawns[i].pos.x == 856 && sHorseSpawns[i].pos.y == 0 && sHorseSpawns[i].pos.z == -918) || ((sHorseSpawns[i].pos.x == 856 && sHorseSpawns[i].pos.y == 0 && sHorseSpawns[i].pos.z == -918) ||
(sHorseSpawns[i].pos.x == -1003 && sHorseSpawns[i].pos.y == 0 && sHorseSpawns[i].pos.z == -755))) { (sHorseSpawns[i].pos.x == -1003 && sHorseSpawns[i].pos.y == 0 && sHorseSpawns[i].pos.z == -755))) {
@ -794,7 +795,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
this->stateFlags = ENHORSE_FLAG_19 | ENHORSE_CANT_JUMP | ENHORSE_UNRIDEABLE; this->stateFlags = ENHORSE_FLAG_19 | ENHORSE_CANT_JUMP | ENHORSE_UNRIDEABLE;
} else if (this->actor.params == 6) { } else if (this->actor.params == 6) {
this->stateFlags = ENHORSE_FLAG_19 | ENHORSE_CANT_JUMP; this->stateFlags = ENHORSE_FLAG_19 | ENHORSE_CANT_JUMP;
if (Flags_GetEventChkInf(EVENTCHKINF_18) || DREG(1) != 0) { if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || DREG(1) != 0) {
this->stateFlags &= ~ENHORSE_CANT_JUMP; this->stateFlags &= ~ENHORSE_CANT_JUMP;
this->stateFlags |= ENHORSE_FLAG_26; this->stateFlags |= ENHORSE_FLAG_26;
} else if (GET_EVENTINF(EVENTINF_HORSES_06) && this->type == HORSE_HNI) { } else if (GET_EVENTINF(EVENTINF_HORSES_06) && this->type == HORSE_HNI) {
@ -808,7 +809,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
} }
if (play->sceneId == SCENE_SPOT20 && GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6 && if (play->sceneId == SCENE_SPOT20 && GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6 &&
!Flags_GetEventChkInf(EVENTCHKINF_18) && !DREG(1)) { !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && !DREG(1)) {
this->stateFlags |= ENHORSE_FLAG_25; this->stateFlags |= ENHORSE_FLAG_25;
} }
@ -834,7 +835,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
return; return;
} }
if (Flags_GetEventChkInf(EVENTCHKINF_18)) { if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
return; return;
} }
@ -842,12 +843,12 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
return; return;
} }
} else if (!Flags_GetEventChkInf(EVENTCHKINF_18) && !DREG(1) && !IS_DAY) { } else if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && !DREG(1) && !IS_DAY) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
return; return;
} }
} else if (play->sceneId == SCENE_MALON_STABLE) { } else if (play->sceneId == SCENE_MALON_STABLE) {
if (IS_DAY || Flags_GetEventChkInf(EVENTCHKINF_18) || DREG(1) != 0 || !LINK_IS_ADULT) { if (IS_DAY || Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || DREG(1) != 0 || !LINK_IS_ADULT) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
return; return;
} }
@ -882,7 +883,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
} else if (this->actor.params == 8) { } else if (this->actor.params == 8) {
EnHorse_InitHorsebackArchery(this); EnHorse_InitHorsebackArchery(this);
Interface_InitHorsebackArchery(play); Interface_InitHorsebackArchery(play);
} else if (play->sceneId == SCENE_SPOT20 && !Flags_GetEventChkInf(EVENTCHKINF_18) && !DREG(1)) { } else if (play->sceneId == SCENE_SPOT20 && !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && !DREG(1)) {
EnHorse_InitFleePlayer(this); EnHorse_InitFleePlayer(this);
} else { } else {
if (play->sceneId == SCENE_SOUKO) { if (play->sceneId == SCENE_SOUKO) {
@ -3598,7 +3599,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) {
this->cyl1.base.atFlags &= ~AT_ON; this->cyl1.base.atFlags &= ~AT_ON;
} }
if (gSaveContext.entranceIndex != 343 || gSaveContext.sceneLayer != 9) { if (gSaveContext.entranceIndex != ENTR_SPOT20_0 || gSaveContext.sceneLayer != 9) {
if (this->dustFlags & 1) { if (this->dustFlags & 1) {
this->dustFlags &= ~1; this->dustFlags &= ~1;
func_800287AC(play, &this->frontRightHoof, &dustVel, &dustAcc, EnHorse_RandInt(100) + 200, func_800287AC(play, &this->frontRightHoof, &dustVel, &dustAcc, EnHorse_RandInt(100) + 200,

View file

@ -444,7 +444,7 @@ void EnHorseGameCheck_Init(Actor* thisx, PlayState* play) {
s32 pad; s32 pad;
EnHorseGameCheckBase* this = (EnHorseGameCheckBase*)thisx; EnHorseGameCheckBase* this = (EnHorseGameCheckBase*)thisx;
if ((play->sceneId == SCENE_SPOT20) && (Flags_GetEventChkInf(EVENTCHKINF_18) || DREG(1))) { if ((play->sceneId == SCENE_SPOT20) && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || DREG(1))) {
this->actor.params = HORSEGAME_MALON_RACE; this->actor.params = HORSEGAME_MALON_RACE;
} }
if (sInitFuncs[this->actor.params] != NULL) { if (sInitFuncs[this->actor.params] != NULL) {

View file

@ -165,7 +165,7 @@ void EnHorseLinkChild_Init(Actor* thisx, PlayState* play) {
if (IS_CUTSCENE_LAYER) { if (IS_CUTSCENE_LAYER) {
func_80A69EC0(this); func_80A69EC0(this);
} else if (play->sceneId == SCENE_SPOT20) { } else if (play->sceneId == SCENE_SPOT20) {
if (!Flags_GetEventChkInf(EVENTCHKINF_14)) { if (!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
return; return;
} }

View file

@ -207,7 +207,7 @@ void EnHorseNormal_Init(Actor* thisx, PlayState* play) {
return; return;
} }
if (!LINK_IS_ADULT) { if (!LINK_IS_ADULT) {
if (Flags_GetEventChkInf(EVENTCHKINF_14)) { if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
if (this->actor.world.rot.z != 3) { if (this->actor.world.rot.z != 3) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
return; return;
@ -216,7 +216,7 @@ void EnHorseNormal_Init(Actor* thisx, PlayState* play) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
return; return;
} }
} else if (Flags_GetEventChkInf(EVENTCHKINF_18) || (DREG(1) != 0)) { } else if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0)) {
if (this->actor.world.rot.z != 7) { if (this->actor.world.rot.z != 7) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
return; return;

View file

@ -429,7 +429,9 @@ u16 func_80A6F810(PlayState* play, Actor* thisx) {
switch (this->actor.params & 0x7F) { switch (this->actor.params & 0x7F) {
case ENHY_TYPE_AOB: case ENHY_TYPE_AOB:
if (play->sceneId == SCENE_KAKARIKO) { if (play->sceneId == SCENE_KAKARIKO) {
return (this->unk_330 & EVENTCHKINF_6B_MASK) ? 0x508D : (GET_INFTABLE(INFTABLE_CB) ? 0x508C : 0x508B); return (this->unk_330 & EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_MASK)
? 0x508D
: (GET_INFTABLE(INFTABLE_CB) ? 0x508C : 0x508B);
} else if (play->sceneId == SCENE_MARKET_DAY) { } else if (play->sceneId == SCENE_MARKET_DAY) {
return GET_EVENTINF(EVENTINF_30) ? 0x709B : 0x709C; return GET_EVENTINF(EVENTINF_30) ? 0x709B : 0x709C;
} else if (gSaveContext.dogIsLost) { } else if (gSaveContext.dogIsLost) {
@ -457,7 +459,7 @@ u16 func_80A6F810(PlayState* play, Actor* thisx) {
return 0x5085; return 0x5085;
} else if (GET_EVENTCHKINF(EVENTCHKINF_80)) { } else if (GET_EVENTCHKINF(EVENTCHKINF_80)) {
return GET_INFTABLE(INFTABLE_C3) ? 0x701A : 0x7047; return GET_INFTABLE(INFTABLE_C3) ? 0x701A : 0x7047;
} else if (GET_EVENTCHKINF(EVENTCHKINF_14)) { } else if (GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
return 0x701A; return 0x701A;
} else if (GET_EVENTCHKINF(EVENTCHKINF_10)) { } else if (GET_EVENTCHKINF(EVENTCHKINF_10)) {
return 0x701B; return 0x701B;
@ -537,7 +539,9 @@ u16 func_80A6F810(PlayState* play, Actor* thisx) {
if (!LINK_IS_ADULT) { if (!LINK_IS_ADULT) {
return GET_EVENTCHKINF(EVENTCHKINF_80) ? 0x505F : (GET_INFTABLE(INFTABLE_163) ? 0x505E : 0x505D); return GET_EVENTCHKINF(EVENTCHKINF_80) ? 0x505F : (GET_INFTABLE(INFTABLE_163) ? 0x505E : 0x505D);
} else { } else {
return (this->unk_330 & EVENTCHKINF_6B_MASK) ? 0x5062 : (GET_INFTABLE(INFTABLE_164) ? 0x5061 : 0x5060); return (this->unk_330 & EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_MASK)
? 0x5062
: (GET_INFTABLE(INFTABLE_164) ? 0x5061 : 0x5060);
} }
case ENHY_TYPE_BJI_19: case ENHY_TYPE_BJI_19:
return 0x7120; return 0x7120;
@ -909,7 +913,7 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) {
} }
if (play->sceneId == SCENE_KAKARIKO) { if (play->sceneId == SCENE_KAKARIKO) {
this->unk_330 = gSaveContext.eventChkInf[EVENTCHKINF_6B_INDEX]; this->unk_330 = gSaveContext.eventChkInf[EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_INDEX];
} }
EnHy_InitSetProperties(this); EnHy_InitSetProperties(this);

View file

@ -427,7 +427,7 @@ void func_80A74EBC(EnIk* this, PlayState* play) {
sp2C.z = this->actor.world.pos.z + Math_CosS(this->actor.shape.rot.y + 0x6A4) * 70.0f; sp2C.z = this->actor.world.pos.z + Math_CosS(this->actor.shape.rot.y + 0x6A4) * 70.0f;
sp2C.y = this->actor.world.pos.y; sp2C.y = this->actor.world.pos.y;
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_IRONNACK_HIT_GND); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_IRONNACK_HIT_GND);
Camera_AddQuake(&play->mainCamera, 2, 0x19, 5); Camera_RequestQuake(&play->mainCamera, 2, 25, 5);
Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150); Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150);
CollisionCheck_SpawnShieldParticles(play, &sp2C); CollisionCheck_SpawnShieldParticles(play, &sp2C);
} }

View file

@ -110,7 +110,7 @@ static Gfx* sAdultEraDLs[] = {
}; };
u16 func_80A78FB0(PlayState* play) { u16 func_80A78FB0(PlayState* play) {
if (GET_EVENTCHKINF(EVENTCHKINF_14)) { if (GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
if (GET_INFTABLE(INFTABLE_97)) { if (GET_INFTABLE(INFTABLE_97)) {
return 0x2046; return 0x2046;
} else { } else {
@ -131,7 +131,7 @@ u16 func_80A79010(PlayState* play) {
if (temp_v0 != 0) { if (temp_v0 != 0) {
return temp_v0; return temp_v0;
} }
if (GET_EVENTCHKINF(EVENTCHKINF_18)) { if (GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
if (IS_DAY) { if (IS_DAY) {
return 0x205F; return 0x205F;
} else { } else {
@ -364,34 +364,34 @@ s32 func_80A7975C(EnIn* this, PlayState* play) {
s32 func_80A79830(EnIn* this, PlayState* play) { s32 func_80A79830(EnIn* this, PlayState* play) {
if (play->sceneId == SCENE_SPOT20 && LINK_IS_CHILD && IS_DAY && this->actor.shape.rot.z == 1 && if (play->sceneId == SCENE_SPOT20 && LINK_IS_CHILD && IS_DAY && this->actor.shape.rot.z == 1 &&
!GET_EVENTCHKINF(EVENTCHKINF_14)) { !GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
return 1; return 1;
} }
if (play->sceneId == SCENE_MALON_STABLE && LINK_IS_CHILD && IS_DAY && this->actor.shape.rot.z == 3 && if (play->sceneId == SCENE_MALON_STABLE && LINK_IS_CHILD && IS_DAY && this->actor.shape.rot.z == 3 &&
GET_EVENTCHKINF(EVENTCHKINF_14)) { GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
return 1; return 1;
} }
if (play->sceneId == SCENE_MALON_STABLE && LINK_IS_CHILD && IS_NIGHT) { if (play->sceneId == SCENE_MALON_STABLE && LINK_IS_CHILD && IS_NIGHT) {
if ((this->actor.shape.rot.z == 2) && !GET_EVENTCHKINF(EVENTCHKINF_14)) { if ((this->actor.shape.rot.z == 2) && !GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
return 1; return 1;
} }
if ((this->actor.shape.rot.z == 4) && GET_EVENTCHKINF(EVENTCHKINF_14)) { if ((this->actor.shape.rot.z == 4) && GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
return 1; return 1;
} }
} }
if (play->sceneId == SCENE_SPOT20 && LINK_IS_ADULT && IS_DAY) { if (play->sceneId == SCENE_SPOT20 && LINK_IS_ADULT && IS_DAY) {
if ((this->actor.shape.rot.z == 5) && !GET_EVENTCHKINF(EVENTCHKINF_18)) { if ((this->actor.shape.rot.z == 5) && !GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
return 2; return 2;
} }
if ((this->actor.shape.rot.z == 7) && GET_EVENTCHKINF(EVENTCHKINF_18)) { if ((this->actor.shape.rot.z == 7) && GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
return 4; return 4;
} }
} }
if (play->sceneId == SCENE_SOUKO && LINK_IS_ADULT && IS_NIGHT) { if (play->sceneId == SCENE_SOUKO && LINK_IS_ADULT && IS_NIGHT) {
if (this->actor.shape.rot.z == 6 && !GET_EVENTCHKINF(EVENTCHKINF_18)) { if (this->actor.shape.rot.z == 6 && !GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
return 3; return 3;
} }
if (this->actor.shape.rot.z == 8 && GET_EVENTCHKINF(EVENTCHKINF_18)) { if (this->actor.shape.rot.z == 8 && GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
return 3; return 3;
} }
} }
@ -530,7 +530,7 @@ void func_80A79FB0(EnIn* this, PlayState* play) {
case 3: case 3:
EnIn_ChangeAnim(this, ENIN_ANIM_7); EnIn_ChangeAnim(this, ENIN_ANIM_7);
this->actionFunc = func_80A7A4BC; this->actionFunc = func_80A7A4BC;
if (!GET_EVENTCHKINF(EVENTCHKINF_18)) { if (!GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
this->actor.params = 5; this->actor.params = 5;
} }
break; break;

View file

@ -8,7 +8,7 @@
#include "overlays/actors/ovl_En_Insect/z_en_insect.h" #include "overlays/actors/ovl_En_Insect/z_en_insect.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
#include "quake.h"
#include "vt.h" #include "vt.h"
#define FLAGS ACTOR_FLAG_23 #define FLAGS ACTOR_FLAG_23
@ -420,7 +420,7 @@ void EnIshi_Fly(EnIshi* this, PlayState* play) {
s32 pad; s32 pad;
s16 type = this->actor.params & 1; s16 type = this->actor.params & 1;
s32 pad2; s32 pad2;
s32 quakeIdx; s32 quakeIndex;
Vec3f contactPos; Vec3f contactPos;
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) { if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) {
@ -432,10 +432,10 @@ void EnIshi_Fly(EnIshi* this, PlayState* play) {
sDustSpawnFuncs[type](this, play); sDustSpawnFuncs[type](this, play);
} }
if (type == ROCK_LARGE) { if (type == ROCK_LARGE) {
quakeIdx = Quake_Add(GET_ACTIVE_CAM(play), 3); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIdx, -0x3CB0); Quake_SetSpeed(quakeIndex, -0x3CB0);
Quake_SetQuakeValues(quakeIdx, 3, 0, 0, 0); Quake_SetPerturbations(quakeIndex, 3, 0, 0, 0);
Quake_SetCountdown(quakeIdx, 7); Quake_SetDuration(quakeIndex, 7);
Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150); Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150);
} }
Actor_Kill(&this->actor); Actor_Kill(&this->actor);

View file

@ -107,7 +107,7 @@ u16 EnMa1_GetText(PlayState* play, Actor* thisx) {
return 0x2048; return 0x2048;
} }
} }
if (GET_EVENTCHKINF(EVENTCHKINF_14)) { if (GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
return 0x2047; return 0x2047;
} }
if (GET_EVENTCHKINF(EVENTCHKINF_12)) { if (GET_EVENTCHKINF(EVENTCHKINF_12)) {
@ -188,10 +188,10 @@ s32 func_80AA08C4(EnMa1* this, PlayState* play) {
return 0; return 0;
} }
if (((play->sceneId == SCENE_MARKET_NIGHT) || (play->sceneId == SCENE_MARKET_DAY)) && if (((play->sceneId == SCENE_MARKET_NIGHT) || (play->sceneId == SCENE_MARKET_DAY)) &&
!GET_EVENTCHKINF(EVENTCHKINF_14) && !GET_INFTABLE(INFTABLE_8B)) { !GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) && !GET_INFTABLE(INFTABLE_8B)) {
return 1; return 1;
} }
if ((play->sceneId == SCENE_SPOT15) && !GET_EVENTCHKINF(EVENTCHKINF_14)) { if ((play->sceneId == SCENE_SPOT15) && !GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
if (GET_INFTABLE(INFTABLE_8B)) { if (GET_INFTABLE(INFTABLE_8B)) {
return 1; return 1;
} else { } else {
@ -199,13 +199,13 @@ s32 func_80AA08C4(EnMa1* this, PlayState* play) {
return 0; return 0;
} }
} }
if ((play->sceneId == SCENE_SOUKO) && IS_NIGHT && GET_EVENTCHKINF(EVENTCHKINF_14)) { if ((play->sceneId == SCENE_SOUKO) && IS_NIGHT && GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
return 1; return 1;
} }
if (play->sceneId != SCENE_SPOT20) { if (play->sceneId != SCENE_SPOT20) {
return 0; return 0;
} }
if ((this->actor.shape.rot.z == 3) && IS_DAY && GET_EVENTCHKINF(EVENTCHKINF_14)) { if ((this->actor.shape.rot.z == 3) && IS_DAY && GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
return 1; return 1;
} }
return 0; return 0;
@ -282,7 +282,7 @@ void EnMa1_Init(Actor* thisx, PlayState* play) {
this->actor.targetMode = 6; this->actor.targetMode = 6;
this->unk_1E8.unk_00 = 0; this->unk_1E8.unk_00 = 0;
if (!GET_EVENTCHKINF(EVENTCHKINF_14) || CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) { if (!GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) || CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) {
this->actionFunc = func_80AA0D88; this->actionFunc = func_80AA0D88;
EnMa1_ChangeAnim(this, ENMA1_ANIM_2); EnMa1_ChangeAnim(this, ENMA1_ANIM_2);
} else { } else {
@ -309,9 +309,9 @@ void func_80AA0D88(EnMa1* this, PlayState* play) {
} }
} }
if ((play->sceneId == SCENE_SPOT15) && GET_EVENTCHKINF(EVENTCHKINF_14)) { if ((play->sceneId == SCENE_SPOT15) && GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} else if (!GET_EVENTCHKINF(EVENTCHKINF_14) || CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) { } else if (!GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) || CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) {
if (this->unk_1E8.unk_00 == 2) { if (this->unk_1E8.unk_00 == 2) {
this->actionFunc = func_80AA0EA0; this->actionFunc = func_80AA0EA0;
play->msgCtx.stateTimer = 4; play->msgCtx.stateTimer = 4;

View file

@ -74,7 +74,7 @@ u16 func_80AA19A0(PlayState* play, Actor* thisx) {
if (faceReaction != 0) { if (faceReaction != 0) {
return faceReaction; return faceReaction;
} }
if (GET_EVENTCHKINF(EVENTCHKINF_18)) { if (GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
return 0x2056; return 0x2056;
} }
if (IS_NIGHT) { if (IS_NIGHT) {
@ -141,15 +141,15 @@ u16 func_80AA1B58(EnMa2* this, PlayState* play) {
if (LINK_IS_CHILD) { if (LINK_IS_CHILD) {
return 0; return 0;
} }
if (!GET_EVENTCHKINF(EVENTCHKINF_18) && (play->sceneId == SCENE_MALON_STABLE) && IS_DAY && if (!GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED) && (play->sceneId == SCENE_MALON_STABLE) && IS_DAY &&
(this->actor.shape.rot.z == 5)) { (this->actor.shape.rot.z == 5)) {
return 1; return 1;
} }
if (!GET_EVENTCHKINF(EVENTCHKINF_18) && (play->sceneId == SCENE_SPOT20) && IS_NIGHT && if (!GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED) && (play->sceneId == SCENE_SPOT20) && IS_NIGHT &&
(this->actor.shape.rot.z == 6)) { (this->actor.shape.rot.z == 6)) {
return 2; return 2;
} }
if (!GET_EVENTCHKINF(EVENTCHKINF_18) || (play->sceneId != SCENE_SPOT20)) { if (!GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED) || (play->sceneId != SCENE_SPOT20)) {
return 0; return 0;
} }
if ((this->actor.shape.rot.z == 7) && IS_DAY) { if ((this->actor.shape.rot.z == 7) && IS_DAY) {

View file

@ -201,7 +201,7 @@ s32 func_80AA2EC8(EnMa3* this, PlayState* play) {
if (LINK_IS_CHILD) { if (LINK_IS_CHILD) {
return 2; return 2;
} }
if (!GET_EVENTCHKINF(EVENTCHKINF_18)) { if (!GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
return 2; return 2;
} }
if (GET_EVENTINF(EVENTINF_HORSES_0A)) { if (GET_EVENTINF(EVENTINF_HORSES_0A)) {

View file

@ -862,7 +862,7 @@ void EnMb_ClubAttack(EnMb* this, PlayState* play) {
EffectSsBlast_SpawnWhiteShockwave(play, &effSpawnPos, &effWhiteShockwaveDynamics, EffectSsBlast_SpawnWhiteShockwave(play, &effSpawnPos, &effWhiteShockwaveDynamics,
&effWhiteShockwaveDynamics); &effWhiteShockwaveDynamics);
func_80033480(play, &effSpawnPos, 2.0f, 3, 0x12C, 0xB4, 1); func_80033480(play, &effSpawnPos, 2.0f, 3, 0x12C, 0xB4, 1);
Camera_AddQuake(&play->mainCamera, 2, 0x19, 5); Camera_RequestQuake(&play->mainCamera, 2, 25, 5);
func_800358DC(&this->actor, &effSpawnPos, &this->actor.world.rot, flamesParams, 20, flamesUnused, play, -1, func_800358DC(&this->actor, &effSpawnPos, &this->actor.world.rot, flamesParams, 20, flamesUnused, play, -1,
NULL); NULL);
EnMb_SetupClubWaitAfterAttack(this); EnMb_SetupClubWaitAfterAttack(this);
@ -1044,7 +1044,7 @@ void EnMb_ClubDamaged(EnMb* this, PlayState* play) {
Animation_PlayOnce(&this->skelAnime, &gEnMbClubStandUpAnim); Animation_PlayOnce(&this->skelAnime, &gEnMbClubStandUpAnim);
this->timer3 = 0; this->timer3 = 0;
Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150); Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150);
Camera_AddQuake(&play->mainCamera, 2, 25, 5); Camera_RequestQuake(&play->mainCamera, 2, 25, 5);
} else { } else {
EnMb_SetupClubWaitPlayerNear(this); EnMb_SetupClubWaitPlayerNear(this);
} }
@ -1105,7 +1105,7 @@ void EnMb_ClubDead(EnMb* this, PlayState* play) {
Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150); Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150);
Actor_SpawnFloorDustRing(play, &this->actor, &effPos, 50.0f, 10, 3.0f, 400, 60, false); Actor_SpawnFloorDustRing(play, &this->actor, &effPos, 50.0f, 10, 3.0f, 400, 60, false);
Audio_PlayActorSfx2(&this->actor, NA_SE_EN_RIZA_DOWN); Audio_PlayActorSfx2(&this->actor, NA_SE_EN_RIZA_DOWN);
Camera_AddQuake(&play->mainCamera, 2, 25, 5); Camera_RequestQuake(&play->mainCamera, 2, 25, 5);
} }
} }

Some files were not shown because too many files have changed in this diff Show more