mirror of
https://github.com/zeldaret/mm.git
synced 2026-05-23 23:05:08 -04:00
Merge remote-tracking branch 'upstream/master' into play
This commit is contained in:
+5
-1
@@ -1,5 +1,9 @@
|
||||
Checks: '-*,readability-braces-around-statements'
|
||||
Checks: '-*,readability-braces-around-statements,readability-inconsistent-declaration-parameter-name'
|
||||
WarningsAsErrors: ''
|
||||
HeaderFilterRegex: '(src|include)\/.*\.h$'
|
||||
FormatStyle: 'file'
|
||||
CheckOptions:
|
||||
# Require argument names to match exactly (instead of allowing a name to be a prefix/suffix of another)
|
||||
# Note: 'true' is expected by clang-tidy 12+ but '1' is used for compatibility with older versions
|
||||
- key: readability-inconsistent-declaration-parameter-name.Strict
|
||||
value: 1
|
||||
|
||||
+675
-675
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,9 @@
|
||||
<Root>
|
||||
<!-- Assets for the sliding doors in the Deku Shrine -->
|
||||
<File Name="object_crace_object" Segment="6">
|
||||
<DList Name="object_crace_object_DL_0003A0" Offset="0x3A0" />
|
||||
<Texture Name="object_crace_object_TLUT_000540" OutName="tlut_000540" Format="rgba16" Width="4" Height="4" Offset="0x540" />
|
||||
<Texture Name="object_crace_object_Tex_000560" OutName="tex_000560" Format="ci4" Width="32" Height="128" Offset="0x560" />
|
||||
<Collision Name="object_crace_object_Colheader_000E00" Offset="0xE00" />
|
||||
<DList Name="gDekuShrineSlidingDoorDL" Offset="0x3A0" /> <!-- Original name is "Y2_DANPEI_shutter_model" -->
|
||||
<Texture Name="gDekuShrineSlidingDoorTLUT" OutName="deku_shrine_sliding_door_tlut" Format="rgba16" Width="4" Height="4" Offset="0x540" />
|
||||
<Texture Name="gDekuShrineSlidingDoorTex" OutName="deku_shrine_sliding_door" Format="ci4" Width="32" Height="128" Offset="0x560" />
|
||||
<Collision Name="gDekuShrineSlidingDoorCol" Offset="0xE00" />
|
||||
</File>
|
||||
</Root>
|
||||
|
||||
@@ -1,86 +1,96 @@
|
||||
<Root>
|
||||
<!-- Assets for the Deku Butler -->
|
||||
<File Name="object_dnj" Segment="6">
|
||||
<Animation Name="object_dnj_Anim_000470" Offset="0x470" />
|
||||
<Animation Name="object_dnj_Anim_0008F0" Offset="0x8F0" />
|
||||
<Animation Name="object_dnj_Anim_000F6C" Offset="0xF6C" />
|
||||
<Animation Name="object_dnj_Anim_001A50" Offset="0x1A50" />
|
||||
<Animation Name="object_dnj_Anim_002530" Offset="0x2530" />
|
||||
<Animation Name="object_dnj_Anim_003320" Offset="0x3320" />
|
||||
<Animation Name="object_dnj_Anim_0036D0" Offset="0x36D0" />
|
||||
<Animation Name="object_dnj_Anim_0041CC" Offset="0x41CC" />
|
||||
<Animation Name="object_dnj_Anim_004DD8" Offset="0x4DD8" />
|
||||
<Animation Name="object_dnj_Anim_0051E4" Offset="0x51E4" />
|
||||
<Animation Name="object_dnj_Anim_005E20" Offset="0x5E20" />
|
||||
<Animation Name="object_dnj_Anim_005F98" Offset="0x5F98" />
|
||||
<Animation Name="object_dnj_Anim_006488" Offset="0x6488" />
|
||||
<Animation Name="object_dnj_Anim_006F84" Offset="0x6F84" />
|
||||
<Animation Name="object_dnj_Anim_0073E4" Offset="0x73E4" />
|
||||
<Animation Name="object_dnj_Anim_0077A8" Offset="0x77A8" />
|
||||
<Animation Name="object_dnj_Anim_007CA4" Offset="0x7CA4" />
|
||||
<Animation Name="object_dnj_Anim_008324" Offset="0x8324" />
|
||||
<Animation Name="object_dnj_Anim_008AE4" Offset="0x8AE4" />
|
||||
<Animation Name="object_dnj_Anim_009100" Offset="0x9100" />
|
||||
<DList Name="object_dnj_DL_00B7C0" Offset="0xB7C0" />
|
||||
<DList Name="object_dnj_DL_00B850" Offset="0xB850" />
|
||||
<DList Name="object_dnj_DL_00BC68" Offset="0xBC68" />
|
||||
<DList Name="object_dnj_DL_00BDD8" Offset="0xBDD8" />
|
||||
<DList Name="object_dnj_DL_00BEF0" Offset="0xBEF0" />
|
||||
<DList Name="object_dnj_DL_00C118" Offset="0xC118" />
|
||||
<DList Name="object_dnj_DL_00C1A0" Offset="0xC1A0" />
|
||||
<DList Name="object_dnj_DL_00C248" Offset="0xC248" />
|
||||
<DList Name="object_dnj_DL_00C370" Offset="0xC370" />
|
||||
<DList Name="object_dnj_DL_00C450" Offset="0xC450" />
|
||||
<DList Name="object_dnj_DL_00C4E0" Offset="0xC4E0" />
|
||||
<DList Name="object_dnj_DL_00C5C0" Offset="0xC5C0" />
|
||||
<DList Name="object_dnj_DL_00C650" Offset="0xC650" />
|
||||
<DList Name="object_dnj_DL_00C7C0" Offset="0xC7C0" />
|
||||
<DList Name="object_dnj_DL_00C8D8" Offset="0xC8D8" />
|
||||
<DList Name="object_dnj_DL_00C988" Offset="0xC988" />
|
||||
<DList Name="object_dnj_DL_00CA38" Offset="0xCA38" />
|
||||
<DList Name="object_dnj_DL_00CAE8" Offset="0xCAE8" />
|
||||
<DList Name="object_dnj_DL_00CBE8" Offset="0xCBE8" />
|
||||
<DList Name="object_dnj_DL_00CC90" Offset="0xCC90" />
|
||||
<DList Name="object_dnj_DL_00CD48" Offset="0xCD48" />
|
||||
<DList Name="object_dnj_DL_00CE00" Offset="0xCE00" />
|
||||
<DList Name="object_dnj_DL_00CEC8" Offset="0xCEC8" />
|
||||
<DList Name="object_dnj_DL_00CF88" Offset="0xCF88" />
|
||||
<DList Name="object_dnj_DL_00D040" Offset="0xD040" />
|
||||
<DList Name="object_dnj_DL_00D108" Offset="0xD108" />
|
||||
<Texture Name="object_dnj_Tex_00D1C8" OutName="tex_00D1C8" Format="rgba16" Width="16" Height="16" Offset="0xD1C8" />
|
||||
<Texture Name="object_dnj_Tex_00D3C8" OutName="tex_00D3C8" Format="rgba16" Width="16" Height="16" Offset="0xD3C8" />
|
||||
<Texture Name="object_dnj_Tex_00D5C8" OutName="tex_00D5C8" Format="rgba16" Width="8" Height="8" Offset="0xD5C8" />
|
||||
<Texture Name="object_dnj_Tex_00D648" OutName="tex_00D648" Format="rgba16" Width="16" Height="16" Offset="0xD648" />
|
||||
<Texture Name="object_dnj_Tex_00D848" OutName="tex_00D848" Format="rgba16" Width="16" Height="32" Offset="0xD848" />
|
||||
<Texture Name="object_dnj_Tex_00DC48" OutName="tex_00DC48" Format="rgba16" Width="16" Height="8" Offset="0xDC48" />
|
||||
<Texture Name="object_dnj_Tex_00DD48" OutName="tex_00DD48" Format="rgba16" Width="16" Height="16" Offset="0xDD48" />
|
||||
<Texture Name="object_dnj_Tex_00DF48" OutName="tex_00DF48" Format="rgba16" Width="8" Height="16" Offset="0xDF48" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E048" Type="Standard" EnumName="OBJECT_DNJ_LIMB_01" Offset="0xE048" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E054" Type="Standard" EnumName="OBJECT_DNJ_LIMB_02" Offset="0xE054" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E060" Type="Standard" EnumName="OBJECT_DNJ_LIMB_03" Offset="0xE060" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E06C" Type="Standard" EnumName="OBJECT_DNJ_LIMB_04" Offset="0xE06C" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E078" Type="Standard" EnumName="OBJECT_DNJ_LIMB_05" Offset="0xE078" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E084" Type="Standard" EnumName="OBJECT_DNJ_LIMB_06" Offset="0xE084" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E090" Type="Standard" EnumName="OBJECT_DNJ_LIMB_07" Offset="0xE090" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E09C" Type="Standard" EnumName="OBJECT_DNJ_LIMB_08" Offset="0xE09C" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E0A8" Type="Standard" EnumName="OBJECT_DNJ_LIMB_09" Offset="0xE0A8" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E0B4" Type="Standard" EnumName="OBJECT_DNJ_LIMB_0A" Offset="0xE0B4" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E0C0" Type="Standard" EnumName="OBJECT_DNJ_LIMB_0B" Offset="0xE0C0" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E0CC" Type="Standard" EnumName="OBJECT_DNJ_LIMB_0C" Offset="0xE0CC" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E0D8" Type="Standard" EnumName="OBJECT_DNJ_LIMB_0D" Offset="0xE0D8" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E0E4" Type="Standard" EnumName="OBJECT_DNJ_LIMB_0E" Offset="0xE0E4" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E0F0" Type="Standard" EnumName="OBJECT_DNJ_LIMB_0F" Offset="0xE0F0" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E0FC" Type="Standard" EnumName="OBJECT_DNJ_LIMB_10" Offset="0xE0FC" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E108" Type="Standard" EnumName="OBJECT_DNJ_LIMB_11" Offset="0xE108" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E114" Type="Standard" EnumName="OBJECT_DNJ_LIMB_12" Offset="0xE114" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E120" Type="Standard" EnumName="OBJECT_DNJ_LIMB_13" Offset="0xE120" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E12C" Type="Standard" EnumName="OBJECT_DNJ_LIMB_14" Offset="0xE12C" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E138" Type="Standard" EnumName="OBJECT_DNJ_LIMB_15" Offset="0xE138" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E144" Type="Standard" EnumName="OBJECT_DNJ_LIMB_16" Offset="0xE144" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E150" Type="Standard" EnumName="OBJECT_DNJ_LIMB_17" Offset="0xE150" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E15C" Type="Standard" EnumName="OBJECT_DNJ_LIMB_18" Offset="0xE15C" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E168" Type="Standard" EnumName="OBJECT_DNJ_LIMB_19" Offset="0xE168" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E174" Type="Standard" EnumName="OBJECT_DNJ_LIMB_1A" Offset="0xE174" />
|
||||
<Limb Name="object_dnj_Standardlimb_00E180" Type="Standard" EnumName="OBJECT_DNJ_LIMB_1B" Offset="0xE180" />
|
||||
<Skeleton Name="object_dnj_Skel_00E1F8" Type="Flex" LimbType="Standard" LimbNone="OBJECT_DNJ_LIMB_NONE" LimbMax="OBJECT_DNJ_LIMB_MAX" EnumName="ObjectDnoLimb" Offset="0xE1F8" />
|
||||
<!-- Deku Butler Animations -->
|
||||
<Animation Name="gDekuButlerStartRaceStartAnim" Offset="0x470" /> <!-- Original name is "dnj_douzoR" (named after the line he says when the race starts in the Japanese text)-->
|
||||
<Animation Name="gDekuButlerStartRaceEndAnim" Offset="0x8F0" /> <!-- Original name is "dnj_douzoTOwaitR" -->
|
||||
<Animation Name="gDekuButlerFlyAnim" Offset="0xF6C" /> <!-- Original name is "dnj_flyR" -->
|
||||
<Animation Name="gDekuButlerFarewellAnim" Offset="0x1A50" /> <!-- Original name is "dnj_goodbye" -->
|
||||
<Animation Name="gDekuButlerGreetingAnim" Offset="0x2530" /> <!-- Original name is "dnj_hello" -->
|
||||
<Animation Name="gDekuButlerGreetingWithCandleAnim" Offset="0x3320" /> <!-- Original name is "dnj_helloR" -->
|
||||
<Animation Name="gDekuButlerPrayerLoopAnim" Offset="0x36D0" /> <!-- Original name is "dnj_inori" ("prayer; supplication") -->
|
||||
<Animation Name="gDekuButlerCloseParasolAnim" Offset="0x41CC" /> <!-- Original name is "dnj_kasacloseR" ("kasa" = "umbrella; parasol") -->
|
||||
<Animation Name="gDekuButlerOpenParasolAnim" Offset="0x4DD8" /> <!-- Original name is "dnj_kasaopenR" -->
|
||||
<Animation Name="gDekuButlerShockStartAnim" Offset="0x51E4" /> <!-- Original name is "dnj_kosinukasu" ("to be unable to stand due to fear/surprise") -->
|
||||
<Animation Name="gDekuButlerShockLoopAnim" Offset="0x5E20" /> <!-- Original name is "dnj_kosinukasu_loop" -->
|
||||
<Animation Name="gDekuButlerImploreLoopAnim" Offset="0x5F98" /> <!-- Original name is "dnj_oisame" ("o" = "king", "isame" = "to admonish; to advise") -->
|
||||
<Animation Name="gDekuButlerImploreEndAnim" Offset="0x6488" /> <!-- Original name is "dnj_oisameTOwait" -->
|
||||
<Animation Name="gDekuButlerGrieveAnim" Offset="0x6F84" /> <!-- Original name is "dnj_rakutan_loop" ("despondency; disappointment")-->
|
||||
<Animation Name="gDekuButlerTalkAnim" Offset="0x73E4" /> <!-- Original name is "dnj_talk" -->
|
||||
<Animation Name="gDekuButlerTalkWithParasolAndCandleAnim" Offset="0x77A8" /> <!-- Original name is "dnj_talkR" -->
|
||||
<Animation Name="gDekuButlerIdleAnim" Offset="0x7CA4" /> <!-- Original name is "dnj_wait" -->
|
||||
<Animation Name="gDekuButlerIdleWithCandleAnim" Offset="0x8324" /> <!-- Original name is "dnj_waitR" -->
|
||||
<Animation Name="gDekuButlerPrayerStartAnim" Offset="0x8AE4" /> <!-- Original name is "dnj_waitTOinori" -->
|
||||
<Animation Name="gDekuButlerImploreStartAnim" Offset="0x9100" /> <!-- Original name is "dnj_waitTOoisame" -->
|
||||
|
||||
<!-- Deku Butler Limb DisplayLists -->
|
||||
<DList Name="gDekuButlerEyesDL" Offset="0xB7C0" />
|
||||
<DList Name="gDekuButlerUpperBodyDL" Offset="0xB850" />
|
||||
<DList Name="gDekuButlerLeftForearmDL" Offset="0xBC68" />
|
||||
<DList Name="gDekuButlerLeftHandDL" Offset="0xBDD8" />
|
||||
<DList Name="gDekuButlerCandleDL" Offset="0xBEF0" />
|
||||
<DList Name="gDekuButlerCandleWickDL" Offset="0xC118" />
|
||||
<DList Name="gDekuButlerLeftUpperArmDL" Offset="0xC1A0" />
|
||||
<DList Name="gDekuButlerSnoutDL" Offset="0xC248" />
|
||||
<DList Name="gDekuButlerRightMustacheCurlDL" Offset="0xC370" />
|
||||
<DList Name="gDekuButlerRightMustacheBaseDL" Offset="0xC450" />
|
||||
<DList Name="gDekuButlerLeftMustacheCurlDL" Offset="0xC4E0" />
|
||||
<DList Name="gDekuButlerLeftMustacheBaseDL" Offset="0xC5C0" />
|
||||
<DList Name="gDekuButlerRightForearmDL" Offset="0xC650" />
|
||||
<DList Name="gDekuButlerRightHandDL" Offset="0xC7C0" />
|
||||
<DList Name="gDekuButlerParasolUpperPetalsDL" Offset="0xC8D8" />
|
||||
<DList Name="gDekuButlerParasolMiddlePetalsDL" Offset="0xC988" />
|
||||
<DList Name="gDekuButlerParasolLowerPetalsDL" Offset="0xCA38" />
|
||||
<DList Name="gDekuButlerParasolHandleDL" Offset="0xCAE8" />
|
||||
<DList Name="gDekuButlerRightUpperArmDL" Offset="0xCBE8" />
|
||||
<DList Name="gDekuButlerPelvisDL" Offset="0xCC90" />
|
||||
<DList Name="gDekuButlerLeftShinDL" Offset="0xCD48" />
|
||||
<DList Name="gDekuButlerLeftFootDL" Offset="0xCE00" />
|
||||
<DList Name="gDekuButlerLeftThighDL" Offset="0xCEC8" />
|
||||
<DList Name="gDekuButlerRightShinDL" Offset="0xCF88" />
|
||||
<DList Name="gDekuButlerRightFootDL" Offset="0xD040" />
|
||||
<DList Name="gDekuButlerRightThighDL" Offset="0xD108" />
|
||||
|
||||
<!-- Deku Butler Textures -->
|
||||
<Texture Name="gDekuButlerEyeTex" OutName="deku_butler_eye" Format="rgba16" Width="16" Height="16" Offset="0xD1C8" />
|
||||
<Texture Name="gDekuButlerBodyAndCandleHolderTex" OutName="deku_butler_body_and_candle_holder" Format="rgba16" Width="16" Height="16" Offset="0xD3C8" />
|
||||
<Texture Name="gDekuButlerMouthTex" OutName="deku_butler_mouth" Format="rgba16" Width="8" Height="8" Offset="0xD5C8" />
|
||||
<Texture Name="gDekuButlerLeafTex" OutName="deku_butler_leaf" Format="rgba16" Width="16" Height="16" Offset="0xD648" />
|
||||
<Texture Name="gDekuButlerParasolPetalTex" OutName="deku_butler_parasol_petal" Format="rgba16" Width="16" Height="32" Offset="0xD848" />
|
||||
<Texture Name="gDekuButlerCandleTex" OutName="deku_butler_candle" Format="rgba16" Width="16" Height="8" Offset="0xDC48" />
|
||||
<Texture Name="gDekuButlerHairTex" OutName="deku_butler_hair" Format="rgba16" Width="16" Height="16" Offset="0xDD48" />
|
||||
<Texture Name="gDekuButlerBowtieCenter" OutName="deku_butler_bowtie_center" Format="rgba16" Width="8" Height="16" Offset="0xDF48" />
|
||||
|
||||
<!-- Deku Butler Limbs -->
|
||||
<Limb Name="gDekuButlerRootLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_ROOT" Offset="0xE048" />
|
||||
<Limb Name="gDekuButlerPelvisLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_PELVIS" Offset="0xE054" />
|
||||
<Limb Name="gDekuButlerRightThighLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_RIGHT_THIGH" Offset="0xE060" />
|
||||
<Limb Name="gDekuButlerRightShinLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_RIGHT_SHIN" Offset="0xE06C" />
|
||||
<Limb Name="gDekuButlerRightFootLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_RIGHT_FOOT" Offset="0xE078" />
|
||||
<Limb Name="gDekuButlerLeftThighLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_LEFT_THIGH" Offset="0xE084" />
|
||||
<Limb Name="gDekuButlerLeftShinLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_LEFT_SHIN" Offset="0xE090" />
|
||||
<Limb Name="gDekuButlerLeftFootLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_LEFT_FOOT" Offset="0xE09C" />
|
||||
<Limb Name="gDekuButlerEyesLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_EYES" Offset="0xE0A8" />
|
||||
<Limb Name="gDekuButlerRightUpperArmLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_RIGHT_UPPER_ARM" Offset="0xE0B4" />
|
||||
<Limb Name="gDekuButlerRightForearmLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_RIGHT_FOREARM" Offset="0xE0C0" />
|
||||
<Limb Name="gDekuButlerRightHandLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_RIGHT_HAND" Offset="0xE0CC" />
|
||||
<Limb Name="gDekuButlerParasolHandleLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_PARASOL_HANDLE" Offset="0xE0D8" />
|
||||
<Limb Name="gDekuButlerParasolUpperPetalsLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_PARASOL_UPPER_PETALS" Offset="0xE0E4" />
|
||||
<Limb Name="gDekuButlerParasolLowerPetalsLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_PARASOL_LOWER_PETALS" Offset="0xE0F0" />
|
||||
<Limb Name="gDekuButlerParasolMiddlePetalsLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_PARASOL_MIDDLE_PETALS" Offset="0xE0FC" />
|
||||
<Limb Name="gDekuButlerSnoutLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_SNOUT" Offset="0xE108" />
|
||||
<Limb Name="gDekuButlerLeftMustacheBaseLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_LEFT_MUSTACHE_BASE" Offset="0xE114" />
|
||||
<Limb Name="gDekuButlerLeftMustacheCurlLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_LEFT_MUSTACHE_CURL" Offset="0xE120" />
|
||||
<Limb Name="gDekuButlerRightMustacheBaseLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_RIGHT_MUSTACHE_BASE" Offset="0xE12C" />
|
||||
<Limb Name="gDekuButlerRightMustacheCurlLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_RIGHT_MUSTACHE_CURL" Offset="0xE138" />
|
||||
<Limb Name="gDekuButlerLeftUpperArmLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_LEFT_UPPER_ARM" Offset="0xE144" />
|
||||
<Limb Name="gDekuButlerLeftForearmLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_LEFT_FOREARM" Offset="0xE150" />
|
||||
<Limb Name="gDekuButlerLeftHandLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_LEFT_HAND" Offset="0xE15C" />
|
||||
<Limb Name="gDekuButlerCandleLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_CANDLE" Offset="0xE168" />
|
||||
<Limb Name="gDekuButlerCandleWickLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_CANDLE_WICK" Offset="0xE174" />
|
||||
<Limb Name="gDekuButlerUpperBodyLimb" Type="Standard" EnumName="DEKU_BUTLER_LIMB_UPPER_BODY" Offset="0xE180" />
|
||||
|
||||
<!-- Deku Butler Skeleton -->
|
||||
<Skeleton Name="gDekuButlerSkel" Type="Flex" LimbType="Standard" LimbNone="DEKU_BUTLER_LIMB_NONE" LimbMax="DEKU_BUTLER_LIMB_MAX" EnumName="DekuButlerLimb" Offset="0xE1F8" />
|
||||
</File>
|
||||
</Root>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Root>
|
||||
<File Name="object_fusen" Segment="6">
|
||||
<DList Name="object_fusen_DL_000A00" Offset="0xA00" />
|
||||
<DList Name="object_fusen_DL_000D78" Offset="0xD78" />
|
||||
<DList Name="gMajoraBalloonDL" Offset="0xA00" />
|
||||
<DList Name="gMajoraBalloonKnotDL" Offset="0xD78" />
|
||||
<Texture Name="object_fusen_Tex_000E08" OutName="tex_000E08" Format="rgba16" Width="32" Height="32" Offset="0xE08" />
|
||||
<Collision Name="object_fusen_Colheader_002420" Offset="0x2420" />
|
||||
</File>
|
||||
|
||||
@@ -51,10 +51,10 @@
|
||||
<Texture Name="gKotakeSkinTex" OutName="kotake_skin" Format="ci8" Width="16" Height="8" Offset="0xA678" />
|
||||
<Texture Name="gKotakeMouthTex" OutName="kotake_mouth" Format="ci8" Width="8" Height="8" Offset="0xA6F8" />
|
||||
<Texture Name="gKotakeHairTex" OutName="kotake_hair" Format="rgba16" Width="8" Height="32" Offset="0xA738" />
|
||||
<Texture Name="gKotakeBraidEndTex" OutName="kotake_BRAID_end" Format="rgba16" Width="8" Height="8" Offset="0xA938" />
|
||||
<Texture Name="gKotakeBraidEndTex" OutName="kotake_braid_end" Format="rgba16" Width="8" Height="8" Offset="0xA938" />
|
||||
<Texture Name="gKotakeEarTex" OutName="kotake_ear" Format="ci8" Width="8" Height="8" Offset="0xA9B8" />
|
||||
<Texture Name="gKotakeCollarNeckTex" OutName="kotake_collar_neck" Format="rgba16" Width="4" Height="8" Offset="0xA9F8" />
|
||||
<Texture Name="gKotakeFingersTex" OutName="kotake_finger" Format="ci8" Width="8" Height="16" Offset="0xAA38" />
|
||||
<Texture Name="gKotakeFingerTex" OutName="kotake_finger" Format="ci8" Width="8" Height="16" Offset="0xAA38" />
|
||||
<Texture Name="gKotakeBroomHandleTex" OutName="kotake_broom_handle" Format="rgba16" Width="8" Height="8" Offset="0xAAB8" />->
|
||||
<Texture Name="gKotakeBroomHeadTex" OutName="kotake_broom_head" Format="rgba16" Width="16" Height="32" Offset="0xAB38" />
|
||||
<Texture Name="gKotakeJewelHolderTex" OutName="kotake_jewel_holder" Format="rgba16" Width="16" Height="8" Offset="0xAF38" />
|
||||
|
||||
+113
-104
@@ -1,108 +1,117 @@
|
||||
<Root>
|
||||
<!-- Assets for Koume -->
|
||||
<File Name="object_tru" Segment="6">
|
||||
<DList Name="object_tru_DL_000390" Offset="0x390" />
|
||||
<DList Name="object_tru_DL_0004C8" Offset="0x4C8" />
|
||||
<Texture Name="object_tru_Tex_000560" OutName="tex_000560" Format="rgba16" Width="16" Height="32" Offset="0x560" />
|
||||
<Texture Name="object_tru_Tex_000960" OutName="tex_000960" Format="rgba16" Width="32" Height="32" Offset="0x960" />
|
||||
<Texture Name="object_tru_Tex_001160" OutName="tex_001160" Format="rgba16" Width="32" Height="32" Offset="0x1160" />
|
||||
<DList Name="object_tru_DL_001F90" Offset="0x1F90" />
|
||||
<DList Name="object_tru_DL_0020C8" Offset="0x20C8" />
|
||||
<DList Name="object_tru_DL_002160" Offset="0x2160" />
|
||||
<Texture Name="object_tru_Tex_002168" OutName="tex_002168" Format="i4" Width="16" Height="16" Offset="0x2168" />
|
||||
<Animation Name="object_tru_Anim_002BD8" Offset="0x2BD8" />
|
||||
<Animation Name="object_tru_Anim_003698" Offset="0x3698" />
|
||||
<Animation Name="object_tru_Anim_00446C" Offset="0x446C" />
|
||||
<Animation Name="object_tru_Anim_007FA0" Offset="0x7FA0" />
|
||||
<Animation Name="object_tru_Anim_009348" Offset="0x9348" />
|
||||
<DList Name="object_tru_DL_00B730" Offset="0xB730" />
|
||||
<DList Name="object_tru_DL_00B940" Offset="0xB940" />
|
||||
<DList Name="object_tru_DL_00BA88" Offset="0xBA88" />
|
||||
<DList Name="object_tru_DL_00BBB8" Offset="0xBBB8" />
|
||||
<DList Name="object_tru_DL_00C630" Offset="0xC630" />
|
||||
<DList Name="object_tru_DL_00C730" Offset="0xC730" />
|
||||
<DList Name="object_tru_DL_00C810" Offset="0xC810" />
|
||||
<DList Name="object_tru_DL_00C860" Offset="0xC860" />
|
||||
<DList Name="object_tru_DL_00C960" Offset="0xC960" />
|
||||
<DList Name="object_tru_DL_00CA40" Offset="0xCA40" />
|
||||
<DList Name="object_tru_DL_00CB50" Offset="0xCB50" />
|
||||
<DList Name="object_tru_DL_00CCC0" Offset="0xCCC0" />
|
||||
<DList Name="object_tru_DL_00CFA8" Offset="0xCFA8" />
|
||||
<DList Name="object_tru_DL_00D0C0" Offset="0xD0C0" />
|
||||
<DList Name="object_tru_DL_00D1D0" Offset="0xD1D0" />
|
||||
<DList Name="object_tru_DL_00D2E0" Offset="0xD2E0" />
|
||||
<DList Name="object_tru_DL_00D450" Offset="0xD450" />
|
||||
<DList Name="object_tru_DL_00D738" Offset="0xD738" />
|
||||
<DList Name="object_tru_DL_00DA38" Offset="0xDA38" />
|
||||
<DList Name="object_tru_DL_00DB50" Offset="0xDB50" />
|
||||
<DList Name="object_tru_DL_00DC40" Offset="0xDC40" />
|
||||
<DList Name="object_tru_DL_00DC88" Offset="0xDC88" />
|
||||
<DList Name="object_tru_DL_00DD38" Offset="0xDD38" />
|
||||
<DList Name="object_tru_DL_00DDD0" Offset="0xDDD0" />
|
||||
<DList Name="object_tru_DL_00DE18" Offset="0xDE18" />
|
||||
<DList Name="object_tru_DL_00DEC8" Offset="0xDEC8" />
|
||||
<Animation Name="object_tru_Anim_00EEDC" Offset="0xEEDC" />
|
||||
<Animation Name="object_tru_Anim_00F9A0" Offset="0xF9A0" />
|
||||
<Animation Name="object_tru_Anim_0108AC" Offset="0x108AC" />
|
||||
<Animation Name="object_tru_Anim_011F88" Offset="0x11F88" />
|
||||
<Animation Name="object_tru_Anim_014728" Offset="0x14728" />
|
||||
<Animation Name="object_tru_Anim_015068" Offset="0x15068" />
|
||||
<Animation Name="object_tru_Anim_015CA0" Offset="0x15CA0" />
|
||||
<Animation Name="object_tru_Anim_016B4C" Offset="0x16B4C" />
|
||||
<Texture Name="object_tru_TLUT_016B60" OutName="tlut_016B60" Format="rgba16" Width="16" Height="16" Offset="0x16B60" />
|
||||
<Texture Name="object_tru_TLUT_016D60" OutName="tlut_016D60" Format="rgba16" Width="16" Height="16" Offset="0x16D60" />
|
||||
<Texture Name="object_tru_TLUT_016F60" OutName="tlut_016F60" Format="rgba16" Width="16" Height="16" Offset="0x16F60" />
|
||||
<Texture Name="object_tru_TLUT_017160" OutName="tlut_017160" Format="rgba16" Width="16" Height="16" Offset="0x17160" />
|
||||
<Texture Name="object_tru_TLUT_017360" OutName="tlut_017360" Format="rgba16" Width="16" Height="16" Offset="0x17360" />
|
||||
<Texture Name="object_tru_TLUT_017560" OutName="tlut_017560" Format="rgba16" Width="16" Height="16" Offset="0x17560" />
|
||||
<Texture Name="object_tru_Tex_017760" OutName="tex_017760" Format="rgba16" Width="32" Height="32" Offset="0x17760" />
|
||||
<Texture Name="object_tru_Tex_017F60" OutName="tex_017F60" Format="rgba16" Width="16" Height="16" Offset="0x17F60" />
|
||||
<Texture Name="object_tru_Tex_018160" OutName="tex_018160" Format="rgba16" Width="16" Height="16" Offset="0x18160" />
|
||||
<Texture Name="object_tru_Tex_018360" OutName="tex_018360" Format="rgba16" Width="16" Height="16" Offset="0x18360" />
|
||||
<Texture Name="object_tru_Tex_018560" OutName="tex_018560" Format="ci8" Width="16" Height="8" Offset="0x18560" />
|
||||
<Texture Name="object_tru_Tex_0185E0" OutName="tex_0185E0" Format="ci8" Width="8" Height="8" Offset="0x185E0" />
|
||||
<Texture Name="object_tru_Tex_018620" OutName="tex_018620" Format="rgba16" Width="8" Height="32" Offset="0x18620" />
|
||||
<Texture Name="object_tru_Tex_018820" OutName="tex_018820" Format="rgba16" Width="8" Height="8" Offset="0x18820" />
|
||||
<Texture Name="object_tru_Tex_0188A0" OutName="tex_0188A0" Format="ci8" Width="8" Height="8" Offset="0x188A0" />
|
||||
<Texture Name="object_tru_Tex_0188E0" OutName="tex_0188E0" Format="rgba16" Width="4" Height="8" Offset="0x188E0" />
|
||||
<Texture Name="object_tru_Tex_018920" OutName="tex_018920" Format="ci8" Width="8" Height="16" Offset="0x18920" />
|
||||
<Texture Name="object_tru_Tex_0189A0" OutName="tex_0189A0" Format="rgba16" Width="8" Height="8" Offset="0x189A0" />
|
||||
<Texture Name="object_tru_Tex_018A20" OutName="tex_018A20" Format="rgba16" Width="16" Height="32" Offset="0x18A20" />
|
||||
<Texture Name="object_tru_Tex_018E20" OutName="tex_018E20" Format="rgba16" Width="16" Height="8" Offset="0x18E20" />
|
||||
<Texture Name="object_tru_Tex_018F20" OutName="tex_018F20" Format="ci8" Width="8" Height="8" Offset="0x18F20" />
|
||||
<Texture Name="object_tru_Tex_018F60" OutName="tex_018F60" Format="ci8" Width="8" Height="8" Offset="0x18F60" />
|
||||
<Texture Name="object_tru_Tex_018FA0" OutName="tex_018FA0" Format="rgba16" Width="32" Height="32" Offset="0x18FA0" />
|
||||
<Texture Name="object_tru_Tex_0197A0" OutName="tex_0197A0" Format="rgba16" Width="32" Height="32" Offset="0x197A0" />
|
||||
<Texture Name="object_tru_Tex_019FA0" OutName="tex_019FA0" Format="rgba16" Width="32" Height="32" Offset="0x19FA0" />
|
||||
<Texture Name="object_tru_Tex_01A7A0" OutName="tex_01A7A0" Format="rgba16" Width="8" Height="8" Offset="0x1A7A0" />
|
||||
<DList Name="object_tru_DL_01A820" Offset="0x1A820" />
|
||||
<DList Name="object_tru_DL_01A830" Offset="0x1A830" />
|
||||
<Limb Name="object_tru_Standardlimb_01A8C0" Type="Standard" EnumName="OBJECT_TRU_LIMB_01" Offset="0x1A8C0" />
|
||||
<Limb Name="object_tru_Standardlimb_01A8CC" Type="Standard" EnumName="OBJECT_TRU_LIMB_02" Offset="0x1A8CC" />
|
||||
<Limb Name="object_tru_Standardlimb_01A8D8" Type="Standard" EnumName="OBJECT_TRU_LIMB_03" Offset="0x1A8D8" />
|
||||
<Limb Name="object_tru_Standardlimb_01A8E4" Type="Standard" EnumName="OBJECT_TRU_LIMB_04" Offset="0x1A8E4" />
|
||||
<Limb Name="object_tru_Standardlimb_01A8F0" Type="Standard" EnumName="OBJECT_TRU_LIMB_05" Offset="0x1A8F0" />
|
||||
<Limb Name="object_tru_Standardlimb_01A8FC" Type="Standard" EnumName="OBJECT_TRU_LIMB_06" Offset="0x1A8FC" />
|
||||
<Limb Name="object_tru_Standardlimb_01A908" Type="Standard" EnumName="OBJECT_TRU_LIMB_07" Offset="0x1A908" />
|
||||
<Limb Name="object_tru_Standardlimb_01A914" Type="Standard" EnumName="OBJECT_TRU_LIMB_08" Offset="0x1A914" />
|
||||
<Limb Name="object_tru_Standardlimb_01A920" Type="Standard" EnumName="OBJECT_TRU_LIMB_09" Offset="0x1A920" />
|
||||
<Limb Name="object_tru_Standardlimb_01A92C" Type="Standard" EnumName="OBJECT_TRU_LIMB_0A" Offset="0x1A92C" />
|
||||
<Limb Name="object_tru_Standardlimb_01A938" Type="Standard" EnumName="OBJECT_TRU_LIMB_0B" Offset="0x1A938" />
|
||||
<Limb Name="object_tru_Standardlimb_01A944" Type="Standard" EnumName="OBJECT_TRU_LIMB_0C" Offset="0x1A944" />
|
||||
<Limb Name="object_tru_Standardlimb_01A950" Type="Standard" EnumName="OBJECT_TRU_LIMB_0D" Offset="0x1A950" />
|
||||
<Limb Name="object_tru_Standardlimb_01A95C" Type="Standard" EnumName="OBJECT_TRU_LIMB_0E" Offset="0x1A95C" />
|
||||
<Limb Name="object_tru_Standardlimb_01A968" Type="Standard" EnumName="OBJECT_TRU_LIMB_0F" Offset="0x1A968" />
|
||||
<Limb Name="object_tru_Standardlimb_01A974" Type="Standard" EnumName="OBJECT_TRU_LIMB_10" Offset="0x1A974" />
|
||||
<Limb Name="object_tru_Standardlimb_01A980" Type="Standard" EnumName="OBJECT_TRU_LIMB_11" Offset="0x1A980" />
|
||||
<Limb Name="object_tru_Standardlimb_01A98C" Type="Standard" EnumName="OBJECT_TRU_LIMB_12" Offset="0x1A98C" />
|
||||
<Limb Name="object_tru_Standardlimb_01A998" Type="Standard" EnumName="OBJECT_TRU_LIMB_13" Offset="0x1A998" />
|
||||
<Limb Name="object_tru_Standardlimb_01A9A4" Type="Standard" EnumName="OBJECT_TRU_LIMB_14" Offset="0x1A9A4" />
|
||||
<Limb Name="object_tru_Standardlimb_01A9B0" Type="Standard" EnumName="OBJECT_TRU_LIMB_15" Offset="0x1A9B0" />
|
||||
<Limb Name="object_tru_Standardlimb_01A9BC" Type="Standard" EnumName="OBJECT_TRU_LIMB_16" Offset="0x1A9BC" />
|
||||
<Limb Name="object_tru_Standardlimb_01A9C8" Type="Standard" EnumName="OBJECT_TRU_LIMB_17" Offset="0x1A9C8" />
|
||||
<Limb Name="object_tru_Standardlimb_01A9D4" Type="Standard" EnumName="OBJECT_TRU_LIMB_18" Offset="0x1A9D4" />
|
||||
<Limb Name="object_tru_Standardlimb_01A9E0" Type="Standard" EnumName="OBJECT_TRU_LIMB_19" Offset="0x1A9E0" />
|
||||
<Limb Name="object_tru_Standardlimb_01A9EC" Type="Standard" EnumName="OBJECT_TRU_LIMB_1A" Offset="0x1A9EC" />
|
||||
<Skeleton Name="object_tru_Skel_01AA60" Type="Flex" LimbType="Standard" LimbNone="OBJECT_TRU_LIMB_NONE" LimbMax="OBJECT_TRU_LIMB_MAX" EnumName="ObjectTruLimb" Offset="0x1AA60" />
|
||||
<Animation Name="object_tru_Anim_01B5C4" Offset="0x1B5C4" />
|
||||
<DList Name="gKoumeTargetDL" Offset="0x390" />
|
||||
<DList Name="gKoumeChainDL" Offset="0x4C8" />
|
||||
<Texture Name="gKoumeChainTex" OutName="koume_chain" Format="rgba16" Width="16" Height="32" Offset="0x560" />
|
||||
<Texture Name="gKoumeTargetSideTex" OutName="koume_target_side" Format="rgba16" Width="32" Height="32" Offset="0x960" />
|
||||
<Texture Name="gKoumeTargetFaceTex" OutName="koume_target_face" Format="rgba16" Width="32" Height="32" Offset="0x1160" />
|
||||
|
||||
<DList Name="gKoumeBottleDL" Offset="0x1F90" />
|
||||
<DList Name="gKoumePotionDL" Offset="0x20C8" />
|
||||
<DList Name="gKoumeEmptyDL" Offset="0x2160" />
|
||||
<Texture Name="gKoumeBottleTex" OutName="koume_bottle" Format="i4" Width="16" Height="16" Offset="0x2168" />
|
||||
|
||||
<Animation Name="gKoumeFlyAnim" Offset="0x2BD8" />
|
||||
<Animation Name="gKoumeTakeOffAnim" Offset="0x3698" />
|
||||
<Animation Name="gKoumeHoverAnim" Offset="0x446C" />
|
||||
<Animation Name="gKoumeDrinkAnim" Offset="0x7FA0" />
|
||||
<Animation Name="gKoumeInjuredRaiseHeadAnim" Offset="0x9348" />
|
||||
|
||||
<DList Name="gKoumePelvisDL" Offset="0xB730" />
|
||||
<DList Name="gKoumeTorsoDL" Offset="0xB940" />
|
||||
<DList Name="gKoumeNeckDL" Offset="0xBA88" />
|
||||
<DList Name="gKoumeHeadDL" Offset="0xBBB8" />
|
||||
<DList Name="gKoumeLeftBraidStartDL" Offset="0xC630" />
|
||||
<DList Name="gKoumeLeftBraidEndDL" Offset="0xC730" />
|
||||
<DList Name="gKoumeTeethDL" Offset="0xC810" />
|
||||
<DList Name="gKoumeRightBraidStartDL" Offset="0xC860" />
|
||||
<DList Name="gKoumeRightBraidEndDL" Offset="0xC960" />
|
||||
<DList Name="gKoumeRightSleeveStartDL" Offset="0xCA40" />
|
||||
<DList Name="gKoumeRightSleeveFrontDL" Offset="0xCB50" />
|
||||
<DList Name="gKoumeRightHandDL" Offset="0xCCC0" />
|
||||
<DList Name="gKoumeRightSleeveMidDL" Offset="0xCFA8" />
|
||||
<DList Name="gKoumeRightSleeveEndDL" Offset="0xD0C0" />
|
||||
<DList Name="gKoumeLeftSleeveStartDL" Offset="0xD1D0" />
|
||||
<DList Name="gKoumeLeftSleeveFrontDL" Offset="0xD2E0" />
|
||||
<DList Name="gKoumeLeftHandDL" Offset="0xD450" />
|
||||
<DList Name="gKoumeBroomDL" Offset="0xD738" />
|
||||
<DList Name="gKoumeLeftSleeveMidDL" Offset="0xDA38" />
|
||||
<DList Name="gKoumeLeftSleeveEndDL" Offset="0xDB50" />
|
||||
<DList Name="gKoumeRightThighDL" Offset="0xDC40" /> <!-- Renders a single triangle instead of a normal-looking limb -->
|
||||
<DList Name="gKoumeRightShinDL" Offset="0xDC88" />
|
||||
<DList Name="gKoumeRightFootDL" Offset="0xDD38" />
|
||||
<DList Name="gKoumeLeftThighDL" Offset="0xDDD0" /> <!-- Renders a single triangle instead of a normal-looking limb -->
|
||||
<DList Name="gKoumeLeftShinDL" Offset="0xDE18" />
|
||||
<DList Name="gKoumeLeftFootDL" Offset="0xDEC8" />
|
||||
|
||||
<Animation Name="gKoumeInjuredTalkAnim" Offset="0xEEDC" />
|
||||
<Animation Name="gKoumeInjuredLyingDownAnim" Offset="0xF9A0" />
|
||||
<Animation Name="gKoumeTryGetUpAnim" Offset="0x108AC" />
|
||||
<Animation Name="gKoumeHealedAnim" Offset="0x11F88" />
|
||||
<Animation Name="gKoumeTakeAnim" Offset="0x14728" />
|
||||
<Animation Name="gKoumeIdleAnim" Offset="0x15068" />
|
||||
<Animation Name="gKoumeInjuredHeadUpAnim" Offset="0x15CA0" />
|
||||
<Animation Name="gKoumeFinishedDrinkingAnim" Offset="0x16B4C" />
|
||||
|
||||
<Texture Name="gKoumeSkinTLUT" OutName="koume_skin_tlut" Format="rgba16" Width="16" Height="16" Offset="0x16B60" />
|
||||
<Texture Name="gKoumeMouthTLUT" OutName="koume_mouth_tlut" Format="rgba16" Width="16" Height="16" Offset="0x16D60" />
|
||||
<Texture Name="gKoumeEarTLUT" OutName="koume_ear_tlut" Format="rgba16" Width="16" Height="16" Offset="0x16F60" />
|
||||
<Texture Name="gKoumeFingerTLUT" OutName="koume_finger_tlut" Format="rgba16" Width="16" Height="16" Offset="0x17160" />
|
||||
<Texture Name="gKoumeNeckTLUT" OutName="koume_neck_tlut" Format="rgba16" Width="16" Height="16" Offset="0x17360" />
|
||||
<Texture Name="gKoumeNostrilsTLUT" OutName="koume_nostrils_tlut" Format="rgba16" Width="16" Height="16" Offset="0x17560" />
|
||||
<Texture Name="gKoumeGerudoFabricTex" OutName="koume_gerudo_fabric" Format="rgba16" Width="32" Height="32" Offset="0x17760" />
|
||||
<Texture Name="gKoumeRobeTex" OutName="koume_robe" Format="rgba16" Width="16" Height="16" Offset="0x17F60" />
|
||||
<Texture Name="gKoumeRobePatternTex" OutName="koume_robe_pattern" Format="rgba16" Width="16" Height="16" Offset="0x18160" />
|
||||
<Texture Name="gKoumeRobeTrimTex" OutName="koume_robe_trim" Format="rgba16" Width="16" Height="16" Offset="0x18360" />
|
||||
<Texture Name="gKoumeSkinTex" OutName="koume_skin" Format="ci8" Width="16" Height="8" Offset="0x18560" />
|
||||
<Texture Name="gKoumeMouthTex" OutName="koume_mouth" Format="ci8" Width="8" Height="8" Offset="0x185E0" />
|
||||
<Texture Name="gKoumeHairTex" OutName="koume_hair" Format="rgba16" Width="8" Height="32" Offset="0x18620" />
|
||||
<Texture Name="gKoumeBraidEndTex" OutName="koume_braid_end" Format="rgba16" Width="8" Height="8" Offset="0x18820" />
|
||||
<Texture Name="gKoumeEarTex" OutName="koume_ear" Format="ci8" Width="8" Height="8" Offset="0x188A0" />
|
||||
<Texture Name="gKoumeCollarNeckTex" OutName="koume_collar_neck" Format="rgba16" Width="4" Height="8" Offset="0x188E0" />
|
||||
<Texture Name="gKoumeFingerTex" OutName="koume_finger" Format="ci8" Width="8" Height="16" Offset="0x18920" />
|
||||
<Texture Name="gKoumeBroomHandleTex" OutName="koume_broom_handle" Format="rgba16" Width="8" Height="8" Offset="0x189A0" />
|
||||
<Texture Name="gKoumeBroomHeadTex" OutName="koume_broom_head" Format="rgba16" Width="16" Height="32" Offset="0x18A20" />
|
||||
<Texture Name="gKoumeJewelHolderTex" OutName="koume_jewel_holder" Format="rgba16" Width="16" Height="8" Offset="0x18E20" />
|
||||
<Texture Name="gKoumeNeckTex" OutName="koume_neck" Format="ci8" Width="8" Height="8" Offset="0x18F20" />
|
||||
<Texture Name="gKoumeNostrilsTex" OutName="koume_nostrils" Format="ci8" Width="8" Height="8" Offset="0x18F60" />
|
||||
<Texture Name="gKoumeEyeOpenTex" OutName="koume_eye_open" Format="rgba16" Width="32" Height="32" Offset="0x18FA0" />
|
||||
<Texture Name="gKoumeEyeHalfTex" OutName="koume_eye_half" Format="rgba16" Width="32" Height="32" Offset="0x197A0" />
|
||||
<Texture Name="gKoumeEyeClosedTex" OutName="koume_eye_closed" Format="rgba16" Width="32" Height="32" Offset="0x19FA0" />
|
||||
<Texture Name="gKoumeJewelTex" OutName="koume_jewel" Format="rgba16" Width="8" Height="8" Offset="0x1A7A0" />
|
||||
|
||||
<DList Name="gKoumeDustMaterialDL" Offset="0x1A820" />
|
||||
<DList Name="gKoumeDustModelDL" Offset="0x1A830" />
|
||||
|
||||
<Limb Name="gKoumePelvisLimb" Type="Standard" EnumName="KOUME_LIMB_PELVIS" Offset="0x1A8C0" />
|
||||
<Limb Name="gKoumeLeftThighLimb" Type="Standard" EnumName="KOUME_LIMB_LEFT_THIGH" Offset="0x1A8CC" />
|
||||
<Limb Name="gKoumeLeftShinLimb" Type="Standard" EnumName="KOUME_LIMB_LEFT_SHIN" Offset="0x1A8D8" />
|
||||
<Limb Name="gKoumeLeftFootLimb" Type="Standard" EnumName="KOUME_LIMB_LEFT_FOOT" Offset="0x1A8E4" />
|
||||
<Limb Name="gKoumeRightThighLimb" Type="Standard" EnumName="KOUME_LIMB_RIGH_THIGH" Offset="0x1A8F0" />
|
||||
<Limb Name="gKoumeRightShinLimb" Type="Standard" EnumName="KOUME_LIMB_RIGHT_SHIN" Offset="0x1A8FC" />
|
||||
<Limb Name="gKoumeRightFootLimb" Type="Standard" EnumName="KOUME_LIMB_RIGHT_FOOT" Offset="0x1A908" />
|
||||
<Limb Name="gKoumeTorsoLimb" Type="Standard" EnumName="KOUME_LIMB_TORSO_LIMB" Offset="0x1A914" />
|
||||
<Limb Name="gKoumeLeftSleeveStartLimb" Type="Standard" EnumName="KOUME_LIMB_LEFT_SLEEVE_START" Offset="0x1A920" />
|
||||
<Limb Name="gKoumeLeftSleeveMidLimb" Type="Standard" EnumName="KOUME_LIMB_LEFT_SLEEVE_MID" Offset="0x1A92C" />
|
||||
<Limb Name="gKoumeLeftSleeveEndLimb" Type="Standard" EnumName="KOUME_LIMB_LEFT_SLEEVE_END" Offset="0x1A938" />
|
||||
<Limb Name="gKoumeLeftSleeveFrontLimb" Type="Standard" EnumName="KOUME_LIMB_LEFT_SLEEVE_FRONT" Offset="0x1A944" />
|
||||
<Limb Name="gKoumeLeftHandLimb" Type="Standard" EnumName="KOUME_LIMB_LEFT_HAND" Offset="0x1A950" />
|
||||
<Limb Name="gKoumeBroomLimb" Type="Standard" EnumName="KOUME_LIMB_BROOM" Offset="0x1A95C" />
|
||||
<Limb Name="gKoumeRightSleeveStartLimb" Type="Standard" EnumName="KOUME_LIMB_RIGHT_SLEEVE_START" Offset="0x1A968" />
|
||||
<Limb Name="gKoumeRightSleeveMidLimb" Type="Standard" EnumName="KOUME_LIMB_RIGHT_SLEEVE_MID" Offset="0x1A974" />
|
||||
<Limb Name="gKoumeRightSleeveEndLimb" Type="Standard" EnumName="KOUME_LIMB_RIGHT_SLEEVE_END" Offset="0x1A980" />
|
||||
<Limb Name="gKoumeRightSleeveFrontLimb" Type="Standard" EnumName="KOUME_LIMB_RIGHT_SLEEVE_FRONT" Offset="0x1A98C" />
|
||||
<Limb Name="gKoumeRightHandLimb" Type="Standard" EnumName="KOUME_LIMB_RIGHT_HAND" Offset="0x1A998" />
|
||||
<Limb Name="gKoumeNeckLimb" Type="Standard" EnumName="KOUME_LIMB_NECK" Offset="0x1A9A4" />
|
||||
<Limb Name="gKoumeHeadLimb" Type="Standard" EnumName="KOUME_LIMB_HEAD" Offset="0x1A9B0" />
|
||||
<Limb Name="gKoumeRightBraidStartLimb" Type="Standard" EnumName="KOUME_LIMB_RIGHT_BRAID_START" Offset="0x1A9BC" />
|
||||
<Limb Name="gKoumeRightBraidEndLimb" Type="Standard" EnumName="KOUME_LIMB_RIGHT_BRAID_END" Offset="0x1A9C8" />
|
||||
<Limb Name="gKoumeTeethLimb" Type="Standard" EnumName="KOUME_LIMB_TEETH" Offset="0x1A9D4" />
|
||||
<Limb Name="gKoumeLeftBraidStartLimb" Type="Standard" EnumName="KOUME_LIMB_LEFT_BRAID_START" Offset="0x1A9E0" />
|
||||
<Limb Name="gKoumeLeftBraidEndLimb" Type="Standard" EnumName="KOUME_LIMB_LEFT_BRAID_END" Offset="0x1A9EC" />
|
||||
<Skeleton Name="gKoumeSkel" Type="Flex" LimbType="Standard" LimbNone="KOUME_LIMB_NONE" LimbMax="KOUME_LIMB_MAX" EnumName="KoumeLimb" Offset="0x1AA60" />
|
||||
|
||||
<Animation Name="gKoumeShakeAnim" Offset="0x1B5C4" />
|
||||
</File>
|
||||
</Root>
|
||||
|
||||
@@ -1,102 +1,148 @@
|
||||
<Root>
|
||||
<!-- Assets for Wizrobe, its platforms, and its magical attacks. -->
|
||||
<File Name="object_wiz" Segment="6">
|
||||
<Animation Name="object_wiz_Anim_0007B0" Offset="0x7B0" />
|
||||
<Texture Name="object_wiz_Tex_0007C0" OutName="tex_0007C0" Format="i4" Width="32" Height="64" Offset="0x7C0" />
|
||||
<Texture Name="object_wiz_Tex_000BC0" OutName="tex_000BC0" Format="i4" Width="32" Height="32" Offset="0xBC0" />
|
||||
<Texture Name="object_wiz_Tex_000DC0" OutName="tex_000DC0" Format="i4" Width="16" Height="16" Offset="0xDC0" />
|
||||
<DList Name="object_wiz_DL_000E70" Offset="0xE70" />
|
||||
<DList Name="object_wiz_DL_000F28" Offset="0xF28" />
|
||||
<DList Name="object_wiz_DL_000FD8" Offset="0xFD8" />
|
||||
<DList Name="object_wiz_DL_0010E0" Offset="0x10E0" />
|
||||
<DList Name="gWizzrobePlatform" Offset="0x10E8" />
|
||||
<Texture Name="object_wiz_Tex_001198" OutName="tex_001198" Format="rgba16" Width="16" Height="32" Offset="0x1198" />
|
||||
<!-- <Blob Name="object_wiz_Blob_0015A0" Size="0x10" Offset="0x15A0" /> -->
|
||||
<Collision Name="object_wiz_Colheader_001690" Offset="0x1690" />
|
||||
<DList Name="object_wiz_DL_001860" Offset="0x1860" />
|
||||
<Texture Name="object_wiz_Tex_0019F0" OutName="tex_0019F0" Format="i4" Width="32" Height="32" Offset="0x19F0" />
|
||||
<Texture Name="object_wiz_Tex_001BF0" OutName="tex_001BF0" Format="i4" Width="16" Height="32" Offset="0x1BF0" />
|
||||
<Texture Name="object_wiz_Tex_001CF0" OutName="tex_001CF0" Format="i8" Width="32" Height="32" Offset="0x1CF0" />
|
||||
<TextureAnimation Name="object_wiz_Matanimheader_00211C" Offset="0x211C" />
|
||||
<Animation Name="object_wiz_Anim_002218" Offset="0x2218" />
|
||||
<Animation Name="object_wiz_Anim_002458" Offset="0x2458" />
|
||||
<Animation Name="object_wiz_Anim_0025F0" Offset="0x25F0" />
|
||||
<DList Name="object_wiz_DL_002630" Offset="0x2630" />
|
||||
<Texture Name="object_wiz_Tex_002700" OutName="tex_002700" Format="i4" Width="32" Height="32" Offset="0x2700" />
|
||||
<Texture Name="object_wiz_Tex_002900" OutName="tex_002900" Format="i4" Width="32" Height="32" Offset="0x2900" />
|
||||
<TextureAnimation Name="object_wiz_Matanimheader_002B08" Offset="0x2B08" />
|
||||
<DList Name="object_wiz_DL_002B40" Offset="0x2B40" />
|
||||
<Texture Name="object_wiz_Tex_002BD0" OutName="tex_002BD0" Format="i4" Width="32" Height="32" Offset="0x2BD0" />
|
||||
<TextureAnimation Name="object_wiz_Matanimheader_002DF4" Offset="0x2DF4" />
|
||||
<Texture Name="object_wiz_Tex_002E00" OutName="tex_002E00" Format="i4" Width="32" Height="32" Offset="0x2E00" />
|
||||
<DList Name="object_wiz_DL_003120" Offset="0x3120" />
|
||||
<Texture Name="object_wiz_Tex_0031E0" OutName="tex_0031E0" Format="i4" Width="32" Height="64" Offset="0x31E0" />
|
||||
<DList Name="object_wiz_DL_003640" Offset="0x3640" />
|
||||
<Texture Name="object_wiz_Tex_003700" OutName="tex_003700" Format="i8" Width="32" Height="32" Offset="0x3700" />
|
||||
<Texture Name="object_wiz_Tex_003B00" OutName="tex_003B00" Format="i4" Width="32" Height="64" Offset="0x3B00" />
|
||||
<DList Name="object_wiz_DL_003FC0" Offset="0x3FC0" />
|
||||
<Texture Name="object_wiz_Tex_0040B0" OutName="tex_0040B0" Format="i8" Width="64" Height="64" Offset="0x40B0" />
|
||||
<!-- <Blob Name="object_wiz_Blob_0050B0" Size="0x40" Offset="0x50B0" /> -->
|
||||
<DList Name="object_wiz_DL_005190" Offset="0x5190" />
|
||||
<Texture Name="object_wiz_Tex_005230" OutName="tex_005230" Format="i4" Width="32" Height="64" Offset="0x5230" />
|
||||
<Texture Name="object_wiz_Tex_005630" OutName="tex_005630" Format="i4" Width="16" Height="16" Offset="0x5630" />
|
||||
<DList Name="object_wiz_DL_005750" Offset="0x5750" />
|
||||
<DList Name="gWizzrobePlatformCenter" Offset="0x5870" />
|
||||
<DList Name="object_wiz_DL_005938" Offset="0x5938" />
|
||||
<Texture Name="object_wiz_Tex_005940" OutName="tex_005940" Format="i4" Width="32" Height="32" Offset="0x5940" />
|
||||
<Texture Name="object_wiz_Tex_005B40" OutName="tex_005B40" Format="i4" Width="16" Height="32" Offset="0x5B40" />
|
||||
<TextureAnimation Name="gWizzrobePlatformTexAnim" Offset="0x5C64" />
|
||||
<Animation Name="object_wiz_Anim_0060E8" Offset="0x60E8" />
|
||||
<Animation Name="object_wiz_Anim_0066C0" Offset="0x66C0" />
|
||||
<DList Name="object_wiz_DL_008640" Offset="0x8640" />
|
||||
<DList Name="object_wiz_DL_0086F0" Offset="0x86F0" />
|
||||
<DList Name="object_wiz_DL_008790" Offset="0x8790" />
|
||||
<DList Name="object_wiz_DL_008868" Offset="0x8868" />
|
||||
<DList Name="object_wiz_DL_008938" Offset="0x8938" />
|
||||
<DList Name="object_wiz_DL_0089D8" Offset="0x89D8" />
|
||||
<DList Name="object_wiz_DL_008AB0" Offset="0x8AB0" />
|
||||
<DList Name="object_wiz_DL_008B80" Offset="0x8B80" />
|
||||
<DList Name="object_wiz_DL_008C10" Offset="0x8C10" />
|
||||
<DList Name="object_wiz_DL_008CE8" Offset="0x8CE8" />
|
||||
<DList Name="object_wiz_DL_008F18" Offset="0x8F18" />
|
||||
<DList Name="object_wiz_DL_0091D8" Offset="0x91D8" />
|
||||
<DList Name="object_wiz_DL_009560" Offset="0x9560" />
|
||||
<DList Name="object_wiz_DL_009608" Offset="0x9608" />
|
||||
<DList Name="object_wiz_DL_0096E0" Offset="0x96E0" />
|
||||
<DList Name="object_wiz_DL_0097B8" Offset="0x97B8" />
|
||||
<DList Name="object_wiz_DL_009918" Offset="0x9918" />
|
||||
<DList Name="object_wiz_DL_0099C0" Offset="0x99C0" />
|
||||
<DList Name="object_wiz_DL_009A98" Offset="0x9A98" />
|
||||
<Texture Name="object_wiz_Tex_009B70" OutName="tex_009B70" Format="rgba16" Width="8" Height="8" Offset="0x9B70" />
|
||||
<Texture Name="object_wiz_Tex_009BF0" OutName="tex_009BF0" Format="rgba16" Width="32" Height="32" Offset="0x9BF0" />
|
||||
<Texture Name="object_wiz_Tex_00A3F0" OutName="tex_00A3F0" Format="rgba16" Width="8" Height="16" Offset="0xA3F0" />
|
||||
<Texture Name="object_wiz_Tex_00A4F0" OutName="tex_00A4F0" Format="rgba16" Width="16" Height="16" Offset="0xA4F0" />
|
||||
<Texture Name="object_wiz_Tex_00A6F0" OutName="tex_00A6F0" Format="rgba16" Width="16" Height="16" Offset="0xA6F0" />
|
||||
<Texture Name="object_wiz_Tex_00A8F0" OutName="tex_00A8F0" Format="rgba16" Width="8" Height="8" Offset="0xA8F0" />
|
||||
<Texture Name="object_wiz_Tex_00A970" OutName="tex_00A970" Format="rgba16" Width="8" Height="16" Offset="0xA970" />
|
||||
<Texture Name="object_wiz_Tex_00AA70" OutName="tex_00AA70" Format="rgba16" Width="16" Height="4" Offset="0xAA70" />
|
||||
<Texture Name="object_wiz_Tex_00AAF0" OutName="tex_00AAF0" Format="rgba16" Width="16" Height="16" Offset="0xAAF0" />
|
||||
<Texture Name="object_wiz_Tex_00ACF0" OutName="tex_00ACF0" Format="rgba16" Width="16" Height="16" Offset="0xACF0" />
|
||||
<Texture Name="object_wiz_Tex_00AEF0" OutName="tex_00AEF0" Format="rgba16" Width="16" Height="16" Offset="0xAEF0" />
|
||||
<Texture Name="object_wiz_Tex_00B0F0" OutName="tex_00B0F0" Format="rgba16" Width="16" Height="8" Offset="0xB0F0" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B1F0" Type="Standard" EnumName="OBJECT_WIZ_LIMB_01" Offset="0xB1F0" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B1FC" Type="Standard" EnumName="OBJECT_WIZ_LIMB_02" Offset="0xB1FC" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B208" Type="Standard" EnumName="OBJECT_WIZ_LIMB_03" Offset="0xB208" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B214" Type="Standard" EnumName="OBJECT_WIZ_LIMB_04" Offset="0xB214" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B220" Type="Standard" EnumName="OBJECT_WIZ_LIMB_05" Offset="0xB220" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B22C" Type="Standard" EnumName="OBJECT_WIZ_LIMB_06" Offset="0xB22C" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B238" Type="Standard" EnumName="OBJECT_WIZ_LIMB_07" Offset="0xB238" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B244" Type="Standard" EnumName="OBJECT_WIZ_LIMB_08" Offset="0xB244" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B250" Type="Standard" EnumName="OBJECT_WIZ_LIMB_09" Offset="0xB250" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B25C" Type="Standard" EnumName="OBJECT_WIZ_LIMB_0A" Offset="0xB25C" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B268" Type="Standard" EnumName="OBJECT_WIZ_LIMB_0B" Offset="0xB268" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B274" Type="Standard" EnumName="OBJECT_WIZ_LIMB_0C" Offset="0xB274" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B280" Type="Standard" EnumName="OBJECT_WIZ_LIMB_0D" Offset="0xB280" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B28C" Type="Standard" EnumName="OBJECT_WIZ_LIMB_0E" Offset="0xB28C" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B298" Type="Standard" EnumName="OBJECT_WIZ_LIMB_0F" Offset="0xB298" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B2A4" Type="Standard" EnumName="OBJECT_WIZ_LIMB_10" Offset="0xB2A4" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B2B0" Type="Standard" EnumName="OBJECT_WIZ_LIMB_11" Offset="0xB2B0" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B2BC" Type="Standard" EnumName="OBJECT_WIZ_LIMB_12" Offset="0xB2BC" />
|
||||
<Limb Name="object_wiz_Standardlimb_00B2C8" Type="Standard" EnumName="OBJECT_WIZ_LIMB_13" Offset="0xB2C8" />
|
||||
<Skeleton Name="object_wiz_Skel_00B320" Type="Flex" LimbType="Standard" LimbNone="OBJECT_WIZ_LIMB_NONE" LimbMax="OBJECT_WIZ_LIMB_MAX" EnumName="ObjectWizLimb" Offset="0xB320" />
|
||||
<!-- Wizrobe Animation -->
|
||||
<Animation Name="gWizrobeAttackAnim" Offset="0x7B0" /> <!-- Original name is "wiz_atack" -->
|
||||
|
||||
<!-- Assets for the smoke that rises from the ice pool -->
|
||||
<Texture Name="gWizrobeIceSmokeTex" OutName="wizrobe_ice_smoke" Format="i4" Width="32" Height="64" Offset="0x7C0" />
|
||||
<Texture Name="gWizrobeIceSmokeMaskTex" OutName="wizrobe_ice_smoke_mask" Format="i4" Width="32" Height="32" Offset="0xBC0" />
|
||||
<Texture Name="gWizrobeUnusedTex" OutName="wizrobe_unused" Format="i4" Width="16" Height="16" Offset="0xDC0" />
|
||||
<DList Name="gWizrobeIceSmokeMaterialDL" Offset="0xE70" />
|
||||
<DList Name="gWizrobeUnusedIceSmokeMaterialDL" Offset="0xF28" />
|
||||
<DList Name="gWizrobeIceSmokeModelDL" Offset="0xFD8" /> <!-- Original name might have been "wiz_coolball_modelT" or "wiz_icesmoke" -->
|
||||
|
||||
<!-- Assets for the Wizrobe platform -->
|
||||
<DList Name="gWizrobePlatformEmptyDL" Offset="0x10E0" /> <!-- Empty, probably was the transparent version of the following DL -->
|
||||
<DList Name="gWizrobePlatformDL" Offset="0x10E8" /> <!-- Original name is "wiz_daiza_model" ("pedestal") -->
|
||||
<Texture Name="gWizrobePlatformTex" OutName="wizrobe_platform" Format="rgba16" Width="16" Height="32" Offset="0x1198" />
|
||||
<TextureAnimation Name="gWizrobePlatformEmptyTexAnim" Offset="0x15A0" />
|
||||
<Collision Name="gWizrobePlatformCol" Offset="0x1690" />
|
||||
|
||||
<!-- Assets for the light that appears from the platform when the Wizrobe appears -->
|
||||
<DList Name="gWizrobePlatformLightDL" Offset="0x1860" /> <!-- Original name is "wiz_daizalight_model" -->
|
||||
<Texture Name="gWizrobePlatformLightMaskTex" OutName="wizrobe_platform_light_mask" Format="i4" Width="32" Height="32" Offset="0x19F0" />
|
||||
<Texture Name="gWizrobePlatformLightBaseTex" OutName="wizrobe_platform_light_base" Format="i4" Width="16" Height="32" Offset="0x1BF0" />
|
||||
<Texture Name="gWizrobePlatformLightRaysTex" OutName="wizrobe_platform_light_rays" Format="i8" Width="32" Height="32" Offset="0x1CF0" />
|
||||
<TextureAnimation Name="gWizrobePlatformLightTexAnim" Offset="0x211C" />
|
||||
|
||||
<!-- Wizrobe Animations -->
|
||||
<Animation Name="gWizrobeDamageAnim" Offset="0x2218" /> <!-- Original name is "wiz_damage" -->
|
||||
<Animation Name="gWizrobeDanceAnim" Offset="0x2458" /> <!-- Original name is "wiz_dance" -->
|
||||
<Animation Name="gWizrobeRunAnim" Offset="0x25F0" /> <!-- Original name is "wiz_dash" -->
|
||||
|
||||
<!-- Assets for the small flames during the Fire Wizrobe fight -->
|
||||
<DList Name="gWizrobeSmallFlameDL" Offset="0x2630" /> <!-- Original name is "wiz_fire_model" -->
|
||||
<Texture Name="gWizrobeSmallFlameTex" OutName="wizrobe_small_flame" Format="i4" Width="32" Height="32" Offset="0x2700" />
|
||||
<Texture Name="gWizrobeSmallFlameMaskTex" OutName="wizrobe_small_flame_mask" Format="i4" Width="32" Height="32" Offset="0x2900" />
|
||||
|
||||
<!-- An unused texture animation that scrolls textures. It works okay with the small flames, so that was likely its original purpose. -->
|
||||
<TextureAnimation Name="gWizrobeUnusedScrollTexAnim" Offset="0x2B08" />
|
||||
|
||||
<!-- Assets for the Wizrobe's magic projectile -->
|
||||
<DList Name="gWizrobeMagicProjectileDL" Offset="0x2B40" /> <!-- Original name is "wiz_fireball_model" -->
|
||||
<Texture Name="gWizrobeMagicProjectileTex" OutName="wizrobe_magic_projectile" Format="i4" Width="32" Height="32" Offset="0x2BD0" />
|
||||
|
||||
<!-- An unused texture animation that changes. Based on its placement, it may have been originally used with the magic projectile. -->
|
||||
<TextureAnimation Name="gWizrobeUnusedColorChangingTexAnim" Offset="0x2DF4" />
|
||||
|
||||
<!-- Assets for the pool of fire that forms when the Fire Wizrobe's projectile hits something -->
|
||||
<Texture Name="gWizrobeFirePoolTex" OutName="wizrobe_fire_pool" Format="i4" Width="32" Height="32" Offset="0x2E00" />
|
||||
<DList Name="gWizrobeFirePoolDL" Offset="0x3120" /> <!-- Original name is "wiz_firefloor_modelT" -->
|
||||
|
||||
<!-- Assets for the smoke that comes off the Fire Wizrobe's fire -->
|
||||
<Texture Name="gWizrobeFireSmokeTex" OutName="wizrobe_fire_smoke" Format="i4" Width="32" Height="64" Offset="0x31E0" />
|
||||
<DList Name="gWizrobeFireSmokeDL" Offset="0x3640" /> <!-- Original name is "wiz_firesmoke_modelT" -->
|
||||
|
||||
<!-- Assets for the big flame during the Fire Wizrobe fight-->
|
||||
<Texture Name="gWizrobeBigFlameTex" OutName="wizrobe_big_flame" Format="i8" Width="32" Height="32" Offset="0x3700" />
|
||||
<Texture Name="gWizrobeBigFlameMaskTex" OutName="wizrobe_big_flame_mask" Format="i4" Width="32" Height="64" Offset="0x3B00" />
|
||||
<DList Name="gWizrobeBigFlameDL" Offset="0x3FC0" /> <!-- Original name is "wiz_firewall_modelT" -->
|
||||
|
||||
<!-- Texture for the ice pool -->
|
||||
<Texture Name="gWizrobeIcePoolTex" OutName="wizrobe_ice_pool" Format="i8" Width="64" Height="64" Offset="0x40B0" />
|
||||
|
||||
<!-- Unused vertices. Based on its placement, this may have been originally used with the ice pool. -->
|
||||
<Array Name="gWizrobeUnusedVtx" Count="4" Offset="0x50B0">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
|
||||
<!-- DisplayList for the ice pool -->
|
||||
<DList Name="gWizrobeIcePoolDL" Offset="0x5190" /> <!-- Original name is "wiz_icefloor03_modelT" -->
|
||||
|
||||
<!-- Assets for the gleam on top of the ice pool-->
|
||||
<Texture Name="gWizrobeIcePoolShineTex" OutName="wizrobe_ice_pool_shine" Format="i4" Width="32" Height="64" Offset="0x5230" />
|
||||
<Texture Name="gWizrobeIcePoolShineMaskTex" OutName="wizrobe_ice_pool_shine_mask" Format="i4" Width="16" Height="16" Offset="0x5630" />
|
||||
<DList Name="gWizrobeIcePoolShineDL" Offset="0x5750" /> <!-- Original name is "wiz_icefloor03_pika_modelT" ("pika" = onomatopoeic for "sparkle, glisten") -->
|
||||
|
||||
<!-- Assets for the glowing light in the center of the Wizrobe platform -->
|
||||
<DList Name="gWizrobePlatformCenterDL" Offset="0x5870" /> <!-- Original name is "wiz_lighthole_modelT" -->
|
||||
<DList Name="gWizrobePlatformCenterEmptyDL" Offset="0x5938" /> <!-- Empty, was probably the opaque version of the previous DL -->
|
||||
<Texture Name="gWizrobePlatformCenterMaskTex" OutName="wizrobe_platform_center_mask" Format="i4" Width="32" Height="32" Offset="0x5940" />
|
||||
<Texture Name="gWizrobePlatformCenterTex" OutName="wizrobe_platform_center" Format="i4" Width="16" Height="32" Offset="0x5B40" />
|
||||
<TextureAnimation Name="gWizrobePlatformCenterTexAnim" Offset="0x5C64" />
|
||||
|
||||
<!-- Wizrobe Animations -->
|
||||
<Animation Name="gWizrobeWindUpAnim" Offset="0x60E8" /> <!-- Original name is "wiz_preatack" -->
|
||||
<Animation Name="gWizrobeIdleAnim" Offset="0x66C0" /> <!-- Original name is "wiz_wait" -->
|
||||
|
||||
<!-- Wizrobe Limb DisplayLists -->
|
||||
<DList Name="gWizrobePelvisDL" Offset="0x8640" />
|
||||
<DList Name="gWizrobeRightThighDL" Offset="0x86F0" />
|
||||
<DList Name="gWizrobeRightShinDL" Offset="0x8790" />
|
||||
<DList Name="gWizrobeRightFootDL" Offset="0x8868" />
|
||||
<DList Name="gWizrobeLeftThighDL" Offset="0x8938" />
|
||||
<DList Name="gWizrobeLeftShinDL" Offset="0x89D8" />
|
||||
<DList Name="gWizrobeLeftFootDL" Offset="0x8AB0" />
|
||||
<DList Name="gWizrobeLoinclothDL" Offset="0x8B80" />
|
||||
<DList Name="gWizrobeTorsoDL" Offset="0x8C10" />
|
||||
<DList Name="gWizrobeNeckDL" Offset="0x8CE8" /> <!-- Also includes the nose and ears for some reason. -->
|
||||
<DList Name="gWizrobeJawDL" Offset="0x8F18" />
|
||||
<DList Name="gWizrobeHeadDL" Offset="0x91D8" />
|
||||
<DList Name="gWizrobeRightUpperArmDL" Offset="0x9560" />
|
||||
<DList Name="gWizrobeRightForearmDL" Offset="0x9608" />
|
||||
<DList Name="gWizrobeRightHandDL" Offset="0x96E0" />
|
||||
<DList Name="gWizrobeStaffDL" Offset="0x97B8" />
|
||||
<DList Name="gWizrobeLeftUpperArmDL" Offset="0x9918" />
|
||||
<DList Name="gWizrobeLeftForearmDL" Offset="0x99C0" />
|
||||
<DList Name="gWizrobeLeftHandDL" Offset="0x9A98" />
|
||||
|
||||
<!-- Wizrobe Textures -->
|
||||
<Texture Name="gWizrobeFaceSkinTex" OutName="wizrobe_face_skin" Format="rgba16" Width="8" Height="8" Offset="0x9B70" />
|
||||
<Texture Name="gWizrobeRobeTex" OutName="wizrobe_robe" Format="rgba16" Width="32" Height="32" Offset="0x9BF0" />
|
||||
<Texture Name="gWizrobeHairTex" OutName="wizrobe_hair" Format="rgba16" Width="8" Height="16" Offset="0xA3F0" />
|
||||
<Texture Name="gWizrobeEyeOrbitTex" OutName="wizrobe_eye_orbit" Format="rgba16" Width="16" Height="16" Offset="0xA4F0" />
|
||||
<Texture Name="gWizrobeEyeTex" OutName="wizrobe_eye" Format="rgba16" Width="16" Height="16" Offset="0xA6F0" />
|
||||
<Texture Name="gWizrobeLowerLipTex" OutName="wizrobe_lower_lip" Format="rgba16" Width="8" Height="8" Offset="0xA8F0" />
|
||||
<Texture Name="gWizrobeNoseTex" OutName="wizrobe_nose" Format="rgba16" Width="8" Height="16" Offset="0xA970" />
|
||||
<Texture Name="gWizrobeEarTex" OutName="wizrobe_ear" Format="rgba16" Width="16" Height="4" Offset="0xAA70" />
|
||||
<Texture Name="gWizrobeStaffTipTex" OutName="wizrobe_staff_tip" Format="rgba16" Width="16" Height="16" Offset="0xAAF0" />
|
||||
<Texture Name="gWizrobeStaffTex" OutName="wizrobe_staff" Format="rgba16" Width="16" Height="16" Offset="0xACF0" />
|
||||
<Texture Name="gWizrobeBandTex" OutName="wizrobe_band" Format="rgba16" Width="16" Height="16" Offset="0xAEF0" />
|
||||
<Texture Name="gWizrobeFootTex" OutName="wizrobe_foot" Format="rgba16" Width="16" Height="8" Offset="0xB0F0" />
|
||||
|
||||
<!-- Wizrobe Limbs -->
|
||||
<Limb Name="gWizrobePelvisLimb" Type="Standard" EnumName="WIZROBE_LIMB_PELVIS" Offset="0xB1F0" />
|
||||
<Limb Name="gWizrobeTorsoLimb" Type="Standard" EnumName="WIZROBE_LIMB_TORSO" Offset="0xB1FC" />
|
||||
<Limb Name="gWizrobeLeftUpperArmLimb" Type="Standard" EnumName="WIZROBE_LIMB_LEFT_UPPER_ARM" Offset="0xB208" />
|
||||
<Limb Name="gWizrobeLeftForearmLimb" Type="Standard" EnumName="WIZROBE_LIMB_LEFT_FOREARM" Offset="0xB214" />
|
||||
<Limb Name="gWizrobeLeftHandLimb" Type="Standard" EnumName="WIZROBE_LIMB_LEFT_HAND" Offset="0xB220" />
|
||||
<Limb Name="gWizrobeRightUpperArmLimb" Type="Standard" EnumName="WIZROBE_LIMB_RIGHT_UPPER_ARM" Offset="0xB22C" />
|
||||
<Limb Name="gWizrobeRightForearmLimb" Type="Standard" EnumName="WIZROBE_LIMB_RIGHT_FOREARM" Offset="0xB238" />
|
||||
<Limb Name="gWizrobeRightHandLimb" Type="Standard" EnumName="WIZROBE_LIMB_RIGHT_HAND" Offset="0xB244" />
|
||||
<Limb Name="gWizrobeStaffLimb" Type="Standard" EnumName="WIZROBE_LIMB_STAFF" Offset="0xB250" />
|
||||
<Limb Name="gWizrobeNeckLimb" Type="Standard" EnumName="WIZROBE_LIMB_NECK" Offset="0xB25C" />
|
||||
<Limb Name="gWizrobeHeadLimb" Type="Standard" EnumName="WIZROBE_LIMB_HEAD" Offset="0xB268" />
|
||||
<Limb Name="gWizrobeJawLimb" Type="Standard" EnumName="WIZROBE_LIMB_JAW" Offset="0xB274" />
|
||||
<Limb Name="gWizrobeLoinclothLimb" Type="Standard" EnumName="WIZROBE_LIMB_LOINCLOTH" Offset="0xB280" />
|
||||
<Limb Name="gWizrobeLeftThighLimb" Type="Standard" EnumName="WIZROBE_LIMB_LEFT_THIGH" Offset="0xB28C" />
|
||||
<Limb Name="gWizrobeLeftShinLimb" Type="Standard" EnumName="WIZROBE_LIMB_LEFT_SHIN" Offset="0xB298" />
|
||||
<Limb Name="gWizrobeLeftFootLimb" Type="Standard" EnumName="WIZROBE_LIMB_LEFT_FOOT" Offset="0xB2A4" />
|
||||
<Limb Name="gWizrobeRightThighLimb" Type="Standard" EnumName="WIZROBE_LIMB_RIGHT_THIGH" Offset="0xB2B0" />
|
||||
<Limb Name="gWizrobeRightShinLimb" Type="Standard" EnumName="WIZROBE_LIMB_RIGHT_SHIN" Offset="0xB2BC" />
|
||||
<Limb Name="gWizrobeRightFootLimb" Type="Standard" EnumName="WIZROBE_LIMB_RIGHT_FOOT" Offset="0xB2C8" />
|
||||
|
||||
<!-- Wizrobe Skeleton -->
|
||||
<Skeleton Name="gWizrobeSkel" Type="Flex" LimbType="Standard" LimbNone="WIZROBE_LIMB_NONE" LimbMax="WIZROBE_LIMB_MAX" EnumName="WizrobeLimb" Offset="0xB320" />
|
||||
</File>
|
||||
</Root>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<Root>
|
||||
<ExternalFile XmlPath="objects/gameplay_keep.xml" OutPath="assets/objects/gameplay_keep/"/>
|
||||
<File Name="ovl_Oceff_Storm" BaseAddress="0x80981760" RangeStart="0x830" RangeEnd="0x1BC0">
|
||||
<Texture Name="sSongOfStormsEffectTex" OutName="song_of_storms_effect" Format="i8" Width="64" Height="64" Offset="0x830"/>
|
||||
<DList Name="sSongOfStormsMaterialDL" Offset="0x1830"/>
|
||||
<Array Name="sSongOfStormsCylinderVtx" Count="27" Offset="0x18D8">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="sSongOfStormsCylinderMaterialDL" Offset="0x1A88"/>
|
||||
<DList Name="sSongOfStormsCylinderModelDL" Offset="0x1B30"/>
|
||||
</File>
|
||||
</Root>
|
||||
@@ -0,0 +1,10 @@
|
||||
<Root>
|
||||
<File Name="ovl_Oceff_Wipe" BaseAddress="0x809764B0" RangeStart="0x4F0" RangeEnd="0xCB0">
|
||||
<Texture Name="sSongOfTimeEffectTex" OutName="song_of_time_effect" Format="i8" Width="32" Height="32" Offset="0x4F0"/>
|
||||
<Array Name="sSongOfTimeFrustumVtx" Count="32" Offset="0x8F0">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="sSongOfTimeFrustumMaterialDL" Offset="0xB70"/>
|
||||
<DList Name="sSongOfTimeFrustumModelDL" Offset="0xBF8"/>
|
||||
</File>
|
||||
</Root>
|
||||
@@ -0,0 +1,9 @@
|
||||
<Root>
|
||||
<File Name="ovl_Oceff_Wipe5" BaseAddress="0x80BC7AD0" RangeStart="0x440" RangeEnd="0x1630">
|
||||
<TextureAnimation Name="gOceff5TexAnim" Offset="0x448" />
|
||||
<Array Name="gOceff5Vtx" Count="22" Offset="0x1450">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="gOceff5DL" Offset="0x15B0"/>
|
||||
</File>
|
||||
</Root>
|
||||
+25
-3
@@ -23,7 +23,7 @@
|
||||
- [`tools/warnings_count/check_new_warnings.sh`](#toolswarnings_countcheck_new_warningssh)
|
||||
- [`tools/warnings_count/update_current_warnings.sh`](#toolswarnings_countupdate_current_warningssh)
|
||||
- [`fixle.sh`](#fixlesh)
|
||||
- [`format.sh`](#formatsh)
|
||||
- [`format.py`](#formatpy)
|
||||
- [External tools](#external-tools)
|
||||
- [mips_to_c](#mips_to_c)
|
||||
- [Permuter](#permuter)
|
||||
@@ -196,9 +196,31 @@ If you have to add new warnings, **and have permission from the leads**, run thi
|
||||
|
||||
Fixes line endings in the repo to Linux style (LF), which is required for the build process to work. (You may be better off creating a new clone directly in Linux/WSL, though)
|
||||
|
||||
### `format.sh`
|
||||
### `format.py`
|
||||
|
||||
Formats all C files in the repo using `clang-format-11` (instructions on how to install this version are pinned in Discord if you can't get it from your package manager in the usual way). This will touch all files in the repo, so the next `make` will take longer.
|
||||
Formats all C files in the repo using `clang-format-11`, `clang-tidy`, and `clang-apply-replacements` (when multiprocessing). This will touch all files in the repo, so the next `make` will take longer.
|
||||
|
||||
You can specify how many threads you would like this to run with by adding the `-jN` flag. Where N is the number of threads. By default this will run using 1 thread (i.e. `-j1`).
|
||||
|
||||
`clang-11` is available in many native package managers, but if not try:
|
||||
|
||||
Linux:
|
||||
Download llvm's setup script, run it, than install normally
|
||||
```bash
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
chmod +x llvm.sh
|
||||
sudo ./llvm.sh 11
|
||||
rm llvm.sh
|
||||
sudo apt install clang-format-11 clang-tidy-11 clang-apply-replacements-11
|
||||
```
|
||||
|
||||
Mac:
|
||||
Install with brew, than create symlinks for `clang-tidy` and `clang-apply-replacements` to use properly
|
||||
```bash
|
||||
brew install llvm clang-format-11
|
||||
ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy"
|
||||
ln -s "$(brew --prefix llvm)/bin/clang-apply-replacements" "/usr/local/bin/clang-apply-replacements"
|
||||
```
|
||||
|
||||
## External tools
|
||||
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import glob
|
||||
import multiprocessing
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
from functools import partial
|
||||
from typing import List
|
||||
|
||||
|
||||
# clang-format, clang-tidy and clang-apply-replacements default version
|
||||
# Version 11 is used when available for more consistency between contributors
|
||||
CLANG_VER = 11
|
||||
|
||||
# Clang-Format options (see .clang-format for rules applied)
|
||||
FORMAT_OPTS = "-i -style=file"
|
||||
|
||||
# Clang-Tidy options (see .clang-tidy for checks enabled)
|
||||
TIDY_OPTS = "-p ."
|
||||
TIDY_FIX_OPTS = "--fix --fix-errors"
|
||||
|
||||
# Clang-Apply-Replacements options (used for multiprocessing)
|
||||
APPLY_OPTS = ""
|
||||
|
||||
# Compiler options used with Clang-Tidy
|
||||
# Normal warnings are disabled with -Wno-everything to focus only on tidying
|
||||
INCLUDES = "-Iinclude -Isrc -Ibuild -I."
|
||||
DEFINES = "-D_LANGUAGE_C -DNON_MATCHING"
|
||||
COMPILER_OPTS = f"-fno-builtin -std=gnu90 -m32 -Wno-everything {INCLUDES} {DEFINES}"
|
||||
|
||||
|
||||
def get_clang_executable(allowed_executables: List[str]):
|
||||
for executable in allowed_executables:
|
||||
try:
|
||||
subprocess.check_call([executable, "--version"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
return executable
|
||||
except FileNotFoundError or subprocess.CalledProcessError:
|
||||
pass
|
||||
return None
|
||||
|
||||
|
||||
def get_tidy_version(tidy_executable: str):
|
||||
tidy_version_run = subprocess.run([tidy_executable, "--version"], stdout=subprocess.PIPE, universal_newlines=True)
|
||||
match = re.search(r"LLVM version ([0-9]+)", tidy_version_run.stdout)
|
||||
return int(match.group(1))
|
||||
|
||||
|
||||
CLANG_FORMAT = get_clang_executable([f"clang-format-{CLANG_VER}"])
|
||||
if CLANG_FORMAT is None:
|
||||
sys.exit(f"Error: clang-format-{CLANG_VER} found")
|
||||
|
||||
CLANG_TIDY = get_clang_executable([f"clang-tidy-{CLANG_VER}", "clang-tidy"])
|
||||
if CLANG_TIDY is None:
|
||||
sys.exit(f"Error: neither clang-tidy-{CLANG_VER} nor clang-tidy found")
|
||||
|
||||
CLANG_APPLY_REPLACEMENTS = get_clang_executable([f"clang-apply-replacements-{CLANG_VER}", "clang-apply-replacements"])
|
||||
|
||||
# Try to detect the clang-tidy version and add --fix-notes for version 13+
|
||||
# This is used to ensure all fixes are applied properly in recent versions
|
||||
if get_tidy_version(CLANG_TIDY) >= 13:
|
||||
TIDY_FIX_OPTS += " --fix-notes"
|
||||
|
||||
|
||||
def list_chunks(list: List, chunk_length: int):
|
||||
for i in range(0, len(list), chunk_length):
|
||||
yield list[i : i + chunk_length]
|
||||
|
||||
|
||||
def run_clang_format(files: List[str]):
|
||||
exec_str = f"{CLANG_FORMAT} {FORMAT_OPTS} {' '.join(files)}"
|
||||
subprocess.run(exec_str, shell=True)
|
||||
|
||||
|
||||
def run_clang_tidy(files: List[str]):
|
||||
exec_str = f"{CLANG_TIDY} {TIDY_OPTS} {TIDY_FIX_OPTS} {' '.join(files)} -- {COMPILER_OPTS}"
|
||||
subprocess.run(exec_str, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
|
||||
|
||||
def run_clang_tidy_with_export(tmp_dir: str, files: List[str]):
|
||||
(handle, tmp_file) = tempfile.mkstemp(suffix=".yaml", dir=tmp_dir)
|
||||
os.close(handle)
|
||||
|
||||
exec_str = f"{CLANG_TIDY} {TIDY_OPTS} --export-fixes={tmp_file} {' '.join(files)} -- {COMPILER_OPTS}"
|
||||
subprocess.run(exec_str, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
|
||||
|
||||
def run_clang_apply_replacements(tmp_dir: str):
|
||||
exec_str = f"{CLANG_APPLY_REPLACEMENTS} {APPLY_OPTS} {tmp_dir}"
|
||||
subprocess.run(exec_str, shell=True)
|
||||
|
||||
|
||||
def add_final_new_line(file: str):
|
||||
# https://backreference.org/2010/05/23/sanitizing-files-with-no-trailing-newline/index.html
|
||||
# "gets the last character of the file pipes it into read, which will exit with a nonzero exit
|
||||
# code if it encounters EOF before newline (so, if the last character of the file isn't a newline).
|
||||
# If read exits nonzero, then append a newline onto the file using echo (if read exits 0,
|
||||
# that satisfies the ||, so the echo command isn't run)." (https://stackoverflow.com/a/34865616)
|
||||
exec_str = f"tail -c1 {file} | read -r _ || echo >> {file}"
|
||||
subprocess.run(exec_str, shell=True)
|
||||
|
||||
|
||||
def format_files(src_files: List[str], extra_files: List[str], nb_jobs: int):
|
||||
if nb_jobs != 1:
|
||||
print(f"Formatting files with {nb_jobs} jobs")
|
||||
else:
|
||||
print(f"Formatting files with a single job (consider using -j to make this faster)")
|
||||
|
||||
# Format files in chunks to improve performance while still utilizing jobs
|
||||
file_chunks = list(list_chunks(src_files, (len(src_files) // nb_jobs) + 1))
|
||||
|
||||
print("Running clang-format...")
|
||||
# clang-format only applies changes in the given files, so it's safe to run in parallel
|
||||
with multiprocessing.get_context("fork").Pool(nb_jobs) as pool:
|
||||
pool.map(run_clang_format, file_chunks)
|
||||
|
||||
print("Running clang-tidy...")
|
||||
if nb_jobs > 1:
|
||||
# clang-tidy may apply changes in #included files, so when running it in parallel we use --export-fixes
|
||||
# then we call clang-apply-replacements to apply all suggested fixes at the end
|
||||
tmp_dir = tempfile.mkdtemp()
|
||||
|
||||
try:
|
||||
with multiprocessing.get_context("fork").Pool(nb_jobs) as pool:
|
||||
pool.map(partial(run_clang_tidy_with_export, tmp_dir), file_chunks)
|
||||
|
||||
run_clang_apply_replacements(tmp_dir)
|
||||
finally:
|
||||
shutil.rmtree(tmp_dir)
|
||||
else:
|
||||
run_clang_tidy(src_files)
|
||||
|
||||
print("Adding missing final new lines...")
|
||||
# Adding final new lines is safe to do in parallel and can be applied to all types of files
|
||||
with multiprocessing.get_context("fork").Pool(nb_jobs) as pool:
|
||||
pool.map(add_final_new_line, src_files + extra_files)
|
||||
|
||||
print("Done formatting files.")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Format files in the codebase to enforce most style rules")
|
||||
parser.add_argument("files", metavar="file", nargs="*")
|
||||
parser.add_argument(
|
||||
"-j",
|
||||
dest="jobs",
|
||||
type=int,
|
||||
nargs="?",
|
||||
default=1,
|
||||
help="number of jobs to run (default: 1 without -j, number of cpus with -j)",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
nb_jobs = args.jobs or multiprocessing.cpu_count()
|
||||
if nb_jobs > 1:
|
||||
if CLANG_APPLY_REPLACEMENTS is None:
|
||||
sys.exit(
|
||||
f"Error: neither clang-apply-replacements-{CLANG_VER} nor clang-apply-replacements found (required to use -j)"
|
||||
)
|
||||
|
||||
if args.files:
|
||||
files = args.files
|
||||
extra_files = []
|
||||
else:
|
||||
files = glob.glob("src/**/*.c", recursive=True)
|
||||
extra_files = glob.glob("assets/**/*.xml", recursive=True)
|
||||
|
||||
format_files(files, extra_files, nb_jobs)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
FORMAT_VER="11"
|
||||
FORMAT_OPTS="-i -style=file"
|
||||
TIDY_OPTS="-p . --fix --fix-errors"
|
||||
COMPILER_OPTS="-fno-builtin -std=gnu90 -Iinclude -Isrc -D_LANGUAGE_C -DNON_MATCHING"
|
||||
|
||||
# https://backreference.org/2010/05/23/sanitizing-files-with-no-trailing-newline/index.html
|
||||
# "gets the last character of the file pipes it into read, which will exit with a nonzero exit code if it encounters EOF before newline (so, if the last character of the file isn't a newline). If read exits nonzero, then append a newline onto the file using echo (if read exits 0, that satisfies the ||, so the echo command isn't run)." (https://stackoverflow.com/a/34865616)
|
||||
function add_final_newline () {
|
||||
for file in "$@"
|
||||
do
|
||||
tail -c1 $file | read -r _ || echo >> $file
|
||||
done
|
||||
}
|
||||
export -f add_final_newline
|
||||
|
||||
shopt -s globstar
|
||||
|
||||
if [ -z `command -v clang-format-${FORMAT_VER}` ]
|
||||
then
|
||||
echo "clang-format-${FORMAT_VER} not found. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if (( $# > 0 )); then
|
||||
echo "Formatting file(s) $*"
|
||||
echo "Running clang-format..."
|
||||
clang-format-${FORMAT_VER} ${FORMAT_OPTS} "$@"
|
||||
echo "Running clang-tidy..."
|
||||
clang-tidy ${TIDY_OPTS} "$@" -- ${COMPILER_OPTS} &> /dev/null
|
||||
echo "Adding missing final new lines..."
|
||||
add_final_newline "$@"
|
||||
echo "Done formatting file(s) $*"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "Formatting C files. This will take a bit"
|
||||
echo "Running clang-format..."
|
||||
clang-format-${FORMAT_VER} ${FORMAT_OPTS} src/**/*.c
|
||||
echo "Running clang-tidy..."
|
||||
clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null
|
||||
echo "Adding missing final new lines..."
|
||||
find src/ -type f -name "*.c" -exec bash -c 'add_final_newline "$@"' bash {} +
|
||||
find assets/xml/ -type f -name "*.xml" -exec bash -c 'add_final_newline "$@"' bash {} +
|
||||
echo "Done formatting all files."
|
||||
+60
-31
@@ -53,6 +53,7 @@
|
||||
#define A_INIT 0x01
|
||||
#define A_CONTINUE 0x00
|
||||
#define A_LOOP 0x02
|
||||
#define A_ADPCM_SHORT 0x04
|
||||
#define A_OUT 0x02
|
||||
#define A_LEFT 0x02
|
||||
#define A_RIGHT 0x00
|
||||
@@ -331,13 +332,20 @@ typedef short ENVMIX_STATE[40];
|
||||
_a->words.w1 = (unsigned int)(a2); \
|
||||
}
|
||||
|
||||
#define aClearBuffer(pkt, d, c) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_CLEARBUFF, 24, 8) | _SHIFTL(d, 0, 24); \
|
||||
_a->words.w1 = (unsigned int)(c); \
|
||||
}
|
||||
/*
|
||||
* Clears DMEM by writing zeros.
|
||||
*
|
||||
* @param pkt pointer to an Acmd buffer
|
||||
* @param dmem DMEM address to clear
|
||||
* @param size number of bytes to clear (rounded up to the next multiple of 16)
|
||||
*/
|
||||
#define aClearBuffer(pkt, dmem, size) \
|
||||
{ \
|
||||
Acmd* _a = (Acmd*)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_CLEARBUFF, 24, 8) | _SHIFTL(dmem, 0, 24); \
|
||||
_a->words.w1 = (uintptr_t)(size); \
|
||||
}
|
||||
|
||||
#define aEnvMixer(pkt, dmemi, count, swapLR, x0, x1, x2, x3, m, bits) \
|
||||
{ \
|
||||
@@ -368,14 +376,21 @@ typedef short ENVMIX_STATE[40];
|
||||
_a->words.w1 = _SHIFTL(dmemi, 16, 16) | _SHIFTL(dmemo, 0, 16); \
|
||||
}
|
||||
|
||||
#define aLoadBuffer(pkt, s, d, c) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_LOADBUFF, 24, 8) | \
|
||||
_SHIFTL((c) >> 4, 16, 8) | _SHIFTL(d, 0, 16); \
|
||||
_a->words.w1 = (unsigned int)(s); \
|
||||
}
|
||||
/*
|
||||
* Loads a buffer to DMEM from any physical source address, KSEG0, or KSEG1
|
||||
*
|
||||
* @param pkt pointer to an Acmd buffer
|
||||
* @param addrSrc Any physical source address, KSEG0, or KSEG1
|
||||
* @param dmemDest DMEM destination address
|
||||
* @param size number of bytes to copy (rounded down to the next multiple of 16)
|
||||
*/
|
||||
#define aLoadBuffer(pkt, addrSrc, dmemDest, size) \
|
||||
{ \
|
||||
Acmd* _a = (Acmd*)pkt; \
|
||||
\
|
||||
_a->words.w0 = (_SHIFTL(A_LOADBUFF, 24, 8) | _SHIFTL((size) >> 4, 16, 8) | _SHIFTL(dmemDest, 0, 16)); \
|
||||
_a->words.w1 = (uintptr_t)(addrSrc); \
|
||||
}
|
||||
|
||||
#define aMix(pkt, f, g, i, o) \
|
||||
{ \
|
||||
@@ -404,14 +419,21 @@ typedef short ENVMIX_STATE[40];
|
||||
_a->words.w1 = (unsigned int)(s); \
|
||||
}
|
||||
|
||||
#define aSaveBuffer(pkt, s, d, c) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_SAVEBUFF, 24, 8) | \
|
||||
_SHIFTL((c) >> 4, 16, 8) | _SHIFTL(s, 0, 16); \
|
||||
_a->words.w1 = (unsigned int)(d); \
|
||||
}
|
||||
/*
|
||||
* Stores a buffer from DMEM to any physical source address, KSEG0, or KSEG1
|
||||
*
|
||||
* @param pkt pointer to an Acmd buffer
|
||||
* @param dmemSrc DMEM source address
|
||||
* @param addrDest Any physical source address, KSEG0, or KSEG1
|
||||
* @param size number of bytes to copy (rounded down to the next multiple of 16)
|
||||
*/
|
||||
#define aSaveBuffer(pkt, dmemSrc, addrDest, size) \
|
||||
{ \
|
||||
Acmd* _a = (Acmd*)pkt; \
|
||||
\
|
||||
_a->words.w0 = (_SHIFTL(A_SAVEBUFF, 24, 8) | _SHIFTL((size) >> 4, 16, 8) | _SHIFTL(dmemSrc, 0, 16)); \
|
||||
_a->words.w1 = (uintptr_t)(addrDest); \
|
||||
}
|
||||
|
||||
#define aSegment(pkt, s, b) \
|
||||
{ \
|
||||
@@ -501,14 +523,21 @@ typedef short ENVMIX_STATE[40];
|
||||
_a->words.w1 = (unsigned int)(addr); \
|
||||
}
|
||||
|
||||
#define aDuplicate(pkt, count, dmemi, dmemo, a4) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = (_SHIFTL(A_DUPLICATE, 24, 8) | \
|
||||
_SHIFTL(count, 16, 8) | _SHIFTL(dmemi, 0, 16)); \
|
||||
_a->words.w1 = _SHIFTL(dmemo, 16, 16) | _SHIFTL(a4, 0, 16); \
|
||||
}
|
||||
/*
|
||||
* Duplicates 128 bytes of data a specified number of times.
|
||||
*
|
||||
* @param pkt pointer to an Acmd buffer
|
||||
* @param numCopies number of times to duplicate 128 bytes from src
|
||||
* @param dmemSrc DMEM source address
|
||||
* @param dmemDest DMEM destination address for the duplicates, size 128 * numCopies
|
||||
*/
|
||||
#define aDuplicate(pkt, numCopies, dmemSrc, dmemDest) \
|
||||
{ \
|
||||
Acmd* _a = (Acmd*)pkt; \
|
||||
\
|
||||
_a->words.w0 = (_SHIFTL(A_DUPLICATE, 24, 8) | _SHIFTL(numCopies, 16, 8) | _SHIFTL(dmemSrc, 0, 16)); \
|
||||
_a->words.w1 = _SHIFTL(dmemDest, 16, 16) | _SHIFTL(0x80, 0, 16); \
|
||||
}
|
||||
|
||||
#define aAddMixer(pkt, count, dmemi, dmemo, a4) \
|
||||
{ \
|
||||
|
||||
+217
-337
File diff suppressed because it is too large
Load Diff
+14
-14
@@ -29,21 +29,21 @@ typedef struct GfxPrint {
|
||||
/* 0x14 */ UNK_TYPE1 unk_14[0x1C]; // unused
|
||||
} GfxPrint; // size = 0x30
|
||||
|
||||
void GfxPrint_Setup(GfxPrint* printer);
|
||||
void GfxPrint_SetColor(GfxPrint* printer, u32 r, u32 g, u32 b, u32 a);
|
||||
void GfxPrint_SetPosPx(GfxPrint* printer, s32 x, s32 y);
|
||||
void GfxPrint_SetPos(GfxPrint* printer, s32 x, s32 y);
|
||||
void GfxPrint_SetBasePosPx(GfxPrint* printer, s32 x, s32 y);
|
||||
void GfxPrint_PrintCharImpl(GfxPrint* printer, u8 c);
|
||||
void GfxPrint_PrintChar(GfxPrint* printer, u8 c);
|
||||
void GfxPrint_PrintStringWithSize(GfxPrint* printer, const void* buffer, size_t charSize, size_t charCount);
|
||||
void GfxPrint_PrintString(GfxPrint* printer, const char* str);
|
||||
void GfxPrint_Setup(GfxPrint* this);
|
||||
void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a);
|
||||
void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y);
|
||||
void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y);
|
||||
void GfxPrint_SetBasePosPx(GfxPrint* this, s32 x, s32 y);
|
||||
void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c);
|
||||
void GfxPrint_PrintChar(GfxPrint* this, u8 c);
|
||||
void GfxPrint_PrintStringWithSize(GfxPrint* this, const void* buffer, size_t charSize, size_t charCount);
|
||||
void GfxPrint_PrintString(GfxPrint* this, const char* str);
|
||||
void* GfxPrint_Callback(void* arg, const char* str, size_t size);
|
||||
void GfxPrint_Init(GfxPrint* printer);
|
||||
void GfxPrint_Init(GfxPrint* this);
|
||||
void GfxPrint_Destroy(GfxPrint* printer);
|
||||
void GfxPrint_Open(GfxPrint* printer, Gfx* dList);
|
||||
Gfx* GfxPrint_Close(GfxPrint* printer);
|
||||
s32 GfxPrint_VPrintf(GfxPrint* printer, const char* fmt, va_list args);
|
||||
s32 GfxPrint_Printf(GfxPrint* printer, const char* fmt, ...);
|
||||
void GfxPrint_Open(GfxPrint* this, Gfx* dList);
|
||||
Gfx* GfxPrint_Close(GfxPrint* this);
|
||||
s32 GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args);
|
||||
s32 GfxPrint_Printf(GfxPrint* this, const char* fmt, ...);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -610,4 +610,12 @@ extern ActorInit Oceff_Wipe7_InitVars;
|
||||
extern ActorInit Shot_Sun_InitVars;
|
||||
extern ActorInit TG_Sw_InitVars;
|
||||
|
||||
extern TransitionInit TransitionFade_InitVars;
|
||||
extern TransitionInit TransitionTriforce_InitVars;
|
||||
extern TransitionInit TransitionWipe1_InitVars;
|
||||
extern TransitionInit TransitionWipe3_InitVars;
|
||||
extern TransitionInit TransitionWipe4_InitVars;
|
||||
extern TransitionInit TransitionCircle_InitVars;
|
||||
extern TransitionInit TransitionWipe5_InitVars;
|
||||
|
||||
#endif
|
||||
|
||||
+5
-5
@@ -47,7 +47,7 @@ typedef struct {
|
||||
/* 0x04 */ u16 transferMode;
|
||||
/* 0x06 */ u16 blockNum;
|
||||
/* 0x08 */ s32 sectorNum;
|
||||
/* 0x0C */ u32 devAddr;
|
||||
/* 0x0C */ uintptr_t devAddr;
|
||||
/* 0x10 */ u32 bmCtlShadow;
|
||||
/* 0x14 */ u32 seqCtlShadow;
|
||||
/* 0x18 */ __OSBlockInfo block[2];
|
||||
@@ -62,7 +62,7 @@ typedef struct OSPiHandle {
|
||||
/* 0x07 */ u8 relDuration;
|
||||
/* 0x08 */ u8 pulse;
|
||||
/* 0x09 */ u8 domain;
|
||||
/* 0x0C */ u32 baseAddress;
|
||||
/* 0x0C */ uintptr_t baseAddress;
|
||||
/* 0x10 */ u32 speed;
|
||||
/* 0x14 */ __OSTranxInfo transferInfo;
|
||||
} OSPiHandle; // size = 0x74
|
||||
@@ -70,7 +70,7 @@ typedef struct OSPiHandle {
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 type;
|
||||
/* 0x4 */ u32 address;
|
||||
/* 0x4 */ uintptr_t address;
|
||||
} OSPiInfo; // size = 0x8
|
||||
|
||||
|
||||
@@ -97,8 +97,8 @@ typedef struct {
|
||||
/* 0x08 */ OSMesgQueue* cmdQueue;
|
||||
/* 0x0C */ OSMesgQueue* evtQueue;
|
||||
/* 0x10 */ OSMesgQueue* acsQueue;
|
||||
/* 0x14 */ s32 (*piDmaCallback)(s32, u32, void*, size_t);
|
||||
/* 0x18 */ s32 (*epiDmaCallback)(OSPiHandle*, s32, u32, void*, size_t);
|
||||
/* 0x14 */ s32 (*piDmaCallback)(s32, uintptr_t, void*, size_t);
|
||||
/* 0x18 */ s32 (*epiDmaCallback)(OSPiHandle*, s32, uintptr_t, void*, size_t);
|
||||
} OSDevMgr; // size = 0x1C
|
||||
|
||||
typedef u64 OSTime;
|
||||
|
||||
@@ -12,8 +12,8 @@ typedef struct {
|
||||
/* 0x08 */ OSMesgQueue* cmdQueue;
|
||||
/* 0x0C */ OSMesgQueue* eventQueue;
|
||||
/* 0x10 */ OSMesgQueue* accessQueue;
|
||||
/* 0x14 */ s32 (*piDmaCallback)(s32, u32, void*, size_t);
|
||||
/* 0x18 */ s32 (*epiDmaCallback)(OSPiHandle*, s32, u32, void*, size_t);
|
||||
/* 0x14 */ s32 (*piDmaCallback)(s32, uintptr_t, void*, size_t);
|
||||
/* 0x18 */ s32 (*epiDmaCallback)(OSPiHandle*, s32, uintptr_t, void*, size_t);
|
||||
} OSMgrArgs; // size = 0x1C
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ void* __osMalloc(Arena* arena, size_t size);
|
||||
void* __osMallocR(Arena* arena, size_t size);
|
||||
void __osFree(Arena* arena, void* ptr);
|
||||
void* __osRealloc(Arena* arena, void* ptr, size_t newSize);
|
||||
void __osGetSizes(Arena* arena, size_t* maxFreeBlock, size_t* bytesFree, size_t* bytesAllocated);
|
||||
void __osGetSizes(Arena* arena, size_t* outMaxFree, size_t* outFree, size_t* outAlloc);
|
||||
s32 __osCheckArena(Arena* arena);
|
||||
|
||||
#endif
|
||||
|
||||
+106
-104
@@ -4,7 +4,7 @@
|
||||
#define NA_BGM_STOP 0x100000FF
|
||||
|
||||
#define NA_BGM_GENERAL_SFX 0x00 // General Sound Effects
|
||||
#define NA_BGM_NATURE_AMBIENCE 0x01 // Ambient background noises
|
||||
#define NA_BGM_AMBIENCE 0x01 // Ambient background noises
|
||||
#define NA_BGM_TERMINA_FIELD 0x02 // Termina Field
|
||||
#define NA_BGM_CHASE 0x03 // Forest Chase
|
||||
#define NA_BGM_MAJORAS_THEME 0x04 // Majora's Theme "STALKID"
|
||||
@@ -40,7 +40,7 @@
|
||||
#define NA_BGM_GET_ITEM 0x22 // Item Catch
|
||||
#define NA_BGM_GATE_OPEN 0x23 // Clock Town Day 2 Duplicate of #16. In MM3D, it shares its filename with the Door of Time song from OoT
|
||||
#define NA_BGM_GET_HEART 0x24 // Complete a Heart Piece
|
||||
#define NA_BGM_MINI_GAME_2 0x25 // Playing Minigame
|
||||
#define NA_BGM_TIMED_MINI_GAME 0x25 // Playing a timed Minigame
|
||||
#define NA_BGM_GORON_RACE 0x26 // Goron Race
|
||||
#define NA_BGM_MUSIC_BOX_HOUSE 0x27 // Music Box House "ORGEL_HOUSE"
|
||||
#define NA_BGM_FAIRY_FOUNTAIN 0x28 // Fairy's Fountain In MM3D, it shares its filename with the Door of Time song from OoT "GODESS"
|
||||
@@ -134,11 +134,12 @@
|
||||
#define NA_BGM_DISABLED 0xFFFF
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SEQ_PLAYER_BGM_MAIN,
|
||||
/* 1 */ SEQ_PLAYER_FANFARE,
|
||||
/* 2 */ SEQ_PLAYER_SFX,
|
||||
/* 3 */ SEQ_PLAYER_BGM_SUB,
|
||||
/* 4 */ SEQ_PLAYER_NATURE
|
||||
/* 0 */ SEQ_PLAYER_BGM_MAIN,
|
||||
/* 1 */ SEQ_PLAYER_FANFARE,
|
||||
/* 2 */ SEQ_PLAYER_SFX,
|
||||
/* 3 */ SEQ_PLAYER_BGM_SUB,
|
||||
/* 4 */ SEQ_PLAYER_AMBIENCE,
|
||||
/* 0xFF */ SEQ_PLAYER_INVALID = 0xFF
|
||||
} SequencePlayerId;
|
||||
|
||||
typedef enum {
|
||||
@@ -160,119 +161,120 @@ typedef enum {
|
||||
} ChannelIOPort;
|
||||
|
||||
typedef enum {
|
||||
/* 0x0 */ NATURE_CHANNEL_STREAM_0,
|
||||
/* 0x1 */ NATURE_CHANNEL_CRITTER_0,
|
||||
/* 0x2 */ NATURE_CHANNEL_CRITTER_1,
|
||||
/* 0x3 */ NATURE_CHANNEL_CRITTER_2,
|
||||
/* 0x4 */ NATURE_CHANNEL_CRITTER_3,
|
||||
/* 0x5 */ NATURE_CHANNEL_CRITTER_4,
|
||||
/* 0x6 */ NATURE_CHANNEL_CRITTER_5,
|
||||
/* 0x7 */ NATURE_CHANNEL_CRITTER_6,
|
||||
/* 0x8 */ NATURE_CHANNEL_CRITTER_7,
|
||||
/* 0xC */ NATURE_CHANNEL_STREAM_1 = 12,
|
||||
/* 0xD */ NATURE_CHANNEL_UNK,
|
||||
/* 0xE */ NATURE_CHANNEL_RAIN,
|
||||
/* 0xF */ NATURE_CHANNEL_LIGHTNING
|
||||
} NatureChannelIdx; // playerIdx = 4
|
||||
/* 0x0 */ AMBIENCE_CHANNEL_STREAM_0,
|
||||
/* 0x1 */ AMBIENCE_CHANNEL_CRITTER_0,
|
||||
/* 0x2 */ AMBIENCE_CHANNEL_CRITTER_1,
|
||||
/* 0x3 */ AMBIENCE_CHANNEL_CRITTER_2,
|
||||
/* 0x4 */ AMBIENCE_CHANNEL_CRITTER_3,
|
||||
/* 0x5 */ AMBIENCE_CHANNEL_CRITTER_4,
|
||||
/* 0x6 */ AMBIENCE_CHANNEL_CRITTER_5,
|
||||
/* 0x7 */ AMBIENCE_CHANNEL_CRITTER_6,
|
||||
/* 0x8 */ AMBIENCE_CHANNEL_CRITTER_7,
|
||||
/* 0xC */ AMBIENCE_CHANNEL_STREAM_1 = 12,
|
||||
/* 0xD */ AMBIENCE_CHANNEL_SOUND_MODE,
|
||||
/* 0xE */ AMBIENCE_CHANNEL_RAIN,
|
||||
/* 0xF */ AMBIENCE_CHANNEL_LIGHTNING
|
||||
} AmbienceChannelIndex; // playerIndex = SEQ_PLAYER_AMBIENCE
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ NATURE_AMBIENCE_0,
|
||||
/* 0x01 */ NATURE_AMBIENCE_1,
|
||||
/* 0x02 */ NATURE_AMBIENCE_2,
|
||||
/* 0x03 */ NATURE_AMBIENCE_3,
|
||||
/* 0x04 */ NATURE_AMBIENCE_4,
|
||||
/* 0x05 */ NATURE_AMBIENCE_5,
|
||||
/* 0x06 */ NATURE_AMBIENCE_6,
|
||||
/* 0x07 */ NATURE_AMBIENCE_7,
|
||||
/* 0x08 */ NATURE_AMBIENCE_8,
|
||||
/* 0x09 */ NATURE_AMBIENCE_9,
|
||||
/* 0x0A */ NATURE_AMBIENCE_A,
|
||||
/* 0x0B */ NATURE_AMBIENCE_B,
|
||||
/* 0x0C */ NATURE_AMBIENCE_C,
|
||||
/* 0x0D */ NATURE_AMBIENCE_D,
|
||||
/* 0x0E */ NATURE_AMBIENCE_E,
|
||||
/* 0x0F */ NATURE_AMBIENCE_F,
|
||||
/* 0x10 */ NATURE_AMBIENCE_10,
|
||||
/* 0x11 */ NATURE_AMBIENCE_11,
|
||||
/* 0x12 */ NATURE_AMBIENCE_12,
|
||||
/* 0x13 */ NATURE_AMBIENCE_13
|
||||
} NatureAmbienceId; // playerIdx = 4
|
||||
/* 0x00 */ AMBIENCE_ID_00,
|
||||
/* 0x01 */ AMBIENCE_ID_01,
|
||||
/* 0x02 */ AMBIENCE_ID_02,
|
||||
/* 0x03 */ AMBIENCE_ID_03,
|
||||
/* 0x04 */ AMBIENCE_ID_04,
|
||||
/* 0x05 */ AMBIENCE_ID_05,
|
||||
/* 0x06 */ AMBIENCE_ID_06,
|
||||
/* 0x07 */ AMBIENCE_ID_07,
|
||||
/* 0x08 */ AMBIENCE_ID_08,
|
||||
/* 0x09 */ AMBIENCE_ID_09,
|
||||
/* 0x0A */ AMBIENCE_ID_0A,
|
||||
/* 0x0B */ AMBIENCE_ID_0B,
|
||||
/* 0x0C */ AMBIENCE_ID_0C,
|
||||
/* 0x0D */ AMBIENCE_ID_0D,
|
||||
/* 0x0E */ AMBIENCE_ID_0E,
|
||||
/* 0x0F */ AMBIENCE_ID_0F,
|
||||
/* 0x10 */ AMBIENCE_ID_10,
|
||||
/* 0x11 */ AMBIENCE_ID_11,
|
||||
/* 0x12 */ AMBIENCE_ID_12,
|
||||
/* 0x13 */ AMBIENCE_ID_13,
|
||||
/* 0xFF */ AMBIENCE_ID_DISABLED = 0xFF
|
||||
} AmbienceId; // playerIndex = SEQ_PLAYER_AMBIENCE
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ NATURE_STREAM_0,
|
||||
/* 0x01 */ NATURE_STREAM_1,
|
||||
/* 0x02 */ NATURE_STREAM_2,
|
||||
/* 0x03 */ NATURE_STREAM_3
|
||||
} NatureStreamId;
|
||||
/* 0x00 */ AMBIENCE_STREAM_0,
|
||||
/* 0x01 */ AMBIENCE_STREAM_1,
|
||||
/* 0x02 */ AMBIENCE_STREAM_2,
|
||||
/* 0x03 */ AMBIENCE_STREAM_3
|
||||
} AmbienceStreamId;
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ NATURE_CRITTER_00,
|
||||
/* 0x01 */ NATURE_CRITTER_01,
|
||||
/* 0x02 */ NATURE_CRITTER_02,
|
||||
/* 0x03 */ NATURE_CRITTER_03,
|
||||
/* 0x04 */ NATURE_CRITTER_04,
|
||||
/* 0x05 */ NATURE_CRITTER_05,
|
||||
/* 0x06 */ NATURE_CRITTER_06,
|
||||
/* 0x07 */ NATURE_CRITTER_07,
|
||||
/* 0x08 */ NATURE_CRITTER_08,
|
||||
/* 0x09 */ NATURE_CRITTER_09,
|
||||
/* 0x0A */ NATURE_CRITTER_10,
|
||||
/* 0x0B */ NATURE_CRITTER_11,
|
||||
/* 0x0C */ NATURE_CRITTER_12,
|
||||
/* 0x0D */ NATURE_CRITTER_13,
|
||||
/* 0x0E */ NATURE_CRITTER_14,
|
||||
/* 0x0F */ NATURE_CRITTER_15,
|
||||
/* 0x10 */ NATURE_CRITTER_16,
|
||||
/* 0x11 */ NATURE_CRITTER_17,
|
||||
/* 0x12 */ NATURE_CRITTER_18,
|
||||
/* 0x13 */ NATURE_CRITTER_19
|
||||
} NatureAmimalId;
|
||||
/* 0x00 */ AMBIENCE_CRITTER_00,
|
||||
/* 0x01 */ AMBIENCE_CRITTER_01,
|
||||
/* 0x02 */ AMBIENCE_CRITTER_02,
|
||||
/* 0x03 */ AMBIENCE_CRITTER_03,
|
||||
/* 0x04 */ AMBIENCE_CRITTER_04,
|
||||
/* 0x05 */ AMBIENCE_CRITTER_05,
|
||||
/* 0x06 */ AMBIENCE_CRITTER_06,
|
||||
/* 0x07 */ AMBIENCE_CRITTER_07,
|
||||
/* 0x08 */ AMBIENCE_CRITTER_08,
|
||||
/* 0x09 */ AMBIENCE_CRITTER_09,
|
||||
/* 0x0A */ AMBIENCE_CRITTER_10,
|
||||
/* 0x0B */ AMBIENCE_CRITTER_11,
|
||||
/* 0x0C */ AMBIENCE_CRITTER_12,
|
||||
/* 0x0D */ AMBIENCE_CRITTER_13,
|
||||
/* 0x0E */ AMBIENCE_CRITTER_14,
|
||||
/* 0x0F */ AMBIENCE_CRITTER_15,
|
||||
/* 0x10 */ AMBIENCE_CRITTER_16,
|
||||
/* 0x11 */ AMBIENCE_CRITTER_17,
|
||||
/* 0x12 */ AMBIENCE_CRITTER_18,
|
||||
/* 0x13 */ AMBIENCE_CRITTER_19
|
||||
} AmbienceCritterId;
|
||||
|
||||
#define NATURE_IO_CRITTER_0_TYPE(type) NATURE_CHANNEL_CRITTER_0, CHANNEL_IO_PORT_2, type
|
||||
#define NATURE_IO_CRITTER_0_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_0, CHANNEL_IO_PORT_3, bend
|
||||
#define NATURE_IO_CRITTER_0_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_0, CHANNEL_IO_PORT_4, num
|
||||
#define NATURE_IO_CRITTER_0_PORT5(reverb) NATURE_CHANNEL_CRITTER_0, CHANNEL_IO_PORT_5, reverb
|
||||
#define AMBIENCE_IO_CRITTER_0_TYPE(type) AMBIENCE_CHANNEL_CRITTER_0, CHANNEL_IO_PORT_2, type
|
||||
#define AMBIENCE_IO_CRITTER_0_BEND_PITCH(bend) AMBIENCE_CHANNEL_CRITTER_0, CHANNEL_IO_PORT_3, bend
|
||||
#define AMBIENCE_IO_CRITTER_0_NUM_LAYERS(num) AMBIENCE_CHANNEL_CRITTER_0, CHANNEL_IO_PORT_4, num
|
||||
#define AMBIENCE_IO_CRITTER_0_PORT5(reverb) AMBIENCE_CHANNEL_CRITTER_0, CHANNEL_IO_PORT_5, reverb
|
||||
|
||||
#define NATURE_IO_CRITTER_1_TYPE(type) NATURE_CHANNEL_CRITTER_1, CHANNEL_IO_PORT_2, type
|
||||
#define NATURE_IO_CRITTER_1_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_1, CHANNEL_IO_PORT_3, bend
|
||||
#define NATURE_IO_CRITTER_1_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_1, CHANNEL_IO_PORT_4, num
|
||||
#define NATURE_IO_CRITTER_1_PORT5(reverb) NATURE_CHANNEL_CRITTER_1, CHANNEL_IO_PORT_5, reverb
|
||||
#define AMBIENCE_IO_CRITTER_1_TYPE(type) AMBIENCE_CHANNEL_CRITTER_1, CHANNEL_IO_PORT_2, type
|
||||
#define AMBIENCE_IO_CRITTER_1_BEND_PITCH(bend) AMBIENCE_CHANNEL_CRITTER_1, CHANNEL_IO_PORT_3, bend
|
||||
#define AMBIENCE_IO_CRITTER_1_NUM_LAYERS(num) AMBIENCE_CHANNEL_CRITTER_1, CHANNEL_IO_PORT_4, num
|
||||
#define AMBIENCE_IO_CRITTER_1_PORT5(reverb) AMBIENCE_CHANNEL_CRITTER_1, CHANNEL_IO_PORT_5, reverb
|
||||
|
||||
#define NATURE_IO_CRITTER_2_TYPE(type) NATURE_CHANNEL_CRITTER_2, CHANNEL_IO_PORT_2, type
|
||||
#define NATURE_IO_CRITTER_2_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_2, CHANNEL_IO_PORT_3, bend
|
||||
#define NATURE_IO_CRITTER_2_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_2, CHANNEL_IO_PORT_4, num
|
||||
#define NATURE_IO_CRITTER_2_PORT5(reverb) NATURE_CHANNEL_CRITTER_2, CHANNEL_IO_PORT_5, reverb
|
||||
#define AMBIENCE_IO_CRITTER_2_TYPE(type) AMBIENCE_CHANNEL_CRITTER_2, CHANNEL_IO_PORT_2, type
|
||||
#define AMBIENCE_IO_CRITTER_2_BEND_PITCH(bend) AMBIENCE_CHANNEL_CRITTER_2, CHANNEL_IO_PORT_3, bend
|
||||
#define AMBIENCE_IO_CRITTER_2_NUM_LAYERS(num) AMBIENCE_CHANNEL_CRITTER_2, CHANNEL_IO_PORT_4, num
|
||||
#define AMBIENCE_IO_CRITTER_2_PORT5(reverb) AMBIENCE_CHANNEL_CRITTER_2, CHANNEL_IO_PORT_5, reverb
|
||||
|
||||
#define NATURE_IO_CRITTER_3_TYPE(type) NATURE_CHANNEL_CRITTER_3, CHANNEL_IO_PORT_2, type
|
||||
#define NATURE_IO_CRITTER_3_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_3, CHANNEL_IO_PORT_3, bend
|
||||
#define NATURE_IO_CRITTER_3_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_3, CHANNEL_IO_PORT_4, num
|
||||
#define NATURE_IO_CRITTER_3_PORT5(reverb) NATURE_CHANNEL_CRITTER_3, CHANNEL_IO_PORT_5, reverb
|
||||
#define AMBIENCE_IO_CRITTER_3_TYPE(type) AMBIENCE_CHANNEL_CRITTER_3, CHANNEL_IO_PORT_2, type
|
||||
#define AMBIENCE_IO_CRITTER_3_BEND_PITCH(bend) AMBIENCE_CHANNEL_CRITTER_3, CHANNEL_IO_PORT_3, bend
|
||||
#define AMBIENCE_IO_CRITTER_3_NUM_LAYERS(num) AMBIENCE_CHANNEL_CRITTER_3, CHANNEL_IO_PORT_4, num
|
||||
#define AMBIENCE_IO_CRITTER_3_PORT5(reverb) AMBIENCE_CHANNEL_CRITTER_3, CHANNEL_IO_PORT_5, reverb
|
||||
|
||||
#define NATURE_IO_CRITTER_4_TYPE(type) NATURE_CHANNEL_CRITTER_4, CHANNEL_IO_PORT_2, type
|
||||
#define NATURE_IO_CRITTER_4_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_4, CHANNEL_IO_PORT_3, bend
|
||||
#define NATURE_IO_CRITTER_4_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_4, CHANNEL_IO_PORT_4, num
|
||||
#define NATURE_IO_CRITTER_4_PORT5(reverb) NATURE_CHANNEL_CRITTER_4, CHANNEL_IO_PORT_5, reverb
|
||||
#define AMBIENCE_IO_CRITTER_4_TYPE(type) AMBIENCE_CHANNEL_CRITTER_4, CHANNEL_IO_PORT_2, type
|
||||
#define AMBIENCE_IO_CRITTER_4_BEND_PITCH(bend) AMBIENCE_CHANNEL_CRITTER_4, CHANNEL_IO_PORT_3, bend
|
||||
#define AMBIENCE_IO_CRITTER_4_NUM_LAYERS(num) AMBIENCE_CHANNEL_CRITTER_4, CHANNEL_IO_PORT_4, num
|
||||
#define AMBIENCE_IO_CRITTER_4_PORT5(reverb) AMBIENCE_CHANNEL_CRITTER_4, CHANNEL_IO_PORT_5, reverb
|
||||
|
||||
#define NATURE_IO_CRITTER_5_TYPE(type) NATURE_CHANNEL_CRITTER_5, CHANNEL_IO_PORT_2, type
|
||||
#define NATURE_IO_CRITTER_5_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_5, CHANNEL_IO_PORT_3, bend
|
||||
#define NATURE_IO_CRITTER_5_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_5, CHANNEL_IO_PORT_4, num
|
||||
#define NATURE_IO_CRITTER_5_PORT5(reverb) NATURE_CHANNEL_CRITTER_5, CHANNEL_IO_PORT_5, reverb
|
||||
#define AMBIENCE_IO_CRITTER_5_TYPE(type) AMBIENCE_CHANNEL_CRITTER_5, CHANNEL_IO_PORT_2, type
|
||||
#define AMBIENCE_IO_CRITTER_5_BEND_PITCH(bend) AMBIENCE_CHANNEL_CRITTER_5, CHANNEL_IO_PORT_3, bend
|
||||
#define AMBIENCE_IO_CRITTER_5_NUM_LAYERS(num) AMBIENCE_CHANNEL_CRITTER_5, CHANNEL_IO_PORT_4, num
|
||||
#define AMBIENCE_IO_CRITTER_5_PORT5(reverb) AMBIENCE_CHANNEL_CRITTER_5, CHANNEL_IO_PORT_5, reverb
|
||||
|
||||
#define NATURE_IO_CRITTER_6_TYPE(type) NATURE_CHANNEL_CRITTER_6, CHANNEL_IO_PORT_2, type
|
||||
#define NATURE_IO_CRITTER_6_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_6, CHANNEL_IO_PORT_3, bend
|
||||
#define NATURE_IO_CRITTER_6_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_6, CHANNEL_IO_PORT_4, num
|
||||
#define NATURE_IO_CRITTER_6_PORT5(reverb) NATURE_CHANNEL_CRITTER_6, CHANNEL_IO_PORT_5, reverb
|
||||
#define AMBIENCE_IO_CRITTER_6_TYPE(type) AMBIENCE_CHANNEL_CRITTER_6, CHANNEL_IO_PORT_2, type
|
||||
#define AMBIENCE_IO_CRITTER_6_BEND_PITCH(bend) AMBIENCE_CHANNEL_CRITTER_6, CHANNEL_IO_PORT_3, bend
|
||||
#define AMBIENCE_IO_CRITTER_6_NUM_LAYERS(num) AMBIENCE_CHANNEL_CRITTER_6, CHANNEL_IO_PORT_4, num
|
||||
#define AMBIENCE_IO_CRITTER_6_PORT5(reverb) AMBIENCE_CHANNEL_CRITTER_6, CHANNEL_IO_PORT_5, reverb
|
||||
|
||||
#define NATURE_IO_STREAM_0_TYPE(type) NATURE_CHANNEL_STREAM_0, CHANNEL_IO_PORT_2, type
|
||||
#define NATURE_IO_STREAM_0_PORT3(data) NATURE_CHANNEL_STREAM_0, CHANNEL_IO_PORT_3, data
|
||||
#define NATURE_IO_STREAM_0_PORT4(data) NATURE_CHANNEL_STREAM_0, CHANNEL_IO_PORT_4, data
|
||||
#define AMBIENCE_IO_STREAM_0_TYPE(type) AMBIENCE_CHANNEL_STREAM_0, CHANNEL_IO_PORT_2, type
|
||||
#define AMBIENCE_IO_STREAM_0_PORT3(data) AMBIENCE_CHANNEL_STREAM_0, CHANNEL_IO_PORT_3, data
|
||||
#define AMBIENCE_IO_STREAM_0_PORT4(data) AMBIENCE_CHANNEL_STREAM_0, CHANNEL_IO_PORT_4, data
|
||||
|
||||
#define NATURE_IO_STREAM_1_TYPE(type) NATURE_CHANNEL_STREAM_1, CHANNEL_IO_PORT_2, type
|
||||
#define NATURE_IO_STREAM_1_PORT3(data) NATURE_CHANNEL_STREAM_1, CHANNEL_IO_PORT_3, data
|
||||
#define NATURE_IO_STREAM_1_PORT4(data) NATURE_CHANNEL_STREAM_1, CHANNEL_IO_PORT_4, data
|
||||
#define AMBIENCE_IO_STREAM_1_TYPE(type) AMBIENCE_CHANNEL_STREAM_1, CHANNEL_IO_PORT_2, type
|
||||
#define AMBIENCE_IO_STREAM_1_PORT3(data) AMBIENCE_CHANNEL_STREAM_1, CHANNEL_IO_PORT_3, data
|
||||
#define AMBIENCE_IO_STREAM_1_PORT4(data) AMBIENCE_CHANNEL_STREAM_1, CHANNEL_IO_PORT_4, data
|
||||
|
||||
#define NATURE_IO_RAIN_PORT4(data) NATURE_CHANNEL_RAIN, CHANNEL_IO_PORT_4, data
|
||||
#define AMBIENCE_IO_RAIN_PORT4(data) AMBIENCE_CHANNEL_RAIN, CHANNEL_IO_PORT_4, data
|
||||
|
||||
#define NATURE_IO_ENTRIES_END 0xFF
|
||||
#define AMBIENCE_IO_ENTRIES_END 0xFF
|
||||
|
||||
#endif
|
||||
|
||||
@@ -29,7 +29,7 @@ MtxF* Matrix_GetCurrent(void);
|
||||
|
||||
/* Basic operations */
|
||||
|
||||
void Matrix_Mult(MtxF* matrix, MatrixMode mode);
|
||||
void Matrix_Mult(MtxF* mf, MatrixMode mode);
|
||||
void Matrix_Translate(f32 x, f32 y, f32 z, MatrixMode mode);
|
||||
void Matrix_Scale(f32 x, f32 y, f32 z, MatrixMode mode);
|
||||
void Matrix_RotateXS(s16 x, MatrixMode mode);
|
||||
|
||||
+14
-32
@@ -1471,9 +1471,7 @@ extern KaleidoMgrOverlay* gKaleidoMgrCurOvl;
|
||||
// extern UNK_TYPE4 D_801D0BB0;
|
||||
// extern UNK_TYPE1 D_801D0C80;
|
||||
// extern UNK_TYPE1 D_801D0CB0;
|
||||
extern const TransitionInit TransitionFade_InitVars;
|
||||
// extern UNK_TYPE1 D_801D0D00;
|
||||
extern const TransitionInit TransitionCircle_InitVars;
|
||||
extern Gfx D_801D0D00[];
|
||||
extern s32 gDbgCamEnabled;
|
||||
// extern UNK_TYPE1 D_801D0D54;
|
||||
// extern UNK_TYPE2 sQuakeIndex;
|
||||
@@ -1557,11 +1555,11 @@ extern f32 gPitchFrequencies[];
|
||||
extern u8 gDefaultShortNoteVelocityTable[];
|
||||
extern u8 gDefaultShortNoteGateTimeTable[];
|
||||
extern EnvelopePoint gDefaultEnvelope[];
|
||||
extern NoteSubEu gZeroNoteSub;
|
||||
extern NoteSubEu gDefaultNoteSub;
|
||||
extern u16 gHeadsetPanQuantization[];
|
||||
extern u16 gHeadsetPanQuantization[];
|
||||
extern s16 D_801D58A8[];
|
||||
extern NoteSampleState gZeroedSampleState;
|
||||
extern NoteSampleState gDefaultSampleState;
|
||||
extern u16 gHaasEffectDelaySize[];
|
||||
extern u16 gHaasEffectDelaySize[];
|
||||
extern s16 gInvalidAdpcmCodeBook[];
|
||||
extern f32 gHeadsetPanVolume[];
|
||||
extern f32 gStereoPanVolume[];
|
||||
extern f32 gDefaultPanVolume[];
|
||||
@@ -1721,21 +1719,7 @@ extern s8 gSfxDefaultReverb;
|
||||
extern u8 gAudioSpecId;
|
||||
// extern UNK_TYPE1 D_801DB4D8;
|
||||
// extern UNK_TYPE4 D_801DB4DC;
|
||||
// extern UNK_TYPE1 D_801DB4E0;
|
||||
// extern UNK_TYPE1 D_801DB528;
|
||||
// extern UNK_TYPE1 D_801DB570;
|
||||
// extern UNK_TYPE1 D_801DB5B8;
|
||||
// extern UNK_TYPE1 D_801DB600;
|
||||
// extern UNK_TYPE1 D_801DB648;
|
||||
// extern UNK_TYPE1 D_801DB690;
|
||||
// extern UNK_TYPE1 D_801DB6D8;
|
||||
// extern UNK_TYPE1 D_801DB720;
|
||||
// extern UNK_TYPE1 D_801DB750;
|
||||
// extern UNK_TYPE1 D_801DB798;
|
||||
// extern UNK_TYPE1 D_801DB870;
|
||||
// extern UNK_TYPE1 D_801DB8B8;
|
||||
// extern UNK_TYPE1 D_801DB900;
|
||||
extern UNK_PTR D_801DB930;
|
||||
extern ReverbSettings* gReverbSettingsTable[];
|
||||
extern AudioSpec gAudioSpecs[21];
|
||||
|
||||
// rodata
|
||||
@@ -2717,7 +2701,7 @@ extern f32 D_801DE860;
|
||||
extern f32 D_801DE864;
|
||||
extern f32 D_801DE868;
|
||||
extern f32 D_801DE884;
|
||||
extern TexturePtr gCircleTex;
|
||||
extern TexturePtr gCircleTex[];
|
||||
extern f32 D_801DF090;
|
||||
extern f32 D_801DF094;
|
||||
extern f32 D_801DF0A0;
|
||||
@@ -3181,8 +3165,6 @@ extern s16 D_801F4E7A;
|
||||
// extern UNK_TYPE1 D_801F6B1E;
|
||||
// extern UNK_TYPE1 D_801F6B20;
|
||||
// extern UNK_TYPE1 D_801F6B22;
|
||||
extern ShrinkWindowContext gShrinkWindowContext;
|
||||
extern ShrinkWindowContext* gShrinkWindowContextPtr;
|
||||
// extern UNK_TYPE4 D_801F6B50;
|
||||
// extern UNK_TYPE1 D_801F6B58;
|
||||
extern void (*sKaleidoScopeUpdateFunc)(PlayState* play);
|
||||
@@ -3416,7 +3398,7 @@ extern s32 D_801FD120;
|
||||
// extern UNK_TYPE1 D_801FD434;
|
||||
// extern UNK_TYPE1 D_801FD435;
|
||||
// extern UNK_TYPE1 D_801FD436;
|
||||
// extern UNK_TYPE1 D_801FD438;
|
||||
// extern UNK_TYPE1 sPrevAmbienceSeqId;
|
||||
// extern UNK_TYPE1 D_801FD43A;
|
||||
// extern UNK_TYPE1 D_801FD43B;
|
||||
// extern UNK_TYPE1 D_801FD43E;
|
||||
@@ -3477,7 +3459,7 @@ extern ActiveSfx gActiveSfx[7][3];
|
||||
// extern UNK_TYPE1 D_8020001E;
|
||||
// extern UNK_TYPE1 D_802000C9;
|
||||
// extern UNK_TYPE1 D_802000D4;
|
||||
// extern UNK_TYPE1 D_80200140;
|
||||
extern ActiveSequence gActiveSeqs[];
|
||||
// extern UNK_TYPE1 D_8020034A;
|
||||
// extern UNK_TYPE1 D_80200B88;
|
||||
// extern UNK_TYPE1 D_80200BBA;
|
||||
@@ -3485,10 +3467,10 @@ extern ActiveSfx gActiveSfx[7][3];
|
||||
// extern UNK_TYPE1 D_80200BCE;
|
||||
// extern UNK_TYPE1 D_80200BD0;
|
||||
extern AudioContext gAudioContext; // at 0x80200C70
|
||||
extern void (*D_80208E68)(void);
|
||||
extern u32 (*D_80208E6C)(s8 value, SequenceChannel* channel);
|
||||
extern s32 (*D_80208E70)(Sample*, s32, s8, s32);
|
||||
extern Acmd* (*D_80208E74)(Acmd*, s32, s32);
|
||||
extern void (*gCustomAudioUpdateFunction)(void);
|
||||
extern u32 (*gCustomAudioSeqFunction)(s8 value, SequenceChannel* channel);
|
||||
extern s32 (*gCustomAudioReverbFunction)(Sample*, s32, s8, s32);
|
||||
extern Acmd* (*gCustomAudioSynthFunction)(Acmd*, s32, s32);
|
||||
|
||||
// post-code buffers
|
||||
extern u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE];
|
||||
|
||||
+9
-101
@@ -286,13 +286,6 @@ typedef struct {
|
||||
/* 0x10 */ OSTime resetTime;
|
||||
} NmiBuff; // size >= 0x18
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ s8 letterboxTarget;
|
||||
/* 0x1 */ s8 letterboxMagnitude;
|
||||
/* 0x2 */ s8 pillarboxTarget;
|
||||
/* 0x3 */ s8 pillarboxMagnitude;
|
||||
} ShrinkWindowContext; // size = 0x4
|
||||
|
||||
typedef void(*osCreateThread_func)(void*);
|
||||
|
||||
typedef enum {
|
||||
@@ -440,13 +433,12 @@ typedef struct {
|
||||
/* 0x220 */ f32 unk_220;
|
||||
/* 0x224 */ u16 alpha;
|
||||
/* 0x226 */ s16 offsetY;
|
||||
/* 0x228 */ s32 unk_228;
|
||||
/* 0x22C */ s32 unk_22C;
|
||||
/* 0x230 */ s32 stickRelX;
|
||||
/* 0x234 */ s32 stickRelY;
|
||||
/* 0x228 */ UNK_TYPE1 unk_228[0x8];
|
||||
/* 0x230 */ s32 stickAdjX;
|
||||
/* 0x234 */ s32 stickAdjY;
|
||||
/* 0x238 */ s16 cursorPoint[5];
|
||||
/* 0x242 */ s16 cursorX[5];
|
||||
/* 0x24C */ s16 cursorY[5];
|
||||
/* 0x242 */ s16 cursorXIndex[5];
|
||||
/* 0x24C */ s16 cursorYIndex[5];
|
||||
/* 0x256 */ s16 unk_256;
|
||||
/* 0x258 */ s16 cursorSpecialPos;
|
||||
/* 0x25A */ s16 pageSwitchTimer;
|
||||
@@ -808,32 +800,6 @@ typedef enum {
|
||||
|
||||
#define TRANS_NEXT_TYPE_DEFAULT 0xFF
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ s16 transitionType;
|
||||
/* 0x002 */ s8 fbdemoType;
|
||||
/* 0x003 */ char unk03[0x5];
|
||||
/* 0x008 */ s32 instanceData;
|
||||
/* 0x00C */ char unk0C[0x224];
|
||||
/*
|
||||
union {
|
||||
TransitionFade fade;
|
||||
TransitionCircle circle;
|
||||
TransitionTriforce triforce;
|
||||
TransitionWipe wipe;
|
||||
} instanceData;
|
||||
*/
|
||||
/* 0x230 */ void* (*init)(void* transition);
|
||||
/* 0x234 */ void (*destroy)(void* transition);
|
||||
/* 0x238 */ void (*update)(void* transition, s32 updateRate);
|
||||
/* 0x23C */ void (*draw)(void* transition, Gfx** gfxP);
|
||||
/* 0x240 */ void (*start)(void* transition);
|
||||
/* 0x244 */ void (*setType)(void* transition, s32 type);
|
||||
/* 0x248 */ void (*setColor)(void* transition, u32 color);
|
||||
/* 0x24C */ void (*setUnkColor)(void* transition, u32 color);
|
||||
/* 0x250 */ s32 (*isDone)(void* transition);
|
||||
/* 0x254 */ char unk254[0x4];
|
||||
} TransitionContext; // size = 0x258
|
||||
|
||||
typedef struct FaultAddrConvClient {
|
||||
/* 0x0 */ struct FaultAddrConvClient* next;
|
||||
/* 0x4 */ void* (*callback)(void*, void*);
|
||||
@@ -934,63 +900,6 @@ typedef s32 (*ColChkLineFunc)(PlayState*, CollisionCheckContext*, Collider*, Vec
|
||||
|
||||
typedef void(*room_draw_func)(PlayState* play, Room* room, u32 flags);
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3f atOffset;
|
||||
/* 0x0C */ Vec3f eyeOffset;
|
||||
/* 0x18 */ s16 rollOffset;
|
||||
/* 0x1A */ s16 zoom;
|
||||
} ShakeInfo; // size = 0x1C
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 randIdx;
|
||||
/* 0x02 */ s16 countdownMax;
|
||||
/* 0x04 */ Camera* camera;
|
||||
/* 0x08 */ u32 callbackIdx;
|
||||
/* 0x0C */ s16 verticalMag;
|
||||
/* 0x0E */ s16 horizontalMag;
|
||||
/* 0x10 */ s16 zoom;
|
||||
/* 0x12 */ s16 rollOffset;
|
||||
/* 0x14 */ Vec3s shakePlaneOffset; // angle deviations from shaking in the perpendicular plane
|
||||
/* 0x1A */ s16 speed;
|
||||
/* 0x1C */ s16 isShakePerpendicular;
|
||||
/* 0x1E */ s16 countdown;
|
||||
/* 0x20 */ s16 camId;
|
||||
} QuakeRequest; // size = 0x24
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3f atOffset;
|
||||
/* 0x0C */ Vec3f eyeOffset;
|
||||
/* 0x18 */ s16 rollOffset;
|
||||
/* 0x1A */ s16 zoom;
|
||||
/* 0x1C */ f32 max; // Set to scaled max data of struct (mag for Vec3f), never used
|
||||
} QuakeCamCalc; // size = 0x20
|
||||
|
||||
typedef s16 (*QuakeCallbackFunc)(QuakeRequest*, ShakeInfo*);
|
||||
|
||||
#define QUAKE_SPEED (1 << 0)
|
||||
#define QUAKE_VERTICAL_MAG (1 << 1)
|
||||
#define QUAKE_HORIZONTAL_MAG (1 << 2)
|
||||
#define QUAKE_ZOOM (1 << 3)
|
||||
#define QUAKE_ROLL_OFFSET (1 << 4)
|
||||
#define QUAKE_SHAKE_PLANE_OFFSET_X (1 << 5)
|
||||
#define QUAKE_SHAKE_PLANE_OFFSET_Y (1 << 6)
|
||||
#define QUAKE_SHAKE_PLANE_OFFSET_Z (1 << 7)
|
||||
#define QUAKE_COUNTDOWN (1 << 8)
|
||||
#define QUAKE_IS_SHAKE_PERPENDICULAR (1 << 9)
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ PlayState* play;
|
||||
/* 0x4 */ s32 type; // bitfield, highest set bit determines type
|
||||
/* 0x8 */ s16 countdown;
|
||||
/* 0xA */ s16 state;
|
||||
} DistortionContext; // size = 0xC
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ DISTORTION_INACTIVE,
|
||||
/* 1 */ DISTORTION_ACTIVE,
|
||||
/* 2 */ DISTORTION_SETUP
|
||||
} DistortionState;
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ u8 controllers; // bit 0 is set if controller 1 is plugged in, etc.
|
||||
/* 0x001 */ UNK_TYPE1 pad1[0x13];
|
||||
@@ -1093,10 +1002,9 @@ struct FireObj {
|
||||
}; // size = 0x8B
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 seqIndex;
|
||||
/* 0x1 */ u8 nightSeqIndex;
|
||||
/* 0x2 */ u8 unk_02;
|
||||
} SoundContext; // size = 0x3
|
||||
/* 0x0 */ u8 seqId;
|
||||
/* 0x1 */ u8 ambienceId;
|
||||
} SequenceContext; // size = 0x2
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ s32 enabled;
|
||||
@@ -1132,7 +1040,7 @@ struct PlayState {
|
||||
/* 0x00800 */ Camera* cameraPtrs[NUM_CAMS];
|
||||
/* 0x00810 */ s16 activeCamId;
|
||||
/* 0x00812 */ s16 nextCamera;
|
||||
/* 0x00814 */ SoundContext soundCtx;
|
||||
/* 0x00814 */ SequenceContext sequenceCtx;
|
||||
/* 0x00818 */ LightContext lightCtx;
|
||||
/* 0x00828 */ FrameAdvanceContext frameAdvCtx;
|
||||
/* 0x00830 */ CollisionContext colCtx;
|
||||
|
||||
+2
-2
@@ -105,8 +105,8 @@ typedef enum {
|
||||
} AllocType;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 vromStart;
|
||||
/* 0x04 */ u32 vromEnd;
|
||||
/* 0x00 */ uintptr_t vromStart;
|
||||
/* 0x04 */ uintptr_t vromEnd;
|
||||
/* 0x08 */ void* vramStart;
|
||||
/* 0x0C */ void* vramEnd;
|
||||
/* 0x10 */ void* loadedRamAddr; // original name: "allocp"
|
||||
|
||||
+179
-144
@@ -1,7 +1,7 @@
|
||||
#ifndef Z64_AUDIO_H
|
||||
#define Z64_AUDIO_H
|
||||
|
||||
#define MK_AUDIO_CMD(b0,b1,b2,b3) ((((b0) & 0xFF) << 0x18) | (((b1) & 0xFF) << 0x10) | (((b2) & 0xFF) << 0x8) | (((b3) & 0xFF) << 0))
|
||||
#define AUDIO_MK_CMD(b0,b1,b2,b3) ((((b0) & 0xFF) << 0x18) | (((b1) & 0xFF) << 0x10) | (((b2) & 0xFF) << 0x8) | (((b3) & 0xFF) << 0))
|
||||
|
||||
#define NO_LAYER ((SequenceLayer*)(-1))
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#define IS_SEQUENCE_CHANNEL_VALID(ptr) ((uintptr_t)(ptr) != (uintptr_t)&gAudioContext.sequenceChannelNone)
|
||||
#define SEQ_NUM_CHANNELS 16
|
||||
#define SEQ_IO_VAL_NONE -1
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SEQPLAYER_STATE_0,
|
||||
@@ -31,13 +32,45 @@ typedef enum {
|
||||
#define ADSR_GOTO -2
|
||||
#define ADSR_RESTART -3
|
||||
|
||||
#define AIBUF_LEN 0x580
|
||||
// size of a single sample point
|
||||
#define SAMPLE_SIZE sizeof(s16)
|
||||
|
||||
// Samples are processed in groups of 16 called a "frame"
|
||||
#define SAMPLES_PER_FRAME ADPCMFSIZE
|
||||
|
||||
// The length of one left/right channel is 13 frames
|
||||
#define DMEM_1CH_SIZE (13 * SAMPLES_PER_FRAME * SAMPLE_SIZE)
|
||||
// Both left and right channels
|
||||
#define DMEM_2CH_SIZE (2 * DMEM_1CH_SIZE)
|
||||
|
||||
#define AIBUF_LEN (88 * SAMPLES_PER_FRAME) // number of samples
|
||||
#define AIBUF_SIZE (AIBUF_LEN * SAMPLE_SIZE) // number of bytes
|
||||
|
||||
// Filter sizes
|
||||
#define FILTER_SIZE (8 * SAMPLE_SIZE)
|
||||
#define FILTER_BUF_PART1 (8 * SAMPLE_SIZE)
|
||||
#define FILTER_BUF_PART2 (8 * SAMPLE_SIZE)
|
||||
|
||||
// Must be the same amount of samples as copied by aDuplicate() (audio microcode)
|
||||
#define WAVE_SAMPLE_COUNT 64
|
||||
|
||||
#define AUDIO_RELOCATED_ADDRESS_START K0BASE
|
||||
|
||||
#define REVERB_INDEX_NONE -1
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ REVERB_DATA_TYPE_SETTINGS, // Reverb Settings (Init)
|
||||
/* 1 */ REVERB_DATA_TYPE_DELAY, // Reverb Delay (numSamples)
|
||||
/* 2 */ REVERB_DATA_TYPE_DECAY, // Reverb Decay Ratio
|
||||
/* 3 */ REVERB_DATA_TYPE_SUB_VOLUME, // Reverb Sub-Volume
|
||||
/* 4 */ REVERB_DATA_TYPE_VOLUME, // Reverb Volume
|
||||
/* 5 */ REVERB_DATA_TYPE_LEAK_RIGHT, // Reverb Leak Right Channel
|
||||
/* 6 */ REVERB_DATA_TYPE_LEAK_LEFT, // Reverb Leak Left Channel
|
||||
/* 7 */ REVERB_DATA_TYPE_FILTER_LEFT, // Reverb Left Filter
|
||||
/* 8 */ REVERB_DATA_TYPE_FILTER_RIGHT, // Reverb Right Filter
|
||||
/* 9 */ REVERB_DATA_TYPE_9 // Reverb Unk
|
||||
} ReverbDataType;
|
||||
|
||||
typedef enum {
|
||||
/* 0x1 */ AUDIO_ERROR_NO_INST = 1,
|
||||
/* 0x3 */ AUDIO_ERROR_INVALID_INST_ID = 3,
|
||||
@@ -51,9 +84,9 @@ typedef enum {
|
||||
typedef enum {
|
||||
/* 0 */ SOUNDMODE_STEREO,
|
||||
/* 1 */ SOUNDMODE_HEADSET,
|
||||
/* 2 */ SOUNDMODE_SURROUND,
|
||||
/* 2 */ SOUNDMODE_SURROUND_EXTERNAL,
|
||||
/* 3 */ SOUNDMODE_MONO,
|
||||
/* 4 */ SOUNDMODE_SURROUND_EXTERNAL,
|
||||
/* 4 */ SOUNDMODE_SURROUND,
|
||||
} SoundMode;
|
||||
|
||||
typedef enum {
|
||||
@@ -77,12 +110,14 @@ typedef enum {
|
||||
} SampleMedium;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ CODEC_ADPCM,
|
||||
/* 1 */ CODEC_S8,
|
||||
/* 0 */ CODEC_ADPCM, // 16 2-byte samples (32 bytes) compressed into 4-bit samples (8 bytes) + 1 header byte
|
||||
/* 1 */ CODEC_S8, // 16 2-byte samples (32 bytes) compressed into 8-bit samples (16 bytes)
|
||||
/* 2 */ CODEC_S16_INMEMORY,
|
||||
/* 3 */ CODEC_SMALL_ADPCM,
|
||||
/* 3 */ CODEC_SMALL_ADPCM, // 16 2-byte samples (32 bytes) compressed into 2-bit samples (4 bytes) + 1 header byte
|
||||
/* 4 */ CODEC_REVERB,
|
||||
/* 5 */ CODEC_S16
|
||||
/* 5 */ CODEC_S16,
|
||||
/* 6 */ CODEC_UNK6,
|
||||
/* 7 */ CODEC_UNK7 // processed as uncompressed samples
|
||||
} SampleCodec;
|
||||
|
||||
typedef enum {
|
||||
@@ -164,24 +199,28 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 start;
|
||||
/* 0x04 */ u32 end;
|
||||
/* 0x04 */ u32 loopEnd; // numSamples into the sample where the loop ends
|
||||
/* 0x08 */ u32 count;
|
||||
/* 0x0C */ u32 unk_0C;
|
||||
/* 0x10 */ s16 state[16]; // only exists if count != 0. 8-byte aligned
|
||||
/* 0x0C */ u32 sampleEnd; // total number of s16-samples in the
|
||||
/* 0x10 */ s16 predictorState[16]; // only exists if count != 0. 8-byte aligned
|
||||
} AdpcmLoop; // size = 0x30 (or 0x10)
|
||||
|
||||
/**
|
||||
* The procedure used to design the codeBook is based on an adaptive clustering algorithm.
|
||||
* The size of the codeBook is (8 * order * numPredictors) and is 8-byte aligned
|
||||
*/
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 order;
|
||||
/* 0x04 */ s32 npredictors;
|
||||
/* 0x08 */ s16 book[1]; // size 8 * order * npredictors. 8-byte aligned
|
||||
/* 0x04 */ s32 numPredictors;
|
||||
/* 0x08 */ s16 codeBook[1]; // a table of prediction coefficients that the coder selects from to optimize sound quality.
|
||||
} AdpcmBook; // size >= 0x8
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 unk_0 : 1;
|
||||
/* 0x00 */ u32 codec : 3; // The state of compression or decompression
|
||||
/* 0x00 */ u32 medium : 2; // Medium where sample is currently stored
|
||||
/* 0x00 */ u32 unk_bit26 : 1; // Has the sample header been relocated (offsets to pointers)
|
||||
/* 0x00 */ u32 isRelocated : 1; // Size of the sample
|
||||
/* 0x00 */ u32 unk_bit26 : 1;
|
||||
/* 0x00 */ u32 isRelocated : 1; // Has the sample header been relocated (offsets to pointers)
|
||||
/* 0x01 */ u32 size : 24; // Size of the sample
|
||||
/* 0x04 */ u8* sampleAddr; // Raw sample data. Offset from the start of the sample bank or absolute address to either rom or ram
|
||||
/* 0x08 */ AdpcmLoop* loop; // Adpcm loop parameters used by the sample. Offset from the start of the sound font / pointer to ram
|
||||
@@ -193,18 +232,23 @@ typedef struct {
|
||||
/* 0x04 */ f32 tuning; // frequency scale factor
|
||||
} TunedSample; // size = 0x8
|
||||
|
||||
/**
|
||||
* Stores an entry of decompressed samples in a reverb ring buffer.
|
||||
* By storing the sample in a ring buffer, the time it takes to loop
|
||||
* around back to the same sample acts as a delay, leading to an echo effect.
|
||||
*/
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 numSamplesAfterDownsampling; // never read
|
||||
/* 0x02 */ s16 chunkLen; // never read
|
||||
/* 0x02 */ s16 numSamples; // never read
|
||||
/* 0x04 */ s16* toDownsampleLeft;
|
||||
/* 0x08 */ s16* toDownsampleRight; // data pointed to by left and right are adjacent in memory
|
||||
/* 0x0C */ s32 startPos; // start pos in ring buffer
|
||||
/* 0x10 */ s16 lengthA; // first length in ring buffer (from startPos, at most until end)
|
||||
/* 0x12 */ s16 lengthB; // second length in ring buffer (from pos 0)
|
||||
/* 0x14 */ u16 unk_14;
|
||||
/* 0x16 */ u16 unk_16;
|
||||
/* 0x18 */ u16 unk_18;
|
||||
} ReverbRingBufferItem; // size = 0x1C
|
||||
/* 0x10 */ s16 size; // first length in ring buffer (from startPos, at most until end)
|
||||
/* 0x12 */ s16 wrappedSize; // second length in ring buffer (from pos 0)
|
||||
/* 0x14 */ u16 loadResamplePitch;
|
||||
/* 0x16 */ u16 saveResamplePitch;
|
||||
/* 0x18 */ u16 saveResampleNumSamples;
|
||||
} ReverbBufferEntry; // size = 0x1C
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ u8 resampleFlags;
|
||||
@@ -212,35 +256,35 @@ typedef struct {
|
||||
/* 0x002 */ u8 framesToIgnore;
|
||||
/* 0x003 */ u8 curFrame;
|
||||
/* 0x004 */ u8 downsampleRate;
|
||||
/* 0x005 */ s8 unk_05;
|
||||
/* 0x006 */ u16 windowSize;
|
||||
/* 0x008 */ s16 unk_08;
|
||||
/* 0x00A */ s16 unk_0A;
|
||||
/* 0x00C */ u16 unk_0C;
|
||||
/* 0x00E */ u16 unk_0E;
|
||||
/* 0x005 */ s8 mixReverbIndex; // mix in reverb from this index. set to 0xFF to not mix any
|
||||
/* 0x006 */ u16 delayNumSamples; // number of samples between echos
|
||||
/* 0x008 */ s16 mixReverbStrength; // the gain/amount to mix in reverb from mixReverbIndex
|
||||
/* 0x00A */ s16 volume;
|
||||
/* 0x00C */ u16 decayRatio; // determines how fast reverb dissipate
|
||||
/* 0x00E */ u16 downsamplePitch;
|
||||
/* 0x010 */ s16 leakRtl;
|
||||
/* 0x012 */ s16 leakLtr;
|
||||
/* 0x014 */ u16 unk_14;
|
||||
/* 0x016 */ s16 unk_16;
|
||||
/* 0x018 */ u8 unk_18;
|
||||
/* 0x019 */ s8 unk_19;
|
||||
/* 0x01A */ u16 unk_1A;
|
||||
/* 0x01C */ u16 unk_1C;
|
||||
/* 0x01E */ u8 unk_1E;
|
||||
/* 0x020 */ s32 nextRingBufPos;
|
||||
/* 0x024 */ s32 unk_24; // May be bufSizePerChan
|
||||
/* 0x028 */ s16* leftRingBuf;
|
||||
/* 0x02C */ s16* rightRingBuf;
|
||||
/* 0x030 */ void* unk_30;
|
||||
/* 0x034 */ void* unk_34;
|
||||
/* 0x038 */ void* unk_38;
|
||||
/* 0x03C */ void* unk_3C;
|
||||
/* 0x040 */ ReverbRingBufferItem items[2][5];
|
||||
/* 0x158 */ ReverbRingBufferItem items2[2][5];
|
||||
/* 0x014 */ u16 subDelay; // number of samples between sub echos
|
||||
/* 0x016 */ s16 subVolume; // strength of the sub echos
|
||||
/* 0x018 */ u8 resampleEffectOn;
|
||||
/* 0x019 */ s8 resampleEffectExtraSamples;
|
||||
/* 0x01A */ u16 resampleEffectLoadUnk;
|
||||
/* 0x01C */ u16 resampleEffectSaveUnk;
|
||||
/* 0x01E */ u8 delayNumSamplesAfterDownsampling;
|
||||
/* 0x020 */ s32 nextReverbBufPos;
|
||||
/* 0x024 */ s32 delayNumSamplesUnk; // May be bufSizePerChan
|
||||
/* 0x028 */ s16* leftReverbBuf;
|
||||
/* 0x02C */ s16* rightReverbBuf;
|
||||
/* 0x030 */ s16* leftLoadResampleBuf;
|
||||
/* 0x034 */ s16* rightLoadResampleBuf;
|
||||
/* 0x038 */ s16* leftSaveResampleBuf;
|
||||
/* 0x03C */ s16* rightSaveResampleBuf;
|
||||
/* 0x040 */ ReverbBufferEntry bufEntry[2][5];
|
||||
/* 0x158 */ ReverbBufferEntry subBufEntry[2][5];
|
||||
/* 0x270 */ s16* filterLeft;
|
||||
/* 0x274 */ s16* filterRight;
|
||||
/* 0x278 */ s16* unk_278;
|
||||
/* 0x27C */ s16* unk_27C;
|
||||
/* 0x278 */ s16* filterLeftInit;
|
||||
/* 0x27C */ s16* filterRightInit;
|
||||
/* 0x280 */ s16* filterLeftState;
|
||||
/* 0x284 */ s16* filterRightState;
|
||||
/* 0x288 */ TunedSample tunedSample;
|
||||
@@ -362,28 +406,26 @@ typedef struct {
|
||||
/* 0x1C */ EnvelopePoint* envelope;
|
||||
} AdsrState; // size = 0x20
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 unused : 2;
|
||||
/* 0x0 */ u8 bit2 : 2;
|
||||
/* 0x0 */ u8 strongRight : 1;
|
||||
/* 0x0 */ u8 strongLeft : 1;
|
||||
/* 0x0 */ u8 stereoHeadsetEffects : 1;
|
||||
/* 0x0 */ u8 usesHeadsetPanEffects : 1;
|
||||
typedef union {
|
||||
struct {
|
||||
/* 0x0 */ u8 unused : 2;
|
||||
/* 0x0 */ u8 type : 2;
|
||||
/* 0x0 */ u8 strongRight : 1;
|
||||
/* 0x0 */ u8 strongLeft : 1;
|
||||
/* 0x0 */ u8 strongReverbRight : 1;
|
||||
/* 0x0 */ u8 strongReverbLeft : 1;
|
||||
};
|
||||
/* 0x0 */ u8 asByte;
|
||||
} StereoData; // size = 0x1
|
||||
|
||||
typedef union {
|
||||
/* 0x0 */ StereoData s;
|
||||
/* 0x0 */ u8 asByte;
|
||||
} Stereo; // size = 0x1
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 reverb;
|
||||
/* 0x00 */ u8 targetReverbVol;
|
||||
/* 0x01 */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number
|
||||
/* 0x02 */ u8 pan;
|
||||
/* 0x03 */ u8 unk_3; // Possibly part of stereo?
|
||||
/* 0x04 */ Stereo stereo;
|
||||
/* 0x05 */ u8 unk_4;
|
||||
/* 0x06 */ u16 unk_6;
|
||||
/* 0x03 */ u8 surroundEffectIndex;
|
||||
/* 0x04 */ StereoData stereoData;
|
||||
/* 0x05 */ u8 combFilterSize;
|
||||
/* 0x06 */ u16 combFilterGain;
|
||||
/* 0x08 */ f32 freqScale;
|
||||
/* 0x0C */ f32 velocity;
|
||||
/* 0x10 */ s16* filter;
|
||||
@@ -420,7 +462,7 @@ typedef struct SequenceChannel {
|
||||
} changes;
|
||||
/* 0x02 */ u8 noteAllocPolicy;
|
||||
/* 0x03 */ u8 muteFlags;
|
||||
/* 0x04 */ u8 reverb; // or dry/wet mix
|
||||
/* 0x04 */ u8 targetReverbVol; // or dry/wet mix
|
||||
/* 0x05 */ u8 notePriority; // 0-3
|
||||
/* 0x06 */ u8 someOtherPriority;
|
||||
/* 0x07 */ u8 fontId;
|
||||
@@ -431,12 +473,12 @@ typedef struct SequenceChannel {
|
||||
/* 0x0C */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number
|
||||
/* 0x0D */ u8 velocityRandomVariance;
|
||||
/* 0x0E */ u8 gateTimeRandomVariance;
|
||||
/* 0x0F */ u8 unk_0F;
|
||||
/* 0x10 */ u8 unk_10;
|
||||
/* 0x0F */ u8 combFilterSize;
|
||||
/* 0x10 */ u8 surroundEffectIndex;
|
||||
/* 0x11 */ u8 unk_11;
|
||||
/* 0x12 */ VibratoSubStruct vibrato;
|
||||
/* 0x20 */ u16 delay;
|
||||
/* 0x22 */ u16 unk_20;
|
||||
/* 0x22 */ u16 combFilterGain;
|
||||
/* 0x24 */ u16 unk_22; // Used for indexing data
|
||||
/* 0x26 */ s16 instOrWave; // either 0 (none), instrument index + 1, or
|
||||
// 0x80..0x83 for sawtooth/triangle/sine/square waves.
|
||||
@@ -458,7 +500,7 @@ typedef struct SequenceChannel {
|
||||
/* 0xC8 */ s8 soundScriptIO[8]; // bridge between sound script and audio lib, "io ports"
|
||||
/* 0xD0 */ u8* sfxState; // SfxChannelState
|
||||
/* 0xD4 */ s16* filter;
|
||||
/* 0xD8 */ Stereo stereo;
|
||||
/* 0xD8 */ StereoData stereoData;
|
||||
/* 0xDC */ s32 startSamplePos;
|
||||
/* 0xE0 */ s32 unk_E0;
|
||||
} SequenceChannel; // size = 0xE4
|
||||
@@ -473,15 +515,15 @@ typedef struct SequenceLayer {
|
||||
/* 0x00 */ u8 ignoreDrumPan : 1;
|
||||
/* 0x00 */ u8 bit1 : 1; // "has initialized continuous notes"?
|
||||
/* 0x00 */ u8 notePropertiesNeedInit : 1;
|
||||
/* 0x01 */ Stereo stereo;
|
||||
/* 0x01 */ StereoData stereoData;
|
||||
/* 0x02 */ u8 instOrWave;
|
||||
/* 0x03 */ u8 gateTime;
|
||||
/* 0x04 */ u8 semitone;
|
||||
/* 0x05 */ u8 portamentoTargetNote;
|
||||
/* 0x06 */ u8 pan; // 0..128
|
||||
/* 0x07 */ u8 notePan;
|
||||
/* 0x08 */ u8 unk_08;
|
||||
/* 0x09 */ u8 unk_09;
|
||||
/* 0x08 */ u8 surroundEffectIndex;
|
||||
/* 0x09 */ u8 targetReverbVol;
|
||||
union {
|
||||
struct {
|
||||
/* 0x0A */ u16 bit_0 : 1;
|
||||
@@ -530,45 +572,37 @@ typedef struct SequenceLayer {
|
||||
} SequenceLayer; // size = 0x90
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 adpcmdecState[0x10];
|
||||
/* 0x20 */ s16 finalResampleState[0x10];
|
||||
/* 0x40 */ s16 mixEnvelopeState[0x28];
|
||||
/* 0x90 */ s16 panResampleState[0x10];
|
||||
/* 0xB0 */ s16 panSamplesBuffer[0x20];
|
||||
/* 0xF0 */ s16 dummyResampleState[0x10];
|
||||
} NoteSynthesisBuffers; // size = 0x110
|
||||
/* 0x000 */ s16 adpcmState[16];
|
||||
/* 0x020 */ s16 finalResampleState[16];
|
||||
/* 0x040 */ s16 filterState[32];
|
||||
/* 0x080 */ s16 unusedState[16];
|
||||
/* 0x0A0 */ s16 haasEffectDelayState[32];
|
||||
/* 0x0E0 */ s16 combFilterState[128];
|
||||
/* 0x1E0 */ s16 surroundEffectState[128];
|
||||
} NoteSynthesisBuffers; // size = 0x2E0
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 restart_bit0 : 1;
|
||||
/* 0x00 */ u8 restart_bit1 : 1;
|
||||
/* 0x00 */ u8 restart_bit2 : 1;
|
||||
/* 0x00 */ u8 restart_bit3 : 1;
|
||||
/* 0x00 */ u8 restart_bit4 : 1;
|
||||
/* 0x00 */ u8 restart_bit5 : 1;
|
||||
/* 0x00 */ u8 restart_bit6 : 1;
|
||||
/* 0x00 */ u8 restart_bit7 : 1;
|
||||
/* 0x00 */ u8 atLoopPoint : 1;
|
||||
/* 0x00 */ u8 stopLoop : 1;
|
||||
/* 0x01 */ u8 sampleDmaIndex;
|
||||
/* 0x02 */ u8 prevHeadsetPanRight;
|
||||
/* 0x03 */ u8 prevHeadsetPanLeft;
|
||||
/* 0x04 */ u8 reverbVol;
|
||||
/* 0x02 */ u8 prevHaasEffectLeftDelaySize;
|
||||
/* 0x03 */ u8 prevHaasEffectRightDelaySize;
|
||||
/* 0x04 */ u8 curReverbVol;
|
||||
/* 0x05 */ u8 numParts;
|
||||
/* 0x06 */ u16 samplePosFrac;
|
||||
/* 0x08 */ u16 unk_08;
|
||||
/* 0x0C */ s32 samplePosInt;
|
||||
/* 0x06 */ u16 samplePosFrac; // Fractional part of the sample position
|
||||
/* 0x08 */ u16 surroundEffectGain;
|
||||
/* 0x0C */ s32 samplePosInt; // Integer part of the sample position
|
||||
/* 0x10 */ NoteSynthesisBuffers* synthesisBuffers;
|
||||
/* 0x14 */ s16 curVolLeft;
|
||||
/* 0x16 */ s16 curVolRight;
|
||||
/* 0x18 */ u16 unk_14;
|
||||
/* 0x1A */ u16 unk_16;
|
||||
/* 0x1C */ u16 unk_18;
|
||||
/* 0x1E */ u8 unk_1A;
|
||||
/* 0x18 */ UNK_TYPE1 unk_14[0x6];
|
||||
/* 0x1E */ u8 combFilterNeedsInit;
|
||||
/* 0x1F */ u8 unk_1F;
|
||||
/* 0x20 */ u16 unk_1C;
|
||||
/* 0x22 */ u16 unk_1E;
|
||||
/* 0x20 */ UNK_TYPE1 unk_20[0x4];
|
||||
} NoteSynthesisState; // size = 0x24
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ struct VibratoSubStruct* vibSubStruct; // MM Something else?
|
||||
/* 0x00 */ struct VibratoSubStruct* vibSubStruct; // Something else?
|
||||
/* 0x04 */ u32 time;
|
||||
/* 0x08 */ s16* curve;
|
||||
/* 0x0C */ f32 extent;
|
||||
@@ -602,67 +636,68 @@ typedef struct {
|
||||
/* 0x34 */ AdsrState adsr;
|
||||
/* 0x54 */ Portamento portamento;
|
||||
/* 0x60 */ VibratoState vibratoState;
|
||||
/* 0x7C */ char unk_7C[0x8];
|
||||
/* 0x7C */ UNK_TYPE1 pad7C[0x4];
|
||||
/* 0x80 */ u8 unk_80;
|
||||
/* 0x84 */ u32 startSamplePos;
|
||||
} NotePlaybackState; // size = 0x88
|
||||
/* 0x88 */ UNK_TYPE1 unk_BC[0x1C];
|
||||
} NotePlaybackState; // size = 0xA4
|
||||
|
||||
typedef struct {
|
||||
struct {
|
||||
/* 0x00 */ volatile u8 enabled : 1;
|
||||
/* 0x00 */ u8 needsInit : 1;
|
||||
/* 0x00 */ u8 finished : 1; // ?
|
||||
/* 0x00 */ u8 finished : 1;
|
||||
/* 0x00 */ u8 unused : 1;
|
||||
/* 0x00 */ u8 stereoStrongRight : 1;
|
||||
/* 0x00 */ u8 stereoStrongLeft : 1;
|
||||
/* 0x00 */ u8 stereoHeadsetEffects : 1;
|
||||
/* 0x00 */ u8 usesHeadsetPanEffects : 1; // ?
|
||||
/* 0x00 */ u8 strongRight : 1;
|
||||
/* 0x00 */ u8 strongLeft : 1;
|
||||
/* 0x00 */ u8 strongReverbRight : 1;
|
||||
/* 0x00 */ u8 strongReverbLeft : 1;
|
||||
} bitField0;
|
||||
struct {
|
||||
/* 0x01 */ u8 reverbIndex : 3;
|
||||
/* 0x01 */ u8 bookOffset : 2;
|
||||
/* 0x01 */ u8 isSyntheticWave : 1;
|
||||
/* 0x01 */ u8 hasTwoParts : 1;
|
||||
/* 0x01 */ u8 usesHeadsetPanEffects2 : 1;
|
||||
/* 0x01 */ u8 useHaasEffect : 1;
|
||||
} bitField1;
|
||||
/* 0x02 */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number
|
||||
/* 0x03 */ u8 headsetPanRight;
|
||||
/* 0x04 */ u8 headsetPanLeft;
|
||||
/* 0x05 */ u8 reverbVol;
|
||||
/* 0x03 */ u8 haasEffectLeftDelaySize;
|
||||
/* 0x04 */ u8 haasEffectRightDelaySize;
|
||||
/* 0x05 */ u8 targetReverbVol;
|
||||
/* 0x06 */ u8 harmonicIndexCurAndPrev; // bits 3..2 store curHarmonicIndex, bits 1..0 store prevHarmonicIndex
|
||||
/* 0x07 */ u8 unk_07;
|
||||
/* 0x07 */ u8 combFilterSize;
|
||||
/* 0x08 */ u16 targetVolLeft;
|
||||
/* 0x0A */ u16 targetVolRight;
|
||||
/* 0x0C */ u16 resamplingRateFixedPoint;
|
||||
/* 0x0E */ u16 unk_0E;
|
||||
/* 0x0C */ u16 frequencyFixedPoint;
|
||||
/* 0x0E */ u16 combFilterGain;
|
||||
union {
|
||||
/* 0x10 */ TunedSample* tunedSample;
|
||||
/* 0x10 */ s16* waveSampleAddr; // used for synthetic waves
|
||||
};
|
||||
/* 0x14 */ s16* filter;
|
||||
/* 0x18 */ u8 unk_18;
|
||||
/* 0x19 */ u8 unk_19;
|
||||
/* 0x1A */ UNK_TYPE1 pad_1A[0x6];
|
||||
} NoteSubEu; // size = 0x20
|
||||
/* 0x18 */ UNK_TYPE1 unk_18;
|
||||
/* 0x19 */ u8 surroundEffectIndex;
|
||||
/* 0x1A */ UNK_TYPE1 unk_1A[0x6];
|
||||
} NoteSampleState; // size = 0x20
|
||||
|
||||
typedef struct Note {
|
||||
/* 0x00 */ AudioListItem listItem;
|
||||
/* 0x10 */ NoteSynthesisState synthesisState;
|
||||
/* 0x34 */ NotePlaybackState playbackState;
|
||||
/* 0xBC */ char unk_BC[0x1C];
|
||||
/* 0xD8 */ NoteSubEu noteSubEu;
|
||||
/* 0xD8 */ NoteSampleState sampleState;
|
||||
} Note; // size = 0xF8
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 downsampleRate;
|
||||
/* 0x02 */ u16 windowSize;
|
||||
/* 0x04 */ u16 unk_4;
|
||||
/* 0x06 */ u16 unk_6;
|
||||
/* 0x08 */ u16 unk_8;
|
||||
/* 0x0A */ u16 unk_A;
|
||||
/* 0x02 */ u16 delayNumSamples;
|
||||
/* 0x04 */ u16 decayRatio; // determines how fast reverb dissipates
|
||||
/* 0x06 */ u16 subDelay;
|
||||
/* 0x08 */ u16 subVolume;
|
||||
/* 0x0A */ u16 volume;
|
||||
/* 0x0C */ u16 leakRtl;
|
||||
/* 0x0E */ u16 leakLtr;
|
||||
/* 0x10 */ s8 unk_10;
|
||||
/* 0x12 */ u16 unk_12;
|
||||
/* 0x10 */ s8 mixReverbIndex;
|
||||
/* 0x12 */ u16 mixReverbStrength;
|
||||
/* 0x14 */ s16 lowPassFilterCutoffLeft;
|
||||
/* 0x16 */ s16 lowPassFilterCutoffRight;
|
||||
} ReverbSettings; // size = 0x18
|
||||
@@ -703,13 +738,13 @@ typedef struct {
|
||||
/* 0x00 */ s16 specUnk4;
|
||||
/* 0x02 */ u16 samplingFreq; // Target sampling rate in Hz
|
||||
/* 0x04 */ u16 aiSamplingFreq; // True sampling rate set to the audio interface (AI) for the audio digital-analog converter (DAC)
|
||||
/* 0x06 */ s16 samplesPerFrameTarget;
|
||||
/* 0x08 */ s16 maxAiBufNumSamples;
|
||||
/* 0x0A */ s16 minAiBufNumSamples;
|
||||
/* 0x06 */ s16 numSamplesPerFrameTarget;
|
||||
/* 0x08 */ s16 numSamplesPerFrameMax;
|
||||
/* 0x0A */ s16 numSamplesPerFrameMin;
|
||||
/* 0x0C */ s16 updatesPerFrame; // for each frame of the audio thread (default 60 fps), number of updates to process audio
|
||||
/* 0x0E */ s16 samplesPerUpdate;
|
||||
/* 0x10 */ s16 samplesPerUpdateMax;
|
||||
/* 0x12 */ s16 samplesPerUpdateMin;
|
||||
/* 0x0E */ s16 numSamplesPerUpdate;
|
||||
/* 0x10 */ s16 numSamplesPerUpdateMax;
|
||||
/* 0x12 */ s16 numSamplesPerUpdateMin;
|
||||
/* 0x14 */ s16 numSequencePlayers;
|
||||
/* 0x18 */ f32 resampleRate;
|
||||
/* 0x1C */ f32 updatesPerFrameInv; // inverse (reciprocal) of updatesPerFrame
|
||||
@@ -898,8 +933,8 @@ typedef struct {
|
||||
/* 0x0002 */ u16 unk_2; // reads from audio spec unk_14, never used, always set to 0x7FFF
|
||||
/* 0x0004 */ u16 unk_4;
|
||||
/* 0x0006 */ char unk_0006[0xA];
|
||||
/* 0x0010 */ s16* curLoadedBook;
|
||||
/* 0x0014 */ NoteSubEu* noteSubsEu;
|
||||
/* 0x0010 */ s16* adpcmCodeBook;
|
||||
/* 0x0014 */ NoteSampleState* sampleStateList;
|
||||
/* 0x0018 */ SynthesisReverb synthesisReverbs[4];
|
||||
/* 0x0B58 */ char unk_0B58[0x30];
|
||||
/* 0x0B88 */ Sample* usedSamples[128];
|
||||
@@ -1001,7 +1036,7 @@ typedef struct {
|
||||
/* 0x4460 */ SequencePlayer seqPlayers[5];
|
||||
/* 0x4B40 */ SequenceLayer sequenceLayers[80];
|
||||
/* 0x7840 */ SequenceChannel sequenceChannelNone;
|
||||
/* 0x7924 */ s32 noteSubEuOffset;
|
||||
/* 0x7924 */ s32 sampleStateOffset; // Start of the list of sample states for this update. Resets after each audio frame.
|
||||
/* 0x7928 */ AudioListItem layerFreeList;
|
||||
/* 0x7938 */ NotePool noteFreeLists;
|
||||
/* 0x7978 */ u8 cmdWritePos;
|
||||
@@ -1022,17 +1057,17 @@ typedef struct {
|
||||
} AudioContext; // size = 0x81F8
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 reverbVol;
|
||||
/* 0x00 */ u8 targetReverbVol;
|
||||
/* 0x01 */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number
|
||||
/* 0x02 */ u8 pan;
|
||||
/* 0x03 */ u8 unk_3;
|
||||
/* 0x04 */ Stereo stereo;
|
||||
/* 0x03 */ u8 surroundEffectIndex;
|
||||
/* 0x04 */ StereoData stereoData;
|
||||
/* 0x08 */ f32 frequency;
|
||||
/* 0x0C */ f32 velocity;
|
||||
/* 0x10 */ char unk_0C[0x4];
|
||||
/* 0x14 */ s16* filter;
|
||||
/* 0x18 */ u8 unk_14;
|
||||
/* 0x1A */ u16 unk_16;
|
||||
/* 0x18 */ u8 combFilterSize;
|
||||
/* 0x1A */ u16 combFilterGain;
|
||||
} NoteSubAttributes; // size = 0x1A
|
||||
|
||||
typedef struct {
|
||||
@@ -1068,7 +1103,7 @@ typedef struct {
|
||||
/* 0x204 */ u16 unk_28;
|
||||
/* 0x206 */ u16 unk_250;
|
||||
/* 0x208 */ u16 unk_252;
|
||||
/* 0x20A */ u16 unk_254;
|
||||
/* 0x20A */ u16 seqId;
|
||||
/* 0x20C */ u16 unk_256;
|
||||
/* 0x20E */ u16 unk_258;
|
||||
/* 0x210 */ u8 unk_260;
|
||||
@@ -1080,7 +1115,7 @@ typedef struct {
|
||||
/* 0x219 */ u8 unk_4D;
|
||||
/* 0x21A */ u8 unk_4E;
|
||||
/* 0x21B */ u8 unk_21B;
|
||||
} unk_D_8016E750; // size = 0x21C
|
||||
} ActiveSequence; // size = 0x21C
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 unk_0;
|
||||
@@ -1095,7 +1130,7 @@ typedef enum {
|
||||
/* 4 */ BANK_SYSTEM,
|
||||
/* 5 */ BANK_OCARINA,
|
||||
/* 6 */ BANK_VOICE
|
||||
} SoundBankTypes;
|
||||
} SfxBankType;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SFX_STATE_EMPTY,
|
||||
|
||||
@@ -56,11 +56,6 @@ struct DynaPolyActor;
|
||||
// CollisionContext flags
|
||||
#define BGCHECK_FLAG_REVERSE_CONVEYOR_FLOW 1
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ CONVEYOR_WATER,
|
||||
/* 1 */ CONVEYOR_FLOOR
|
||||
} ConveyorType;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ Vec3s pos;
|
||||
} BgVertex; // size = 0x6
|
||||
|
||||
+11
-11
@@ -4,21 +4,21 @@
|
||||
#include "ultra64.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 vromAddr; // VROM address (source)
|
||||
/* 0x04 */ void* dramAddr; // DRAM address (destination)
|
||||
/* 0x08 */ u32 size; // File Transfer size
|
||||
/* 0x0C */ char* filename; // Filename for debugging
|
||||
/* 0x10 */ s32 line; // Line for debugging
|
||||
/* 0x14 */ s32 unk14;
|
||||
/* 0x00 */ uintptr_t vromAddr; // VROM address (source)
|
||||
/* 0x04 */ void* dramAddr; // DRAM address (destination)
|
||||
/* 0x08 */ u32 size; // File Transfer size
|
||||
/* 0x0C */ char* filename; // Filename for debugging
|
||||
/* 0x10 */ s32 line; // Line for debugging
|
||||
/* 0x14 */ s32 unk14;
|
||||
/* 0x18 */ OSMesgQueue* notifyQueue; // Message queue for the notification message
|
||||
/* 0x1C */ OSMesg notifyMsg; // Completion notification message
|
||||
/* 0x1C */ OSMesg notifyMsg; // Completion notification message
|
||||
} DmaRequest; // size = 0x20
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u32 vromStart;
|
||||
/* 0x4 */ u32 vromEnd;
|
||||
/* 0x8 */ u32 romStart;
|
||||
/* 0xC */ u32 romEnd;
|
||||
/* 0x0 */ uintptr_t vromStart;
|
||||
/* 0x4 */ uintptr_t vromEnd;
|
||||
/* 0x8 */ uintptr_t romStart;
|
||||
/* 0xC */ uintptr_t romEnd;
|
||||
} DmaEntry; // size = 0x10
|
||||
|
||||
#endif
|
||||
|
||||
+2
-3
@@ -248,8 +248,8 @@ typedef struct {
|
||||
} EffectSsInit; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 vromStart;
|
||||
/* 0x04 */ u32 vromEnd;
|
||||
/* 0x00 */ uintptr_t vromStart;
|
||||
/* 0x04 */ uintptr_t vromEnd;
|
||||
/* 0x08 */ void* vramStart;
|
||||
/* 0x0C */ void* vramEnd;
|
||||
/* 0x10 */ void* loadedRamAddr;
|
||||
@@ -257,7 +257,6 @@ typedef struct {
|
||||
/* 0x18 */ u8 unk18; // Always 1?
|
||||
} EffectSsOverlay; // size = 0x1C
|
||||
|
||||
//! TODO: Review reuse of vec/gfx/actor fields across all effects
|
||||
typedef struct EffectSs {
|
||||
/* 0x00 */ Vec3f pos;
|
||||
/* 0x0C */ Vec3f velocity;
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
#ifndef Z64QUAKE_H
|
||||
#define Z64QUAKE_H
|
||||
|
||||
#include "z64math.h"
|
||||
|
||||
struct PlayState;
|
||||
struct Camera;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3f atOffset;
|
||||
/* 0x0C */ Vec3f eyeOffset;
|
||||
/* 0x18 */ s16 rollOffset;
|
||||
/* 0x1A */ s16 zoom;
|
||||
/* 0x1C */ f32 max; // Set to scaled max data of struct (mag for Vec3f), never used
|
||||
} QuakeCamCalc; // size = 0x20
|
||||
|
||||
#define QUAKE_SPEED (1 << 0)
|
||||
#define QUAKE_VERTICAL_MAG (1 << 1)
|
||||
#define QUAKE_HORIZONTAL_MAG (1 << 2)
|
||||
#define QUAKE_ZOOM (1 << 3)
|
||||
#define QUAKE_ROLL_OFFSET (1 << 4)
|
||||
#define QUAKE_SHAKE_PLANE_OFFSET_X (1 << 5)
|
||||
#define QUAKE_SHAKE_PLANE_OFFSET_Y (1 << 6)
|
||||
#define QUAKE_SHAKE_PLANE_OFFSET_Z (1 << 7)
|
||||
#define QUAKE_COUNTDOWN (1 << 8)
|
||||
#define QUAKE_IS_SHAKE_PERPENDICULAR (1 << 9)
|
||||
|
||||
typedef enum {
|
||||
/* 1 */ QUAKE_TYPE_1 = 1,
|
||||
/* 2 */ QUAKE_TYPE_2,
|
||||
/* 3 */ QUAKE_TYPE_3,
|
||||
/* 4 */ QUAKE_TYPE_4,
|
||||
/* 5 */ QUAKE_TYPE_5,
|
||||
/* 6 */ QUAKE_TYPE_6
|
||||
} QuakeType;
|
||||
|
||||
u32 Quake_SetValue(s16 quakeIndex, s16 valueType, s16 value);
|
||||
u32 Quake_SetSpeed(s16 quakeIndex, s16 speed);
|
||||
u32 Quake_SetCountdown(s16 quakeIndex, s16 countdown);
|
||||
s16 Quake_GetCountdown(s16 quakeIndex);
|
||||
u32 Quake_SetQuakeValues(s16 quakeIndex, s16 verticalMag, s16 horizontalMag, s16 zoom, s16 rollOffset);
|
||||
u32 Quake_SetQuakeValues2(s16 quakeIndex, s16 isShakePerpendicular, Vec3s shakePlaneOffset);
|
||||
s16 Quake_Add(Camera* camera, u32 type);
|
||||
s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData);
|
||||
u32 Quake_Remove(s16 index);
|
||||
s32 Quake_NumActiveQuakes(void);
|
||||
void Quake_Init(void);
|
||||
|
||||
#define DISTORTION_TYPE_0 (1 << 0)
|
||||
#define DISTORTION_TYPE_2 (1 << 2)
|
||||
#define DISTORTION_TYPE_3 (1 << 3)
|
||||
#define DISTORTION_TYPE_4 (1 << 4)
|
||||
#define DISTORTION_TYPE_5 (1 << 5)
|
||||
#define DISTORTION_TYPE_6 (1 << 6)
|
||||
#define DISTORTION_TYPE_7 (1 << 7)
|
||||
#define DISTORTION_TYPE_8 (1 << 8)
|
||||
#define DISTORTION_TYPE_9 (1 << 9)
|
||||
#define DISTORTION_TYPE_A (1 << 10)
|
||||
#define DISTORTION_TYPE_B (1 << 11)
|
||||
|
||||
void Distortion_SetCountdown(s16 countdown);
|
||||
s16 Distortion_GetCountdown(void);
|
||||
s16 Distortion_GetType(void);
|
||||
void Distortion_SetType(s32 type);
|
||||
void Distortion_ClearType(s32 type);
|
||||
void Distortion_Init(PlayState* play);
|
||||
void Distortion_Update(void);
|
||||
|
||||
#endif
|
||||
+7
-7
@@ -304,7 +304,7 @@ typedef struct SaveContext {
|
||||
/* 0x3CA6 */ u8 unk_3CA6;
|
||||
/* 0x3CA7 */ u8 unk_3CA7; // "day_night_flag"
|
||||
/* 0x3CA8 */ s32 gameMode; // "mode"
|
||||
/* 0x3CAC */ s32 sceneSetupIndex; // "counter"
|
||||
/* 0x3CAC */ s32 sceneLayer; // "counter"
|
||||
/* 0x3CB0 */ s32 respawnFlag; // "restart_flag"
|
||||
/* 0x3CB4 */ RespawnData respawn[RESPAWN_MODE_MAX]; // "restart_data"
|
||||
/* 0x3DB4 */ f32 entranceSpeed; // "player_wipe_speedF"
|
||||
@@ -327,8 +327,8 @@ typedef struct SaveContext {
|
||||
/* 0x3EF8 */ s16 timerX[TIMER_ID_MAX]; // "event_xp"
|
||||
/* 0x3F06 */ s16 timerY[TIMER_ID_MAX]; // "event_yp"
|
||||
/* 0x3F14 */ s16 unk_3F14; // "character_change"
|
||||
/* 0x3F16 */ u8 seqIndex; // "old_bgm"
|
||||
/* 0x3F17 */ u8 nightSeqIndex; // "old_env"
|
||||
/* 0x3F16 */ u8 seqId; // "old_bgm"
|
||||
/* 0x3F17 */ u8 ambienceId; // "old_env"
|
||||
/* 0x3F18 */ u8 buttonStatus[6]; // "button_item"
|
||||
/* 0x3F1E */ u8 hudVisibilityForceButtonAlphasByStatus; // if btn alphas are updated through Interface_UpdateButtonAlphas, instead update them through Interface_UpdateButtonAlphasByStatus "ck_fg"
|
||||
/* 0x3F20 */ u16 nextHudVisibility; // triggers the hud to change visibility to the requested value. Reset to HUD_VISIBILITY_IDLE when target is reached "alpha_type"
|
||||
@@ -368,7 +368,7 @@ typedef struct SaveContext {
|
||||
/* 0x3F64 */ f32 screenScale; // "framescale_scale"
|
||||
/* 0x3F68 */ CycleSceneFlags cycleSceneFlags[120]; // Scene flags that are temporarily stored over the duration of a single 3-day cycle
|
||||
/* 0x48C8 */ u16 dungeonIndex; // "scene_id_mix"
|
||||
/* 0x48CA */ u8 maskMaskBit[27]; // "mask_mask_bit", masks given away on the Moon
|
||||
/* 0x48CA */ u8 masksGivenOnMoon[27]; // bit-packed, masks given away on the Moon. "mask_mask_bit"
|
||||
} SaveContext; // size = 0x48C8
|
||||
|
||||
typedef enum ButtonStatus {
|
||||
@@ -480,9 +480,9 @@ void func_80144A94(SramContext* sramCtx);
|
||||
void Sram_OpenSave(struct FileSelectState* fileSelect, SramContext* sramCtx);
|
||||
void func_8014546C(SramContext* sramCtx);
|
||||
void func_801457CC(struct FileSelectState* fileSelect, SramContext* sramCtx);
|
||||
void func_80146580(struct FileSelectState* fileSelect, SramContext* sramCtx, s32 fileNum);
|
||||
void func_80146628(struct FileSelectState* fileSelect, SramContext* sramCtx);
|
||||
void Sram_InitSave(struct FileSelectState* fileSelect, SramContext* sramCtx);
|
||||
void func_80146580(struct FileSelectState* fileSelect2, SramContext* sramCtx, s32 fileNum);
|
||||
void func_80146628(struct FileSelectState* fileSelect2, SramContext* sramCtx);
|
||||
void Sram_InitSave(struct FileSelectState* fileSelect2, SramContext* sramCtx);
|
||||
void func_80146DF8(SramContext* sramCtx);
|
||||
void Sram_InitSram(struct GameState* gameState, SramContext* sramCtx);
|
||||
void Sram_Alloc(struct GameState* gameState, SramContext* sramCtx);
|
||||
|
||||
+9
-9
@@ -153,16 +153,16 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 bgmId;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[4];
|
||||
/* 0x6 */ u8 nighttimeSFX;
|
||||
/* 0x7 */ u8 musicSeq;
|
||||
/* 0x1 */ u8 specId;
|
||||
/* 0x2 */ UNK_TYPE1 unk_02[4];
|
||||
/* 0x6 */ u8 ambienceId;
|
||||
/* 0x7 */ u8 seqId;
|
||||
} SCmdSoundSettings; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[5];
|
||||
/* 0x2 */ UNK_TYPE1 unk_02[5];
|
||||
/* 0x7 */ u8 echo;
|
||||
} SCmdEchoSettings; // size = 0x8
|
||||
|
||||
@@ -768,7 +768,7 @@ typedef enum {
|
||||
/*
|
||||
* 0xFE00: Index into sSceneEntranceTable (Scene)
|
||||
* 0x01F0: Index into the scenes specific entrance table (Spawn)
|
||||
* 0x000F: Index into the specific entrance table (Layer), stored seperately in sceneSetupIndex
|
||||
* 0x000F: Index into the specific entrance table (Layer), stored seperately in sceneLayer
|
||||
*/
|
||||
#define ENTRANCE(scene, spawn) ((((ENTR_SCENE_##scene) & 0x7F) << 9) | (((spawn) & 0x1F) << 4))
|
||||
|
||||
@@ -818,7 +818,7 @@ typedef enum {
|
||||
/* 0x1D */ SCENE_CMD_ID_UNUSED_1D,
|
||||
/* 0x1E */ SCENE_CMD_ID_MINIMAP_COMPASS_ICON_INFO,
|
||||
/* 0x1F */ SCENE_CMD_MAX
|
||||
} SceneCommandTypeID;
|
||||
} SceneCommandTypeId;
|
||||
|
||||
#define SCENE_CMD_SPAWN_LIST(numSpawns, spawnList) \
|
||||
{ SCENE_CMD_ID_SPAWN_LIST, numSpawns, CMD_PTR(spawnList) }
|
||||
@@ -888,8 +888,8 @@ typedef enum {
|
||||
#define SCENE_CMD_END() \
|
||||
{ SCENE_CMD_ID_END, 0, CMD_W(0) }
|
||||
|
||||
#define SCENE_CMD_SOUND_SETTINGS(audioSessionId, nighttimeSfx, bgmId) \
|
||||
{ SCENE_CMD_ID_SOUND_SETTINGS, audioSessionId, CMD_BBBB(0, 0, nighttimeSfx, bgmId) }
|
||||
#define SCENE_CMD_SOUND_SETTINGS(specId, ambienceId, seqId) \
|
||||
{ SCENE_CMD_ID_SOUND_SETTINGS, specId, CMD_BBBB(0, 0, ambienceId, seqId) }
|
||||
|
||||
#define SCENE_CMD_ECHO_SETTINGS(echo) \
|
||||
{ SCENE_CMD_ID_ECHO_SETTINGS, 0, CMD_BBBB(0, 0, 0, echo) }
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef Z64SHRINK_WINDOW_H
|
||||
#define Z64SHRINK_WINDOW_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
struct GraphicsContext;
|
||||
|
||||
void ShrinkWindow_Letterbox_SetSizeTarget(s32 target);
|
||||
s32 ShrinkWindow_Letterbox_GetSizeTarget(void);
|
||||
void ShrinkWindow_Letterbox_SetSize(s32 size);
|
||||
s32 ShrinkWindow_Letterbox_GetSize(void);
|
||||
|
||||
void ShrinkWindow_Pillarbox_SetSizeTarget(s32 target);
|
||||
s32 ShrinkWindow_Pillarbox_GetSizeTarget(void);
|
||||
void ShrinkWindow_Pillarbox_SetSize(s32 size);
|
||||
s32 ShrinkWindow_Pillarbox_GetSize(void);
|
||||
|
||||
void ShrinkWindow_Init(void);
|
||||
void ShrinkWindow_Destroy(void);
|
||||
void ShrinkWindow_Update(s32 framerateDivisor);
|
||||
void ShrinkWindow_Draw(GraphicsContext* gfxCtx);
|
||||
|
||||
#endif
|
||||
+3
-3
@@ -100,7 +100,7 @@ void SubS_TimePathing_ComputeTargetPosXZ(f32* x, f32* z, f32 progress, s32 order
|
||||
s32 SubS_TimePathing_Update(Path* path, f32* progress, s32* elapsedTime, s32 waypointTime, s32 totalTime, s32* waypoint, f32 knots[], Vec3f* targetPos, s32 timeSpeed);
|
||||
void SubS_TimePathing_ComputeInitialY(struct PlayState* play, Path* path, s32 waypoint, Vec3f* targetPos);
|
||||
|
||||
Path* SubS_GetAdditionalPath(struct PlayState* play, u8 pathIndex, s32 max);
|
||||
Path* SubS_GetAdditionalPath(struct PlayState* play, u8 pathIndex, s32 limit);
|
||||
|
||||
Actor* SubS_FindNearestActor(Actor* actor, struct PlayState* play, u8 actorCategory, s16 actorId);
|
||||
|
||||
@@ -122,7 +122,7 @@ void SubS_GenShadowTex(Vec3f bodyPartsPos[], Vec3f* worldPos, u8* tex, f32 tween
|
||||
void SubS_DrawShadowTex(Actor* actor, struct GameState* gameState, u8* tex);
|
||||
|
||||
s16 SubS_ComputeTrackPointRot(s16* rot, s16 rotMax, s16 target, f32 slowness, f32 stepMin, f32 stepMax);
|
||||
s32 SubS_TrackPoint(Vec3f* point, Vec3f* focusPos, Vec3s* shapeRot, Vec3s* trackTarget, Vec3s* headRot, Vec3s* torsoRot, TrackOptionsSet* options);
|
||||
s32 SubS_TrackPoint(Vec3f* target, Vec3f* focusPos, Vec3s* shapeRot, Vec3s* trackTarget, Vec3s* headRot, Vec3s* torsoRot, TrackOptionsSet* options);
|
||||
|
||||
s32 SubS_AngleDiffLessEqual(s16 angleA, s16 threshold, s16 angleB);
|
||||
|
||||
@@ -130,7 +130,7 @@ Path* SubS_GetPathByIndex(struct PlayState* play, s16 pathIndex, s16 max);
|
||||
s32 SubS_CopyPointFromPath(Path* path, s32 pointIndex, Vec3f* dst);
|
||||
s16 SubS_GetDistSqAndOrientPoints(Vec3f* vecA, Vec3f* vecB, f32* distSq);
|
||||
s32 SubS_MoveActorToPoint(Actor* actor, Vec3f* point, s16 rotStep);
|
||||
s16 SubS_GetDistSqAndOrientPath(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq);
|
||||
s16 SubS_GetDistSqAndOrientPath(Path* path, s32 pointIndex, Vec3f* pos, f32* distSq);
|
||||
|
||||
s8 SubS_IsObjectLoaded(s8 index, struct PlayState* play);
|
||||
s8 SubS_GetObjectIndex(s16 id, struct PlayState* play);
|
||||
|
||||
+58
-12
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "ultra64.h"
|
||||
|
||||
#define TC_SET_PARAMS (1 << 7)
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* (*init)(void* transition);
|
||||
/* 0x04 */ void (*destroy)(void* transition);
|
||||
@@ -16,20 +18,64 @@ typedef struct {
|
||||
} TransitionInit; // size = 0x24
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s8 unk_00;
|
||||
/* 0x01 */ s8 unk_01;
|
||||
/* 0x02 */ s8 unk_02;
|
||||
/* 0x04 */ Color_RGBA8_u32 unk_04;
|
||||
/* 0x08 */ s16 unk_08;
|
||||
/* 0x0A */ char unk_0A[0x2];
|
||||
} TransitionFade; // size = 0xC
|
||||
|
||||
extern const TransitionInit TransitionFade_InitVars;
|
||||
union {
|
||||
struct {
|
||||
/* 0x00 */ u32 count : 8;
|
||||
/* 0x00 */ uintptr_t addr : 24;
|
||||
};
|
||||
/* 0x00 */ u32 word;
|
||||
} loadInfo;
|
||||
/* 0x04 */ void* vramStart;
|
||||
/* 0x08 */ void* vramEnd;
|
||||
/* 0x0C */ uintptr_t vromStart;
|
||||
/* 0x10 */ uintptr_t vromEnd;
|
||||
/* 0x14 */ TransitionInit* initInfo;
|
||||
/* 0x18 */ size_t size;
|
||||
} TransitionOverlay;
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ s16 transitionType;
|
||||
/* 0x002 */ s8 fbdemoType;
|
||||
/* 0x003 */ char unk_003[0x5];
|
||||
/* 0x008 */ s32 instanceData;
|
||||
/* 0x00C */ char unk_00C[0x224];
|
||||
/* 0x230 */ void* (*init)(void* transition);
|
||||
/* 0x234 */ void (*destroy)(void* transition);
|
||||
/* 0x238 */ void (*update)(void* transition, s32 updateRate);
|
||||
/* 0x23C */ void (*draw)(void* transition, Gfx** gfxP);
|
||||
/* 0x240 */ void (*start)(void* transition);
|
||||
/* 0x244 */ void (*setType)(void* transition, s32 type);
|
||||
/* 0x248 */ void (*setColor)(void* transition, u32 color);
|
||||
/* 0x24C */ void (*setEnvColor)(void* transition, u32 color);
|
||||
/* 0x250 */ s32 (*isDone)(void* transition);
|
||||
/* 0x254 */ char unk_254[0x4];
|
||||
} TransitionContext; // size = 0x258
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_0[0x20];
|
||||
/* 0x0 */ char unk_0[0xC];
|
||||
} TransitionFade; // size = 0xC
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ TRANSITION_CIRCLE_IN,
|
||||
/* 1 */ TRANSITION_CIRCLE_OUT,
|
||||
} TransitionCircleDirection;
|
||||
|
||||
#define FBDEMO_CIRCLE_GET_MASK_TYPE(type) (type & 1)
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ Color_RGBA8_u32 color;
|
||||
/* 0x04 */ f32 referenceRadius; // Reference for where to transition to
|
||||
/* 0x08 */ f32 stepValue; // How fast the Transition is
|
||||
/* 0x0C */ f32 startingRadius; // Radius value where transition will begin
|
||||
/* 0x10 */ f32 targetRadius; // Final radius of transition circle
|
||||
/* 0x14 */ u8 direction; // Direction the circle is transitioning ( In / Out )
|
||||
/* 0x15 */ u8 maskType; // Positive / Negative mask type. Value of 0 will create a black circle
|
||||
/* 0x16 */ u8 isDone; // Signals when Transition is done updating
|
||||
/* 0x18 */ TexturePtr texture;
|
||||
/* 0x1C */ u8 masks;
|
||||
/* 0x1D */ u8 maskt;
|
||||
/* 0x1E */ s8 unk_1E; // Set to 4 and never used
|
||||
/* 0x1F */ s8 unk_1F; // Set to 0 and never used
|
||||
} TransitionCircle; // size = 0x20
|
||||
|
||||
extern const TransitionInit TransitionCircle_InitVars;
|
||||
|
||||
#endif
|
||||
|
||||
+38
-3
@@ -33,16 +33,27 @@ typedef struct View {
|
||||
/* 0x0E0 */ Mtx unkE0;
|
||||
/* 0x120 */ Mtx* projectionPtr;
|
||||
/* 0x124 */ Mtx* viewingPtr;
|
||||
/* 0x128 */ Vec3f distortionDirRot;
|
||||
/* 0x128 */ Vec3f distortionOrientation;
|
||||
/* 0x134 */ Vec3f distortionScale;
|
||||
/* 0x140 */ f32 distortionSpeed;
|
||||
/* 0x144 */ Vec3f curDistortionDirRot;
|
||||
/* 0x144 */ Vec3f curDistortionOrientation;
|
||||
/* 0x150 */ Vec3f curDistortionScale;
|
||||
/* 0x15C */ u16 normal; // used to normalize the projection matrix
|
||||
/* 0x15C */ u16 perspNorm; // used to normalize the projection matrix
|
||||
/* 0x160 */ u32 flags; // bit 3: Render to an orthographic perspective
|
||||
/* 0x164 */ s32 unk164;
|
||||
} View; // size = 0x168
|
||||
|
||||
#define VIEW_VIEWING (1 << 0)
|
||||
#define VIEW_VIEWPORT (1 << 1)
|
||||
#define VIEW_PROJECTION_PERSPECTIVE (1 << 2)
|
||||
#define VIEW_PROJECTION_ORTHO (1 << 3)
|
||||
#define VIEW_ALL (VIEW_VIEWING | VIEW_VIEWPORT | VIEW_PROJECTION_PERSPECTIVE | VIEW_PROJECTION_ORTHO)
|
||||
|
||||
#define VIEW_FORCE_VIEWING (VIEW_VIEWING << 4)
|
||||
#define VIEW_FORCE_VIEWPORT (VIEW_VIEWPORT << 4)
|
||||
#define VIEW_FORCE_PROJECTION_PERSPECTIVE (VIEW_PROJECTION_PERSPECTIVE << 4)
|
||||
#define VIEW_FORCE_PROJECTION_ORTHO (VIEW_PROJECTION_ORTHO << 4)
|
||||
|
||||
#define SET_FULLSCREEN_VIEWPORT(view) \
|
||||
{ \
|
||||
Viewport viewport; \
|
||||
@@ -54,4 +65,28 @@ typedef struct View {
|
||||
} \
|
||||
(void)0
|
||||
|
||||
void View_Init(View* view, struct GraphicsContext* gfxCtx);
|
||||
void View_LookAt(View* view, Vec3f* eye, Vec3f* at, Vec3f* up);
|
||||
void View_SetScale(View* view, f32 scale);
|
||||
void View_GetScale(View* view, f32* scale);
|
||||
void View_SetPerspective(View* view, f32 fovy, f32 zNear, f32 zFar);
|
||||
void View_GetPerspective(View* view, f32* fovy, f32* zNear, f32* zFar);
|
||||
void View_SetOrtho(View* view, f32 fovy, f32 zNear, f32 zFar);
|
||||
void View_GetOrtho(View* view, f32* fovy, f32* zNear, f32* zFar);
|
||||
void View_SetViewport(View* view, Viewport* viewport);
|
||||
void View_GetViewport(View* view, Viewport* viewport);
|
||||
|
||||
s32 View_SetDistortionOrientation(View* view, f32 rotX, f32 rotY, f32 rotZ);
|
||||
s32 View_SetDistortionScale(View* view, f32 scaleX, f32 scaleY, f32 scaleZ);
|
||||
s32 View_SetDistortionSpeed(View* view, f32 speed);
|
||||
s32 View_InitDistortion(View* view);
|
||||
s32 View_ClearDistortion(View* view);
|
||||
s32 View_SetDistortion(View* view, Vec3f orientation, Vec3f scale, f32 speed);
|
||||
|
||||
void View_Apply(View* view, s32 mask);
|
||||
s32 View_ApplyOrthoToOverlay(View* view);
|
||||
s32 View_ApplyPerspectiveToOverlay(View* view);
|
||||
s32 View_UpdateViewingMatrix(View* view);
|
||||
s32 View_ApplyTo(View* view, Gfx** gfxp);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -79,7 +79,7 @@ s32 EnHy_ChangeAnim(SkelAnime* skelAnime, s16 animIndex);
|
||||
EnDoor* EnHy_FindNearestDoor(Actor* actor, PlayState* play);
|
||||
void EnHy_ChangeObjectAndAnim(EnHy* enHy, PlayState* play, s16 animIndex);
|
||||
s32 EnHy_UpdateSkelAnime(EnHy* enHy, PlayState* play);
|
||||
void EnHy_Blink(EnHy* enHy, s32 arg1);
|
||||
void EnHy_Blink(EnHy* enHy, s32 eyeTexMaxIndex);
|
||||
s32 EnHy_Init(EnHy* enHy, PlayState* play, FlexSkeletonHeader* skeletonHeaderSeg, s16 animIndex);
|
||||
void func_800F0BB4(EnHy* enHy, PlayState* play, EnDoor* door, s16 arg3, s16 arg4);
|
||||
s32 func_800F0CE4(EnHy* enHy, PlayState* play, ActorFunc draw, s16 arg3, s16 arg4, f32 arg5);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "global.h"
|
||||
|
||||
void Setup_Destroy(GameState* gameState);
|
||||
void Setup_Init(GameState* gameState);
|
||||
void Setup_Init(GameState* thisx);
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ GameState state;
|
||||
|
||||
@@ -549,12 +549,10 @@ beginseg
|
||||
include "build/src/code/z_kaleido_manager.o"
|
||||
include "build/src/code/z_kaleido_scope_call.o"
|
||||
include "build/src/code/z_fbdemo_dlftbls.o"
|
||||
include "build/data/code/code_801D0BB0.data.o"
|
||||
include "build/src/code/z_fbdemo.o"
|
||||
include "build/data/code/z_fbdemo.data.o"
|
||||
include "build/src/code/z_fbdemo_fade.o"
|
||||
include "build/src/code/z_fbdemo_circle.o"
|
||||
include "build/data/code/z_fbdemo_circle.data.o"
|
||||
include "build/src/code/z_overlay.o"
|
||||
include "build/src/code/z_play.o"
|
||||
include "build/data/code/z_play.bss.o"
|
||||
@@ -607,7 +605,6 @@ beginseg
|
||||
pad_text
|
||||
include "build/src/code/audio/audio_data.o"
|
||||
include "build/src/code/audio/audio_synthesis.o"
|
||||
include "build/data/code/audio_synthesis.data.o"
|
||||
include "build/src/code/audio/audio_heap.o"
|
||||
include "build/data/code/audio_heap.bss.o"
|
||||
include "build/src/code/audio/audio_load.o"
|
||||
@@ -983,8 +980,7 @@ beginseg
|
||||
name "ovl_En_M_Thunder"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.o"
|
||||
include "build/data/ovl_En_M_Thunder/ovl_En_M_Thunder.data.o"
|
||||
include "build/data/ovl_En_M_Thunder/ovl_En_M_Thunder.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_En_M_Thunder/ovl_En_M_Thunder_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
@@ -1729,9 +1725,7 @@ beginseg
|
||||
name "ovl_Oceff_Wipe"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.o"
|
||||
include "build/data/ovl_Oceff_Wipe/ovl_Oceff_Wipe.data.o"
|
||||
include "build/data/ovl_Oceff_Wipe/ovl_Oceff_Wipe.bss.o"
|
||||
include "build/data/ovl_Oceff_Wipe/ovl_Oceff_Wipe.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_Oceff_Wipe/ovl_Oceff_Wipe_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
@@ -1871,8 +1865,7 @@ beginseg
|
||||
name "ovl_Effect_Ss_Solder_Srch_Ball"
|
||||
compress
|
||||
include "build/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.o"
|
||||
include "build/data/ovl_Effect_Ss_Solder_Srch_Ball/ovl_Effect_Ss_Solder_Srch_Ball.data.o"
|
||||
include "build/data/ovl_Effect_Ss_Solder_Srch_Ball/ovl_Effect_Ss_Solder_Srch_Ball.reloc.o"
|
||||
include "build/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/ovl_Effect_Ss_Solder_Srch_Ball_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
@@ -1942,8 +1935,7 @@ beginseg
|
||||
name "ovl_Oceff_Storm"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.o"
|
||||
include "build/data/ovl_Oceff_Storm/ovl_Oceff_Storm.data.o"
|
||||
include "build/data/ovl_Oceff_Storm/ovl_Oceff_Storm.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_Oceff_Storm/ovl_Oceff_Storm_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
@@ -2716,8 +2708,7 @@ beginseg
|
||||
name "ovl_En_Wiz"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_En_Wiz/z_en_wiz.o"
|
||||
include "build/data/ovl_En_Wiz/ovl_En_Wiz.data.o"
|
||||
include "build/data/ovl_En_Wiz/ovl_En_Wiz.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_En_Wiz/ovl_En_Wiz_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
@@ -3201,8 +3192,7 @@ beginseg
|
||||
name "ovl_En_Door_Etc"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.o"
|
||||
include "build/data/ovl_En_Door_Etc/ovl_En_Door_Etc.data.o"
|
||||
include "build/data/ovl_En_Door_Etc/ovl_En_Door_Etc.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_En_Door_Etc/ovl_En_Door_Etc_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
@@ -4364,9 +4354,7 @@ beginseg
|
||||
name "ovl_Oceff_Wipe5"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.o"
|
||||
include "build/data/ovl_Oceff_Wipe5/ovl_Oceff_Wipe5.data.o"
|
||||
include "build/data/ovl_Oceff_Wipe5/ovl_Oceff_Wipe5.bss.o"
|
||||
include "build/data/ovl_Oceff_Wipe5/ovl_Oceff_Wipe5.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_Oceff_Wipe5/ovl_Oceff_Wipe5_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
@@ -4777,8 +4765,7 @@ beginseg
|
||||
name "ovl_En_Bombal"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_En_Bombal/z_en_bombal.o"
|
||||
include "build/data/ovl_En_Bombal/ovl_En_Bombal.data.o"
|
||||
include "build/data/ovl_En_Bombal/ovl_En_Bombal.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_En_Bombal/ovl_En_Bombal_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
@@ -5036,8 +5023,7 @@ beginseg
|
||||
name "ovl_Dm_Tag"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.o"
|
||||
include "build/data/ovl_Dm_Tag/ovl_Dm_Tag.data.o"
|
||||
include "build/data/ovl_Dm_Tag/ovl_Dm_Tag.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_Dm_Tag/ovl_Dm_Tag_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
||||
@@ -5,22 +5,22 @@ volatile OSTime sIrqMgrResetTime = 0;
|
||||
volatile OSTime sIrqMgrRetraceTime = 0;
|
||||
s32 sIrqMgrRetraceCount = 0;
|
||||
|
||||
void IrqMgr_AddClient(IrqMgr* irqmgr, IrqMgrClient* param_2, OSMesgQueue* param_3) {
|
||||
void IrqMgr_AddClient(IrqMgr* irqmgr, IrqMgrClient* client, OSMesgQueue* msgQueue) {
|
||||
u32 saveMask;
|
||||
|
||||
saveMask = osSetIntMask(1);
|
||||
|
||||
param_2->queue = param_3;
|
||||
param_2->next = irqmgr->callbacks;
|
||||
irqmgr->callbacks = param_2;
|
||||
client->queue = msgQueue;
|
||||
client->next = irqmgr->callbacks;
|
||||
irqmgr->callbacks = client;
|
||||
|
||||
osSetIntMask(saveMask);
|
||||
|
||||
if (irqmgr->prenmiStage > 0) {
|
||||
osSendMesg(param_2->queue, &irqmgr->prenmiMsg.type, OS_MESG_NOBLOCK);
|
||||
osSendMesg(client->queue, &irqmgr->prenmiMsg.type, OS_MESG_NOBLOCK);
|
||||
}
|
||||
if (irqmgr->prenmiStage > 1) {
|
||||
osSendMesg(param_2->queue, &irqmgr->nmiMsg.type, OS_MESG_NOBLOCK);
|
||||
osSendMesg(client->queue, &irqmgr->nmiMsg.type, OS_MESG_NOBLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
u8 sYaz0DataBuffer[0x400];
|
||||
u8* sYaz0CurDataEnd;
|
||||
u32 sYaz0CurRomStart;
|
||||
uintptr_t sYaz0CurRomStart;
|
||||
u32 sYaz0CurSize;
|
||||
u8* sYaz0MaxPtr;
|
||||
u8* D_8009BE20;
|
||||
@@ -123,7 +123,7 @@ s32 Yaz0_DecompressImpl(u8* src, u8* dst) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Yaz0_Decompress(u32 romStart, void* dst, size_t size) {
|
||||
void Yaz0_Decompress(uintptr_t romStart, void* dst, size_t size) {
|
||||
s32 status;
|
||||
u32 pad;
|
||||
char sp80[0x50];
|
||||
|
||||
@@ -60,7 +60,7 @@ s32 DmaMgr_DmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction) {
|
||||
return osEPiStartDma(pihandle, mb, direction);
|
||||
}
|
||||
|
||||
DmaEntry* DmaMgr_FindDmaEntry(u32 vrom) {
|
||||
DmaEntry* DmaMgr_FindDmaEntry(uintptr_t vrom) {
|
||||
DmaEntry* curr;
|
||||
|
||||
for (curr = dmadata; curr->vromEnd != 0; curr++) {
|
||||
@@ -77,7 +77,7 @@ DmaEntry* DmaMgr_FindDmaEntry(u32 vrom) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u32 DmaMgr_TranslateVromToRom(u32 vrom) {
|
||||
u32 DmaMgr_TranslateVromToRom(uintptr_t vrom) {
|
||||
DmaEntry* entry = DmaMgr_FindDmaEntry(vrom);
|
||||
|
||||
if (entry != NULL) {
|
||||
@@ -95,7 +95,7 @@ u32 DmaMgr_TranslateVromToRom(u32 vrom) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
s32 DmaMgr_FindDmaIndex(u32 vrom) {
|
||||
s32 DmaMgr_FindDmaIndex(uintptr_t vrom) {
|
||||
DmaEntry* entry = DmaMgr_FindDmaEntry(vrom);
|
||||
|
||||
if (entry != NULL) {
|
||||
|
||||
@@ -857,22 +857,99 @@ EnvelopePoint gDefaultEnvelope[] = {
|
||||
{ ADSR_DISABLE, 0 },
|
||||
};
|
||||
|
||||
NoteSubEu gZeroNoteSub = { 0 };
|
||||
NoteSampleState gZeroedSampleState = { 0 };
|
||||
|
||||
NoteSubEu gDefaultNoteSub = {
|
||||
{ 1, 1, 0, 0, 0, 0, 0, 0 }, { 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
NoteSampleState gDefaultSampleState = {
|
||||
{ true, true, false, false, false, false, false, false },
|
||||
{ 0 },
|
||||
0, // gain
|
||||
0, // haasEffectLeftDelaySize
|
||||
0, // haasEffectRightDelaySize
|
||||
0, // targetReverbVol
|
||||
0, // harmonicIndexCurAndPrev
|
||||
0, // combFilterSize
|
||||
0, // targetVolLeft
|
||||
0, // targetVolRight
|
||||
0, // frequencyFixedPoint
|
||||
0, // combFilterGain
|
||||
NULL, // tunedSample
|
||||
NULL, // filter
|
||||
0, // unk_18
|
||||
0, // surroundEffectIndex
|
||||
0, // unk_1A
|
||||
};
|
||||
|
||||
u16 gHeadsetPanQuantization[64] = {
|
||||
60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, 30, 28, 26, 24, 22, 20, 18,
|
||||
16, 14, 12, 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
u16 gHaasEffectDelaySize[64] = {
|
||||
30 * SAMPLE_SIZE,
|
||||
29 * SAMPLE_SIZE,
|
||||
28 * SAMPLE_SIZE,
|
||||
27 * SAMPLE_SIZE,
|
||||
26 * SAMPLE_SIZE,
|
||||
25 * SAMPLE_SIZE,
|
||||
24 * SAMPLE_SIZE,
|
||||
23 * SAMPLE_SIZE,
|
||||
22 * SAMPLE_SIZE,
|
||||
21 * SAMPLE_SIZE,
|
||||
20 * SAMPLE_SIZE,
|
||||
19 * SAMPLE_SIZE,
|
||||
18 * SAMPLE_SIZE,
|
||||
17 * SAMPLE_SIZE,
|
||||
16 * SAMPLE_SIZE,
|
||||
15 * SAMPLE_SIZE,
|
||||
14 * SAMPLE_SIZE,
|
||||
13 * SAMPLE_SIZE,
|
||||
12 * SAMPLE_SIZE,
|
||||
11 * SAMPLE_SIZE,
|
||||
10 * SAMPLE_SIZE,
|
||||
9 * SAMPLE_SIZE,
|
||||
8 * SAMPLE_SIZE,
|
||||
7 * SAMPLE_SIZE,
|
||||
6 * SAMPLE_SIZE,
|
||||
5 * SAMPLE_SIZE,
|
||||
4 * SAMPLE_SIZE,
|
||||
3 * SAMPLE_SIZE,
|
||||
2 * SAMPLE_SIZE,
|
||||
1 * SAMPLE_SIZE,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
s32 D_801D58A4 = 0;
|
||||
|
||||
// clang-format off
|
||||
s16 D_801D58A8[] = {
|
||||
s16 gInvalidAdpcmCodeBook[] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
|
||||
+142
-122
@@ -10,7 +10,7 @@ void AudioHeap_DiscardSampleCaches(void);
|
||||
void AudioHeap_DiscardSampleBank(s32 sampleBankId);
|
||||
void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId);
|
||||
void AudioHeap_DiscardSampleBanks(void);
|
||||
void AudioHeap_InitReverb(s32 reverbIndex, ReverbSettings* settings, s32 flags);
|
||||
void AudioHeap_InitReverb(s32 reverbIndex, ReverbSettings* settings, s32 isFirstInit);
|
||||
|
||||
#define gTatumsPerBeat (gAudioTatumInit[1])
|
||||
|
||||
@@ -421,7 +421,7 @@ void* AudioHeap_AllocCached(s32 tableType, size_t size, s32 cache, s32 id) {
|
||||
if (loadStatusEntry0 == LOAD_STATUS_MAYBE_DISCARDABLE) {
|
||||
for (i = 0; i < gAudioContext.numNotes; i++) {
|
||||
if ((gAudioContext.notes[i].playbackState.fontId == temporaryCache->entries[0].id) &&
|
||||
gAudioContext.notes[i].noteSubEu.bitField0.enabled) {
|
||||
gAudioContext.notes[i].sampleState.bitField0.enabled) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -435,7 +435,7 @@ void* AudioHeap_AllocCached(s32 tableType, size_t size, s32 cache, s32 id) {
|
||||
if (loadStatusEntry1 == LOAD_STATUS_MAYBE_DISCARDABLE) {
|
||||
for (i = 0; i < gAudioContext.numNotes; i++) {
|
||||
if ((gAudioContext.notes[i].playbackState.fontId == temporaryCache->entries[1].id) &&
|
||||
gAudioContext.notes[i].noteSubEu.bitField0.enabled) {
|
||||
gAudioContext.notes[i].sampleState.bitField0.enabled) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -491,7 +491,7 @@ void* AudioHeap_AllocCached(s32 tableType, size_t size, s32 cache, s32 id) {
|
||||
if (loadStatusEntry0 == LOAD_STATUS_COMPLETE) {
|
||||
for (i = 0; i < gAudioContext.numNotes; i++) {
|
||||
if ((gAudioContext.notes[i].playbackState.fontId == temporaryCache->entries[0].id) &&
|
||||
gAudioContext.notes[i].noteSubEu.bitField0.enabled) {
|
||||
gAudioContext.notes[i].sampleState.bitField0.enabled) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -504,7 +504,7 @@ void* AudioHeap_AllocCached(s32 tableType, size_t size, s32 cache, s32 id) {
|
||||
if (loadStatusEntry1 == LOAD_STATUS_COMPLETE) {
|
||||
for (i = 0; i < gAudioContext.numNotes; i++) {
|
||||
if ((gAudioContext.notes[i].playbackState.fontId == temporaryCache->entries[1].id) &&
|
||||
gAudioContext.notes[i].noteSubEu.bitField0.enabled) {
|
||||
gAudioContext.notes[i].sampleState.bitField0.enabled) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -814,7 +814,7 @@ void AudioHeap_UpdateReverb(SynthesisReverb* reverb) {
|
||||
|
||||
void AudioHeap_UpdateReverbs(void) {
|
||||
s32 count;
|
||||
s32 i;
|
||||
s32 reverbIndex;
|
||||
s32 j;
|
||||
|
||||
if (gAudioContext.audioBufferParameters.specUnk4 == 2) {
|
||||
@@ -823,9 +823,9 @@ void AudioHeap_UpdateReverbs(void) {
|
||||
count = 1;
|
||||
}
|
||||
|
||||
for (i = 0; i < gAudioContext.numSynthesisReverbs; i++) {
|
||||
for (reverbIndex = 0; reverbIndex < gAudioContext.numSynthesisReverbs; reverbIndex++) {
|
||||
for (j = 0; j < count; j++) {
|
||||
AudioHeap_UpdateReverb(&gAudioContext.synthesisReverbs[i]);
|
||||
AudioHeap_UpdateReverb(&gAudioContext.synthesisReverbs[reverbIndex]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -837,7 +837,7 @@ void AudioHeap_ClearAiBuffers(void) {
|
||||
s32 curAiBufferIndex = gAudioContext.curAiBufferIndex;
|
||||
s32 i;
|
||||
|
||||
gAudioContext.aiBufNumSamples[curAiBufferIndex] = gAudioContext.audioBufferParameters.minAiBufNumSamples;
|
||||
gAudioContext.aiBufNumSamples[curAiBufferIndex] = gAudioContext.audioBufferParameters.numSamplesPerFrameMin;
|
||||
|
||||
for (i = 0; i < AIBUF_LEN; i++) {
|
||||
gAudioContext.aiBuffers[curAiBufferIndex][i] = 0;
|
||||
@@ -870,7 +870,7 @@ s32 AudioHeap_ResetStep(void) {
|
||||
AudioHeap_UpdateReverbs();
|
||||
} else {
|
||||
for (i = 0; i < gAudioContext.numNotes; i++) {
|
||||
if (gAudioContext.notes[i].noteSubEu.bitField0.enabled &&
|
||||
if (gAudioContext.notes[i].sampleState.bitField0.enabled &&
|
||||
gAudioContext.notes[i].playbackState.adsr.action.s.state != ADSR_STATE_DISABLED) {
|
||||
gAudioContext.notes[i].playbackState.adsr.fadeOutVel =
|
||||
gAudioContext.audioBufferParameters.updatesPerFrameInv;
|
||||
@@ -907,7 +907,7 @@ s32 AudioHeap_ResetStep(void) {
|
||||
AudioHeap_Init();
|
||||
gAudioContext.resetStatus = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(gAudioContext.aiBufNumSamples); i++) {
|
||||
gAudioContext.aiBufNumSamples[i] = gAudioContext.audioBufferParameters.maxAiBufNumSamples;
|
||||
gAudioContext.aiBufNumSamples[i] = gAudioContext.audioBufferParameters.numSamplesPerFrameMax;
|
||||
for (j = 0; j < AIBUF_LEN; j++) {
|
||||
gAudioContext.aiBuffers[i][j] = 0;
|
||||
}
|
||||
@@ -930,8 +930,8 @@ void AudioHeap_Init(void) {
|
||||
size_t cachePoolSize;
|
||||
size_t miscPoolSize;
|
||||
u32 intMask;
|
||||
s32 reverbIndex;
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 pad2;
|
||||
AudioSpec* spec = &gAudioSpecs[gAudioContext.audioResetSpecIdToLoad]; // Audio Specifications
|
||||
|
||||
@@ -942,19 +942,22 @@ void AudioHeap_Init(void) {
|
||||
gAudioContext.audioBufferParameters.aiSamplingFreq =
|
||||
osAiSetFrequency(gAudioContext.audioBufferParameters.samplingFreq);
|
||||
|
||||
gAudioContext.audioBufferParameters.samplesPerFrameTarget =
|
||||
gAudioContext.audioBufferParameters.numSamplesPerFrameTarget =
|
||||
ALIGN16(gAudioContext.audioBufferParameters.samplingFreq / gAudioContext.refreshRate);
|
||||
gAudioContext.audioBufferParameters.minAiBufNumSamples =
|
||||
gAudioContext.audioBufferParameters.samplesPerFrameTarget - 0x10;
|
||||
gAudioContext.audioBufferParameters.maxAiBufNumSamples =
|
||||
gAudioContext.audioBufferParameters.samplesPerFrameTarget + 0x10;
|
||||
gAudioContext.audioBufferParameters.numSamplesPerFrameMin =
|
||||
gAudioContext.audioBufferParameters.numSamplesPerFrameTarget - 0x10;
|
||||
gAudioContext.audioBufferParameters.numSamplesPerFrameMax =
|
||||
gAudioContext.audioBufferParameters.numSamplesPerFrameTarget + 0x10;
|
||||
gAudioContext.audioBufferParameters.updatesPerFrame =
|
||||
((gAudioContext.audioBufferParameters.samplesPerFrameTarget + 0x10) / 0xD0) + 1;
|
||||
gAudioContext.audioBufferParameters.samplesPerUpdate = (gAudioContext.audioBufferParameters.samplesPerFrameTarget /
|
||||
gAudioContext.audioBufferParameters.updatesPerFrame) &
|
||||
~7;
|
||||
gAudioContext.audioBufferParameters.samplesPerUpdateMax = gAudioContext.audioBufferParameters.samplesPerUpdate + 8;
|
||||
gAudioContext.audioBufferParameters.samplesPerUpdateMin = gAudioContext.audioBufferParameters.samplesPerUpdate - 8;
|
||||
((gAudioContext.audioBufferParameters.numSamplesPerFrameTarget + 0x10) / 0xD0) + 1;
|
||||
gAudioContext.audioBufferParameters.numSamplesPerUpdate =
|
||||
(gAudioContext.audioBufferParameters.numSamplesPerFrameTarget /
|
||||
gAudioContext.audioBufferParameters.updatesPerFrame) &
|
||||
~7;
|
||||
gAudioContext.audioBufferParameters.numSamplesPerUpdateMax =
|
||||
gAudioContext.audioBufferParameters.numSamplesPerUpdate + 8;
|
||||
gAudioContext.audioBufferParameters.numSamplesPerUpdateMin =
|
||||
gAudioContext.audioBufferParameters.numSamplesPerUpdate - 8;
|
||||
gAudioContext.audioBufferParameters.resampleRate = 32000.0f / (s32)gAudioContext.audioBufferParameters.samplingFreq;
|
||||
gAudioContext.audioBufferParameters.updatesPerFrameInvScaled =
|
||||
(1.0f / 256.0f) / gAudioContext.audioBufferParameters.updatesPerFrame;
|
||||
@@ -984,13 +987,13 @@ void AudioHeap_Init(void) {
|
||||
gAudioContext.unk_2870 /= gAudioContext.tempoInternalToExternal;
|
||||
|
||||
gAudioContext.audioBufferParameters.specUnk4 = spec->unk_04;
|
||||
gAudioContext.audioBufferParameters.samplesPerFrameTarget *= gAudioContext.audioBufferParameters.specUnk4;
|
||||
gAudioContext.audioBufferParameters.maxAiBufNumSamples *= gAudioContext.audioBufferParameters.specUnk4;
|
||||
gAudioContext.audioBufferParameters.minAiBufNumSamples *= gAudioContext.audioBufferParameters.specUnk4;
|
||||
gAudioContext.audioBufferParameters.numSamplesPerFrameTarget *= gAudioContext.audioBufferParameters.specUnk4;
|
||||
gAudioContext.audioBufferParameters.numSamplesPerFrameMax *= gAudioContext.audioBufferParameters.specUnk4;
|
||||
gAudioContext.audioBufferParameters.numSamplesPerFrameMin *= gAudioContext.audioBufferParameters.specUnk4;
|
||||
gAudioContext.audioBufferParameters.updatesPerFrame *= gAudioContext.audioBufferParameters.specUnk4;
|
||||
|
||||
if (gAudioContext.audioBufferParameters.specUnk4 >= 2) {
|
||||
gAudioContext.audioBufferParameters.maxAiBufNumSamples -= 0x10;
|
||||
gAudioContext.audioBufferParameters.numSamplesPerFrameMax -= 0x10;
|
||||
}
|
||||
|
||||
// Determine the maximum allowable number of audio command list entries for the rsp microcode
|
||||
@@ -1037,13 +1040,13 @@ void AudioHeap_Init(void) {
|
||||
gAudioContext.notes = AudioHeap_AllocZeroed(&gAudioContext.miscPool, gAudioContext.numNotes * sizeof(Note));
|
||||
AudioPlayback_NoteInitAll();
|
||||
AudioPlayback_InitNoteFreeList();
|
||||
gAudioContext.noteSubsEu =
|
||||
gAudioContext.sampleStateList =
|
||||
AudioHeap_AllocZeroed(&gAudioContext.miscPool, gAudioContext.audioBufferParameters.updatesPerFrame *
|
||||
gAudioContext.numNotes * sizeof(NoteSubEu));
|
||||
gAudioContext.numNotes * sizeof(NoteSampleState));
|
||||
|
||||
// Initialize audio binary interface command list buffer
|
||||
for (j = 0; j < ARRAY_COUNT(gAudioContext.abiCmdBufs); j++) {
|
||||
gAudioContext.abiCmdBufs[j] =
|
||||
for (i = 0; i < ARRAY_COUNT(gAudioContext.abiCmdBufs); i++) {
|
||||
gAudioContext.abiCmdBufs[i] =
|
||||
AudioHeap_AllocDmaMemoryZeroed(&gAudioContext.miscPool, gAudioContext.maxAudioCmds * sizeof(Acmd));
|
||||
}
|
||||
|
||||
@@ -1052,20 +1055,20 @@ void AudioHeap_Init(void) {
|
||||
AudioHeap_InitAdsrDecayTable();
|
||||
|
||||
// Initialize reverbs
|
||||
for (i = 0; i < ARRAY_COUNT(gAudioContext.synthesisReverbs); i++) {
|
||||
gAudioContext.synthesisReverbs[i].useReverb = 0;
|
||||
for (reverbIndex = 0; reverbIndex < ARRAY_COUNT(gAudioContext.synthesisReverbs); reverbIndex++) {
|
||||
gAudioContext.synthesisReverbs[reverbIndex].useReverb = 0;
|
||||
}
|
||||
|
||||
gAudioContext.numSynthesisReverbs = spec->numReverbs;
|
||||
for (i = 0; i < gAudioContext.numSynthesisReverbs; i++) {
|
||||
AudioHeap_InitReverb(i, &spec->reverbSettings[i], 1);
|
||||
for (reverbIndex = 0; reverbIndex < gAudioContext.numSynthesisReverbs; reverbIndex++) {
|
||||
AudioHeap_InitReverb(reverbIndex, &spec->reverbSettings[reverbIndex], true);
|
||||
}
|
||||
|
||||
// Initialize sequence players
|
||||
AudioSeq_InitSequencePlayers();
|
||||
for (j = 0; j < gAudioContext.audioBufferParameters.numSequencePlayers; j++) {
|
||||
AudioSeq_InitSequencePlayerChannels(j);
|
||||
AudioSeq_ResetSequencePlayer(&gAudioContext.seqPlayers[j]);
|
||||
for (i = 0; i < gAudioContext.audioBufferParameters.numSequencePlayers; i++) {
|
||||
AudioSeq_InitSequencePlayerChannels(i);
|
||||
AudioSeq_ResetSequencePlayer(&gAudioContext.seqPlayers[i]);
|
||||
}
|
||||
|
||||
// Initialize two additional caches on the audio heap to store individual audio samples
|
||||
@@ -1529,149 +1532,165 @@ void AudioHeap_DiscardSampleBanks(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void AudioHeap_SetReverbData(s32 reverbIndex, u32 dataType, s32 data, s32 flags) {
|
||||
s32 windowSize;
|
||||
void AudioHeap_SetReverbData(s32 reverbIndex, u32 dataType, s32 data, s32 isFirstInit) {
|
||||
s32 delayNumSamples;
|
||||
SynthesisReverb* reverb = &gAudioContext.synthesisReverbs[reverbIndex];
|
||||
|
||||
switch (dataType) {
|
||||
case 0:
|
||||
AudioHeap_InitReverb(reverbIndex, (ReverbSettings*)data, 0);
|
||||
case REVERB_DATA_TYPE_SETTINGS:
|
||||
AudioHeap_InitReverb(reverbIndex, (ReverbSettings*)data, false);
|
||||
break;
|
||||
case 1:
|
||||
|
||||
case REVERB_DATA_TYPE_DELAY:
|
||||
if (data < 4) {
|
||||
data = 4;
|
||||
}
|
||||
|
||||
windowSize = data * 64;
|
||||
if (windowSize < 0x100) {
|
||||
windowSize = 0x100;
|
||||
delayNumSamples = data * 64;
|
||||
if (delayNumSamples < (16 * SAMPLES_PER_FRAME)) {
|
||||
delayNumSamples = 16 * SAMPLES_PER_FRAME;
|
||||
}
|
||||
|
||||
windowSize /= reverb->downsampleRate;
|
||||
delayNumSamples /= reverb->downsampleRate;
|
||||
|
||||
if (flags == 0) {
|
||||
if (reverb->unk_1E >= (data / reverb->downsampleRate)) {
|
||||
if ((reverb->nextRingBufPos >= windowSize) || (reverb->unk_24 >= windowSize)) {
|
||||
reverb->nextRingBufPos = 0;
|
||||
reverb->unk_24 = 0;
|
||||
}
|
||||
} else {
|
||||
if (!isFirstInit) {
|
||||
if (reverb->delayNumSamplesAfterDownsampling < (data / reverb->downsampleRate)) {
|
||||
break;
|
||||
}
|
||||
if ((reverb->nextReverbBufPos >= delayNumSamples) || (reverb->delayNumSamplesUnk >= delayNumSamples)) {
|
||||
reverb->nextReverbBufPos = 0;
|
||||
reverb->delayNumSamplesUnk = 0;
|
||||
}
|
||||
}
|
||||
|
||||
reverb->windowSize = windowSize;
|
||||
reverb->delayNumSamples = delayNumSamples;
|
||||
|
||||
if ((reverb->downsampleRate != 1) || reverb->unk_18) {
|
||||
reverb->unk_0E = 0x8000 / reverb->downsampleRate;
|
||||
if (reverb->unk_30 == NULL) {
|
||||
reverb->unk_30 = AudioHeap_AllocZeroed(&gAudioContext.miscPool, 0x20);
|
||||
reverb->unk_34 = AudioHeap_AllocZeroed(&gAudioContext.miscPool, 0x20);
|
||||
reverb->unk_38 = AudioHeap_AllocZeroed(&gAudioContext.miscPool, 0x20);
|
||||
reverb->unk_3C = AudioHeap_AllocZeroed(&gAudioContext.miscPool, 0x20);
|
||||
if (reverb->unk_3C == NULL) {
|
||||
if ((reverb->downsampleRate != 1) || reverb->resampleEffectOn) {
|
||||
reverb->downsamplePitch = 0x8000 / reverb->downsampleRate;
|
||||
if (reverb->leftLoadResampleBuf == NULL) {
|
||||
reverb->leftLoadResampleBuf =
|
||||
AudioHeap_AllocZeroed(&gAudioContext.miscPool, sizeof(RESAMPLE_STATE));
|
||||
reverb->rightLoadResampleBuf =
|
||||
AudioHeap_AllocZeroed(&gAudioContext.miscPool, sizeof(RESAMPLE_STATE));
|
||||
reverb->leftSaveResampleBuf =
|
||||
AudioHeap_AllocZeroed(&gAudioContext.miscPool, sizeof(RESAMPLE_STATE));
|
||||
reverb->rightSaveResampleBuf =
|
||||
AudioHeap_AllocZeroed(&gAudioContext.miscPool, sizeof(RESAMPLE_STATE));
|
||||
if (reverb->rightSaveResampleBuf == NULL) {
|
||||
reverb->downsampleRate = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
gAudioContext.synthesisReverbs[reverbIndex].unk_0C = data;
|
||||
|
||||
case REVERB_DATA_TYPE_DECAY:
|
||||
gAudioContext.synthesisReverbs[reverbIndex].decayRatio = data;
|
||||
break;
|
||||
case 3:
|
||||
gAudioContext.synthesisReverbs[reverbIndex].unk_16 = data;
|
||||
|
||||
case REVERB_DATA_TYPE_SUB_VOLUME:
|
||||
gAudioContext.synthesisReverbs[reverbIndex].subVolume = data;
|
||||
break;
|
||||
case 4:
|
||||
gAudioContext.synthesisReverbs[reverbIndex].unk_0A = data;
|
||||
|
||||
case REVERB_DATA_TYPE_VOLUME:
|
||||
gAudioContext.synthesisReverbs[reverbIndex].volume = data;
|
||||
break;
|
||||
case 5:
|
||||
|
||||
case REVERB_DATA_TYPE_LEAK_RIGHT:
|
||||
gAudioContext.synthesisReverbs[reverbIndex].leakRtl = data;
|
||||
break;
|
||||
case 6:
|
||||
|
||||
case REVERB_DATA_TYPE_LEAK_LEFT:
|
||||
gAudioContext.synthesisReverbs[reverbIndex].leakLtr = data;
|
||||
break;
|
||||
case 7:
|
||||
|
||||
case REVERB_DATA_TYPE_FILTER_LEFT:
|
||||
if (data != 0) {
|
||||
if ((flags != 0) || (reverb->unk_278 == 0)) {
|
||||
reverb->filterLeftState = AudioHeap_AllocDmaMemoryZeroed(&gAudioContext.miscPool, 0x40);
|
||||
reverb->unk_278 = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, 0x10);
|
||||
if (isFirstInit || (reverb->filterLeftInit == NULL)) {
|
||||
reverb->filterLeftState = AudioHeap_AllocDmaMemoryZeroed(&gAudioContext.miscPool,
|
||||
2 * (FILTER_BUF_PART1 + FILTER_BUF_PART2));
|
||||
reverb->filterLeftInit = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, FILTER_SIZE);
|
||||
}
|
||||
|
||||
reverb->filterLeft = reverb->unk_278;
|
||||
if (reverb->filterLeft != 0) {
|
||||
reverb->filterLeft = reverb->filterLeftInit;
|
||||
if (reverb->filterLeft != NULL) {
|
||||
AudioHeap_LoadLowPassFilter(reverb->filterLeft, data);
|
||||
}
|
||||
} else {
|
||||
reverb->filterLeft = 0;
|
||||
reverb->filterLeft = NULL;
|
||||
|
||||
if (flags != 0) {
|
||||
reverb->unk_278 = 0;
|
||||
if (isFirstInit) {
|
||||
reverb->filterLeftInit = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case 8:
|
||||
|
||||
case REVERB_DATA_TYPE_FILTER_RIGHT:
|
||||
if (data != 0) {
|
||||
if ((flags != 0) || (reverb->unk_27C == 0)) {
|
||||
reverb->filterRightState = AudioHeap_AllocDmaMemoryZeroed(&gAudioContext.miscPool, 0x40);
|
||||
reverb->unk_27C = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, 0x10);
|
||||
if (isFirstInit || (reverb->filterRightInit == NULL)) {
|
||||
reverb->filterRightState = AudioHeap_AllocDmaMemoryZeroed(
|
||||
&gAudioContext.miscPool, 2 * (FILTER_BUF_PART1 + FILTER_BUF_PART2));
|
||||
reverb->filterRightInit = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, FILTER_SIZE);
|
||||
}
|
||||
reverb->filterRight = reverb->unk_27C;
|
||||
if (reverb->unk_27C != 0) {
|
||||
AudioHeap_LoadLowPassFilter(reverb->unk_27C, data);
|
||||
reverb->filterRight = reverb->filterRightInit;
|
||||
if (reverb->filterRight != NULL) {
|
||||
AudioHeap_LoadLowPassFilter(reverb->filterRight, data);
|
||||
}
|
||||
} else {
|
||||
reverb->filterRight = 0;
|
||||
if (flags != 0) {
|
||||
reverb->unk_27C = 0;
|
||||
reverb->filterRight = NULL;
|
||||
if (isFirstInit) {
|
||||
reverb->filterRightInit = NULL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
reverb->unk_19 = data;
|
||||
|
||||
case REVERB_DATA_TYPE_9:
|
||||
reverb->resampleEffectExtraSamples = data;
|
||||
if (data == 0) {
|
||||
reverb->unk_18 = false;
|
||||
reverb->resampleEffectOn = false;
|
||||
} else {
|
||||
reverb->unk_18 = true;
|
||||
reverb->resampleEffectOn = true;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void AudioHeap_InitReverb(s32 reverbIndex, ReverbSettings* settings, s32 flags) {
|
||||
void AudioHeap_InitReverb(s32 reverbIndex, ReverbSettings* settings, s32 isFirstInit) {
|
||||
SynthesisReverb* reverb = &gAudioContext.synthesisReverbs[reverbIndex];
|
||||
|
||||
if (flags != 0) {
|
||||
reverb->unk_1E = settings->windowSize / settings->downsampleRate;
|
||||
reverb->unk_30 = 0;
|
||||
} else if (reverb->unk_1E < (settings->windowSize / settings->downsampleRate)) {
|
||||
if (isFirstInit) {
|
||||
reverb->delayNumSamplesAfterDownsampling = settings->delayNumSamples / settings->downsampleRate;
|
||||
reverb->leftLoadResampleBuf = NULL;
|
||||
} else if (reverb->delayNumSamplesAfterDownsampling < (settings->delayNumSamples / settings->downsampleRate)) {
|
||||
return;
|
||||
}
|
||||
|
||||
reverb->downsampleRate = settings->downsampleRate;
|
||||
reverb->unk_18 = false;
|
||||
reverb->unk_19 = 0;
|
||||
reverb->unk_1A = 0;
|
||||
reverb->unk_1C = 0;
|
||||
AudioHeap_SetReverbData(reverbIndex, 1, settings->windowSize, flags);
|
||||
reverb->unk_0C = settings->unk_4;
|
||||
reverb->unk_0A = settings->unk_A;
|
||||
reverb->unk_14 = settings->unk_6 << 6;
|
||||
reverb->unk_16 = settings->unk_8;
|
||||
reverb->resampleEffectOn = false;
|
||||
reverb->resampleEffectExtraSamples = 0;
|
||||
reverb->resampleEffectLoadUnk = 0;
|
||||
reverb->resampleEffectSaveUnk = 0;
|
||||
AudioHeap_SetReverbData(reverbIndex, REVERB_DATA_TYPE_DELAY, settings->delayNumSamples, isFirstInit);
|
||||
reverb->decayRatio = settings->decayRatio;
|
||||
reverb->volume = settings->volume;
|
||||
reverb->subDelay = settings->subDelay * 64;
|
||||
reverb->subVolume = settings->subVolume;
|
||||
reverb->leakRtl = settings->leakRtl;
|
||||
reverb->leakLtr = settings->leakLtr;
|
||||
reverb->unk_05 = settings->unk_10;
|
||||
reverb->unk_08 = settings->unk_12;
|
||||
reverb->useReverb = 8;
|
||||
reverb->mixReverbIndex = settings->mixReverbIndex;
|
||||
reverb->mixReverbStrength = settings->mixReverbStrength;
|
||||
reverb->useReverb = 8; // used as a boolean
|
||||
|
||||
if (flags != 0) {
|
||||
reverb->leftRingBuf = AudioHeap_AllocZeroedAttemptExternal(&gAudioContext.miscPool, reverb->windowSize * 2);
|
||||
reverb->rightRingBuf = AudioHeap_AllocZeroedAttemptExternal(&gAudioContext.miscPool, reverb->windowSize * 2);
|
||||
if (isFirstInit) {
|
||||
reverb->leftReverbBuf =
|
||||
AudioHeap_AllocZeroedAttemptExternal(&gAudioContext.miscPool, reverb->delayNumSamples * 2);
|
||||
reverb->rightReverbBuf =
|
||||
AudioHeap_AllocZeroedAttemptExternal(&gAudioContext.miscPool, reverb->delayNumSamples * 2);
|
||||
reverb->resampleFlags = 1;
|
||||
reverb->nextRingBufPos = 0;
|
||||
reverb->unk_24 = 0;
|
||||
reverb->nextReverbBufPos = 0;
|
||||
reverb->delayNumSamplesUnk = 0;
|
||||
reverb->curFrame = 0;
|
||||
reverb->framesToIgnore = 2;
|
||||
}
|
||||
@@ -1681,12 +1700,13 @@ void AudioHeap_InitReverb(s32 reverbIndex, ReverbSettings* settings, s32 flags)
|
||||
reverb->tunedSample.tuning = 1.0f;
|
||||
reverb->sample.codec = CODEC_REVERB;
|
||||
reverb->sample.medium = MEDIUM_RAM;
|
||||
reverb->sample.size = reverb->windowSize * 2;
|
||||
reverb->sample.sampleAddr = (u8*)reverb->leftRingBuf;
|
||||
reverb->sample.size = reverb->delayNumSamples * SAMPLE_SIZE;
|
||||
reverb->sample.sampleAddr = (u8*)reverb->leftReverbBuf;
|
||||
reverb->loop.start = 0;
|
||||
reverb->loop.count = 1;
|
||||
reverb->loop.end = reverb->windowSize;
|
||||
reverb->loop.loopEnd = reverb->delayNumSamples;
|
||||
|
||||
AudioHeap_SetReverbData(reverbIndex, 7, settings->lowPassFilterCutoffLeft, flags);
|
||||
AudioHeap_SetReverbData(reverbIndex, 8, settings->lowPassFilterCutoffRight, flags);
|
||||
AudioHeap_SetReverbData(reverbIndex, REVERB_DATA_TYPE_FILTER_LEFT, settings->lowPassFilterCutoffLeft, isFirstInit);
|
||||
AudioHeap_SetReverbData(reverbIndex, REVERB_DATA_TYPE_FILTER_RIGHT, settings->lowPassFilterCutoffRight,
|
||||
isFirstInit);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,184 @@
|
||||
#include "global.h"
|
||||
|
||||
const s16 gAudioTatumInit[] = {
|
||||
0x1C00, // unused
|
||||
0x30, // gTatumsPerBeat
|
||||
0x1C00, // unused
|
||||
TATUMS_PER_BEAT, // gTatumsPerBeat
|
||||
};
|
||||
|
||||
// TODO: Extract from table?
|
||||
#define NUM_SOUNDFONTS 41
|
||||
#define SFX_SEQ_SIZE 0xC6A0
|
||||
#define AMBIENCE_SEQ_SIZE 0xFC0
|
||||
#define SOUNDFONT_0_SIZE 0x81C0
|
||||
#define SOUNDFONT_1_SIZE 0x36D0
|
||||
#define SOUNDFONT_2_SIZE 0xCE0
|
||||
|
||||
// Sizes of everything on the init pool
|
||||
#define AI_BUFFERS_SIZE (AIBUF_SIZE * ARRAY_COUNT(gAudioContext.aiBuffers))
|
||||
#define SOUNDFONT_LIST_SIZE (NUM_SOUNDFONTS * sizeof(SoundFont))
|
||||
|
||||
// 0x19BD0
|
||||
#define PERMANENT_POOL_SIZE \
|
||||
(SFX_SEQ_SIZE + AMBIENCE_SEQ_SIZE + SOUNDFONT_0_SIZE + SOUNDFONT_1_SIZE + SOUNDFONT_2_SIZE + 0x430)
|
||||
|
||||
const AudioHeapInitSizes gAudioHeapInitSizes = {
|
||||
0x137F00, // heapSize
|
||||
0x1C480, // initPoolSize
|
||||
0x1A000, // permanentPoolSize
|
||||
ALIGN16(sizeof(gAudioHeap) - 0x100), // audio heap size
|
||||
ALIGN16(PERMANENT_POOL_SIZE + AI_BUFFERS_SIZE + SOUNDFONT_LIST_SIZE + 0x40), // init pool size
|
||||
ALIGN16(PERMANENT_POOL_SIZE), // permanent pool size
|
||||
};
|
||||
|
||||
#define REVERB_INDEX_0_SETTINGS \
|
||||
{ 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x3000, 0, 0 }
|
||||
|
||||
ReverbSettings reverbSettings0[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x20, 0x0800, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 0, 0 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettings1[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x30, 0x1800, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 11, 11 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettings2[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x38, 0x2800, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 7, 7 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettings3[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x30, 0x6800, 0, 0, 0x7FFF, 0x1400, 0x1400, REVERB_INDEX_NONE, 0x3000, 6, 6 },
|
||||
{ 2, 0x50, 0x6000, 0, 0, 0x7FFF, 0xD000, 0x3000, REVERB_INDEX_NONE, 0x3000, 0, 0 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettings4[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x40, 0x5000, 0, 0, 0x7FFF, 0x1800, 0x1800, REVERB_INDEX_NONE, 0x3000, 7, 7 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettings5[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x40, 0x5C00, 0, 0, 0x7FFF, 0x2000, 0x2000, REVERB_INDEX_NONE, 0x3000, 4, 4 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettings6[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x30, 0x6000, 0, 0, 0x7FFF, 0x1000, 0x1000, REVERB_INDEX_NONE, 0x3000, 10, 10 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettings7[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x30, 0x6800, 0, 0, 0x7FFF, 0x1400, 0x1400, REVERB_INDEX_NONE, 0x3000, 6, 6 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettings8[2] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x50, 0x5000, 0, 0, 0x7FFF, 0xD000, 0x3000, REVERB_INDEX_NONE, 0x3000, 0, 0 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettings9[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x20, 0x0000, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 0, 0 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettingsA[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x30, 0x1800, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 11, 11 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettingsB[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettingsC[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x40, 0x5000, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x3000, 0, 0 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettingsD[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x30, 0x6800, 0, 0, 0x7FFF, 0x1400, 0x1400, REVERB_INDEX_NONE, 0x3000, 6, 6 },
|
||||
{ 2, 0x50, 0x6000, 0, 0, 0x7FFF, 0xD000, 0x3000, REVERB_INDEX_NONE, 0x3000, 0, 0 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettingsE[3] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x30, 0x1800, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 11, 11 },
|
||||
{ 1, 0x40, 0x5000, 0, 0, 0x7FFF, 0x1800, 0x1800, REVERB_INDEX_NONE, 0x3000, 7, 7 },
|
||||
};
|
||||
|
||||
ReverbSettings reverbSettingsF[2] = {
|
||||
REVERB_INDEX_0_SETTINGS,
|
||||
{ 1, 0x50, 0x1800, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 11, 11 },
|
||||
};
|
||||
|
||||
ReverbSettings* gReverbSettingsTable[] = {
|
||||
reverbSettings0, reverbSettings1, reverbSettings2, reverbSettings4, reverbSettings5,
|
||||
reverbSettings6, reverbSettings7, reverbSettings8, reverbSettings9, reverbSettings3,
|
||||
};
|
||||
|
||||
AudioSpec gAudioSpecs[21] = {
|
||||
/* 0x0 */
|
||||
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x1 */
|
||||
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x2 */
|
||||
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x3 */
|
||||
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x4 */
|
||||
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x5 */
|
||||
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x6 */
|
||||
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x7 */
|
||||
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x8 */
|
||||
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x9 */
|
||||
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0xA */
|
||||
{ 32000, 1, 28, 3, 0, 0, 2, reverbSettingsA, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x2800, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0xB */
|
||||
{ 32000, 1, 28, 3, 0, 0, 2, reverbSettingsA, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0xC */
|
||||
{ 32000, 1, 28, 5, 0, 0, 2, reverbSettingsA, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xCC800 },
|
||||
/* 0xD */
|
||||
{ 32000, 1, 24, 5, 0, 0, 3, reverbSettingsD, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0xE */
|
||||
{ 32000, 1, 24, 5, 0, 0, 3, reverbSettingsE, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0xF */
|
||||
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4000, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x10 */
|
||||
{ 32000, 1, 22, 5, 0, 0, 2, reverbSettings0, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x11 */
|
||||
{ 32000, 1, 22, 5, 0, 0, 2, reverbSettings8, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x12 */
|
||||
{ 32000, 1, 16, 5, 0, 0, 2, reverbSettings0, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x13 */
|
||||
{ 22050, 1, 24, 5, 0, 0, 2, reverbSettings0, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
|
||||
0xDC800 },
|
||||
/* 0x14 */
|
||||
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettings2, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x3600, 0x2600, 0, 0,
|
||||
0xDC800 },
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ void* AudioLoad_SyncLoad(s32 tableType, u32 id, s32* didAllocate);
|
||||
u32 AudioLoad_GetRealTableIndex(s32 tableType, u32 id);
|
||||
void* AudioLoad_SearchCaches(s32 tableType, s32 id);
|
||||
AudioTable* AudioLoad_GetLoadTable(s32 tableType);
|
||||
void AudioLoad_SyncDma(uintptr_t devAddr, u8* addr, size_t size, s32 medium);
|
||||
void AudioLoad_SyncDma(uintptr_t devAddr, u8* ramAddr, size_t size, s32 medium);
|
||||
void AudioLoad_SyncDmaUnkMedium(uintptr_t devAddr, u8* addr, size_t size, s32 unkMediumParam);
|
||||
s32 AudioLoad_Dma(OSIoMesg* mesg, u32 priority, s32 direction, uintptr_t devAddr, void* ramAddr, size_t size,
|
||||
OSMesgQueue* reqQueue, s32 medium, const char* dmaFuncType);
|
||||
@@ -1218,9 +1218,9 @@ void AudioLoad_Init(void* heap, size_t heapSize) {
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
D_80208E68 = NULL;
|
||||
D_80208E70 = NULL;
|
||||
D_80208E74 = NULL;
|
||||
gCustomAudioUpdateFunction = NULL;
|
||||
gCustomAudioReverbFunction = NULL;
|
||||
gCustomAudioSynthFunction = NULL;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gAudioContext.unk_29A8); i++) {
|
||||
gAudioContext.unk_29A8[i] = NULL;
|
||||
|
||||
+103
-99
@@ -1,10 +1,10 @@
|
||||
#include "global.h"
|
||||
|
||||
void AudioPlayback_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput);
|
||||
void AudioPlayback_NoteSetResamplingRate(NoteSampleState* sampleState, f32 resamplingRateInput);
|
||||
void AudioPlayback_AudioListPushFront(AudioListItem* list, AudioListItem* item);
|
||||
void AudioPlayback_NoteInitForLayer(Note* note, SequenceLayer* layer);
|
||||
|
||||
void AudioPlayback_InitNoteSub(Note* note, NoteSubEu* noteSubEu, NoteSubAttributes* subAttrs) {
|
||||
void AudioPlayback_InitSampleState(Note* note, NoteSampleState* sampleState, NoteSubAttributes* subAttrs) {
|
||||
f32 volLeft;
|
||||
f32 volRight;
|
||||
s32 halfPanIndex;
|
||||
@@ -13,45 +13,45 @@ void AudioPlayback_InitNoteSub(Note* note, NoteSubEu* noteSubEu, NoteSubAttribut
|
||||
u8 strongRight;
|
||||
f32 vel;
|
||||
u8 pan;
|
||||
u8 reverbVol;
|
||||
u8 targetReverbVol;
|
||||
StereoData stereoData;
|
||||
s32 stereoHeadsetEffects = note->playbackState.stereoHeadsetEffects;
|
||||
|
||||
vel = subAttrs->velocity;
|
||||
pan = subAttrs->pan;
|
||||
reverbVol = subAttrs->reverbVol;
|
||||
stereoData = subAttrs->stereo.s;
|
||||
targetReverbVol = subAttrs->targetReverbVol;
|
||||
stereoData = subAttrs->stereoData;
|
||||
|
||||
noteSubEu->bitField0 = note->noteSubEu.bitField0;
|
||||
noteSubEu->bitField1 = note->noteSubEu.bitField1;
|
||||
noteSubEu->waveSampleAddr = note->noteSubEu.waveSampleAddr;
|
||||
noteSubEu->harmonicIndexCurAndPrev = note->noteSubEu.harmonicIndexCurAndPrev;
|
||||
sampleState->bitField0 = note->sampleState.bitField0;
|
||||
sampleState->bitField1 = note->sampleState.bitField1;
|
||||
sampleState->waveSampleAddr = note->sampleState.waveSampleAddr;
|
||||
sampleState->harmonicIndexCurAndPrev = note->sampleState.harmonicIndexCurAndPrev;
|
||||
|
||||
AudioPlayback_NoteSetResamplingRate(noteSubEu, subAttrs->frequency);
|
||||
AudioPlayback_NoteSetResamplingRate(sampleState, subAttrs->frequency);
|
||||
|
||||
pan &= 0x7F;
|
||||
|
||||
noteSubEu->bitField0.stereoStrongRight = false;
|
||||
noteSubEu->bitField0.stereoStrongLeft = false;
|
||||
noteSubEu->bitField0.stereoHeadsetEffects = stereoData.stereoHeadsetEffects;
|
||||
noteSubEu->bitField0.usesHeadsetPanEffects = stereoData.usesHeadsetPanEffects;
|
||||
sampleState->bitField0.strongRight = false;
|
||||
sampleState->bitField0.strongLeft = false;
|
||||
sampleState->bitField0.strongReverbRight = stereoData.strongReverbRight;
|
||||
sampleState->bitField0.strongReverbLeft = stereoData.strongReverbLeft;
|
||||
if (stereoHeadsetEffects && (gAudioContext.soundMode == SOUNDMODE_HEADSET)) {
|
||||
halfPanIndex = pan >> 1;
|
||||
if (halfPanIndex > 0x3F) {
|
||||
halfPanIndex = 0x3F;
|
||||
}
|
||||
|
||||
noteSubEu->headsetPanLeft = gHeadsetPanQuantization[halfPanIndex];
|
||||
noteSubEu->headsetPanRight = gHeadsetPanQuantization[0x3F - halfPanIndex];
|
||||
noteSubEu->bitField1.usesHeadsetPanEffects2 = true;
|
||||
sampleState->haasEffectRightDelaySize = gHaasEffectDelaySize[halfPanIndex];
|
||||
sampleState->haasEffectLeftDelaySize = gHaasEffectDelaySize[0x3F - halfPanIndex];
|
||||
sampleState->bitField1.useHaasEffect = true;
|
||||
|
||||
volLeft = gHeadsetPanVolume[pan];
|
||||
volRight = gHeadsetPanVolume[0x7F - pan];
|
||||
} else if (stereoHeadsetEffects && (gAudioContext.soundMode == SOUNDMODE_STEREO)) {
|
||||
strongLeft = strongRight = false;
|
||||
noteSubEu->headsetPanRight = 0;
|
||||
noteSubEu->headsetPanLeft = 0;
|
||||
noteSubEu->bitField1.usesHeadsetPanEffects2 = false;
|
||||
sampleState->haasEffectLeftDelaySize = 0;
|
||||
sampleState->haasEffectRightDelaySize = 0;
|
||||
sampleState->bitField1.useHaasEffect = false;
|
||||
|
||||
volLeft = gStereoPanVolume[pan];
|
||||
volRight = gStereoPanVolume[0x7F - pan];
|
||||
@@ -62,37 +62,37 @@ void AudioPlayback_InitNoteSub(Note* note, NoteSubEu* noteSubEu, NoteSubAttribut
|
||||
}
|
||||
|
||||
// case 0:
|
||||
noteSubEu->bitField0.stereoStrongRight = strongRight;
|
||||
noteSubEu->bitField0.stereoStrongLeft = strongLeft;
|
||||
sampleState->bitField0.strongRight = strongRight;
|
||||
sampleState->bitField0.strongLeft = strongLeft;
|
||||
|
||||
switch (stereoData.bit2) {
|
||||
switch (stereoData.type) {
|
||||
case 0:
|
||||
break;
|
||||
|
||||
case 1:
|
||||
noteSubEu->bitField0.stereoStrongRight = stereoData.strongRight;
|
||||
noteSubEu->bitField0.stereoStrongLeft = stereoData.strongLeft;
|
||||
sampleState->bitField0.strongRight = stereoData.strongRight;
|
||||
sampleState->bitField0.strongLeft = stereoData.strongLeft;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
noteSubEu->bitField0.stereoStrongRight = stereoData.strongRight | strongRight;
|
||||
noteSubEu->bitField0.stereoStrongLeft = stereoData.strongLeft | strongLeft;
|
||||
sampleState->bitField0.strongRight = stereoData.strongRight | strongRight;
|
||||
sampleState->bitField0.strongLeft = stereoData.strongLeft | strongLeft;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
noteSubEu->bitField0.stereoStrongRight = stereoData.strongRight ^ strongRight;
|
||||
noteSubEu->bitField0.stereoStrongLeft = stereoData.strongLeft ^ strongLeft;
|
||||
sampleState->bitField0.strongRight = stereoData.strongRight ^ strongRight;
|
||||
sampleState->bitField0.strongLeft = stereoData.strongLeft ^ strongLeft;
|
||||
break;
|
||||
}
|
||||
|
||||
} else if (gAudioContext.soundMode == SOUNDMODE_MONO) {
|
||||
noteSubEu->bitField0.stereoHeadsetEffects = false;
|
||||
noteSubEu->bitField0.usesHeadsetPanEffects = false;
|
||||
sampleState->bitField0.strongReverbRight = false;
|
||||
sampleState->bitField0.strongReverbLeft = false;
|
||||
volLeft = 0.707f; // approx 1/sqrt(2)
|
||||
volRight = 0.707f;
|
||||
} else {
|
||||
noteSubEu->bitField0.stereoStrongRight = stereoData.strongRight;
|
||||
noteSubEu->bitField0.stereoStrongLeft = stereoData.strongLeft;
|
||||
sampleState->bitField0.strongRight = stereoData.strongRight;
|
||||
sampleState->bitField0.strongLeft = stereoData.strongLeft;
|
||||
volLeft = gDefaultPanVolume[pan];
|
||||
volRight = gDefaultPanVolume[0x7F - pan];
|
||||
}
|
||||
@@ -100,33 +100,33 @@ void AudioPlayback_InitNoteSub(Note* note, NoteSubEu* noteSubEu, NoteSubAttribut
|
||||
vel = 0.0f > vel ? 0.0f : vel;
|
||||
vel = 1.0f < vel ? 1.0f : vel;
|
||||
|
||||
noteSubEu->targetVolLeft = (s32)((vel * volLeft) * (0x1000 - 0.001f));
|
||||
noteSubEu->targetVolRight = (s32)((vel * volRight) * (0x1000 - 0.001f));
|
||||
sampleState->targetVolLeft = (s32)((vel * volLeft) * (0x1000 - 0.001f));
|
||||
sampleState->targetVolRight = (s32)((vel * volRight) * (0x1000 - 0.001f));
|
||||
|
||||
noteSubEu->gain = subAttrs->gain;
|
||||
noteSubEu->filter = subAttrs->filter;
|
||||
noteSubEu->unk_07 = subAttrs->unk_14;
|
||||
noteSubEu->unk_0E = subAttrs->unk_16;
|
||||
noteSubEu->reverbVol = reverbVol;
|
||||
noteSubEu->unk_19 = subAttrs->unk_3;
|
||||
sampleState->gain = subAttrs->gain;
|
||||
sampleState->filter = subAttrs->filter;
|
||||
sampleState->combFilterSize = subAttrs->combFilterSize;
|
||||
sampleState->combFilterGain = subAttrs->combFilterGain;
|
||||
sampleState->targetReverbVol = targetReverbVol;
|
||||
sampleState->surroundEffectIndex = subAttrs->surroundEffectIndex;
|
||||
}
|
||||
|
||||
void AudioPlayback_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput) {
|
||||
void AudioPlayback_NoteSetResamplingRate(NoteSampleState* sampleState, f32 resamplingRateInput) {
|
||||
f32 resamplingRate = 0.0f;
|
||||
|
||||
if (resamplingRateInput < 2.0f) {
|
||||
noteSubEu->bitField1.hasTwoParts = false;
|
||||
sampleState->bitField1.hasTwoParts = false;
|
||||
resamplingRate = CLAMP_MAX(resamplingRateInput, 1.99998f);
|
||||
|
||||
} else {
|
||||
noteSubEu->bitField1.hasTwoParts = true;
|
||||
sampleState->bitField1.hasTwoParts = true;
|
||||
if (resamplingRateInput > 3.99996f) {
|
||||
resamplingRate = 1.99998f;
|
||||
} else {
|
||||
resamplingRate = resamplingRateInput * 0.5f;
|
||||
}
|
||||
}
|
||||
noteSubEu->resamplingRateFixedPoint = (s32)(resamplingRate * 32768.0f);
|
||||
sampleState->frequencyFixedPoint = (s32)(resamplingRate * 32768.0f);
|
||||
}
|
||||
|
||||
void AudioPlayback_NoteInit(Note* note) {
|
||||
@@ -140,17 +140,17 @@ void AudioPlayback_NoteInit(Note* note) {
|
||||
|
||||
note->playbackState.status = PLAYBACK_STATUS_0;
|
||||
note->playbackState.adsr.action.s.state = ADSR_STATE_INITIAL;
|
||||
note->noteSubEu = gDefaultNoteSub;
|
||||
note->sampleState = gDefaultSampleState;
|
||||
}
|
||||
|
||||
void AudioPlayback_NoteDisable(Note* note) {
|
||||
if (note->noteSubEu.bitField0.needsInit == true) {
|
||||
note->noteSubEu.bitField0.needsInit = false;
|
||||
if (note->sampleState.bitField0.needsInit == true) {
|
||||
note->sampleState.bitField0.needsInit = false;
|
||||
}
|
||||
note->playbackState.priority = 0;
|
||||
note->noteSubEu.bitField0.enabled = false;
|
||||
note->sampleState.bitField0.enabled = false;
|
||||
note->playbackState.status = PLAYBACK_STATUS_0;
|
||||
note->noteSubEu.bitField0.finished = false;
|
||||
note->sampleState.bitField0.finished = false;
|
||||
note->playbackState.parentLayer = NO_LAYER;
|
||||
note->playbackState.prevParentLayer = NO_LAYER;
|
||||
note->playbackState.adsr.action.s.state = ADSR_STATE_DISABLED;
|
||||
@@ -161,8 +161,8 @@ void AudioPlayback_ProcessNotes(void) {
|
||||
s32 pad;
|
||||
s32 playbackStatus;
|
||||
NoteAttributes* attrs;
|
||||
NoteSubEu* noteSubEu2;
|
||||
NoteSubEu* noteSubEu;
|
||||
NoteSampleState* sampleState;
|
||||
NoteSampleState* noteSampleState;
|
||||
Note* note;
|
||||
NotePlaybackState* playbackState;
|
||||
NoteSubAttributes subAttrs;
|
||||
@@ -172,7 +172,7 @@ void AudioPlayback_ProcessNotes(void) {
|
||||
|
||||
for (i = 0; i < gAudioContext.numNotes; i++) {
|
||||
note = &gAudioContext.notes[i];
|
||||
noteSubEu2 = &gAudioContext.noteSubsEu[gAudioContext.noteSubEuOffset + i];
|
||||
sampleState = &gAudioContext.sampleStateList[gAudioContext.sampleStateOffset + i];
|
||||
playbackState = ¬e->playbackState;
|
||||
if (playbackState->parentLayer != NO_LAYER) {
|
||||
if ((u32)playbackState->parentLayer < 0x7FFFFFFF) {
|
||||
@@ -211,10 +211,12 @@ void AudioPlayback_ProcessNotes(void) {
|
||||
|
||||
out:
|
||||
if (playbackState->priority != 0) {
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
noteSubEu = ¬e->noteSubEu;
|
||||
if ((playbackState->status >= 1) || noteSubEu->bitField0.finished) {
|
||||
if ((playbackState->adsr.action.s.state == ADSR_STATE_DISABLED) || noteSubEu->bitField0.finished) {
|
||||
noteSampleState = ¬e->sampleState;
|
||||
if ((playbackState->status >= 1) || noteSampleState->bitField0.finished) {
|
||||
if ((playbackState->adsr.action.s.state == ADSR_STATE_DISABLED) ||
|
||||
noteSampleState->bitField0.finished) {
|
||||
if (playbackState->wantedParentLayer != NO_LAYER) {
|
||||
AudioPlayback_NoteDisable(note);
|
||||
if (playbackState->wantedParentLayer->channel != NULL) {
|
||||
@@ -260,14 +262,14 @@ void AudioPlayback_ProcessNotes(void) {
|
||||
subAttrs.frequency = attrs->freqScale;
|
||||
subAttrs.velocity = attrs->velocity;
|
||||
subAttrs.pan = attrs->pan;
|
||||
subAttrs.reverbVol = attrs->reverb;
|
||||
subAttrs.stereo = attrs->stereo;
|
||||
subAttrs.targetReverbVol = attrs->targetReverbVol;
|
||||
subAttrs.stereoData = attrs->stereoData;
|
||||
subAttrs.gain = attrs->gain;
|
||||
subAttrs.filter = attrs->filter;
|
||||
subAttrs.unk_14 = attrs->unk_4;
|
||||
subAttrs.unk_16 = attrs->unk_6;
|
||||
subAttrs.unk_3 = attrs->unk_3;
|
||||
bookOffset = noteSubEu->bitField1.bookOffset;
|
||||
subAttrs.combFilterSize = attrs->combFilterSize;
|
||||
subAttrs.combFilterGain = attrs->combFilterGain;
|
||||
subAttrs.surroundEffectIndex = attrs->surroundEffectIndex;
|
||||
bookOffset = noteSampleState->bitField1.bookOffset;
|
||||
} else {
|
||||
SequenceLayer* layer = playbackState->parentLayer;
|
||||
SequenceChannel* channel = playbackState->parentLayer->channel;
|
||||
@@ -276,34 +278,35 @@ void AudioPlayback_ProcessNotes(void) {
|
||||
subAttrs.velocity = layer->noteVelocity;
|
||||
subAttrs.pan = layer->notePan;
|
||||
|
||||
if (layer->unk_08 == 0x80) {
|
||||
subAttrs.unk_3 = channel->unk_10;
|
||||
if (layer->surroundEffectIndex == 0x80) {
|
||||
subAttrs.surroundEffectIndex = channel->surroundEffectIndex;
|
||||
} else {
|
||||
subAttrs.unk_3 = layer->unk_08;
|
||||
subAttrs.surroundEffectIndex = layer->surroundEffectIndex;
|
||||
}
|
||||
|
||||
if (layer->stereo.s.bit2 == 0) {
|
||||
subAttrs.stereo = channel->stereo;
|
||||
if (layer->stereoData.type == 0) {
|
||||
subAttrs.stereoData = channel->stereoData;
|
||||
} else {
|
||||
subAttrs.stereo = layer->stereo;
|
||||
subAttrs.stereoData = layer->stereoData;
|
||||
}
|
||||
|
||||
if (layer->unk_0A.s.bit_2 == 1) {
|
||||
subAttrs.reverbVol = channel->reverb;
|
||||
subAttrs.targetReverbVol = channel->targetReverbVol;
|
||||
} else {
|
||||
subAttrs.reverbVol = layer->unk_09;
|
||||
subAttrs.targetReverbVol = layer->targetReverbVol;
|
||||
}
|
||||
|
||||
if (layer->unk_0A.s.bit_9 == 1) {
|
||||
subAttrs.gain = channel->gain;
|
||||
} else {
|
||||
subAttrs.gain = 0;
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
}
|
||||
|
||||
subAttrs.filter = channel->filter;
|
||||
subAttrs.unk_14 = channel->unk_0F;
|
||||
subAttrs.unk_16 = channel->unk_20;
|
||||
subAttrs.combFilterSize = channel->combFilterSize;
|
||||
subAttrs.combFilterGain = channel->combFilterGain;
|
||||
bookOffset = channel->bookOffset & 0x7;
|
||||
|
||||
if (channel->seqPlayer->muted && (channel->muteFlags & MUTE_FLAGS_3)) {
|
||||
@@ -315,8 +318,8 @@ void AudioPlayback_ProcessNotes(void) {
|
||||
subAttrs.frequency *= playbackState->vibratoFreqScale * playbackState->portamentoFreqScale;
|
||||
subAttrs.frequency *= gAudioContext.audioBufferParameters.resampleRate;
|
||||
subAttrs.velocity *= scale;
|
||||
AudioPlayback_InitNoteSub(note, noteSubEu2, &subAttrs);
|
||||
noteSubEu->bitField1.bookOffset = bookOffset;
|
||||
AudioPlayback_InitSampleState(note, sampleState, &subAttrs);
|
||||
noteSampleState->bitField1.bookOffset = bookOffset;
|
||||
skip:;
|
||||
}
|
||||
}
|
||||
@@ -500,15 +503,15 @@ void AudioPlayback_SeqLayerDecayRelease(SequenceLayer* layer, s32 target) {
|
||||
channel = layer->channel;
|
||||
|
||||
if (layer->unk_0A.s.bit_2 == 1) {
|
||||
attrs->reverb = channel->reverb;
|
||||
attrs->targetReverbVol = channel->targetReverbVol;
|
||||
} else {
|
||||
attrs->reverb = layer->unk_09;
|
||||
attrs->targetReverbVol = layer->targetReverbVol;
|
||||
}
|
||||
|
||||
if (layer->unk_08 == 0x80) {
|
||||
attrs->unk_3 = channel->unk_10;
|
||||
if (layer->surroundEffectIndex == 0x80) {
|
||||
attrs->surroundEffectIndex = channel->surroundEffectIndex;
|
||||
} else {
|
||||
attrs->unk_3 = layer->unk_08;
|
||||
attrs->surroundEffectIndex = layer->surroundEffectIndex;
|
||||
}
|
||||
|
||||
if (layer->unk_0A.s.bit_9 == 1) {
|
||||
@@ -526,20 +529,20 @@ void AudioPlayback_SeqLayerDecayRelease(SequenceLayer* layer, s32 target) {
|
||||
attrs->filter = attrs->filterBuf;
|
||||
}
|
||||
|
||||
attrs->unk_6 = channel->unk_20;
|
||||
attrs->unk_4 = channel->unk_0F;
|
||||
attrs->combFilterGain = channel->combFilterGain;
|
||||
attrs->combFilterSize = channel->combFilterSize;
|
||||
if (channel->seqPlayer->muted && (channel->muteFlags & MUTE_FLAGS_3)) {
|
||||
note->noteSubEu.bitField0.finished = true;
|
||||
note->sampleState.bitField0.finished = true;
|
||||
}
|
||||
|
||||
if (layer->stereo.asByte == 0) {
|
||||
attrs->stereo = channel->stereo;
|
||||
if (layer->stereoData.asByte == 0) {
|
||||
attrs->stereoData = channel->stereoData;
|
||||
} else {
|
||||
attrs->stereo = layer->stereo;
|
||||
attrs->stereoData = layer->stereoData;
|
||||
}
|
||||
note->playbackState.priority = channel->someOtherPriority;
|
||||
} else {
|
||||
attrs->stereo = layer->stereo;
|
||||
attrs->stereoData = layer->stereoData;
|
||||
note->playbackState.priority = 1;
|
||||
}
|
||||
|
||||
@@ -620,7 +623,7 @@ s32 AudioPlayback_BuildSyntheticWave(Note* note, SequenceLayer* layer, s32 waveI
|
||||
|
||||
// Save the pointer to the synthethic wave
|
||||
// waveId index starts at 128, there are WAVE_SAMPLE_COUNT samples to read from
|
||||
note->noteSubEu.waveSampleAddr = &gWaveSamples[waveId - 128][harmonicIndex * WAVE_SAMPLE_COUNT];
|
||||
note->sampleState.waveSampleAddr = &gWaveSamples[waveId - 128][harmonicIndex * WAVE_SAMPLE_COUNT];
|
||||
|
||||
return harmonicIndex;
|
||||
}
|
||||
@@ -638,7 +641,7 @@ void AudioPlayback_InitSyntheticWave(Note* note, SequenceLayer* layer) {
|
||||
curHarmonicIndex = AudioPlayback_BuildSyntheticWave(note, layer, waveId);
|
||||
|
||||
if (curHarmonicIndex != prevHarmonicIndex) {
|
||||
note->noteSubEu.harmonicIndexCurAndPrev = (curHarmonicIndex << 2) + prevHarmonicIndex;
|
||||
note->sampleState.harmonicIndexCurAndPrev = (curHarmonicIndex << 2) + prevHarmonicIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -808,7 +811,7 @@ void AudioPlayback_NoteInitForLayer(Note* note, SequenceLayer* layer) {
|
||||
s16 instId;
|
||||
SequenceChannel* channel = layer->channel;
|
||||
NotePlaybackState* playbackState = ¬e->playbackState;
|
||||
NoteSubEu* noteSubEu = ¬e->noteSubEu;
|
||||
NoteSampleState* noteSampleState = ¬e->sampleState;
|
||||
|
||||
playbackState->prevParentLayer = NO_LAYER;
|
||||
playbackState->parentLayer = layer;
|
||||
@@ -825,28 +828,28 @@ void AudioPlayback_NoteInitForLayer(Note* note, SequenceLayer* layer) {
|
||||
if (instId == 0xFF) {
|
||||
instId = channel->instOrWave;
|
||||
}
|
||||
noteSubEu->tunedSample = layer->tunedSample;
|
||||
noteSampleState->tunedSample = layer->tunedSample;
|
||||
|
||||
if (instId >= 0x80 && instId < 0xC0) {
|
||||
noteSubEu->bitField1.isSyntheticWave = true;
|
||||
noteSampleState->bitField1.isSyntheticWave = true;
|
||||
} else {
|
||||
noteSubEu->bitField1.isSyntheticWave = false;
|
||||
noteSampleState->bitField1.isSyntheticWave = false;
|
||||
}
|
||||
|
||||
if (noteSubEu->bitField1.isSyntheticWave) {
|
||||
if (noteSampleState->bitField1.isSyntheticWave) {
|
||||
AudioPlayback_BuildSyntheticWave(note, layer, instId);
|
||||
} else if (channel->startSamplePos == 1) {
|
||||
playbackState->startSamplePos = noteSubEu->tunedSample->sample->loop->start;
|
||||
playbackState->startSamplePos = noteSampleState->tunedSample->sample->loop->start;
|
||||
} else {
|
||||
playbackState->startSamplePos = channel->startSamplePos;
|
||||
if (playbackState->startSamplePos >= noteSubEu->tunedSample->sample->loop->end) {
|
||||
if (playbackState->startSamplePos >= noteSampleState->tunedSample->sample->loop->loopEnd) {
|
||||
playbackState->startSamplePos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
playbackState->fontId = channel->fontId;
|
||||
playbackState->stereoHeadsetEffects = channel->stereoHeadsetEffects;
|
||||
noteSubEu->bitField1.reverbIndex = channel->reverbIndex & 3;
|
||||
noteSampleState->bitField1.reverbIndex = channel->reverbIndex & 3;
|
||||
}
|
||||
|
||||
void func_801963E8(Note* note, SequenceLayer* layer) {
|
||||
@@ -987,7 +990,7 @@ void AudioPlayback_NoteInitAll(void) {
|
||||
|
||||
for (i = 0; i < gAudioContext.numNotes; i++) {
|
||||
note = &gAudioContext.notes[i];
|
||||
note->noteSubEu = gZeroNoteSub;
|
||||
note->sampleState = gZeroedSampleState;
|
||||
note->playbackState.priority = 0;
|
||||
note->playbackState.status = PLAYBACK_STATUS_0;
|
||||
note->playbackState.parentLayer = NO_LAYER;
|
||||
@@ -1002,7 +1005,8 @@ void AudioPlayback_NoteInitAll(void) {
|
||||
note->playbackState.portamento.speed = 0;
|
||||
note->playbackState.stereoHeadsetEffects = false;
|
||||
note->playbackState.startSamplePos = 0;
|
||||
note->synthesisState.synthesisBuffers = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, 0x2E0);
|
||||
note->playbackState.attributes.filterBuf = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, 0x10);
|
||||
note->synthesisState.synthesisBuffers =
|
||||
AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, sizeof(NoteSynthesisBuffers));
|
||||
note->playbackState.attributes.filterBuf = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, FILTER_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,17 +282,17 @@ void AudioSeq_InitSequenceChannel(SequenceChannel* channel) {
|
||||
channel->transposition = 0;
|
||||
channel->largeNotes = false;
|
||||
channel->bookOffset = 0;
|
||||
channel->stereo.asByte = 0;
|
||||
channel->stereoData.asByte = 0;
|
||||
channel->changes.asByte = 0xFF;
|
||||
channel->scriptState.depth = 0;
|
||||
channel->newPan = 0x40;
|
||||
channel->panChannelWeight = 0x80;
|
||||
channel->unk_10 = 0xFF;
|
||||
channel->surroundEffectIndex = 0xFF;
|
||||
channel->velocityRandomVariance = 0;
|
||||
channel->gateTimeRandomVariance = 0;
|
||||
channel->noteUnused = NULL;
|
||||
channel->reverbIndex = 0;
|
||||
channel->reverb = 0;
|
||||
channel->targetReverbVol = 0;
|
||||
channel->gain = 0;
|
||||
channel->notePriority = 3;
|
||||
channel->someOtherPriority = 1;
|
||||
@@ -308,14 +308,14 @@ void AudioSeq_InitSequenceChannel(SequenceChannel* channel) {
|
||||
channel->vibrato.vibratoExtentChangeDelay = 0;
|
||||
channel->vibrato.vibratoDelay = 0;
|
||||
channel->filter = NULL;
|
||||
channel->unk_20 = 0;
|
||||
channel->unk_0F = 0;
|
||||
channel->combFilterGain = 0;
|
||||
channel->combFilterSize = 0;
|
||||
channel->volume = 1.0f;
|
||||
channel->volumeScale = 1.0f;
|
||||
channel->freqScale = 1.0f;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(channel->soundScriptIO); i++) {
|
||||
channel->soundScriptIO[i] = -1;
|
||||
channel->soundScriptIO[i] = SEQ_IO_VAL_NONE;
|
||||
}
|
||||
|
||||
channel->unused = false;
|
||||
@@ -345,7 +345,7 @@ s32 AudioSeq_SeqChannelSetLayer(SequenceChannel* channel, s32 layerIndex) {
|
||||
layer->channel = channel;
|
||||
layer->adsr = channel->adsr;
|
||||
layer->adsr.decayIndex = 0;
|
||||
layer->unk_09 = channel->reverb;
|
||||
layer->targetReverbVol = channel->targetReverbVol;
|
||||
layer->enabled = true;
|
||||
layer->finished = false;
|
||||
layer->stopSomething = false;
|
||||
@@ -355,8 +355,8 @@ s32 AudioSeq_SeqChannelSetLayer(SequenceChannel* channel, s32 layerIndex) {
|
||||
layer->bit1 = false;
|
||||
layer->notePropertiesNeedInit = false;
|
||||
layer->gateTime = 0x80;
|
||||
layer->unk_08 = 0x80;
|
||||
layer->stereo.asByte = 0;
|
||||
layer->surroundEffectIndex = 0x80;
|
||||
layer->stereoData.asByte = 0;
|
||||
layer->portamento.mode = PORTAMENTO_MODE_OFF;
|
||||
layer->scriptState.depth = 0;
|
||||
layer->pan = 0x40;
|
||||
@@ -782,7 +782,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
|
||||
break;
|
||||
|
||||
case 0xCD: // layer: stereo effects
|
||||
layer->stereo.asByte = AudioSeq_ScriptReadU8(state);
|
||||
layer->stereoData.asByte = AudioSeq_ScriptReadU8(state);
|
||||
break;
|
||||
|
||||
case 0xCE: // layer: bend pitch
|
||||
@@ -796,7 +796,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
|
||||
break;
|
||||
|
||||
case 0xF1: // layer:
|
||||
layer->unk_08 = AudioSeq_ScriptReadU8(state);
|
||||
layer->surroundEffectIndex = AudioSeq_ScriptReadU8(state);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -991,13 +991,14 @@ s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) {
|
||||
|
||||
if (layer->delay == 0) {
|
||||
if (layer->tunedSample != NULL) {
|
||||
time = layer->tunedSample->sample->loop->end;
|
||||
time = layer->tunedSample->sample->loop->loopEnd;
|
||||
} else {
|
||||
time = 0.0f;
|
||||
}
|
||||
time *= seqPlayer->tempo;
|
||||
time *= gAudioContext.unk_2870;
|
||||
time /= layer->freqScale;
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
if (time > 0x7FFE) {
|
||||
time = 0x7FFE;
|
||||
@@ -1416,9 +1417,9 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
|
||||
channel->vibrato.vibratoDelay = cmd * 16;
|
||||
break;
|
||||
|
||||
case 0xD4: // channel: set reverb
|
||||
case 0xD4: // channel: set reverb volume
|
||||
cmd = (u8)cmdArgs[0];
|
||||
channel->reverb = cmd;
|
||||
channel->targetReverbVol = cmd;
|
||||
break;
|
||||
|
||||
case 0xC6: // channel: set soundFont
|
||||
@@ -1491,7 +1492,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
|
||||
} else {
|
||||
channel->stereoHeadsetEffects = false;
|
||||
}
|
||||
channel->stereo.asByte = cmd & 0x7F;
|
||||
channel->stereoData.asByte = cmd & 0x7F;
|
||||
break;
|
||||
|
||||
case 0xD1: // channel: set note allocation policy
|
||||
@@ -1537,7 +1538,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
|
||||
data += 4;
|
||||
channel->newPan = data[-3];
|
||||
channel->panChannelWeight = data[-2];
|
||||
channel->reverb = data[-1];
|
||||
channel->targetReverbVol = data[-1];
|
||||
channel->reverbIndex = data[0];
|
||||
//! @bug: Not marking reverb state as changed
|
||||
channel->changes.s.pan = true;
|
||||
@@ -1551,7 +1552,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
|
||||
channel->transposition = (s8)AudioSeq_ScriptReadU8(scriptState);
|
||||
channel->newPan = AudioSeq_ScriptReadU8(scriptState);
|
||||
channel->panChannelWeight = AudioSeq_ScriptReadU8(scriptState);
|
||||
channel->reverb = AudioSeq_ScriptReadU8(scriptState);
|
||||
channel->targetReverbVol = AudioSeq_ScriptReadU8(scriptState);
|
||||
channel->reverbIndex = AudioSeq_ScriptReadU8(scriptState);
|
||||
//! @bug: Not marking reverb state as changed
|
||||
channel->changes.s.pan = true;
|
||||
@@ -1569,8 +1570,8 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
|
||||
channel->adsr.sustain = 0;
|
||||
channel->velocityRandomVariance = 0;
|
||||
channel->gateTimeRandomVariance = 0;
|
||||
channel->unk_0F = 0;
|
||||
channel->unk_20 = 0;
|
||||
channel->combFilterSize = 0;
|
||||
channel->combFilterGain = 0;
|
||||
channel->bookOffset = 0;
|
||||
channel->startSamplePos = 0;
|
||||
channel->unk_E0 = 0;
|
||||
@@ -1651,8 +1652,8 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
|
||||
break;
|
||||
|
||||
case 0xBB: // channel:
|
||||
channel->unk_0F = cmdArgs[0];
|
||||
channel->unk_20 = cmdArgs[1];
|
||||
channel->combFilterSize = cmdArgs[0];
|
||||
channel->combFilterGain = cmdArgs[1];
|
||||
break;
|
||||
|
||||
case 0xBC: // channel: add large
|
||||
@@ -1667,8 +1668,8 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
|
||||
if (cmdArgs[0] < 5) {
|
||||
if (1) {}
|
||||
if (gAudioContext.unk_29A8[cmdArgs[0]] != NULL) {
|
||||
D_80208E6C = gAudioContext.unk_29A8[cmdArgs[0]];
|
||||
scriptState->value = D_80208E6C(scriptState->value, channel);
|
||||
gCustomAudioSeqFunction = gAudioContext.unk_29A8[cmdArgs[0]];
|
||||
scriptState->value = gCustomAudioSeqFunction(scriptState->value, channel);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1693,7 +1694,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
|
||||
break;
|
||||
|
||||
case 0xA4: // channel:
|
||||
channel->unk_10 = cmdArgs[0];
|
||||
channel->surroundEffectIndex = cmdArgs[0];
|
||||
break;
|
||||
|
||||
case 0xA5: // channel:
|
||||
@@ -1791,12 +1792,12 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
|
||||
|
||||
case 0x10: // channel: load sample
|
||||
if (lowBits < 8) {
|
||||
channel->soundScriptIO[lowBits] = -1;
|
||||
channel->soundScriptIO[lowBits] = SEQ_IO_VAL_NONE;
|
||||
if (AudioLoad_SlowLoadSample(channel->fontId, scriptState->value,
|
||||
&channel->soundScriptIO[lowBits]) == -1) {}
|
||||
} else {
|
||||
lowBits -= 8;
|
||||
channel->soundScriptIO[lowBits] = -1;
|
||||
channel->soundScriptIO[lowBits] = SEQ_IO_VAL_NONE;
|
||||
if (AudioLoad_SlowLoadSample(channel->fontId, channel->unk_22 + 0x100,
|
||||
&channel->soundScriptIO[lowBits]) == -1) {}
|
||||
}
|
||||
@@ -1805,7 +1806,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
|
||||
case 0x60: // channel: io read value
|
||||
scriptState->value = channel->soundScriptIO[lowBits];
|
||||
if (lowBits < 2) {
|
||||
channel->soundScriptIO[lowBits] = -1;
|
||||
channel->soundScriptIO[lowBits] = SEQ_IO_VAL_NONE;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2150,7 +2151,7 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
|
||||
case 0x80: // seqPlayer: io read value
|
||||
seqScript->value = seqPlayer->soundScriptIO[cmdLowBits];
|
||||
if (cmdLowBits < 2) {
|
||||
seqPlayer->soundScriptIO[cmdLowBits] = -1;
|
||||
seqPlayer->soundScriptIO[cmdLowBits] = SEQ_IO_VAL_NONE;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2197,7 +2198,7 @@ void AudioSeq_ProcessSequences(s32 arg0) {
|
||||
SequencePlayer* seqPlayer;
|
||||
u32 i;
|
||||
|
||||
gAudioContext.noteSubEuOffset =
|
||||
gAudioContext.sampleStateOffset =
|
||||
(gAudioContext.audioBufferParameters.updatesPerFrame - arg0 - 1) * gAudioContext.numNotes;
|
||||
|
||||
for (i = 0; i < (u32)gAudioContext.audioBufferParameters.numSequencePlayers; i++) {
|
||||
@@ -2286,7 +2287,7 @@ void AudioSeq_InitSequencePlayer(SequencePlayer* seqPlayer) {
|
||||
seqPlayer->applyBend = false;
|
||||
|
||||
for (j = 0; j < ARRAY_COUNT(seqPlayer->soundScriptIO); j++) {
|
||||
seqPlayer->soundScriptIO[j] = -1;
|
||||
seqPlayer->soundScriptIO[j] = SEQ_IO_VAL_NONE;
|
||||
}
|
||||
|
||||
seqPlayer->muteFlags = MUTE_FLAGS_SOFTEN | MUTE_FLAGS_STOP_NOTES;
|
||||
|
||||
+1684
-123
File diff suppressed because it is too large
Load Diff
+1121
-537
File diff suppressed because it is too large
Load Diff
@@ -671,7 +671,7 @@ void AudioSfx_PlayActiveSfx(u8 bankId) {
|
||||
// "one-frame" sfx
|
||||
entry->state = SFX_STATE_PLAYING_ONE_FRAME;
|
||||
}
|
||||
} else if ((u8)channel->soundScriptIO[1] == 0xFF) {
|
||||
} else if ((u8)channel->soundScriptIO[1] == (u8)SEQ_IO_VAL_NONE) {
|
||||
// Signal from seq 0 that the sfx is finished playing. Remove entry
|
||||
AudioSfx_RemoveBankEntry(bankId, entryIndex);
|
||||
} else if (entry->state == SFX_STATE_PLAYING_REFRESH) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/Audio_StartSequence.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A7D04.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/Audio_StopSequence.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A7D84.s")
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A89D0.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A8A50.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/Audio_GetActiveSequence.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A8ABC.s")
|
||||
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* File: flg_set.c
|
||||
* Description: Event Editor, used to view and edit weekEventReg, eventInf and maskMaskBit flags.
|
||||
* Description: Event Editor, used to view and edit weekEventReg, eventInf and masksGivenOnMoon flags.
|
||||
* Controls:
|
||||
* + Left and Right: select different flags/bits in array element
|
||||
* + Up and Down: select array element (byte) 1 up/down
|
||||
@@ -123,9 +123,9 @@ static FlagSetEntry sFlagEntries[] = {
|
||||
{ &gSaveContext.eventInf[6], "event_inf[6]" },
|
||||
{ &gSaveContext.eventInf[7], "event_inf[7]" },
|
||||
|
||||
{ &gSaveContext.maskMaskBit[0], "mask_mask_bit[0]" },
|
||||
{ &gSaveContext.maskMaskBit[1], "mask_mask_bit[1]" },
|
||||
{ &gSaveContext.maskMaskBit[2], "mask_mask_bit[2]" },
|
||||
{ &gSaveContext.masksGivenOnMoon[0], "mask_mask_bit[0]" },
|
||||
{ &gSaveContext.masksGivenOnMoon[1], "mask_mask_bit[1]" },
|
||||
{ &gSaveContext.masksGivenOnMoon[2], "mask_mask_bit[2]" },
|
||||
|
||||
{ NULL, NULL }, // used in the code to detect array end
|
||||
};
|
||||
|
||||
+1
-1
@@ -225,7 +225,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
|
||||
|
||||
void GameState_Destroy(GameState* gameState) {
|
||||
AudioMgr_StopAllSfxExceptSystem();
|
||||
func_8019E014();
|
||||
Audio_Update();
|
||||
osRecvMesg(&gameState->gfxCtx->queue, NULL, OS_MESG_BLOCK);
|
||||
|
||||
if (gameState->destroy != NULL) {
|
||||
|
||||
+1
-1
@@ -232,7 +232,7 @@ void Graph_UpdateGame(GameState* gameState) {
|
||||
Game_UpdateInput(gameState);
|
||||
Game_IncrementFrameCount(gameState);
|
||||
if (SREG(20) < 3) {
|
||||
func_8019E014();
|
||||
Audio_Update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "z64view.h"
|
||||
#include "system_malloc.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/speed_meter/func_80177390.s")
|
||||
|
||||
+15
-13
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "z64load.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64rumble.h"
|
||||
#include "overlays/actors/ovl_En_Horse/z_en_horse.h"
|
||||
#include "overlays/actors/ovl_En_Part/z_en_part.h"
|
||||
@@ -1059,7 +1060,7 @@ void Actor_SetScale(Actor* actor, f32 scale) {
|
||||
}
|
||||
|
||||
void Actor_SetObjectDependency(PlayState* play, Actor* actor) {
|
||||
gSegments[0x06] = PHYSICAL_TO_VIRTUAL(play->objectCtx.status[actor->objBankIndex].segment);
|
||||
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[actor->objBankIndex].segment);
|
||||
}
|
||||
|
||||
void Actor_Init(Actor* actor, PlayState* play) {
|
||||
@@ -2608,7 +2609,8 @@ s32 Actor_RecordUndrawnActor(PlayState* play, Actor* actor) {
|
||||
}
|
||||
|
||||
void Actor_DrawLensOverlay(Gfx** gfxP, s32 lensMaskSize) {
|
||||
func_80164C14(gfxP, &gCircleTex, 4, 0, 6, 6, ((LENS_MASK_ACTIVE_SIZE - lensMaskSize) * 0.003f) + 1.0f);
|
||||
TransitionCircle_LoadAndSetTexture(gfxP, gCircleTex, 4, 0, 6, 6,
|
||||
((LENS_MASK_ACTIVE_SIZE - lensMaskSize) * 0.003f) + 1.0f);
|
||||
}
|
||||
|
||||
#ifdef NON_EQUIVALENT
|
||||
@@ -3777,20 +3779,20 @@ void func_800BC620(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play) {
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
void func_800BC770(PlayState* play, s16 y, s16 countdown) {
|
||||
s16 idx = Quake_Add(&play->mainCamera, 3);
|
||||
void Actor_AddQuake(PlayState* play, s16 verticalMag, s16 countdown) {
|
||||
s16 quakeIndex = Quake_Add(&play->mainCamera, QUAKE_TYPE_3);
|
||||
|
||||
Quake_SetSpeed(idx, 20000);
|
||||
Quake_SetQuakeValues(idx, y, 0, 0, 0);
|
||||
Quake_SetCountdown(idx, countdown);
|
||||
Quake_SetSpeed(quakeIndex, 20000);
|
||||
Quake_SetQuakeValues(quakeIndex, verticalMag, 0, 0, 0);
|
||||
Quake_SetCountdown(quakeIndex, countdown);
|
||||
}
|
||||
|
||||
void func_800BC7D8(PlayState* play, s16 y, s16 countdown, s16 speed) {
|
||||
s16 idx = Quake_Add(&play->mainCamera, 3);
|
||||
void Actor_AddQuakeWithSpeed(PlayState* play, s16 verticalMag, s16 countdown, s16 speed) {
|
||||
s16 quakeIndex = Quake_Add(&play->mainCamera, QUAKE_TYPE_3);
|
||||
|
||||
Quake_SetSpeed(idx, speed);
|
||||
Quake_SetQuakeValues(idx, y, 0, 0, 0);
|
||||
Quake_SetCountdown(idx, countdown);
|
||||
Quake_SetSpeed(quakeIndex, speed);
|
||||
Quake_SetQuakeValues(quakeIndex, verticalMag, 0, 0, 0);
|
||||
Quake_SetCountdown(quakeIndex, countdown);
|
||||
}
|
||||
|
||||
// Actor_RequestRumble?
|
||||
@@ -3800,7 +3802,7 @@ void func_800BC848(Actor* actor, PlayState* play, s16 y, s16 countdown) {
|
||||
} else {
|
||||
Rumble_Request(actor->xyzDistToPlayerSq, 180, 20, 100);
|
||||
}
|
||||
func_800BC770(play, y, countdown);
|
||||
Actor_AddQuake(play, y, countdown);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
||||
+10
-6
@@ -4331,18 +4331,22 @@ s32 SurfaceType_IsIgnoredByProjectiles(CollisionContext* colCtx, CollisionPoly*
|
||||
}
|
||||
|
||||
/**
|
||||
* SurfaceType Get Conveyor Surface Type
|
||||
* Return type 0 (CONVEYOR_WATER) if 'poly' is a surface that will only move player underwater
|
||||
* Return type 1 (CONVEYOR_FLOOR) if `poly` is a surface that must be stood on to move player
|
||||
* Checks if poly is a floor conveyor
|
||||
*
|
||||
* A conveyor surface is enabled with non-zero speed.
|
||||
* When enabled, the conveyor will exhibit two types of behaviour depending on the return value:
|
||||
*
|
||||
* If true, then it is a floor conveyor and will push player only while being stood on
|
||||
* If false, then it is a water conveyor and will push player only while in water
|
||||
*/
|
||||
s32 SurfaceType_GetConveyorType(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
|
||||
s32 SurfaceType_IsFloorConveyor(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
|
||||
u32 flags;
|
||||
|
||||
if (BgCheck_GetCollisionHeader(colCtx, bgId) == NULL) {
|
||||
return CONVEYOR_FLOOR;
|
||||
return true;
|
||||
}
|
||||
if (poly == NULL) {
|
||||
return CONVEYOR_WATER;
|
||||
return false;
|
||||
}
|
||||
flags = poly->flags_vIB & 0x2000;
|
||||
return !!flags;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "z64view.h"
|
||||
|
||||
/**
|
||||
* Returns the absolute value for floats
|
||||
|
||||
@@ -6,8 +6,8 @@ void SaveContext_Init(void) {
|
||||
bzero(&gSaveContext, sizeof(SaveContext));
|
||||
|
||||
gSaveContext.save.playerForm = 0;
|
||||
gSaveContext.seqIndex = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.nightSeqIndex = 0xFF;
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
|
||||
gSaveContext.unk_3F46 = NA_BGM_GENERAL_SFX;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFEF;
|
||||
gSaveContext.cutsceneTrigger = 0;
|
||||
|
||||
+28
-30
@@ -1,5 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
|
||||
|
||||
void Cutscene_DoNothing(PlayState* play, CutsceneContext* csCtx);
|
||||
@@ -106,7 +108,7 @@ s32 func_800EA220(PlayState* play, CutsceneContext* csCtx, f32 target) {
|
||||
|
||||
void func_800EA258(PlayState* play, CutsceneContext* csCtx) {
|
||||
Interface_SetHudVisibility(HUD_VISIBILITY_NONE);
|
||||
ShrinkWindow_SetLetterboxTarget(32);
|
||||
ShrinkWindow_Letterbox_SetSizeTarget(32);
|
||||
if (func_800EA220(play, csCtx, 1.0f)) {
|
||||
Audio_SetCutsceneFlag(true);
|
||||
csCtx->state++;
|
||||
@@ -116,7 +118,7 @@ void func_800EA258(PlayState* play, CutsceneContext* csCtx) {
|
||||
void func_800EA2B8(PlayState* play, CutsceneContext* csCtx) {
|
||||
func_800ED980(play, csCtx);
|
||||
Interface_SetHudVisibility(HUD_VISIBILITY_NONE);
|
||||
ShrinkWindow_SetLetterboxTarget(32);
|
||||
ShrinkWindow_Letterbox_SetSizeTarget(32);
|
||||
if (func_800EA220(play, csCtx, 1.0f)) {
|
||||
Audio_SetCutsceneFlag(true);
|
||||
csCtx->state++;
|
||||
@@ -152,7 +154,7 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
|
||||
break;
|
||||
case 0x2:
|
||||
if (isStartFrame) {
|
||||
func_801A47DC(NATURE_CHANNEL_LIGHTNING, CHANNEL_IO_PORT_0, 0);
|
||||
Audio_SetAmbienceChannelIO(AMBIENCE_CHANNEL_LIGHTNING, CHANNEL_IO_PORT_0, 0);
|
||||
Environment_AddLightningBolts(play, 3);
|
||||
D_801F4E68 = 1;
|
||||
}
|
||||
@@ -191,7 +193,7 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
|
||||
case 0x8:
|
||||
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG);
|
||||
if (isStartFrame) {
|
||||
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 6);
|
||||
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
|
||||
Quake_SetSpeed(sCutsceneQuakeIndex, 22000);
|
||||
Quake_SetQuakeValues(sCutsceneQuakeIndex, 6, 4, 0, 0);
|
||||
Quake_SetCountdown(sCutsceneQuakeIndex, 800);
|
||||
@@ -281,7 +283,7 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
|
||||
case 0x1A:
|
||||
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG);
|
||||
if (isStartFrame) {
|
||||
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 6);
|
||||
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
|
||||
Quake_SetSpeed(sCutsceneQuakeIndex, 30000);
|
||||
Quake_SetQuakeValues(sCutsceneQuakeIndex, 20, 10, 0, 0);
|
||||
Quake_SetCountdown(sCutsceneQuakeIndex, 800);
|
||||
@@ -333,7 +335,7 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
|
||||
case 0x24:
|
||||
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG);
|
||||
if (isStartFrame) {
|
||||
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 6);
|
||||
sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6);
|
||||
Quake_SetSpeed(sCutsceneQuakeIndex, 22000);
|
||||
Quake_SetQuakeValues(sCutsceneQuakeIndex, 2, 1, 0, 0);
|
||||
Quake_SetCountdown(sCutsceneQuakeIndex, 800);
|
||||
@@ -376,14 +378,14 @@ void Cutscene_Command_SetLighting(PlayState* play, CutsceneContext* csCtx, CsCmd
|
||||
// Command 0x12C: Plays a sequence (Background music or Fanfare)
|
||||
void Cutscene_Command_PlaySequence(PlayState* play, CutsceneContext* csCtx, CsCmdSequenceChange* cmd) {
|
||||
if (csCtx->frames == cmd->startFrame) {
|
||||
func_801A2C88(cmd->sequence - 1);
|
||||
Audio_PlaySequenceInCutscene(cmd->sequence - 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Command 0x12D: Stops a sequence (Background music or Fanfare)
|
||||
void Cutscene_Command_StopSequence(PlayState* play, CutsceneContext* csCtx, CsCmdSequenceChange* cmd) {
|
||||
if ((csCtx->frames >= cmd->startFrame) && (cmd->endFrame >= csCtx->frames)) {
|
||||
func_801A2D54(cmd->sequence - 1);
|
||||
Audio_StopSequenceInCutscene(cmd->sequence - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,9 +405,7 @@ void Cutscene_Command_FadeSequence(PlayState* play, CutsceneContext* csCtx, CsCm
|
||||
// Command 0x12E: Play Ambience sequence
|
||||
void Cutscene_Command_PlayAmbienceSequence(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
|
||||
if (csCtx->frames == cmd->startFrame) {
|
||||
// Audio_PlayNatureAmbienceSequence
|
||||
// nightSeqIndex is natureAmbienceId
|
||||
func_801A4A28(play->soundCtx.nightSeqIndex);
|
||||
Audio_PlayAmbience(play->sequenceCtx.ambienceId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,29 +455,27 @@ void func_800EADB0(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// func_801A246C(SEQ_PLAYER_NATURE, TYPE_1);
|
||||
func_801A246C(SEQ_PLAYER_NATURE, 1);
|
||||
// func_801A246C(SEQ_PLAYER_AMBIENCE, TYPE_1);
|
||||
func_801A246C(SEQ_PLAYER_AMBIENCE, 1);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
// func_801A246C(SEQ_PLAYER_NATURE, TYPE_0);
|
||||
func_801A246C(SEQ_PLAYER_NATURE, 0);
|
||||
// func_801A246C(SEQ_PLAYER_AMBIENCE, TYPE_0);
|
||||
func_801A246C(SEQ_PLAYER_AMBIENCE, 0);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
// func_801A246C(SEQ_PLAYER_NATURE, TYPE_2);
|
||||
func_801A246C(SEQ_PLAYER_NATURE, 2);
|
||||
// func_801A246C(SEQ_PLAYER_AMBIENCE, TYPE_2);
|
||||
func_801A246C(SEQ_PLAYER_AMBIENCE, 2);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
// Audio_GetActiveSequence
|
||||
seqId = func_801A8A50(0);
|
||||
seqId = Audio_GetActiveSequence(SEQ_PLAYER_BGM_MAIN);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
if (seqId != NA_BGM_DISABLED) {
|
||||
// Audio_PlayBgmForDayScene
|
||||
func_801A25E4(seqId, dayMinusOne);
|
||||
Audio_PlaySceneSequence(seqId, dayMinusOne);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -647,7 +645,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
||||
// Command 0x15F: Chooses between a cutscene or a rotating mask depending on whether the player has the corresponding
|
||||
// mask
|
||||
void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
|
||||
if ((csCtx->frames >= cmd->startFrame) && (func_801A3950(0, true) != 0xFF)) {
|
||||
if ((csCtx->frames >= cmd->startFrame) && (func_801A3950(SEQ_PLAYER_BGM_MAIN, true) != 0xFF)) {
|
||||
switch (cmd->base) {
|
||||
case 1:
|
||||
Cutscene_TerminatorImpl(play, csCtx, cmd);
|
||||
@@ -1452,8 +1450,8 @@ void func_800EDA84(PlayState* play, CutsceneContext* csCtx) {
|
||||
|
||||
if (gSaveContext.cutsceneTrigger == 0) {
|
||||
Interface_SetHudVisibility(HUD_VISIBILITY_NONE);
|
||||
ShrinkWindow_SetLetterboxTarget(32);
|
||||
ShrinkWindow_SetLetterboxMagnitude(0x20);
|
||||
ShrinkWindow_Letterbox_SetSizeTarget(32);
|
||||
ShrinkWindow_Letterbox_SetSize(32);
|
||||
csCtx->state++;
|
||||
}
|
||||
|
||||
@@ -1500,7 +1498,7 @@ void func_800EDBE0(PlayState* play) {
|
||||
sp24 = play->loadedScene;
|
||||
if ((sp24->titleTextId != 0) && gSaveContext.showTitleCard) {
|
||||
if ((Entrance_GetTransitionFlags(((void)0, gSaveContext.save.entrance) +
|
||||
((void)0, gSaveContext.sceneSetupIndex)) &
|
||||
((void)0, gSaveContext.sceneLayer)) &
|
||||
0x4000) != 0) {
|
||||
func_80151A68(play, sp24->titleTextId);
|
||||
}
|
||||
@@ -1611,13 +1609,13 @@ void Cutscene_ActorTranslateXZAndYawSmooth(Actor* actor, PlayState* play, s32 ac
|
||||
actor->shape.rot.y = actor->world.rot.y;
|
||||
}
|
||||
|
||||
s32 Cutscene_GetSceneSetupIndex(PlayState* play) {
|
||||
s32 sceneSetupIndex = 0;
|
||||
s32 Cutscene_GetSceneLayer(PlayState* play) {
|
||||
s32 sceneLayer = 0;
|
||||
|
||||
if (gSaveContext.sceneSetupIndex > 0) {
|
||||
sceneSetupIndex = gSaveContext.sceneSetupIndex;
|
||||
if (gSaveContext.sceneLayer > 0) {
|
||||
sceneLayer = gSaveContext.sceneLayer;
|
||||
}
|
||||
return sceneSetupIndex;
|
||||
return sceneLayer;
|
||||
}
|
||||
|
||||
s32 Cutscene_GetActorActionIndex(PlayState* play, u16 actorActionCmd) {
|
||||
|
||||
@@ -50,7 +50,7 @@ void EffectSs_DrawGEffect(PlayState* play, EffectSs* this, TexturePtr texture) {
|
||||
SkinMatrix_SetScale(&mfScale, scale, scale, scale);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTrans11DA0);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0, &mfScale, &mfResult);
|
||||
gSegments[0x06] = PHYSICAL_TO_VIRTUAL(object);
|
||||
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(object);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x06, object);
|
||||
|
||||
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
|
||||
@@ -702,16 +702,16 @@ void EffectSsKFire_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* ac
|
||||
|
||||
// EffectSsSolderSrchBall Spawn Functions
|
||||
|
||||
void EffectSsSolderSrchBall_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused,
|
||||
s16* linkDetected, s16 drawFlag) {
|
||||
void EffectSsSolderSrchBall_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale,
|
||||
s16* playerDetected, s16 flags) {
|
||||
EffectSsSolderSrchBallInitParams initParams;
|
||||
|
||||
Math_Vec3f_Copy(&initParams.pos, pos);
|
||||
Math_Vec3f_Copy(&initParams.velocity, velocity);
|
||||
Math_Vec3f_Copy(&initParams.accel, accel);
|
||||
initParams.unused = unused;
|
||||
initParams.linkDetected = linkDetected;
|
||||
initParams.drawFlag = drawFlag;
|
||||
initParams.scale = scale;
|
||||
initParams.playerDetected = playerDetected;
|
||||
initParams.flags = flags;
|
||||
|
||||
EffectSs_Spawn(play, EFFECT_SS_SOLDER_SRCH_BALL, 128, &initParams);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ EnDoor* EnHy_FindNearestDoor(Actor* actor, PlayState* play) {
|
||||
}
|
||||
|
||||
void EnHy_ChangeObjectAndAnim(EnHy* enHy, PlayState* play, s16 animIndex) {
|
||||
gSegments[6] = PHYSICAL_TO_VIRTUAL(play->objectCtx.status[enHy->animObjIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[enHy->animObjIndex].segment);
|
||||
EnHy_ChangeAnim(&enHy->skelAnime, animIndex);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ s32 EnHy_UpdateSkelAnime(EnHy* enHy, PlayState* play) {
|
||||
s32 isUpdated = false;
|
||||
|
||||
if (enHy->actor.draw != NULL) {
|
||||
gSegments[6] = PHYSICAL_TO_VIRTUAL(play->objectCtx.status[enHy->animObjIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[enHy->animObjIndex].segment);
|
||||
SkelAnime_Update(&enHy->skelAnime);
|
||||
isUpdated = true;
|
||||
}
|
||||
@@ -119,7 +119,7 @@ s32 EnHy_Init(EnHy* enHy, PlayState* play, FlexSkeletonHeader* skeletonHeaderSeg
|
||||
enHy->actor.objBankIndex = enHy->skelLowerObjIndex;
|
||||
isInitialized = true;
|
||||
ActorShape_Init(&enHy->actor.shape, 0.0f, NULL, 0.0f);
|
||||
gSegments[6] = PHYSICAL_TO_VIRTUAL(play->objectCtx.status[enHy->actor.objBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[enHy->actor.objBankIndex].segment);
|
||||
SkelAnime_InitFlex(play, &enHy->skelAnime, skeletonHeaderSeg, NULL, enHy->jointTable, enHy->morphTable,
|
||||
ENHY_LIMB_MAX);
|
||||
EnHy_ChangeObjectAndAnim(enHy, play, animIndex);
|
||||
|
||||
@@ -843,10 +843,10 @@ void EnItem00_DrawSprite(EnItem00* this, PlayState* play) {
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
void EnItem00_DrawHeartContainer(EnItem00* actor, PlayState* play) {
|
||||
void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
|
||||
if (Object_GetIndex(&play->objectCtx, OBJECT_GI_HEARTS) == actor->actor.objBankIndex) {
|
||||
if (Object_GetIndex(&play->objectCtx, OBJECT_GI_HEARTS) == this->actor.objBankIndex) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
func_8012C2DC(play->state.gfxCtx);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "z64shrink_window.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F1460.s")
|
||||
|
||||
|
||||
+134
-9
@@ -1,19 +1,144 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_circle/TransitionCircle_Start.s")
|
||||
Gfx D_801D0D00[] = {
|
||||
gsDPPipeSync(),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_THRESHOLD | G_ZS_PRIM | AA_EN | IM_RD | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA | FORCE_BL |
|
||||
GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) |
|
||||
GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)),
|
||||
gsDPSetPrimColor(0, 255, 0, 0, 0, 1),
|
||||
gsDPSetBlendColor(0, 0, 0, 1),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_circle/TransitionCircle_Init.s")
|
||||
//! @bug: TransitionCircle_Update should take an additional argument `s32 updateRate`
|
||||
TransitionInit TransitionCircle_InitVars = {
|
||||
TransitionCircle_Init, TransitionCircle_Destroy, (void*)TransitionCircle_Update, TransitionCircle_Draw,
|
||||
TransitionCircle_Start, TransitionCircle_SetType, TransitionCircle_SetColor, NULL,
|
||||
TransitionCircle_IsDone,
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_circle/TransitionCircle_Destroy.s")
|
||||
void TransitionCircle_Start(void* thisx) {
|
||||
TransitionCircle* this = (TransitionCircle*)thisx;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_circle/TransitionCircle_Update.s")
|
||||
this->stepValue = 0.1f;
|
||||
if (this->direction == TRANSITION_CIRCLE_IN) {
|
||||
this->targetRadius = 0.0f;
|
||||
this->startingRadius = 1.0f;
|
||||
} else {
|
||||
this->startingRadius = 0.0f;
|
||||
this->targetRadius = 1.0f;
|
||||
}
|
||||
this->referenceRadius = this->startingRadius;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_circle/TransitionCircle_SetColor.s")
|
||||
void* TransitionCircle_Init(void* thisx) {
|
||||
TransitionCircle* this = (TransitionCircle*)thisx;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_circle/TransitionCircle_SetType.s")
|
||||
bzero(this, sizeof(TransitionCircle));
|
||||
this->maskType = 1;
|
||||
this->texture = gCircleTex;
|
||||
this->masks = 6;
|
||||
this->maskt = 6;
|
||||
this->unk_1E = 4;
|
||||
this->unk_1F = 0;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_circle/func_80164C14.s")
|
||||
return this;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_circle/TransitionCircle_Draw.s")
|
||||
void TransitionCircle_Destroy(void* thisx) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_circle/TransitionCircle_IsDone.s")
|
||||
void TransitionCircle_Update(void* thisx) {
|
||||
TransitionCircle* this = (TransitionCircle*)thisx;
|
||||
|
||||
this->isDone = Math_StepToF(&this->referenceRadius, this->targetRadius, this->stepValue);
|
||||
}
|
||||
|
||||
void TransitionCircle_SetColor(void* thisx, u32 color) {
|
||||
TransitionCircle* this = (TransitionCircle*)thisx;
|
||||
|
||||
this->color.rgba = color;
|
||||
}
|
||||
|
||||
void TransitionCircle_SetType(void* thisx, s32 type) {
|
||||
TransitionCircle* this = (TransitionCircle*)thisx;
|
||||
|
||||
if (type & TC_SET_PARAMS) {
|
||||
this->maskType = FBDEMO_CIRCLE_GET_MASK_TYPE(type);
|
||||
} else if (type == 1) {
|
||||
this->direction = TRANSITION_CIRCLE_OUT;
|
||||
} else {
|
||||
this->direction = TRANSITION_CIRCLE_IN;
|
||||
}
|
||||
}
|
||||
|
||||
void TransitionCircle_LoadAndSetTexture(Gfx** gfxp, TexturePtr texture, s32 fmt, s32 arg3, s32 masks, s32 maskt,
|
||||
f32 arg6) {
|
||||
Gfx* gfx = *gfxp;
|
||||
s32 xh = D_801FBBCC;
|
||||
s32 yh = D_801FBBCE;
|
||||
s32 width = 1 << masks;
|
||||
s32 height = 1 << maskt;
|
||||
f32 s;
|
||||
f32 t;
|
||||
s32 dtdy;
|
||||
s32 dsdx;
|
||||
|
||||
gDPLoadTextureBlock_4b(gfx++, texture, fmt, width, height, 0, G_TX_MIRROR | G_TX_CLAMP, G_TX_MIRROR | G_TX_CLAMP,
|
||||
masks, maskt, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gDPSetTileSize(gfx++, G_TX_RENDERTILE, ((SCREEN_WIDTH / 2) - width) << 2, ((SCREEN_HEIGHT / 2) - height) << 2,
|
||||
((SCREEN_WIDTH / 2) + (width - 1)) << 2, ((SCREEN_HEIGHT / 2) + (height - 1)) << 2);
|
||||
|
||||
s = ((1.0f - (1.0f / arg6)) * (SCREEN_WIDTH / 2)) + 70.0f;
|
||||
t = ((1.0f - (1.0f / arg6)) * (SCREEN_HEIGHT / 2)) + 50.0f;
|
||||
|
||||
if (s < -1023.0f) {
|
||||
s = -1023.0f;
|
||||
}
|
||||
if (t < -1023.0f) {
|
||||
t = -1023.0f;
|
||||
}
|
||||
|
||||
if ((s <= -1023.0f) || (t <= -1023.0f)) {
|
||||
dsdx = 0;
|
||||
dtdy = 0;
|
||||
} else {
|
||||
dsdx = ((SCREEN_WIDTH - (2.0f * s)) / gScreenWidth) * (1 << 10);
|
||||
dtdy = ((SCREEN_HEIGHT - (2.0f * t)) / gScreenHeight) * (1 << 10);
|
||||
}
|
||||
|
||||
gSPTextureRectangle(gfx++, 0, 0, xh << 2, yh << 2, G_TX_RENDERTILE, (s32)(s * (1 << 5)), (s32)(t * (1 << 5)), dsdx,
|
||||
dtdy);
|
||||
gDPPipeSync(gfx++);
|
||||
|
||||
*gfxp = gfx;
|
||||
}
|
||||
|
||||
void TransitionCircle_Draw(void* thisx, Gfx** gfxp) {
|
||||
Gfx* gfx = *gfxp;
|
||||
TransitionCircle* this = (TransitionCircle*)thisx;
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
gSPDisplayList(gfx++, &D_801D0D00);
|
||||
gDPSetPrimColor(gfx++, 0, this->color.a, this->color.r, this->color.g, this->color.b, 1);
|
||||
if (this->maskType == 0) {
|
||||
gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIM_LOD_FRAC, PRIMITIVE, 0, 0, 0, PRIMITIVE, TEXEL0, 0,
|
||||
PRIM_LOD_FRAC, PRIMITIVE);
|
||||
} else {
|
||||
gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, 1, TEXEL0, PRIM_LOD_FRAC, PRIMITIVE, 0, 0, 0, PRIMITIVE, 1, TEXEL0,
|
||||
PRIM_LOD_FRAC, PRIMITIVE);
|
||||
}
|
||||
TransitionCircle_LoadAndSetTexture(&gfx, this->texture, G_IM_FMT_I, 0, this->masks, this->maskt,
|
||||
this->referenceRadius);
|
||||
gDPPipeSync(gfx++);
|
||||
|
||||
*gfxp = gfx;
|
||||
}
|
||||
|
||||
s32 TransitionCircle_IsDone(void* thisx) {
|
||||
TransitionCircle* this = (TransitionCircle*)thisx;
|
||||
|
||||
return this->isDone;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,54 @@
|
||||
#include "global.h"
|
||||
#include "initvars.h"
|
||||
#include "overlays/fbdemos/ovl_fbdemo_triforce/z_fbdemo_triforce.h"
|
||||
#include "overlays/fbdemos/ovl_fbdemo_wipe1/z_fbdemo_wipe1.h"
|
||||
#include "overlays/fbdemos/ovl_fbdemo_wipe3/z_fbdemo_wipe3.h"
|
||||
#include "overlays/fbdemos/ovl_fbdemo_wipe4/z_fbdemo_wipe4.h"
|
||||
#include "overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_dlftbls/func_80163C90.s")
|
||||
#define TRANSITION_OVERLAY(name, filename) \
|
||||
{ \
|
||||
{ 0, 0 }, SEGMENT_START(ovl_##filename), SEGMENT_END(ovl_##filename), SEGMENT_ROM_START(ovl_##filename), \
|
||||
SEGMENT_ROM_END(ovl_##filename), &name##_InitVars, sizeof(name) \
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_dlftbls/func_80163D80.s")
|
||||
#define TRANSITION_OVERLAY_INTERNAL(name) \
|
||||
{ { 0, 0 }, NULL, NULL, 0, 0, &name##_InitVars, sizeof(name) }
|
||||
|
||||
#define TRANSITION_OVERLAY_UNSET \
|
||||
{ 0 }
|
||||
|
||||
TransitionOverlay gTransitionOverlayTable[] = {
|
||||
TRANSITION_OVERLAY_INTERNAL(TransitionFade), TRANSITION_OVERLAY(TransitionTriforce, fbdemo_triforce),
|
||||
TRANSITION_OVERLAY(TransitionWipe1, fbdemo_wipe1), TRANSITION_OVERLAY(TransitionWipe3, fbdemo_wipe3),
|
||||
TRANSITION_OVERLAY(TransitionWipe4, fbdemo_wipe4), TRANSITION_OVERLAY_INTERNAL(TransitionCircle),
|
||||
TRANSITION_OVERLAY(TransitionWipe5, fbdemo_wipe5),
|
||||
};
|
||||
|
||||
void Transition_Init(TransitionContext* transitionCtx) {
|
||||
TransitionOverlay* overlayEntry;
|
||||
ptrdiff_t relocOffset;
|
||||
TransitionInit* initInfo[1];
|
||||
|
||||
overlayEntry = &gTransitionOverlayTable[transitionCtx->fbdemoType];
|
||||
TransitionOverlay_Load(overlayEntry);
|
||||
|
||||
relocOffset = (uintptr_t)Lib_PhysicalToVirtual(overlayEntry->loadInfo.addr) - (uintptr_t)overlayEntry->vramStart;
|
||||
initInfo[0] = NULL;
|
||||
initInfo[0] = (overlayEntry->initInfo != NULL) ? (TransitionInit*)((uintptr_t)overlayEntry->initInfo + relocOffset)
|
||||
: initInfo[0];
|
||||
|
||||
transitionCtx->init = initInfo[0]->init;
|
||||
transitionCtx->destroy = initInfo[0]->destroy;
|
||||
transitionCtx->start = initInfo[0]->start;
|
||||
transitionCtx->isDone = initInfo[0]->isDone;
|
||||
transitionCtx->draw = initInfo[0]->draw;
|
||||
transitionCtx->update = initInfo[0]->update;
|
||||
transitionCtx->setType = initInfo[0]->setType;
|
||||
transitionCtx->setColor = initInfo[0]->setColor;
|
||||
transitionCtx->setEnvColor = initInfo[0]->setEnvColor;
|
||||
}
|
||||
|
||||
void Transition_Destroy(TransitionContext* transitionCtx) {
|
||||
TransitionOverlay_Free(&gTransitionOverlayTable[transitionCtx->fbdemoType]);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64shrink_window.h"
|
||||
|
||||
void GameOver_Init(PlayState* play) {
|
||||
play->gameOverCtx.state = GAMEOVER_INACTIVE;
|
||||
@@ -46,8 +47,8 @@ void GameOver_Update(PlayState* play) {
|
||||
|
||||
gSaveContext.unk_3DC0 = 2000;
|
||||
gSaveContext.save.playerData.tatlTimer = 0;
|
||||
gSaveContext.seqIndex = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.nightSeqIndex = 0xFF;
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
|
||||
gSaveContext.eventInf[0] = 0;
|
||||
gSaveContext.eventInf[1] = 0;
|
||||
gSaveContext.eventInf[2] = 0;
|
||||
@@ -67,7 +68,7 @@ void GameOver_Update(PlayState* play) {
|
||||
gameOverCtx->state = GAMEOVER_DEATH_WAIT_GROUND;
|
||||
break;
|
||||
case GAMEOVER_DEATH_FADE_OUT:
|
||||
if (func_801A8A50(1) != NA_BGM_GAME_OVER) {
|
||||
if (Audio_GetActiveSequence(SEQ_PLAYER_FANFARE) != NA_BGM_GAME_OVER) {
|
||||
Play_LoadToLastEntrance(&play->state);
|
||||
if (gSaveContext.respawnFlag != -7) {
|
||||
gSaveContext.respawnFlag = -6;
|
||||
@@ -86,7 +87,7 @@ void GameOver_Update(PlayState* play) {
|
||||
gameOverCtx->state++;
|
||||
sGameOverTimer = 0;
|
||||
Kankyo_InitGameOverLights(play);
|
||||
ShrinkWindow_SetLetterboxTarget(32);
|
||||
ShrinkWindow_Letterbox_SetSizeTarget(32);
|
||||
break;
|
||||
case GAMEOVER_REVIVE_RUMBLE:
|
||||
sGameOverTimer = 50;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
|
||||
void (*sKaleidoScopeUpdateFunc)(PlayState* play);
|
||||
@@ -36,7 +37,7 @@ void KaleidoScopeCall_Update(PlayState* play) {
|
||||
|
||||
if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugEditor != DEBUG_EDITOR_NONE)) {
|
||||
if (pauseCtx->state == 1 || pauseCtx->state == 19) {
|
||||
if (ShrinkWindow_GetLetterboxMagnitude() == 0) {
|
||||
if (ShrinkWindow_Letterbox_GetSize() == 0) {
|
||||
R_PAUSE_MENU_MODE = 1;
|
||||
pauseCtx->unk_200 = 0;
|
||||
pauseCtx->unk_208 = 0;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "z64view.h"
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
|
||||
s16 D_801BDB00[] = { PAUSE_MAP, PAUSE_QUEST, PAUSE_MASK, PAUSE_ITEM };
|
||||
@@ -91,8 +93,8 @@ void KaleidoSetup_Update(PlayState* play) {
|
||||
|
||||
if (pauseCtx->state == 1) {
|
||||
Game_SetFramerateDivisor(&play->state, 2);
|
||||
if (ShrinkWindow_GetLetterboxTarget() != 0) {
|
||||
ShrinkWindow_SetLetterboxTarget(0);
|
||||
if (ShrinkWindow_Letterbox_GetSizeTarget() != 0) {
|
||||
ShrinkWindow_Letterbox_SetSizeTarget(0);
|
||||
}
|
||||
func_801A3AEC(1);
|
||||
}
|
||||
|
||||
+20
-10
@@ -704,11 +704,29 @@ void* Lib_SegmentedToVirtual(void* ptr) {
|
||||
void* Lib_SegmentedToVirtualNull(void* ptr) {
|
||||
if (((uintptr_t)ptr >> 28) == 0) {
|
||||
return ptr;
|
||||
} else {
|
||||
return SEGMENTED_TO_VIRTUAL(ptr);
|
||||
}
|
||||
|
||||
return SEGMENTED_TO_VIRTUAL(ptr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Converts a 32-bit virtual address (0x80XXXXXX) to a 24-bit physical address (0xXXXXXX). The NULL case accounts for
|
||||
* the NULL virtual address being 0x00000000 and not 0x80000000. Used by transition overlays, which store their
|
||||
* addresses in 24-bit fields.
|
||||
*/
|
||||
void* Lib_VirtualToPhysical(void* ptr) {
|
||||
if (ptr == NULL) {
|
||||
return NULL;
|
||||
} else {
|
||||
return (void*)VIRTUAL_TO_PHYSICAL(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Converts a 24-bit physical address (0xXXXXXX) to a 32-bit virtual address (0x80XXXXXX). The NULL case accounts for
|
||||
* the NULL virtual address being 0x00000000 and not 0x80000000. Used by transition overlays, which store their
|
||||
* addresses in 24-bit fields.
|
||||
*/
|
||||
void* Lib_PhysicalToVirtual(void* ptr) {
|
||||
if (ptr == NULL) {
|
||||
return NULL;
|
||||
@@ -716,11 +734,3 @@ void* Lib_PhysicalToVirtual(void* ptr) {
|
||||
return (void*)PHYSICAL_TO_VIRTUAL(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
void* Lib_PhysicalToVirtualNull(void* ptr) {
|
||||
if (ptr == NULL) {
|
||||
return NULL;
|
||||
} else {
|
||||
return (void*)PHYSICAL_TO_VIRTUAL(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "z64view.h"
|
||||
#include "message_data_static.h"
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
|
||||
@@ -489,7 +491,7 @@ u8 Message_GetState(MessageContext* msgCtx) {
|
||||
|
||||
void func_80152C64(View* view) {
|
||||
SET_FULLSCREEN_VIEWPORT(view);
|
||||
func_8013FBC8(view);
|
||||
View_ApplyOrthoToOverlay(view);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_80152CAC.s")
|
||||
|
||||
+95
-6
@@ -1,14 +1,103 @@
|
||||
/**
|
||||
* @file z_overlay.c
|
||||
*
|
||||
* Functions for handling transition overlays in memory
|
||||
*
|
||||
* Status codes returned from TransitionOverlay_Load and TransitionOverlay_Free:
|
||||
*
|
||||
* -1 : failed allocation or null reference
|
||||
* 0 : successfully loaded/freed overlay
|
||||
* 1 : successfully added/removed instance
|
||||
* 2 : overlay is loaded but has no instances (?) TODO: Figure out why this exists
|
||||
* 3 : internal overlay, so always loaded
|
||||
*/
|
||||
|
||||
#include "global.h"
|
||||
#include "z64load.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_overlay/func_801651B0.s")
|
||||
void* TransitionOverlay_VramToRam(TransitionOverlay* overlayEntry, void* vramAddr) {
|
||||
void* loadedRamAddr = Lib_PhysicalToVirtual(overlayEntry->loadInfo.addr);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_overlay/func_80165224.s")
|
||||
if ((loadedRamAddr != NULL) && (vramAddr >= overlayEntry->vramStart) && (vramAddr < overlayEntry->vramEnd)) {
|
||||
return ((uintptr_t)loadedRamAddr - (uintptr_t)overlayEntry->vramStart) + (uintptr_t)vramAddr;
|
||||
}
|
||||
return vramAddr;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_overlay/func_80165288.s")
|
||||
void TransitionOverlay_VramToRamArray(TransitionOverlay* overlayEntry, void** vramAddrs, s32 count) {
|
||||
s32 i;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_overlay/func_8016537C.s")
|
||||
for (i = 0; i < count; i++) {
|
||||
vramAddrs[i] = TransitionOverlay_VramToRam(overlayEntry, vramAddrs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_overlay/func_80165438.s")
|
||||
s32 TransitionOverlay_Load(TransitionOverlay* overlayEntry) {
|
||||
s32 count;
|
||||
void* loadedRamAddr;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_overlay/func_80165444.s")
|
||||
if (overlayEntry->vromStart == 0) {
|
||||
return 3;
|
||||
}
|
||||
if (Lib_PhysicalToVirtual(overlayEntry->loadInfo.addr) == NULL) {
|
||||
loadedRamAddr = ZeldaArena_Malloc(VRAM_PTR_SIZE(overlayEntry));
|
||||
|
||||
if (loadedRamAddr == NULL) {
|
||||
return -1;
|
||||
}
|
||||
Load2_LoadOverlay(overlayEntry->vromStart, overlayEntry->vromEnd, overlayEntry->vramStart,
|
||||
overlayEntry->vramEnd, loadedRamAddr);
|
||||
overlayEntry->loadInfo.addr = Lib_VirtualToPhysical(loadedRamAddr);
|
||||
overlayEntry->loadInfo.count = 1;
|
||||
return 0;
|
||||
} else {
|
||||
count = overlayEntry->loadInfo.count;
|
||||
if (count != 0) {
|
||||
count++;
|
||||
overlayEntry->loadInfo.count = count;
|
||||
if (count == 0) {
|
||||
return 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
s32 TransitionOverlay_Free(TransitionOverlay* overlayEntry) {
|
||||
s32 count;
|
||||
void* loadedRamAddr;
|
||||
|
||||
if (overlayEntry->vromStart == 0) {
|
||||
return 3;
|
||||
}
|
||||
loadedRamAddr = Lib_PhysicalToVirtual(overlayEntry->loadInfo.addr);
|
||||
if (loadedRamAddr != NULL) {
|
||||
count = overlayEntry->loadInfo.count;
|
||||
if (count != 0) {
|
||||
count--;
|
||||
overlayEntry->loadInfo.count = count;
|
||||
if (count == 0) {
|
||||
ZeldaArena_Free(loadedRamAddr);
|
||||
overlayEntry->loadInfo.addr = Lib_VirtualToPhysical(NULL);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void TransitionOverlay_ClearLoadInfo(TransitionOverlay* overlayEntry) {
|
||||
overlayEntry->loadInfo.word = 0; // Equivalent to overlayEntry->loadInfo.count = 0, overlayEntry->loadInfo.addr = 0;
|
||||
}
|
||||
|
||||
void TransitionOverlay_SetSegment(TransitionOverlay* overlayEntry, void* vramStart, void* vramEnd, uintptr_t vromStart,
|
||||
uintptr_t vromEnd) {
|
||||
overlayEntry->vramStart = vramStart;
|
||||
overlayEntry->vramEnd = vramEnd;
|
||||
overlayEntry->vromStart = vromStart;
|
||||
overlayEntry->vromEnd = vromEnd;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "global.h"
|
||||
|
||||
#include "z64view.h"
|
||||
#include "interface/parameter_static/parameter_static.h"
|
||||
#include "interface/do_action_static/do_action_static.h"
|
||||
#include "misc/story_static/story_static.h"
|
||||
@@ -2264,7 +2264,7 @@ void Magic_Update(PlayState* play) {
|
||||
// Add magic until magicFillTarget is reached
|
||||
gSaveContext.save.playerData.magic += 0x10;
|
||||
|
||||
if ((gSaveContext.gameMode == 0) && (gSaveContext.sceneSetupIndex < 4)) {
|
||||
if ((gSaveContext.gameMode == 0) && (gSaveContext.sceneLayer < 4)) {
|
||||
play_sound(NA_SE_SY_GAUGE_UP - SFX_FLAG);
|
||||
}
|
||||
|
||||
@@ -2863,7 +2863,7 @@ void Interface_DrawTimers(PlayState* play) {
|
||||
|
||||
if (sTimerId == TIMER_ID_MOON_CRASH) {
|
||||
gSaveContext.save.day = 4;
|
||||
if ((play->sceneId == SCENE_OKUJOU) && (gSaveContext.sceneSetupIndex == 3)) {
|
||||
if ((play->sceneId == SCENE_OKUJOU) && (gSaveContext.sceneLayer == 3)) {
|
||||
play->nextEntrance = ENTRANCE(TERMINA_FIELD, 1);
|
||||
gSaveContext.nextCutsceneIndex = 0xFFF0;
|
||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||
|
||||
+25
-23
@@ -1,5 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "z64view.h"
|
||||
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
|
||||
#include "overlays/gamestates/ovl_opening/z_opening.h"
|
||||
#include "overlays/gamestates/ovl_file_choose/z_file_choose.h"
|
||||
@@ -309,7 +312,7 @@ void Play_SetupTransition(PlayState* this, s32 transitionType) {
|
||||
transitionCtx->transitionType = transitionType;
|
||||
transitionCtx->fbdemoType = fbdemoType;
|
||||
if (fbdemoType != -1) {
|
||||
func_80163C90(transitionCtx);
|
||||
Transition_Init(transitionCtx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,7 +382,7 @@ const char D_801DFB28[] = "fk";
|
||||
|
||||
void Play_ClearTransitionInstanceType(PlayState* this) {
|
||||
if (this->transitionCtx.fbdemoType != -1) {
|
||||
func_80163D80(&this->transitionCtx, this);
|
||||
Transition_Destroy(&this->transitionCtx);
|
||||
}
|
||||
this->transitionCtx.transitionType = -1;
|
||||
}
|
||||
@@ -577,7 +580,7 @@ void func_80166968(PlayState* this, Camera* camera) {
|
||||
Distortion_ClearType(0x10);
|
||||
Distortion_ClearType(8);
|
||||
if (sQuakeIndex != 0) {
|
||||
Quake_RemoveFromIdx(sQuakeIndex);
|
||||
Quake_Remove(sQuakeIndex);
|
||||
}
|
||||
func_800F694C(this);
|
||||
func_801A3EC0(0);
|
||||
@@ -612,20 +615,20 @@ void Play_UpdateTransition(PlayState* this) {
|
||||
((this->nextEntrance == ENTRANCE(ROAD_TO_IKANA, 1)) &&
|
||||
!(gSaveContext.save.weekEventReg[0x34] & 0x20))) &&
|
||||
(!func_800FE590(this) || (Entrance_GetSceneId(this->nextEntrance + sceneLayer) < 0) ||
|
||||
(func_801A8A50(0) != NA_BGM_FINAL_HOURS))) {
|
||||
(Audio_GetActiveSequence(0) != NA_BGM_FINAL_HOURS))) {
|
||||
func_801A4058(20);
|
||||
gSaveContext.seqIndex = 0xFF;
|
||||
gSaveContext.nightSeqIndex = 0xFF;
|
||||
gSaveContext.seqId = 0xFF;
|
||||
gSaveContext.ambienceId = 0xFF;
|
||||
}
|
||||
|
||||
if (func_800FD768()) {
|
||||
func_801A4058(20);
|
||||
gSaveContext.seqIndex = 0xFF;
|
||||
gSaveContext.nightSeqIndex = 0xFF;
|
||||
gSaveContext.seqId = 0xFF;
|
||||
gSaveContext.ambienceId = 0xFF;
|
||||
}
|
||||
|
||||
if (func_800FE590(this) && (Entrance_GetSceneId(this->nextEntrance + sceneLayer) >= 0) &&
|
||||
(func_801A8A50(0) == NA_BGM_FINAL_HOURS)) {
|
||||
(Audio_GetActiveSequence(0) == NA_BGM_FINAL_HOURS)) {
|
||||
func_801A41C8(20);
|
||||
}
|
||||
}
|
||||
@@ -703,8 +706,8 @@ void Play_UpdateTransition(PlayState* this) {
|
||||
}
|
||||
|
||||
this->transitionCtx.setColor(&this->transitionCtx.instanceData, color);
|
||||
if (this->transitionCtx.setUnkColor != NULL) {
|
||||
this->transitionCtx.setUnkColor(&this->transitionCtx.instanceData, color);
|
||||
if (this->transitionCtx.setEnvColor != NULL) {
|
||||
this->transitionCtx.setEnvColor(&this->transitionCtx.instanceData, color);
|
||||
}
|
||||
|
||||
this->transitionCtx.setType(&this->transitionCtx.instanceData,
|
||||
@@ -1190,9 +1193,9 @@ void Play_Draw(PlayState* this) {
|
||||
var_fv0 = 12800.0f;
|
||||
}
|
||||
|
||||
func_8013F0D0(&this->view, this->view.fovy, this->view.zNear, var_fv0);
|
||||
View_SetPerspective(&this->view, this->view.fovy, this->view.zNear, var_fv0);
|
||||
|
||||
View_RenderView(&this->view, 0xF);
|
||||
View_Apply(&this->view, 0xF);
|
||||
|
||||
// The billboard matrix temporarily stores the viewing matrix
|
||||
Matrix_MtxToMtxF(&this->view.viewing, &this->billboardMtxF);
|
||||
@@ -1238,7 +1241,7 @@ void Play_Draw(PlayState* this) {
|
||||
|
||||
SET_FULLSCREEN_VIEWPORT(&spA8);
|
||||
|
||||
func_801400CC(&spA8, &sp218);
|
||||
View_ApplyTo(&spA8, &sp218);
|
||||
this->transitionCtx.draw(&this->transitionCtx.instanceData, &sp218);
|
||||
}
|
||||
|
||||
@@ -1421,7 +1424,7 @@ void Play_Draw(PlayState* this) {
|
||||
Vec3s sp4C;
|
||||
|
||||
Camera_Update(&sp4C, GET_ACTIVE_CAM(this));
|
||||
func_80140024(&this->view);
|
||||
View_UpdateViewingMatrix(&this->view);
|
||||
this->view.unk164 = 0;
|
||||
if ((this->skyboxId != 0) && !this->envCtx.skyboxDisabled) {
|
||||
SkyboxDraw_UpdateMatrix(&this->skyboxCtx, this->view.eye.x, this->view.eye.y, this->view.eye.z);
|
||||
@@ -2204,18 +2207,17 @@ void Play_Init(GameState* thisx) {
|
||||
if (((gSaveContext.gameMode != 0) && (gSaveContext.gameMode != 1)) || (gSaveContext.save.cutscene >= 0xFFF0)) {
|
||||
gSaveContext.unk_3DC0 = 0;
|
||||
Magic_Reset(this);
|
||||
gSaveContext.sceneSetupIndex = (gSaveContext.save.cutscene & 0xF) + 1;
|
||||
gSaveContext.sceneLayer = (gSaveContext.save.cutscene & 0xF) + 1;
|
||||
gSaveContext.save.cutscene = 0;
|
||||
} else {
|
||||
gSaveContext.sceneSetupIndex = 0;
|
||||
gSaveContext.sceneLayer = 0;
|
||||
}
|
||||
|
||||
sp87 = gSaveContext.sceneSetupIndex;
|
||||
sp87 = gSaveContext.sceneLayer;
|
||||
|
||||
Play_SpawnScene(
|
||||
this,
|
||||
Entrance_GetSceneIdAbsolute(((void)0, gSaveContext.save.entrance) + ((void)0, gSaveContext.sceneSetupIndex)),
|
||||
Entrance_GetSpawnNum(((void)0, gSaveContext.save.entrance) + ((void)0, gSaveContext.sceneSetupIndex)));
|
||||
this, Entrance_GetSceneIdAbsolute(((void)0, gSaveContext.save.entrance) + ((void)0, gSaveContext.sceneLayer)),
|
||||
Entrance_GetSpawnNum(((void)0, gSaveContext.save.entrance) + ((void)0, gSaveContext.sceneLayer)));
|
||||
KaleidoScopeCall_Init(this);
|
||||
func_80121FC4(this);
|
||||
|
||||
@@ -2317,8 +2319,8 @@ void Play_Init(GameState* thisx) {
|
||||
func_800F15D8(&this->mainCamera);
|
||||
func_801129E4(this);
|
||||
func_800FB758(this);
|
||||
gSaveContext.seqIndex = this->soundCtx.seqIndex;
|
||||
gSaveContext.nightSeqIndex = this->soundCtx.nightSeqIndex;
|
||||
gSaveContext.seqId = this->sequenceCtx.seqId;
|
||||
gSaveContext.ambienceId = this->sequenceCtx.ambienceId;
|
||||
AnimationContext_Update(this, &this->animationCtx);
|
||||
func_800EDBE0(this);
|
||||
gSaveContext.respawnFlag = 0;
|
||||
|
||||
@@ -1107,7 +1107,7 @@ void Player_DrawGetItemImpl(PlayState* play, Player* player, Vec3f* refPos, s32
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
gSegments[6] = PHYSICAL_TO_VIRTUAL(player->giObjectSegment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(player->giObjectSegment);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, player->giObjectSegment);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x06, player->giObjectSegment);
|
||||
@@ -1187,7 +1187,7 @@ void func_80127488(PlayState* play, Player* player, u8 alpha) {
|
||||
}
|
||||
|
||||
void Player_DrawCouplesMask(PlayState* play, Player* player) {
|
||||
gSegments[0xA] = PHYSICAL_TO_VIRTUAL(player->maskObjectSegment);
|
||||
gSegments[0xA] = VIRTUAL_TO_PHYSICAL(player->maskObjectSegment);
|
||||
AnimatedMat_DrawOpa(play, Lib_SegmentedToVirtual(&object_mask_meoto_Matanimheader_001CD8));
|
||||
}
|
||||
|
||||
|
||||
+185
-120
@@ -1,7 +1,47 @@
|
||||
#include "global.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64view.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 randIndex;
|
||||
/* 0x02 */ s16 countdownMax;
|
||||
/* 0x04 */ Camera* camera;
|
||||
/* 0x08 */ u32 type;
|
||||
/* 0x0C */ s16 verticalMag;
|
||||
/* 0x0E */ s16 horizontalMag;
|
||||
/* 0x10 */ s16 zoom;
|
||||
/* 0x12 */ s16 rollOffset;
|
||||
/* 0x14 */ Vec3s shakePlaneOffset; // angle deviations from shaking in the perpendicular plane
|
||||
/* 0x1A */ s16 speed;
|
||||
/* 0x1C */ s16 isShakePerpendicular;
|
||||
/* 0x1E */ s16 countdown;
|
||||
/* 0x20 */ s16 camId;
|
||||
} QuakeRequest; // size = 0x24
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ PlayState* play;
|
||||
/* 0x4 */ s32 type; // bitfield, highest set bit determines type
|
||||
/* 0x8 */ s16 countdown;
|
||||
/* 0xA */ s16 state;
|
||||
} DistortionRequest; // size = 0xC
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3f atOffset;
|
||||
/* 0x0C */ Vec3f eyeOffset;
|
||||
/* 0x18 */ s16 rollOffset;
|
||||
/* 0x1A */ s16 zoom;
|
||||
} ShakeInfo; // size = 0x1C
|
||||
|
||||
typedef s16 (*QuakeCallbackFunc)(QuakeRequest*, ShakeInfo*);
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ DISTORTION_INACTIVE,
|
||||
/* 1 */ DISTORTION_ACTIVE,
|
||||
/* 2 */ DISTORTION_SETUP
|
||||
} DistortionState;
|
||||
|
||||
QuakeRequest sQuakeRequest[4];
|
||||
DistortionContext sDistortionContext;
|
||||
DistortionRequest sDistortionRequest;
|
||||
|
||||
static s16 sIsQuakeInitialized = true;
|
||||
static s16 sQuakeRequestCount = 0;
|
||||
@@ -51,7 +91,7 @@ void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 verticalPert
|
||||
shake->zoom = req->zoom * verticalPertubation;
|
||||
}
|
||||
|
||||
s16 Quake_Callback1(QuakeRequest* req, ShakeInfo* shake) {
|
||||
s16 Quake_CallbackType1(QuakeRequest* req, ShakeInfo* shake) {
|
||||
if (req->countdown > 0) {
|
||||
f32 perpendicularPertubation = Math_SinS(req->speed * req->countdown);
|
||||
|
||||
@@ -61,7 +101,7 @@ s16 Quake_Callback1(QuakeRequest* req, ShakeInfo* shake) {
|
||||
return req->countdown;
|
||||
}
|
||||
|
||||
s16 Quake_Callback5(QuakeRequest* req, ShakeInfo* shake) {
|
||||
s16 Quake_CallbackType5(QuakeRequest* req, ShakeInfo* shake) {
|
||||
if (req->countdown > 0) {
|
||||
f32 perpendicularPertubation = Math_SinS(req->speed * req->countdown);
|
||||
|
||||
@@ -71,7 +111,7 @@ s16 Quake_Callback5(QuakeRequest* req, ShakeInfo* shake) {
|
||||
return req->countdown;
|
||||
}
|
||||
|
||||
s16 Quake_Callback6(QuakeRequest* req, ShakeInfo* shake) {
|
||||
s16 Quake_CallbackType6(QuakeRequest* req, ShakeInfo* shake) {
|
||||
f32 perpendicularPertubation;
|
||||
|
||||
req->countdown--;
|
||||
@@ -80,7 +120,7 @@ s16 Quake_Callback6(QuakeRequest* req, ShakeInfo* shake) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s16 Quake_Callback3(QuakeRequest* req, ShakeInfo* shake) {
|
||||
s16 Quake_CallbackType3(QuakeRequest* req, ShakeInfo* shake) {
|
||||
if (req->countdown > 0) {
|
||||
f32 perpendicularPertubation =
|
||||
Math_SinS(req->speed * req->countdown) * ((f32)req->countdown / (f32)req->countdownMax);
|
||||
@@ -91,7 +131,7 @@ s16 Quake_Callback3(QuakeRequest* req, ShakeInfo* shake) {
|
||||
return req->countdown;
|
||||
}
|
||||
|
||||
s16 Quake_Callback2(QuakeRequest* req, ShakeInfo* shake) {
|
||||
s16 Quake_CallbackType2(QuakeRequest* req, ShakeInfo* shake) {
|
||||
if (req->countdown > 0) {
|
||||
f32 perpendicularPertubation = Quake_Random();
|
||||
|
||||
@@ -101,7 +141,7 @@ s16 Quake_Callback2(QuakeRequest* req, ShakeInfo* shake) {
|
||||
return req->countdown;
|
||||
}
|
||||
|
||||
s16 Quake_Callback4(QuakeRequest* req, ShakeInfo* shake) {
|
||||
s16 Quake_CallbackType4(QuakeRequest* req, ShakeInfo* shake) {
|
||||
if (req->countdown > 0) {
|
||||
f32 perpendicularPertubation = Quake_Random() * ((f32)req->countdown / (f32)req->countdownMax);
|
||||
|
||||
@@ -117,7 +157,7 @@ s16 Quake_GetFreeIndex(void) {
|
||||
s32 min = 0x10000;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sQuakeRequest); i++) {
|
||||
if (sQuakeRequest[i].callbackIdx == 0) {
|
||||
if (sQuakeRequest[i].type == 0) {
|
||||
ret = i;
|
||||
break;
|
||||
}
|
||||
@@ -131,43 +171,43 @@ s16 Quake_GetFreeIndex(void) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
QuakeRequest* Quake_AddImpl(Camera* camera, u32 callbackIdx) {
|
||||
s16 idx = Quake_GetFreeIndex();
|
||||
QuakeRequest* req = &sQuakeRequest[idx];
|
||||
QuakeRequest* Quake_AddImpl(Camera* camera, u32 type) {
|
||||
s16 index = Quake_GetFreeIndex();
|
||||
QuakeRequest* req = &sQuakeRequest[index];
|
||||
|
||||
__osMemset(req, 0, sizeof(QuakeRequest));
|
||||
req->camera = camera;
|
||||
req->camId = camera->camId;
|
||||
req->callbackIdx = callbackIdx;
|
||||
req->type = type;
|
||||
req->isShakePerpendicular = true;
|
||||
req->randIdx = ((s16)(Rand_ZeroOne() * (f32)0x10000) & ~3) + idx;
|
||||
req->randIndex = ((s16)(Rand_ZeroOne() * 0x10000) & ~3) + index;
|
||||
sQuakeRequestCount++;
|
||||
|
||||
return req;
|
||||
}
|
||||
|
||||
void Quake_Remove(QuakeRequest* req) {
|
||||
req->callbackIdx = 0;
|
||||
void Quake_RemoveRequest(QuakeRequest* req) {
|
||||
req->type = 0;
|
||||
req->countdown = -1;
|
||||
sQuakeRequestCount--;
|
||||
}
|
||||
|
||||
QuakeRequest* Quake_GetRequest(s16 idx) {
|
||||
QuakeRequest* req = &sQuakeRequest[idx & 3];
|
||||
QuakeRequest* Quake_GetRequest(s16 quakeIndex) {
|
||||
QuakeRequest* req = &sQuakeRequest[quakeIndex & 3];
|
||||
|
||||
if (req->callbackIdx == 0) {
|
||||
if (req->type == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (idx != req->randIdx) {
|
||||
if (quakeIndex != req->randIndex) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return req;
|
||||
}
|
||||
|
||||
u32 Quake_SetValue(s16 idx, s16 valueType, s16 value) {
|
||||
QuakeRequest* req = Quake_GetRequest(idx);
|
||||
u32 Quake_SetValue(s16 quakeIndex, s16 valueType, s16 value) {
|
||||
QuakeRequest* req = Quake_GetRequest(quakeIndex);
|
||||
|
||||
if (req == NULL) {
|
||||
return false;
|
||||
@@ -176,62 +216,75 @@ u32 Quake_SetValue(s16 idx, s16 valueType, s16 value) {
|
||||
case QUAKE_SPEED:
|
||||
req->speed = value;
|
||||
break;
|
||||
|
||||
case QUAKE_VERTICAL_MAG:
|
||||
req->verticalMag = value;
|
||||
break;
|
||||
|
||||
case QUAKE_HORIZONTAL_MAG:
|
||||
req->horizontalMag = value;
|
||||
break;
|
||||
|
||||
case QUAKE_ZOOM:
|
||||
req->zoom = value;
|
||||
break;
|
||||
|
||||
case QUAKE_ROLL_OFFSET:
|
||||
req->rollOffset = value;
|
||||
break;
|
||||
|
||||
case QUAKE_SHAKE_PLANE_OFFSET_X:
|
||||
req->shakePlaneOffset.x = value;
|
||||
break;
|
||||
|
||||
case QUAKE_SHAKE_PLANE_OFFSET_Y:
|
||||
req->shakePlaneOffset.y = value;
|
||||
break;
|
||||
|
||||
case QUAKE_SHAKE_PLANE_OFFSET_Z:
|
||||
req->shakePlaneOffset.z = value;
|
||||
break;
|
||||
|
||||
case QUAKE_COUNTDOWN:
|
||||
req->countdown = value;
|
||||
req->countdownMax = req->countdown;
|
||||
break;
|
||||
|
||||
case QUAKE_IS_SHAKE_PERPENDICULAR:
|
||||
req->isShakePerpendicular = value;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
u32 Quake_SetSpeed(s16 idx, s16 value) {
|
||||
QuakeRequest* req = Quake_GetRequest(idx);
|
||||
u32 Quake_SetSpeed(s16 quakeIndex, s16 speed) {
|
||||
QuakeRequest* req = Quake_GetRequest(quakeIndex);
|
||||
|
||||
if (req != NULL) {
|
||||
req->speed = value;
|
||||
req->speed = speed;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
u32 Quake_SetCountdown(s16 idx, s16 value) {
|
||||
QuakeRequest* req = Quake_GetRequest(idx);
|
||||
u32 Quake_SetCountdown(s16 quakeIndex, s16 countdown) {
|
||||
QuakeRequest* req = Quake_GetRequest(quakeIndex);
|
||||
|
||||
if (req != NULL) {
|
||||
req->countdown = value;
|
||||
req->countdown = countdown;
|
||||
req->countdownMax = req->countdown;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
s16 Quake_GetCountdown(s16 idx) {
|
||||
QuakeRequest* req = Quake_GetRequest(idx);
|
||||
s16 Quake_GetCountdown(s16 quakeIndex) {
|
||||
QuakeRequest* req = Quake_GetRequest(quakeIndex);
|
||||
|
||||
if (req != NULL) {
|
||||
return req->countdown;
|
||||
@@ -239,8 +292,8 @@ s16 Quake_GetCountdown(s16 idx) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 Quake_SetQuakeValues(s16 idx, s16 verticalMag, s16 horizontalMag, s16 zoom, s16 rollOffset) {
|
||||
QuakeRequest* req = Quake_GetRequest(idx);
|
||||
u32 Quake_SetQuakeValues(s16 quakeIndex, s16 verticalMag, s16 horizontalMag, s16 zoom, s16 rollOffset) {
|
||||
QuakeRequest* req = Quake_GetRequest(quakeIndex);
|
||||
|
||||
if (req != NULL) {
|
||||
req->verticalMag = verticalMag;
|
||||
@@ -252,8 +305,8 @@ u32 Quake_SetQuakeValues(s16 idx, s16 verticalMag, s16 horizontalMag, s16 zoom,
|
||||
return false;
|
||||
}
|
||||
|
||||
u32 Quake_SetQuakeValues2(s16 idx, s16 isShakePerpendicular, Vec3s shakePlaneOffset) {
|
||||
QuakeRequest* req = Quake_GetRequest(idx);
|
||||
u32 Quake_SetQuakeValues2(s16 quakeIndex, s16 isShakePerpendicular, Vec3s shakePlaneOffset) {
|
||||
QuakeRequest* req = Quake_GetRequest(quakeIndex);
|
||||
|
||||
if (req != NULL) {
|
||||
req->isShakePerpendicular = isShakePerpendicular;
|
||||
@@ -267,29 +320,35 @@ void Quake_Init(void) {
|
||||
s16 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sQuakeRequest); i++) {
|
||||
sQuakeRequest[i].callbackIdx = 0;
|
||||
sQuakeRequest[i].type = 0;
|
||||
sQuakeRequest[i].countdown = 0;
|
||||
}
|
||||
sIsQuakeInitialized = true;
|
||||
sQuakeRequestCount = 0;
|
||||
}
|
||||
|
||||
s16 Quake_Add(Camera* camera, u32 callbackIdx) {
|
||||
return Quake_AddImpl(camera, callbackIdx)->randIdx;
|
||||
s16 Quake_Add(Camera* camera, u32 type) {
|
||||
return Quake_AddImpl(camera, type)->randIndex;
|
||||
}
|
||||
|
||||
u32 Quake_RemoveFromIdx(s16 idx) {
|
||||
QuakeRequest* req = Quake_GetRequest(idx);
|
||||
u32 Quake_Remove(s16 index) {
|
||||
QuakeRequest* req = Quake_GetRequest(index);
|
||||
|
||||
if (req != NULL) {
|
||||
Quake_Remove(req);
|
||||
Quake_RemoveRequest(req);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static QuakeCallbackFunc sQuakeCallbacks[] = {
|
||||
NULL, Quake_Callback1, Quake_Callback2, Quake_Callback3, Quake_Callback4, Quake_Callback5, Quake_Callback6,
|
||||
NULL,
|
||||
Quake_CallbackType1,
|
||||
Quake_CallbackType2,
|
||||
Quake_CallbackType3,
|
||||
Quake_CallbackType4,
|
||||
Quake_CallbackType5,
|
||||
Quake_CallbackType6,
|
||||
};
|
||||
|
||||
s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData) {
|
||||
@@ -299,7 +358,7 @@ s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData) {
|
||||
f32 absSpeedDiv;
|
||||
f32 maxCurr;
|
||||
f32 maxNext;
|
||||
s32 idx;
|
||||
s32 index;
|
||||
s32 ret;
|
||||
u32 eq;
|
||||
Vec3f originVec;
|
||||
@@ -323,16 +382,16 @@ s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData) {
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
for (idx = 0; idx < ARRAY_COUNT(sQuakeRequest); idx++) {
|
||||
req = &sQuakeRequest[idx];
|
||||
if (req->callbackIdx != 0) {
|
||||
for (index = 0; index < ARRAY_COUNT(sQuakeRequest); index++) {
|
||||
req = &sQuakeRequest[index];
|
||||
if (req->type != 0) {
|
||||
if (play->cameraPtrs[req->camId] == NULL) {
|
||||
Quake_Remove(req);
|
||||
Quake_RemoveRequest(req);
|
||||
} else {
|
||||
eq = (camera->camId != req->camera->camId);
|
||||
absSpeedDiv = ABS(req->speed) / (f32)0x8000;
|
||||
if (sQuakeCallbacks[req->callbackIdx](req, &shake) == 0) {
|
||||
Quake_Remove(req);
|
||||
if (sQuakeCallbacks[req->type](req, &shake) == 0) {
|
||||
Quake_RemoveRequest(req);
|
||||
} else if (eq == 0) {
|
||||
if (fabsf(camData->atOffset.x) < fabsf(shake.atOffset.x)) {
|
||||
camData->atOffset.x = shake.atOffset.x;
|
||||
@@ -383,35 +442,35 @@ s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData) {
|
||||
}
|
||||
|
||||
void Distortion_Init(PlayState* play) {
|
||||
sDistortionContext.play = play;
|
||||
sDistortionRequest.play = play;
|
||||
View_ClearDistortion(&play->view);
|
||||
sDistortionContext.type = 0;
|
||||
sDistortionContext.countdown = 0;
|
||||
sDistortionContext.state = DISTORTION_INACTIVE;
|
||||
sDistortionRequest.type = 0;
|
||||
sDistortionRequest.countdown = 0;
|
||||
sDistortionRequest.state = DISTORTION_INACTIVE;
|
||||
}
|
||||
|
||||
void Distortion_SetCountdown(s16 countdown) {
|
||||
sDistortionContext.countdown = countdown;
|
||||
sDistortionContext.state = DISTORTION_SETUP;
|
||||
sDistortionRequest.countdown = countdown;
|
||||
sDistortionRequest.state = DISTORTION_SETUP;
|
||||
}
|
||||
|
||||
s16 Distortion_GetCountdown(void) {
|
||||
return sDistortionContext.countdown;
|
||||
return sDistortionRequest.countdown;
|
||||
}
|
||||
|
||||
s16 Distortion_GetType(void) {
|
||||
return sDistortionContext.type;
|
||||
return sDistortionRequest.type;
|
||||
}
|
||||
|
||||
void Distortion_SetType(s32 type) {
|
||||
if (sDistortionContext.type < type) {
|
||||
sDistortionContext.type = type;
|
||||
if (sDistortionRequest.type < type) {
|
||||
sDistortionRequest.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
void Distortion_ClearType(s32 type) {
|
||||
if (sDistortionContext.type == type) {
|
||||
sDistortionContext.type = 0;
|
||||
if (sDistortionRequest.type == type) {
|
||||
sDistortionRequest.type = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,9 +478,9 @@ void Distortion_ClearType(s32 type) {
|
||||
* Checks that the bg surface is an underwater conveyor type and if so, returns the conveyor speed
|
||||
*/
|
||||
s32 Distortion_GetUnderwaterCurrentSpeed(Player* player) {
|
||||
if (SurfaceType_GetConveyorType(&sDistortionContext.play->colCtx, player->actor.floorPoly,
|
||||
player->actor.floorBgId) == CONVEYOR_WATER) {
|
||||
return SurfaceType_GetConveyorSpeed(&sDistortionContext.play->colCtx, player->actor.floorPoly,
|
||||
if (!SurfaceType_IsFloorConveyor(&sDistortionRequest.play->colCtx, player->actor.floorPoly,
|
||||
player->actor.floorBgId)) {
|
||||
return SurfaceType_GetConveyorSpeed(&sDistortionRequest.play->colCtx, player->actor.floorPoly,
|
||||
player->actor.floorBgId);
|
||||
}
|
||||
return 0;
|
||||
@@ -446,14 +505,14 @@ void Distortion_Update(void) {
|
||||
f32 zScale;
|
||||
f32 speed;
|
||||
Player* player;
|
||||
PlayState* play = sDistortionContext.play;
|
||||
PlayState* play = sDistortionRequest.play;
|
||||
PosRot playerPosRot;
|
||||
Camera* camera = GET_ACTIVE_CAM(play);
|
||||
f32 speedRatio = CLAMP_MAX(camera->speedRatio, 1.0f);
|
||||
|
||||
if (sDistortionContext.type != 0) {
|
||||
if (sDistortionContext.type & 0x800) {
|
||||
sDistortionContext.countdown = 2;
|
||||
if (sDistortionRequest.type != 0) {
|
||||
if (sDistortionRequest.type & DISTORTION_TYPE_B) {
|
||||
sDistortionRequest.countdown = 2;
|
||||
depthPhase = 0x3F0;
|
||||
screenPlanePhase = 0x156;
|
||||
|
||||
@@ -469,11 +528,11 @@ void Distortion_Update(void) {
|
||||
zScale = 0.0f;
|
||||
|
||||
speed = 0.6f;
|
||||
xyScaleFactor = zScaleFactor = sDistortionContext.countdown / 60.0f;
|
||||
xyScaleFactor = zScaleFactor = sDistortionRequest.countdown / 60.0f;
|
||||
speedScaleFactor = 1.0f;
|
||||
} else if (sDistortionContext.type & 0x400) {
|
||||
if (sDistortionContext.state == DISTORTION_SETUP) {
|
||||
countdownMax = sDistortionContext.countdown;
|
||||
} else if (sDistortionRequest.type & DISTORTION_TYPE_A) {
|
||||
if (sDistortionRequest.state == DISTORTION_SETUP) {
|
||||
countdownMax = sDistortionRequest.countdown;
|
||||
depthPhase = 0x3F0;
|
||||
screenPlanePhase = 0x156;
|
||||
}
|
||||
@@ -490,11 +549,11 @@ void Distortion_Update(void) {
|
||||
zScale = 0.0f;
|
||||
|
||||
speed = 0.4f;
|
||||
xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionContext.countdown) / (f32)countdownMax;
|
||||
xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionRequest.countdown) / (f32)countdownMax;
|
||||
speedScaleFactor = 0.5f;
|
||||
} else if (sDistortionContext.type & 0x200) {
|
||||
if (sDistortionContext.state == DISTORTION_SETUP) {
|
||||
countdownMax = sDistortionContext.countdown;
|
||||
} else if (sDistortionRequest.type & DISTORTION_TYPE_9) {
|
||||
if (sDistortionRequest.state == DISTORTION_SETUP) {
|
||||
countdownMax = sDistortionRequest.countdown;
|
||||
depthPhase = 0x1FC;
|
||||
screenPlanePhase = 0x156;
|
||||
}
|
||||
@@ -511,11 +570,11 @@ void Distortion_Update(void) {
|
||||
zScale = 0.0f;
|
||||
|
||||
speed = 0.1f;
|
||||
xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionContext.countdown) / (f32)countdownMax;
|
||||
xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionRequest.countdown) / (f32)countdownMax;
|
||||
speedScaleFactor = 1.0f;
|
||||
} else if (sDistortionContext.type & 0x100) {
|
||||
if (sDistortionContext.state == DISTORTION_SETUP) {
|
||||
countdownMax = sDistortionContext.countdown;
|
||||
} else if (sDistortionRequest.type & DISTORTION_TYPE_8) {
|
||||
if (sDistortionRequest.state == DISTORTION_SETUP) {
|
||||
countdownMax = sDistortionRequest.countdown;
|
||||
depthPhase = 0x2710;
|
||||
screenPlanePhase = 0x3E8;
|
||||
}
|
||||
@@ -532,15 +591,15 @@ void Distortion_Update(void) {
|
||||
zScale = 0.01f;
|
||||
|
||||
speed = 1.5f;
|
||||
if (sDistortionContext.countdown < 5) {
|
||||
xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionContext.countdown) / (f32)countdownMax;
|
||||
if (sDistortionRequest.countdown < 5) {
|
||||
xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionRequest.countdown) / (f32)countdownMax;
|
||||
} else {
|
||||
xyScaleFactor = zScaleFactor = 0.0f;
|
||||
}
|
||||
speedScaleFactor = 1.0f;
|
||||
} else if (sDistortionContext.type & 0x80) {
|
||||
if (sDistortionContext.state == DISTORTION_SETUP) {
|
||||
countdownMax = sDistortionContext.countdown;
|
||||
} else if (sDistortionRequest.type & DISTORTION_TYPE_7) {
|
||||
if (sDistortionRequest.state == DISTORTION_SETUP) {
|
||||
countdownMax = sDistortionRequest.countdown;
|
||||
depthPhase = 0x4B0;
|
||||
screenPlanePhase = 0x7D0;
|
||||
}
|
||||
@@ -557,11 +616,11 @@ void Distortion_Update(void) {
|
||||
zScale = 0.01f;
|
||||
|
||||
speed = 1.5f;
|
||||
xyScaleFactor = zScaleFactor = sDistortionContext.countdown / (f32)countdownMax;
|
||||
xyScaleFactor = zScaleFactor = sDistortionRequest.countdown / (f32)countdownMax;
|
||||
speedScaleFactor = 1.0f;
|
||||
} else if (sDistortionContext.type & 0x40) {
|
||||
if (sDistortionContext.state == DISTORTION_SETUP) {
|
||||
countdownMax = sDistortionContext.countdown;
|
||||
} else if (sDistortionRequest.type & DISTORTION_TYPE_6) {
|
||||
if (sDistortionRequest.state == DISTORTION_SETUP) {
|
||||
countdownMax = sDistortionRequest.countdown;
|
||||
depthPhase = 0x9C4;
|
||||
screenPlanePhase = 0xBB8;
|
||||
}
|
||||
@@ -578,15 +637,15 @@ void Distortion_Update(void) {
|
||||
zScale = 0.01f;
|
||||
|
||||
speed = 1.3f;
|
||||
if (sDistortionContext.countdown < 4) {
|
||||
xyScaleFactor = zScaleFactor = sDistortionContext.countdown / (f32)countdownMax;
|
||||
if (sDistortionRequest.countdown < 4) {
|
||||
xyScaleFactor = zScaleFactor = sDistortionRequest.countdown / (f32)countdownMax;
|
||||
} else {
|
||||
xyScaleFactor = zScaleFactor = 0.0f;
|
||||
}
|
||||
speedScaleFactor = 1.0f;
|
||||
} else if (sDistortionContext.type & 0x20) {
|
||||
sDistortionContext.countdown = 2;
|
||||
if (sDistortionContext.state == DISTORTION_SETUP) {
|
||||
} else if (sDistortionRequest.type & DISTORTION_TYPE_5) {
|
||||
sDistortionRequest.countdown = 2;
|
||||
if (sDistortionRequest.state == DISTORTION_SETUP) {
|
||||
depthPhase = 0x9C4;
|
||||
screenPlanePhase = 0xBB8;
|
||||
}
|
||||
@@ -609,9 +668,9 @@ void Distortion_Update(void) {
|
||||
zScaleFactor = 1.0f;
|
||||
xyScaleFactor = 1.0f;
|
||||
speedScaleFactor = 1.0f;
|
||||
} else if (sDistortionContext.type & 0x10) {
|
||||
if (sDistortionContext.state == DISTORTION_SETUP) {
|
||||
countdownMax = sDistortionContext.countdown;
|
||||
} else if (sDistortionRequest.type & DISTORTION_TYPE_4) {
|
||||
if (sDistortionRequest.state == DISTORTION_SETUP) {
|
||||
countdownMax = sDistortionRequest.countdown;
|
||||
depthPhase = 0x760;
|
||||
screenPlanePhase = 0x1BC;
|
||||
}
|
||||
@@ -628,14 +687,14 @@ void Distortion_Update(void) {
|
||||
zScale = 0.2f;
|
||||
|
||||
speed = 0.25f;
|
||||
countdownRatio = sDistortionContext.countdown / (f32)countdownMax;
|
||||
countdownRatio = sDistortionRequest.countdown / (f32)countdownMax;
|
||||
zScaleFactor = xyScaleFactor = countdownRatio;
|
||||
speedScaleFactor = 1.0f;
|
||||
} else if (sDistortionContext.type & 8) {
|
||||
} else if (sDistortionRequest.type & DISTORTION_TYPE_3) {
|
||||
depthPhase = 0x3F0;
|
||||
screenPlanePhase = 0x156;
|
||||
|
||||
sDistortionContext.countdown = 2;
|
||||
sDistortionRequest.countdown = 2;
|
||||
player = GET_PLAYER(play);
|
||||
|
||||
if (player != NULL) {
|
||||
@@ -656,18 +715,21 @@ void Distortion_Update(void) {
|
||||
zScale = 0.03f;
|
||||
speed = 0.33f;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
xScale = -0.06f;
|
||||
yScale = 0.1f;
|
||||
zScale = 0.03f;
|
||||
speed = 0.33f;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
xScale = -0.06f;
|
||||
yScale = 0.1f;
|
||||
zScale = 0.03f;
|
||||
speed = 0.33f;
|
||||
break;
|
||||
|
||||
default:
|
||||
xScale = -0.06f;
|
||||
yScale = 0.1f;
|
||||
@@ -683,11 +745,11 @@ void Distortion_Update(void) {
|
||||
}
|
||||
zScaleFactor = -xyScaleFactor;
|
||||
speedScaleFactor = 1.0f;
|
||||
} else if (sDistortionContext.type & 4) {
|
||||
} else if (sDistortionRequest.type & DISTORTION_TYPE_2) {
|
||||
depthPhase = 0x3F0;
|
||||
screenPlanePhase = 0x156;
|
||||
|
||||
sDistortionContext.countdown = 2;
|
||||
sDistortionRequest.countdown = 2;
|
||||
player = GET_PLAYER(play);
|
||||
|
||||
depthPhaseStep = 359.2f;
|
||||
@@ -703,18 +765,21 @@ void Distortion_Update(void) {
|
||||
zScale = 0.08f;
|
||||
speed = 0.18f;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
xScale = 0.12f;
|
||||
yScale = 0.12f;
|
||||
zScale = 0.08f;
|
||||
speed = 0.12f;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
xScale = 0.12f;
|
||||
yScale = 0.12f;
|
||||
zScale = 0.08f;
|
||||
speed = 0.08f;
|
||||
break;
|
||||
|
||||
default:
|
||||
xScale = 0.12f;
|
||||
yScale = 0.12f;
|
||||
@@ -731,12 +796,12 @@ void Distortion_Update(void) {
|
||||
|
||||
xyScaleFactor = speedScaleFactor = (waterYScaleFactor * 0.15f) + 0.35f + (speedRatio * 0.4f);
|
||||
zScaleFactor = 0.9f - xyScaleFactor;
|
||||
} else if (sDistortionContext.type & 1) {
|
||||
} else if (sDistortionRequest.type & DISTORTION_TYPE_0) {
|
||||
// Gives a small mirage-like appearance
|
||||
depthPhase = 0x3F0;
|
||||
screenPlanePhase = 0x156;
|
||||
|
||||
sDistortionContext.countdown = 2;
|
||||
sDistortionRequest.countdown = 2;
|
||||
depthPhaseStep = 0.0f;
|
||||
screenPlanePhaseStep = 150.0f;
|
||||
|
||||
@@ -759,29 +824,29 @@ void Distortion_Update(void) {
|
||||
depthPhase += CAM_DEG_TO_BINANG(depthPhaseStep);
|
||||
screenPlanePhase += CAM_DEG_TO_BINANG(screenPlanePhaseStep);
|
||||
|
||||
View_SetDistortionDirRot(&sDistortionContext.play->view,
|
||||
Math_CosS(depthPhase) * (DEGF_TO_RADF(rotX) * xyScaleFactor),
|
||||
Math_SinS(depthPhase) * (DEGF_TO_RADF(rotY) * xyScaleFactor),
|
||||
Math_SinS(screenPlanePhase) * (DEGF_TO_RADF(rotZ) * zScaleFactor));
|
||||
View_SetDistortionScale(&sDistortionContext.play->view,
|
||||
View_SetDistortionOrientation(&sDistortionRequest.play->view,
|
||||
Math_CosS(depthPhase) * (DEGF_TO_RADF(rotX) * xyScaleFactor),
|
||||
Math_SinS(depthPhase) * (DEGF_TO_RADF(rotY) * xyScaleFactor),
|
||||
Math_SinS(screenPlanePhase) * (DEGF_TO_RADF(rotZ) * zScaleFactor));
|
||||
View_SetDistortionScale(&sDistortionRequest.play->view,
|
||||
(Math_SinS(screenPlanePhase) * (xScale * xyScaleFactor)) + 1.0f,
|
||||
(Math_CosS(screenPlanePhase) * (yScale * xyScaleFactor)) + 1.0f,
|
||||
(Math_CosS(depthPhase) * (zScale * zScaleFactor)) + 1.0f);
|
||||
View_SetDistortionSpeed(&sDistortionContext.play->view, speed * speedScaleFactor);
|
||||
View_SetDistortionSpeed(&sDistortionRequest.play->view, speed * speedScaleFactor);
|
||||
|
||||
sDistortionContext.state = DISTORTION_ACTIVE;
|
||||
sDistortionRequest.state = DISTORTION_ACTIVE;
|
||||
|
||||
} else if (sDistortionContext.state != DISTORTION_INACTIVE) {
|
||||
} else if (sDistortionRequest.state != DISTORTION_INACTIVE) {
|
||||
View_ClearDistortion(&play->view);
|
||||
|
||||
sDistortionContext.state = DISTORTION_INACTIVE;
|
||||
sDistortionContext.countdown = 0;
|
||||
sDistortionRequest.state = DISTORTION_INACTIVE;
|
||||
sDistortionRequest.countdown = 0;
|
||||
}
|
||||
|
||||
if (sDistortionContext.countdown != 0) {
|
||||
sDistortionContext.countdown--;
|
||||
if (sDistortionContext.countdown == 0) {
|
||||
sDistortionContext.type = 0;
|
||||
if (sDistortionRequest.countdown != 0) {
|
||||
sDistortionRequest.countdown--;
|
||||
if (sDistortionRequest.countdown == 0) {
|
||||
sDistortionRequest.type = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -790,16 +855,16 @@ s32 Quake_NumActiveQuakes(void) {
|
||||
QuakeRequest* req = sQuakeRequest;
|
||||
s32 numActiveQuakes = 0;
|
||||
|
||||
if (req[0].callbackIdx != 0) {
|
||||
if (req[0].type != 0) {
|
||||
numActiveQuakes++;
|
||||
}
|
||||
if (req[1].callbackIdx != 0) {
|
||||
if (req[1].type != 0) {
|
||||
numActiveQuakes++;
|
||||
}
|
||||
if (req[2].callbackIdx != 0) {
|
||||
if (req[2].type != 0) {
|
||||
numActiveQuakes++;
|
||||
}
|
||||
if (req[3].callbackIdx != 0) {
|
||||
if (req[3].type != 0) {
|
||||
numActiveQuakes++;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -105,7 +105,7 @@ s32 Room_HandleLoadCallbacks(PlayState* play, RoomContext* roomCtx) {
|
||||
roomCtx->unk31 = 0;
|
||||
roomCtx->curRoom.segment = roomCtx->activeRoomVram;
|
||||
// TODO: Segment number enum
|
||||
gSegments[0x03] = PHYSICAL_TO_VIRTUAL(roomCtx->activeRoomVram);
|
||||
gSegments[0x03] = VIRTUAL_TO_PHYSICAL(roomCtx->activeRoomVram);
|
||||
|
||||
Scene_ProcessHeader(play, (SceneCmd*)roomCtx->curRoom.segment);
|
||||
func_80123140(play, GET_PLAYER(play));
|
||||
@@ -130,7 +130,7 @@ s32 Room_HandleLoadCallbacks(PlayState* play, RoomContext* roomCtx) {
|
||||
void Room_Draw(PlayState* play, Room* room, u32 flags) {
|
||||
if (room->segment != NULL) {
|
||||
// TODO: Segment number enum
|
||||
gSegments[0x03] = PHYSICAL_TO_VIRTUAL(room->segment);
|
||||
gSegments[0x03] = VIRTUAL_TO_PHYSICAL(room->segment);
|
||||
roomDrawFuncs[room->mesh->type0.type](play, room, flags);
|
||||
}
|
||||
return;
|
||||
|
||||
+12
-11
@@ -52,7 +52,7 @@ void Object_InitBank(GameState* gameState, ObjectContext* objectCtx) {
|
||||
objectCtx->spaceEnd = (void*)((u32)objectCtx->spaceStart + spaceSize);
|
||||
objectCtx->mainKeepIndex = Object_Spawn(objectCtx, GAMEPLAY_KEEP);
|
||||
|
||||
gSegments[0x04] = PHYSICAL_TO_VIRTUAL(objectCtx->status[objectCtx->mainKeepIndex].segment);
|
||||
gSegments[0x04] = VIRTUAL_TO_PHYSICAL(objectCtx->status[objectCtx->mainKeepIndex].segment);
|
||||
}
|
||||
|
||||
void Object_UpdateBank(ObjectContext* objectCtx) {
|
||||
@@ -108,7 +108,7 @@ s32 Object_IsLoaded(ObjectContext* objectCtx, s32 index) {
|
||||
void Object_LoadAll(ObjectContext* objectCtx) {
|
||||
s32 i;
|
||||
s32 id;
|
||||
u32 vromSize;
|
||||
uintptr_t vromSize;
|
||||
|
||||
for (i = 0; i < objectCtx->num; i++) {
|
||||
id = objectCtx->status[i].id;
|
||||
@@ -124,7 +124,7 @@ void Object_LoadAll(ObjectContext* objectCtx) {
|
||||
|
||||
void* func_8012F73C(ObjectContext* objectCtx, s32 iParm2, s16 id) {
|
||||
u32 addr;
|
||||
u32 vromSize;
|
||||
uintptr_t vromSize;
|
||||
RomFile* fileTableEntry;
|
||||
|
||||
objectCtx->status[iParm2].id = -id;
|
||||
@@ -224,7 +224,7 @@ void Scene_HeaderCmdSpecialFiles(PlayState* play, SceneCmd* cmd) {
|
||||
if (cmd->specialFiles.subKeepIndex != 0) {
|
||||
play->objectCtx.subKeepIndex = Object_Spawn(&play->objectCtx, cmd->specialFiles.subKeepIndex);
|
||||
// TODO: Segment number enum?
|
||||
gSegments[0x05] = PHYSICAL_TO_VIRTUAL(play->objectCtx.status[play->objectCtx.subKeepIndex].segment);
|
||||
gSegments[0x05] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[play->objectCtx.subKeepIndex].segment);
|
||||
}
|
||||
|
||||
if (cmd->specialFiles.cUpElfMsgNum != 0) {
|
||||
@@ -350,7 +350,7 @@ void Scene_LoadAreaTextures(PlayState* play, s32 fileIndex) {
|
||||
{ SEGMENT_ROM_START(scene_texture_07), SEGMENT_ROM_END(scene_texture_07) },
|
||||
{ SEGMENT_ROM_START(scene_texture_08), SEGMENT_ROM_END(scene_texture_08) },
|
||||
};
|
||||
u32 vromStart = sceneTextureFiles[fileIndex].vromStart;
|
||||
uintptr_t vromStart = sceneTextureFiles[fileIndex].vromStart;
|
||||
size_t size = sceneTextureFiles[fileIndex].vromEnd - vromStart;
|
||||
|
||||
if (size != 0) {
|
||||
@@ -436,11 +436,12 @@ void Scene_HeaderCmd09(PlayState* play, SceneCmd* cmd) {
|
||||
|
||||
// SceneTableEntry Header Command 0x15: Sound Settings=
|
||||
void Scene_HeaderCmdSoundSettings(PlayState* play, SceneCmd* cmd) {
|
||||
play->soundCtx.seqIndex = cmd->soundSettings.musicSeq;
|
||||
play->soundCtx.nightSeqIndex = cmd->soundSettings.nighttimeSFX;
|
||||
play->sequenceCtx.seqId = cmd->soundSettings.seqId;
|
||||
play->sequenceCtx.ambienceId = cmd->soundSettings.ambienceId;
|
||||
|
||||
if (gSaveContext.seqIndex == (u8)NA_BGM_DISABLED || func_801A8A50(0) == NA_BGM_FINAL_HOURS) {
|
||||
audio_setBGM(cmd->soundSettings.bgmId);
|
||||
if (gSaveContext.seqId == (u8)NA_BGM_DISABLED ||
|
||||
Audio_GetActiveSequence(SEQ_PLAYER_BGM_MAIN) == NA_BGM_FINAL_HOURS) {
|
||||
Audio_SetSpec(cmd->soundSettings.specId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,9 +455,9 @@ void Scene_HeaderCmdAltHeaderList(PlayState* play, SceneCmd* cmd) {
|
||||
SceneCmd** altHeaderList;
|
||||
SceneCmd* altHeader;
|
||||
|
||||
if (gSaveContext.sceneSetupIndex != 0) {
|
||||
if (gSaveContext.sceneLayer != 0) {
|
||||
altHeaderList = Lib_SegmentedToVirtual(cmd->altHeaders.segment);
|
||||
altHeader = altHeaderList[gSaveContext.sceneSetupIndex - 1];
|
||||
altHeader = altHeaderList[gSaveContext.sceneLayer - 1];
|
||||
|
||||
if (altHeader != NULL) {
|
||||
Scene_ProcessHeader(play, Lib_SegmentedToVirtual(altHeader));
|
||||
|
||||
@@ -459,8 +459,8 @@ void AnimatedMat_DrawStep(PlayState* play, AnimatedMaterial* matAnim, u32 step)
|
||||
/**
|
||||
* Draws an animated material with a step to only the OPA buffer.
|
||||
*/
|
||||
void AnimatedMat_DrawStepOpa(PlayState* play, AnimatedMaterial* textures, u32 step) {
|
||||
AnimatedMat_DrawMain(play, textures, 1, step, 1);
|
||||
void AnimatedMat_DrawStepOpa(PlayState* play, AnimatedMaterial* matAnim, u32 step) {
|
||||
AnimatedMat_DrawMain(play, matAnim, 1, step, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+50
-43
@@ -4,70 +4,78 @@
|
||||
*/
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "z64shrink_window.h"
|
||||
|
||||
ShrinkWindowContext gShrinkWindowContext;
|
||||
ShrinkWindowContext* gShrinkWindowContextPtr;
|
||||
typedef struct {
|
||||
/* 0x0 */ s8 letterboxTarget;
|
||||
/* 0x1 */ s8 letterboxSize;
|
||||
/* 0x2 */ s8 pillarboxTarget;
|
||||
/* 0x3 */ s8 pillarboxSize;
|
||||
} ShrinkWindow; // size = 0x4
|
||||
|
||||
void ShrinkWindow_SetLetterboxTarget(s32 target) {
|
||||
gShrinkWindowContextPtr->letterboxTarget = target;
|
||||
ShrinkWindow sShrinkWindow;
|
||||
ShrinkWindow* sShrinkWindowPtr;
|
||||
|
||||
void ShrinkWindow_Letterbox_SetSizeTarget(s32 target) {
|
||||
sShrinkWindowPtr->letterboxTarget = target;
|
||||
}
|
||||
|
||||
s32 ShrinkWindow_GetLetterboxTarget(void) {
|
||||
return gShrinkWindowContextPtr->letterboxTarget;
|
||||
s32 ShrinkWindow_Letterbox_GetSizeTarget(void) {
|
||||
return sShrinkWindowPtr->letterboxTarget;
|
||||
}
|
||||
|
||||
void ShrinkWindow_SetLetterboxMagnitude(s32 magnitude) {
|
||||
gShrinkWindowContextPtr->letterboxMagnitude = magnitude;
|
||||
void ShrinkWindow_Letterbox_SetSize(s32 size) {
|
||||
sShrinkWindowPtr->letterboxSize = size;
|
||||
}
|
||||
|
||||
s32 ShrinkWindow_GetLetterboxMagnitude(void) {
|
||||
return gShrinkWindowContextPtr->letterboxMagnitude;
|
||||
s32 ShrinkWindow_Letterbox_GetSize(void) {
|
||||
return sShrinkWindowPtr->letterboxSize;
|
||||
}
|
||||
|
||||
void ShrinkWindow_SetPillarboxTarget(s32 target) {
|
||||
gShrinkWindowContextPtr->pillarboxTarget = target;
|
||||
void ShrinkWindow_Pillarbox_SetSizeTarget(s32 target) {
|
||||
sShrinkWindowPtr->pillarboxTarget = target;
|
||||
}
|
||||
|
||||
s32 ShrinkWindow_GetPillarboxTarget(void) {
|
||||
return gShrinkWindowContextPtr->pillarboxTarget;
|
||||
s32 ShrinkWindow_Pillarbox_GetSizeTarget(void) {
|
||||
return sShrinkWindowPtr->pillarboxTarget;
|
||||
}
|
||||
|
||||
void ShrinkWindow_SetPillarboxMagnitude(s32 magnitude) {
|
||||
gShrinkWindowContextPtr->pillarboxMagnitude = magnitude;
|
||||
void ShrinkWindow_Pillarbox_SetSize(s32 size) {
|
||||
sShrinkWindowPtr->pillarboxSize = size;
|
||||
}
|
||||
|
||||
s32 ShrinkWindow_GetPillarboxMagnitude(void) {
|
||||
return gShrinkWindowContextPtr->pillarboxMagnitude;
|
||||
s32 ShrinkWindow_Pillarbox_GetSize(void) {
|
||||
return sShrinkWindowPtr->pillarboxSize;
|
||||
}
|
||||
|
||||
void ShrinkWindow_Init(void) {
|
||||
gShrinkWindowContextPtr = &gShrinkWindowContext;
|
||||
bzero(gShrinkWindowContextPtr, sizeof(gShrinkWindowContext));
|
||||
sShrinkWindowPtr = &sShrinkWindow;
|
||||
bzero(sShrinkWindowPtr, sizeof(sShrinkWindow));
|
||||
}
|
||||
|
||||
void ShrinkWindow_Destroy(void) {
|
||||
gShrinkWindowContextPtr = NULL;
|
||||
sShrinkWindowPtr = NULL;
|
||||
}
|
||||
|
||||
void ShrinkWindow_Update(s32 framerateDivisor) {
|
||||
s32 step = ((framerateDivisor == 3) ? 10 : 30 / framerateDivisor);
|
||||
s32 nextMagnitude;
|
||||
s32 step = (framerateDivisor == 3) ? 10 : (30 / framerateDivisor);
|
||||
s32 nextSize;
|
||||
|
||||
nextMagnitude = gShrinkWindowContextPtr->letterboxMagnitude;
|
||||
Math_StepToIGet(&nextMagnitude, gShrinkWindowContextPtr->letterboxTarget, step);
|
||||
gShrinkWindowContextPtr->letterboxMagnitude = nextMagnitude;
|
||||
nextSize = sShrinkWindowPtr->letterboxSize;
|
||||
Math_StepToIGet(&nextSize, sShrinkWindowPtr->letterboxTarget, step);
|
||||
sShrinkWindowPtr->letterboxSize = nextSize;
|
||||
|
||||
nextMagnitude = gShrinkWindowContextPtr->pillarboxMagnitude;
|
||||
Math_StepToIGet(&nextMagnitude, gShrinkWindowContextPtr->pillarboxTarget, step);
|
||||
gShrinkWindowContextPtr->pillarboxMagnitude = nextMagnitude;
|
||||
nextSize = sShrinkWindowPtr->pillarboxSize;
|
||||
Math_StepToIGet(&nextSize, sShrinkWindowPtr->pillarboxTarget, step);
|
||||
sShrinkWindowPtr->pillarboxSize = nextSize;
|
||||
}
|
||||
|
||||
void ShrinkWindow_Draw(GraphicsContext* gfxCtx) {
|
||||
Gfx* gfx;
|
||||
s8 letterboxMagnitude = gShrinkWindowContextPtr->letterboxMagnitude;
|
||||
s8 pillarboxMagnitude = gShrinkWindowContextPtr->pillarboxMagnitude;
|
||||
s8 letterboxSize = sShrinkWindowPtr->letterboxSize;
|
||||
s8 pillarboxSize = sShrinkWindowPtr->pillarboxSize;
|
||||
|
||||
if (letterboxMagnitude > 0) {
|
||||
if (letterboxSize > 0) {
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
gfx = OVERLAY_DISP;
|
||||
@@ -76,23 +84,23 @@ void ShrinkWindow_Draw(GraphicsContext* gfxCtx) {
|
||||
gDPSetCycleType(gfx++, G_CYC_FILL);
|
||||
gDPSetRenderMode(gfx++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(gfx++, (GPACK_RGBA5551(0, 0, 0, 1) << 16) | GPACK_RGBA5551(0, 0, 0, 1));
|
||||
gDPFillRectangle(gfx++, 0, 0, gScreenWidth - 1, letterboxMagnitude - 1);
|
||||
gDPFillRectangle(gfx++, 0, gScreenHeight - letterboxMagnitude, gScreenWidth - 1, gScreenHeight - 1);
|
||||
gDPFillRectangle(gfx++, 0, 0, gScreenWidth - 1, letterboxSize - 1);
|
||||
gDPFillRectangle(gfx++, 0, gScreenHeight - letterboxSize, gScreenWidth - 1, gScreenHeight - 1);
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetCycleType(gfx++, G_CYC_1CYCLE);
|
||||
gDPSetRenderMode(gfx++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
|
||||
gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, 0);
|
||||
gDPFillRectangle(gfx++, 0, letterboxMagnitude, gScreenWidth, letterboxMagnitude + 1);
|
||||
gDPFillRectangle(gfx++, 0, gScreenHeight - letterboxMagnitude - 1, gScreenWidth,
|
||||
gScreenHeight - letterboxMagnitude);
|
||||
gDPFillRectangle(gfx++, 0, letterboxSize, gScreenWidth, letterboxSize + 1);
|
||||
gDPFillRectangle(gfx++, 0, gScreenHeight - letterboxSize - 1, gScreenWidth, gScreenHeight - letterboxSize);
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
OVERLAY_DISP = gfx++;
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
if (pillarboxMagnitude > 0) {
|
||||
|
||||
if (pillarboxSize > 0) {
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
gfx = OVERLAY_DISP;
|
||||
@@ -102,17 +110,16 @@ void ShrinkWindow_Draw(GraphicsContext* gfxCtx) {
|
||||
gDPSetRenderMode(gfx++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(gfx++, (GPACK_RGBA5551(0, 0, 0, 1) << 16) | GPACK_RGBA5551(0, 0, 0, 1));
|
||||
|
||||
gDPFillRectangle(gfx++, 0, 0, pillarboxMagnitude - 1, gScreenHeight - 1);
|
||||
gDPFillRectangle(gfx++, gScreenWidth - pillarboxMagnitude, 0, gScreenWidth - 1, gScreenHeight - 1);
|
||||
gDPFillRectangle(gfx++, 0, 0, pillarboxSize - 1, gScreenHeight - 1);
|
||||
gDPFillRectangle(gfx++, gScreenWidth - pillarboxSize, 0, gScreenWidth - 1, gScreenHeight - 1);
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetCycleType(gfx++, G_CYC_1CYCLE);
|
||||
gDPSetRenderMode(gfx++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
|
||||
gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
gDPFillRectangle(gfx++, pillarboxMagnitude, 0, pillarboxMagnitude + 2, gScreenHeight);
|
||||
gDPFillRectangle(gfx++, gScreenWidth - pillarboxMagnitude - 2, 0, gScreenWidth - pillarboxMagnitude,
|
||||
gScreenHeight);
|
||||
gDPFillRectangle(gfx++, pillarboxSize, 0, pillarboxSize + 2, gScreenHeight);
|
||||
gDPFillRectangle(gfx++, gScreenWidth - pillarboxSize - 2, 0, gScreenWidth - pillarboxSize, gScreenHeight);
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
OVERLAY_DISP = gfx++;
|
||||
|
||||
@@ -8,9 +8,9 @@ s32 SkelAnime_LoopFull(SkelAnime* skelAnime);
|
||||
s32 SkelAnime_LoopPartial(SkelAnime* skelAnime);
|
||||
s32 SkelAnime_Once(SkelAnime* skelAnime);
|
||||
void Animation_PlayLoop(SkelAnime* skelAnime, AnimationHeader* animation);
|
||||
void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* pos, s16 angle);
|
||||
void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle);
|
||||
void LinkAnimation_Change(PlayState* play, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 playSpeed,
|
||||
f32 frame, f32 frameCount, u8 animationMode, f32 morphFrames);
|
||||
f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames);
|
||||
void SkelAnime_CopyFrameTable(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src);
|
||||
|
||||
static AnimationEntryCallback sAnimationLoadDone[] = {
|
||||
|
||||
@@ -292,8 +292,8 @@ void Sram_SaveEndOfCycle(PlayState* play) {
|
||||
gSaveContext.cycleSceneFlags[i].collectible = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gSaveContext.maskMaskBit); i++) {
|
||||
gSaveContext.maskMaskBit[i] = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(gSaveContext.masksGivenOnMoon); i++) {
|
||||
gSaveContext.masksGivenOnMoon[i] = 0;
|
||||
}
|
||||
|
||||
if (gSaveContext.save.weekEventReg[84] & 0x20) {
|
||||
|
||||
+142
-105
@@ -1,4 +1,9 @@
|
||||
#include "global.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "z64view.h"
|
||||
|
||||
s32 View_ApplyPerspective(View* view);
|
||||
s32 View_ApplyOrtho(View* view);
|
||||
|
||||
void View_ViewportToVp(Vp* dest, Viewport* src) {
|
||||
s32 width = src->rightX - src->leftX;
|
||||
@@ -13,41 +18,45 @@ void View_ViewportToVp(Vp* dest, Viewport* src) {
|
||||
dest->vp.vtrans[2] = 0x01FF;
|
||||
dest->vp.vtrans[3] = 0;
|
||||
|
||||
if (src->leftX == 0 && src->rightX == 576 && src->topY == 0 && src->bottomY) {}
|
||||
if ((src->leftX == 0) && (src->rightX == SCREEN_WIDTH_HIGH_RES) && (src->topY == 0) &&
|
||||
(src->bottomY == SCREEN_HEIGHT_HIGH_RES)) {}
|
||||
}
|
||||
|
||||
void View_Init(View* view, GraphicsContext* gfxCtx) {
|
||||
view->gfxCtx = gfxCtx;
|
||||
|
||||
view->viewport.topY = 0;
|
||||
view->viewport.bottomY = 240;
|
||||
view->viewport.bottomY = SCREEN_HEIGHT;
|
||||
view->viewport.leftX = 0;
|
||||
view->viewport.rightX = 320;
|
||||
view->viewport.rightX = SCREEN_WIDTH;
|
||||
|
||||
view->magic = 0x56494557; // "VIEW"
|
||||
|
||||
view->unk164 = 0;
|
||||
view->flags = 1 | 2 | 4;
|
||||
|
||||
if (1) {
|
||||
;
|
||||
}
|
||||
if (1) {}
|
||||
|
||||
view->scale = 1.0f;
|
||||
view->up.y = 1.0f;
|
||||
view->fovy = 60.0f;
|
||||
view->eye.x = 0.0f;
|
||||
view->eye.y = 0.0f;
|
||||
view->at.x = 0.0f;
|
||||
view->up.x = 0.0f;
|
||||
view->up.z = 0.0f;
|
||||
view->zNear = 10.0f;
|
||||
view->zFar = 12800.0f;
|
||||
|
||||
view->eye.x = 0.0f;
|
||||
view->eye.y = 0.0f;
|
||||
view->eye.z = -1.0f;
|
||||
|
||||
view->at.x = 0.0f;
|
||||
|
||||
view->up.x = 0.0f;
|
||||
view->up.y = 1.0f;
|
||||
view->up.z = 0.0f;
|
||||
|
||||
view->unk164 = 0;
|
||||
view->flags = VIEW_VIEWING | VIEW_VIEWPORT | VIEW_PROJECTION_PERSPECTIVE;
|
||||
|
||||
View_InitDistortion(view);
|
||||
}
|
||||
|
||||
void View_SetViewOrientation(View* view, Vec3f* eye, Vec3f* at, Vec3f* up) {
|
||||
if (eye->x == at->x && eye->z == at->z) {
|
||||
void View_LookAt(View* view, Vec3f* eye, Vec3f* at, Vec3f* up) {
|
||||
if ((eye->x == at->x) && (eye->z == at->z)) {
|
||||
eye->z += 0.1f;
|
||||
up->z = 0.0f;
|
||||
up->x = 0.0f;
|
||||
@@ -57,17 +66,21 @@ void View_SetViewOrientation(View* view, Vec3f* eye, Vec3f* at, Vec3f* up) {
|
||||
view->eye = *eye;
|
||||
view->at = *at;
|
||||
view->up = *up;
|
||||
view->flags |= 1;
|
||||
view->flags |= VIEW_VIEWING;
|
||||
}
|
||||
|
||||
void func_8013F050(View* view, Vec3f* eye, Vec3f* at, Vec3f* up) {
|
||||
/*
|
||||
* Unused. View_LookAt is always used instead. This version is similar but
|
||||
* is missing the input sanitization and the update to the flags.
|
||||
*/
|
||||
void View_LookAtUnsafe(View* view, Vec3f* eye, Vec3f* at, Vec3f* up) {
|
||||
view->eye = *eye;
|
||||
view->at = *at;
|
||||
view->up = *up;
|
||||
}
|
||||
|
||||
void View_SetScale(View* view, f32 scale) {
|
||||
view->flags |= 4;
|
||||
view->flags |= VIEW_PROJECTION_PERSPECTIVE;
|
||||
view->scale = scale;
|
||||
}
|
||||
|
||||
@@ -75,28 +88,32 @@ void View_GetScale(View* view, f32* scale) {
|
||||
*scale = view->scale;
|
||||
}
|
||||
|
||||
void func_8013F0D0(View* view, f32 fovy, f32 zNear, f32 zFar) {
|
||||
void View_SetPerspective(View* view, f32 fovy, f32 zNear, f32 zFar) {
|
||||
view->fovy = fovy;
|
||||
view->zNear = zNear;
|
||||
view->zFar = zFar;
|
||||
view->flags |= 4;
|
||||
view->flags |= VIEW_PROJECTION_PERSPECTIVE;
|
||||
}
|
||||
|
||||
void func_8013F100(View* view, f32* fovy, f32* zNear, f32* zFar) {
|
||||
void View_GetPerspective(View* view, f32* fovy, f32* zNear, f32* zFar) {
|
||||
*fovy = view->fovy;
|
||||
*zNear = view->zNear;
|
||||
*zFar = view->zFar;
|
||||
}
|
||||
|
||||
void func_8013F120(View* view, f32 fovy, f32 zNear, f32 zFar) {
|
||||
void View_SetOrtho(View* view, f32 fovy, f32 zNear, f32 zFar) {
|
||||
view->fovy = fovy;
|
||||
view->zNear = zNear;
|
||||
view->zFar = zFar;
|
||||
view->flags |= 8;
|
||||
view->flags |= VIEW_PROJECTION_ORTHO;
|
||||
view->scale = 1.0f;
|
||||
}
|
||||
|
||||
void func_8013F15C(View* view, f32* fovy, f32* zNear, f32* zFar) {
|
||||
/*
|
||||
* Identical to View_GetPerspective, and never called.
|
||||
* Named as it seems to fit the "set, get" pattern.
|
||||
*/
|
||||
void View_GetOrtho(View* view, f32* fovy, f32* zNear, f32* zFar) {
|
||||
*fovy = view->fovy;
|
||||
*zNear = view->zNear;
|
||||
*zFar = view->zFar;
|
||||
@@ -104,14 +121,14 @@ void func_8013F15C(View* view, f32* fovy, f32* zNear, f32* zFar) {
|
||||
|
||||
void View_SetViewport(View* view, Viewport* viewport) {
|
||||
view->viewport = *viewport;
|
||||
view->flags |= 2;
|
||||
view->flags |= VIEW_VIEWPORT;
|
||||
}
|
||||
|
||||
void View_GetViewport(View* view, Viewport* viewport) {
|
||||
*viewport = view->viewport;
|
||||
}
|
||||
|
||||
void View_WriteScissor(Gfx** gfx, s32 ulx, s32 uly, s32 lrx, s32 lry) {
|
||||
void View_SetScissor(Gfx** gfx, s32 ulx, s32 uly, s32 lrx, s32 lry) {
|
||||
Gfx* gfxp = *gfx;
|
||||
|
||||
gDPSetScissor(gfxp++, G_SC_NON_INTERLACE, ulx, uly, lrx, lry);
|
||||
@@ -119,7 +136,7 @@ void View_WriteScissor(Gfx** gfx, s32 ulx, s32 uly, s32 lrx, s32 lry) {
|
||||
*gfx = gfxp;
|
||||
}
|
||||
|
||||
void View_SyncAndWriteScissor(View* view, Gfx** gfx) {
|
||||
void View_ClearScissor(View* view, Gfx** gfx) {
|
||||
Gfx* gfxp = *gfx;
|
||||
s32 ulx = view->viewport.leftX;
|
||||
s32 uly = view->viewport.topY;
|
||||
@@ -127,12 +144,12 @@ void View_SyncAndWriteScissor(View* view, Gfx** gfx) {
|
||||
s32 lry = view->viewport.bottomY;
|
||||
|
||||
gDPPipeSync(gfxp++);
|
||||
View_WriteScissor(&gfxp, ulx, uly, lrx, lry);
|
||||
View_SetScissor(&gfxp, ulx, uly, lrx, lry);
|
||||
|
||||
*gfx = gfxp;
|
||||
}
|
||||
|
||||
void View_SetScissorForLetterbox(View* view) {
|
||||
void View_ApplyLetterbox(View* view) {
|
||||
s32 letterboxY;
|
||||
s32 letterboxX;
|
||||
s32 pad1;
|
||||
@@ -143,20 +160,21 @@ void View_SetScissorForLetterbox(View* view) {
|
||||
|
||||
OPEN_DISPS(view->gfxCtx);
|
||||
|
||||
letterboxY = ShrinkWindow_GetLetterboxMagnitude();
|
||||
letterboxY = ShrinkWindow_Letterbox_GetSize();
|
||||
|
||||
letterboxX = -1; // The following is optimized to varX = 0 but affects codegen
|
||||
|
||||
if (letterboxX < 0) {
|
||||
letterboxX = 0;
|
||||
}
|
||||
if (letterboxX > 160) {
|
||||
letterboxX = 160;
|
||||
if (letterboxX > (SCREEN_WIDTH / 2)) {
|
||||
letterboxX = SCREEN_WIDTH / 2;
|
||||
}
|
||||
|
||||
if (letterboxY < 0) {
|
||||
letterboxY = 0;
|
||||
} else if (letterboxY > 120) {
|
||||
letterboxY = 120;
|
||||
} else if (letterboxY > (SCREEN_HEIGHT / 2)) {
|
||||
letterboxY = SCREEN_HEIGHT / 2;
|
||||
}
|
||||
|
||||
ulx = view->viewport.leftX + letterboxX;
|
||||
@@ -166,31 +184,31 @@ void View_SetScissorForLetterbox(View* view) {
|
||||
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
{
|
||||
s32 pad3;
|
||||
s32 pad2;
|
||||
Gfx* polyOpa;
|
||||
|
||||
polyOpa = POLY_OPA_DISP;
|
||||
View_WriteScissor(&polyOpa, ulx, uly, lrx, lry);
|
||||
View_SetScissor(&polyOpa, ulx, uly, lrx, lry);
|
||||
POLY_OPA_DISP = polyOpa;
|
||||
}
|
||||
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
{
|
||||
Gfx* polyXlu;
|
||||
s32 pad4;
|
||||
s32 pad3;
|
||||
|
||||
polyXlu = POLY_XLU_DISP;
|
||||
View_WriteScissor(&polyXlu, ulx, uly, lrx, lry);
|
||||
View_SetScissor(&polyXlu, ulx, uly, lrx, lry);
|
||||
POLY_XLU_DISP = polyXlu;
|
||||
}
|
||||
|
||||
CLOSE_DISPS(view->gfxCtx);
|
||||
}
|
||||
|
||||
s32 View_SetDistortionDirRot(View* view, f32 dirRotX, f32 dirRotY, f32 dirRotZ) {
|
||||
view->distortionDirRot.x = dirRotX;
|
||||
view->distortionDirRot.y = dirRotY;
|
||||
view->distortionDirRot.z = dirRotZ;
|
||||
s32 View_SetDistortionOrientation(View* view, f32 rotX, f32 rotY, f32 rotZ) {
|
||||
view->distortionOrientation.x = rotX;
|
||||
view->distortionOrientation.y = rotY;
|
||||
view->distortionOrientation.z = rotZ;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -207,22 +225,22 @@ s32 View_SetDistortionSpeed(View* view, f32 speed) {
|
||||
}
|
||||
|
||||
s32 View_InitDistortion(View* view) {
|
||||
view->distortionDirRot.x = 0.0f;
|
||||
view->distortionDirRot.y = 0.0f;
|
||||
view->distortionDirRot.z = 0.0f;
|
||||
view->distortionOrientation.x = 0.0f;
|
||||
view->distortionOrientation.y = 0.0f;
|
||||
view->distortionOrientation.z = 0.0f;
|
||||
view->distortionScale.x = 1.0f;
|
||||
view->distortionScale.y = 1.0f;
|
||||
view->distortionScale.z = 1.0f;
|
||||
view->curDistortionDirRot = view->distortionDirRot;
|
||||
view->curDistortionOrientation = view->distortionOrientation;
|
||||
view->curDistortionScale = view->distortionScale;
|
||||
view->distortionSpeed = 0.0f;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 View_ClearDistortion(View* view) {
|
||||
view->distortionDirRot.x = 0.0f;
|
||||
view->distortionDirRot.y = 0.0f;
|
||||
view->distortionDirRot.z = 0.0f;
|
||||
view->distortionOrientation.x = 0.0f;
|
||||
view->distortionOrientation.y = 0.0f;
|
||||
view->distortionOrientation.z = 0.0f;
|
||||
view->distortionScale.x = 1.0f;
|
||||
view->distortionScale.y = 1.0f;
|
||||
view->distortionScale.z = 1.0f;
|
||||
@@ -230,8 +248,8 @@ s32 View_ClearDistortion(View* view) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 View_SetDistortion(View* view, Vec3f dirRot, Vec3f scale, f32 speed) {
|
||||
view->distortionDirRot = dirRot;
|
||||
s32 View_SetDistortion(View* view, Vec3f orientation, Vec3f scale, f32 speed) {
|
||||
view->distortionOrientation = orientation;
|
||||
view->distortionScale = scale;
|
||||
view->distortionSpeed = speed;
|
||||
return 1;
|
||||
@@ -242,17 +260,19 @@ s32 View_StepDistortion(View* view, Mtx* projectionMtx) {
|
||||
|
||||
if (view->distortionSpeed == 0.0f) {
|
||||
return false;
|
||||
} else if (view->distortionSpeed == 1.0f) {
|
||||
view->curDistortionDirRot = view->distortionDirRot;
|
||||
}
|
||||
|
||||
if (view->distortionSpeed == 1.0f) {
|
||||
view->curDistortionOrientation = view->distortionOrientation;
|
||||
view->curDistortionScale = view->distortionScale;
|
||||
view->distortionSpeed = 0.0f;
|
||||
} else {
|
||||
view->curDistortionDirRot.x =
|
||||
F32_LERPIMP(view->curDistortionDirRot.x, view->distortionDirRot.x, view->distortionSpeed);
|
||||
view->curDistortionDirRot.y =
|
||||
F32_LERPIMP(view->curDistortionDirRot.y, view->distortionDirRot.y, view->distortionSpeed);
|
||||
view->curDistortionDirRot.z =
|
||||
F32_LERPIMP(view->curDistortionDirRot.z, view->distortionDirRot.z, view->distortionSpeed);
|
||||
view->curDistortionOrientation.x =
|
||||
F32_LERPIMP(view->curDistortionOrientation.x, view->distortionOrientation.x, view->distortionSpeed);
|
||||
view->curDistortionOrientation.y =
|
||||
F32_LERPIMP(view->curDistortionOrientation.y, view->distortionOrientation.y, view->distortionSpeed);
|
||||
view->curDistortionOrientation.z =
|
||||
F32_LERPIMP(view->curDistortionOrientation.z, view->distortionOrientation.z, view->distortionSpeed);
|
||||
|
||||
view->curDistortionScale.x =
|
||||
F32_LERPIMP(view->curDistortionScale.x, view->distortionScale.x, view->distortionSpeed);
|
||||
@@ -264,29 +284,32 @@ s32 View_StepDistortion(View* view, Mtx* projectionMtx) {
|
||||
|
||||
Matrix_MtxToMtxF(projectionMtx, &projectionMtxF);
|
||||
Matrix_Put(&projectionMtxF);
|
||||
Matrix_RotateXFApply(view->curDistortionDirRot.x);
|
||||
Matrix_RotateYF(view->curDistortionDirRot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(view->curDistortionDirRot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(view->curDistortionOrientation.x);
|
||||
Matrix_RotateYF(view->curDistortionOrientation.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(view->curDistortionOrientation.z, MTXMODE_APPLY);
|
||||
Matrix_Scale(view->curDistortionScale.x, view->curDistortionScale.y, view->curDistortionScale.z, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(-view->curDistortionDirRot.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(-view->curDistortionDirRot.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(-view->curDistortionDirRot.x);
|
||||
Matrix_RotateZF(-view->curDistortionOrientation.z, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(-view->curDistortionOrientation.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(-view->curDistortionOrientation.x);
|
||||
Matrix_ToMtx(projectionMtx);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void View_RenderView(View* view, s32 uParm2) {
|
||||
uParm2 = (view->flags & uParm2) | uParm2 >> 4;
|
||||
/**
|
||||
* Apply view to POLY_OPA_DISP, POLY_XLU_DISP (and OVERLAY_DISP if ortho)
|
||||
*/
|
||||
void View_Apply(View* view, s32 mask) {
|
||||
mask = (view->flags & mask) | (mask >> 4);
|
||||
|
||||
if (uParm2 & 8) {
|
||||
View_RenderToOrthographicMatrix(view);
|
||||
if (mask & VIEW_PROJECTION_ORTHO) {
|
||||
View_ApplyOrtho(view);
|
||||
} else {
|
||||
View_RenderToPerspectiveMatrix(view);
|
||||
View_ApplyPerspective(view);
|
||||
}
|
||||
}
|
||||
|
||||
s32 View_RenderToPerspectiveMatrix(View* view) {
|
||||
s32 View_ApplyPerspective(View* view) {
|
||||
f32 aspect;
|
||||
s32 width;
|
||||
s32 height;
|
||||
@@ -297,36 +320,39 @@ s32 View_RenderToPerspectiveMatrix(View* view) {
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
vp = GRAPH_ALLOC(gfxCtx, sizeof(*vp));
|
||||
// Viewport
|
||||
vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp));
|
||||
View_ViewportToVp(vp, &view->viewport);
|
||||
view->vp = *vp;
|
||||
|
||||
View_SetScissorForLetterbox(view);
|
||||
View_ApplyLetterbox(view);
|
||||
|
||||
gSPViewport(POLY_OPA_DISP++, vp);
|
||||
gSPViewport(POLY_XLU_DISP++, vp);
|
||||
|
||||
projection = GRAPH_ALLOC(gfxCtx, sizeof(*projection));
|
||||
// Perspective projection
|
||||
projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
|
||||
view->projectionPtr = projection;
|
||||
|
||||
width = view->viewport.rightX - view->viewport.leftX;
|
||||
height = view->viewport.bottomY - view->viewport.topY;
|
||||
aspect = (f32)width / (f32)height;
|
||||
|
||||
guPerspective(projection, &view->normal, view->fovy, aspect, view->zNear, view->zFar, view->scale);
|
||||
guPerspective(projection, &view->perspNorm, view->fovy, aspect, view->zNear, view->zFar, view->scale);
|
||||
view->projection = *projection;
|
||||
|
||||
View_StepDistortion(view, projection);
|
||||
|
||||
gSPPerspNormalize(POLY_OPA_DISP++, view->normal);
|
||||
gSPPerspNormalize(POLY_OPA_DISP++, view->perspNorm);
|
||||
gSPMatrix(POLY_OPA_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
gSPPerspNormalize(POLY_XLU_DISP++, view->normal);
|
||||
gSPPerspNormalize(POLY_XLU_DISP++, view->perspNorm);
|
||||
gSPMatrix(POLY_XLU_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
|
||||
viewing = GRAPH_ALLOC(gfxCtx, sizeof(*viewing));
|
||||
// View matrix (look-at)
|
||||
viewing = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
|
||||
view->viewingPtr = viewing;
|
||||
|
||||
if (view->eye.x == view->at.x && view->eye.y == view->at.y && view->eye.z == view->at.z) {
|
||||
if ((view->eye.x == view->at.x) && (view->eye.y == view->at.y) && (view->eye.z == view->at.z)) {
|
||||
view->eye.z += 2.0f;
|
||||
}
|
||||
|
||||
@@ -343,24 +369,24 @@ s32 View_RenderToPerspectiveMatrix(View* view) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 View_RenderToOrthographicMatrix(View* view) {
|
||||
s32 View_ApplyOrtho(View* view) {
|
||||
Vp* vp;
|
||||
Mtx* projection;
|
||||
GraphicsContext* gfxCtx = view->gfxCtx;
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
vp = GRAPH_ALLOC(gfxCtx, sizeof(*vp));
|
||||
vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp));
|
||||
View_ViewportToVp(vp, &view->viewport);
|
||||
view->vp = *vp;
|
||||
|
||||
View_SetScissorForLetterbox(view);
|
||||
View_ApplyLetterbox(view);
|
||||
|
||||
gSPViewport(POLY_OPA_DISP++, vp);
|
||||
gSPViewport(POLY_XLU_DISP++, vp);
|
||||
gSPViewport(OVERLAY_DISP++, vp);
|
||||
|
||||
projection = GRAPH_ALLOC(gfxCtx, sizeof(*projection));
|
||||
projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
|
||||
view->projectionPtr = projection;
|
||||
|
||||
guOrtho(projection, gScreenWidth * -0.5f, gScreenWidth * 0.5f, gScreenHeight * -0.5f, gScreenHeight * 0.5f,
|
||||
@@ -376,7 +402,10 @@ s32 View_RenderToOrthographicMatrix(View* view) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8013FBC8(View* view) {
|
||||
/**
|
||||
* Apply scissor, viewport and projection (ortho) to OVERLAY_DISP.
|
||||
*/
|
||||
s32 View_ApplyOrthoToOverlay(View* view) {
|
||||
Vp* vp;
|
||||
Mtx* projection;
|
||||
GraphicsContext* gfxCtx;
|
||||
@@ -385,7 +414,7 @@ s32 func_8013FBC8(View* view) {
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
vp = GRAPH_ALLOC(gfxCtx, sizeof(*vp));
|
||||
vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp));
|
||||
View_ViewportToVp(vp, &view->viewport);
|
||||
view->vp = *vp;
|
||||
|
||||
@@ -395,26 +424,29 @@ s32 func_8013FBC8(View* view) {
|
||||
s32 pad;
|
||||
|
||||
overlay = OVERLAY_DISP;
|
||||
View_WriteScissor(&overlay, view->viewport.leftX, view->viewport.topY, view->viewport.rightX,
|
||||
view->viewport.bottomY);
|
||||
View_SetScissor(&overlay, view->viewport.leftX, view->viewport.topY, view->viewport.rightX,
|
||||
view->viewport.bottomY);
|
||||
OVERLAY_DISP = overlay;
|
||||
}
|
||||
|
||||
gSPViewport(OVERLAY_DISP++, vp);
|
||||
projection = GRAPH_ALLOC(gfxCtx, sizeof(*projection));
|
||||
projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
|
||||
view->projectionPtr = projection;
|
||||
|
||||
guOrtho(projection, gScreenWidth * -0.5f, gScreenWidth * 0.5f, gScreenHeight * -0.5f, gScreenHeight * 0.5f,
|
||||
view->zNear, view->zFar, view->scale);
|
||||
view->projection = *projection;
|
||||
|
||||
gSPMatrix(OVERLAY_DISP++, projection, G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
gSPMatrix(OVERLAY_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_8013FD74(View* view) {
|
||||
/**
|
||||
* Apply scissor, viewport, view and projection (perspective) to OVERLAY_DISP.
|
||||
*/
|
||||
s32 View_ApplyPerspectiveToOverlay(View* view) {
|
||||
f32 aspect;
|
||||
s32 width;
|
||||
s32 height;
|
||||
@@ -428,7 +460,7 @@ s32 func_8013FD74(View* view) {
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
vp = GRAPH_ALLOC(gfxCtx, sizeof(*vp));
|
||||
vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp));
|
||||
View_ViewportToVp(vp, &view->viewport);
|
||||
view->vp = *vp;
|
||||
|
||||
@@ -438,28 +470,30 @@ s32 func_8013FD74(View* view) {
|
||||
Gfx* overlay;
|
||||
|
||||
overlay = OVERLAY_DISP;
|
||||
View_WriteScissor(&overlay, view->viewport.leftX, view->viewport.topY, view->viewport.rightX,
|
||||
view->viewport.bottomY);
|
||||
View_SetScissor(&overlay, view->viewport.leftX, view->viewport.topY, view->viewport.rightX,
|
||||
view->viewport.bottomY);
|
||||
OVERLAY_DISP = overlay;
|
||||
}
|
||||
|
||||
gSPViewport(OVERLAY_DISP++, vp);
|
||||
projection = GRAPH_ALLOC(gfxCtx, sizeof(*projection));
|
||||
projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
|
||||
view->projectionPtr = projection;
|
||||
|
||||
width = view->viewport.rightX - view->viewport.leftX;
|
||||
height = view->viewport.bottomY - view->viewport.topY;
|
||||
aspect = (f32)width / (f32)height;
|
||||
|
||||
guPerspective(projection, &view->normal, view->fovy, aspect, view->zNear, view->zFar, view->scale);
|
||||
guPerspective(projection, &view->perspNorm, view->fovy, aspect, view->zNear, view->zFar, view->scale);
|
||||
|
||||
view->projection = *projection;
|
||||
|
||||
gSPPerspNormalize(OVERLAY_DISP++, view->normal);
|
||||
gSPPerspNormalize(OVERLAY_DISP++, view->perspNorm);
|
||||
gSPMatrix(OVERLAY_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
|
||||
viewing = GRAPH_ALLOC(gfxCtx, sizeof(*viewing));
|
||||
viewing = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
|
||||
view->viewingPtr = viewing;
|
||||
|
||||
// This check avoids a divide-by-zero in guLookAt if eye == at
|
||||
if (view->eye.x == view->at.x && view->eye.y == view->at.y && view->eye.z == view->at.z) {
|
||||
view->eye.z += 2.0f;
|
||||
}
|
||||
@@ -476,7 +510,10 @@ s32 func_8013FD74(View* view) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_80140024(View* view) {
|
||||
/**
|
||||
* Just updates view's view matrix from its eye/at/up vectors.
|
||||
*/
|
||||
s32 View_UpdateViewingMatrix(View* view) {
|
||||
guLookAt(view->viewingPtr, view->eye.x, view->eye.y, view->eye.z, view->at.x, view->at.y, view->at.z, view->up.x,
|
||||
view->up.y, view->up.z);
|
||||
|
||||
@@ -486,22 +523,22 @@ s32 func_80140024(View* view) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_801400CC(View* view, Gfx** gfxp) {
|
||||
s32 View_ApplyTo(View* view, Gfx** gfxp) {
|
||||
Gfx* gfx = *gfxp;
|
||||
GraphicsContext* gfxCtx = view->gfxCtx;
|
||||
Viewport* viewport = &view->viewport;
|
||||
Mtx* projection;
|
||||
Vp* vp;
|
||||
|
||||
vp = GRAPH_ALLOC(gfxCtx, sizeof(*vp));
|
||||
vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp));
|
||||
View_ViewportToVp(vp, viewport);
|
||||
view->vp = *vp;
|
||||
|
||||
View_SyncAndWriteScissor(view, &gfx);
|
||||
View_ClearScissor(view, &gfx);
|
||||
|
||||
gSPViewport(gfx++, vp);
|
||||
|
||||
projection = GRAPH_ALLOC(gfxCtx, sizeof(*projection));
|
||||
projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
|
||||
view->projectionPtr = projection;
|
||||
|
||||
guOrtho(projection, gScreenWidth * -0.5f, gScreenWidth * 0.5f, gScreenHeight * -0.5f, gScreenHeight * 0.5f,
|
||||
@@ -509,7 +546,7 @@ s32 func_801400CC(View* view, Gfx** gfxp) {
|
||||
|
||||
view->projection = *projection;
|
||||
|
||||
gSPMatrix(gfx++, projection, G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
gSPMatrix(gfx++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
*gfxp = gfx;
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -32,9 +32,9 @@ OSPiHandle* osFlashReInit(u8 latency, u8 pulse, u8 pageSize, u8 relDuration, u32
|
||||
return &__osFlashHandler;
|
||||
}
|
||||
|
||||
void osFlashChange(u32 flash_num) {
|
||||
__osFlashHandler.baseAddress = RDRAM_UNCACHED | (FRAM_STATUS_REGISTER + (flash_num << 17));
|
||||
__osFlashHandler.type = 8 + flash_num;
|
||||
void osFlashChange(u32 flashNum) {
|
||||
__osFlashHandler.baseAddress = RDRAM_UNCACHED | (FRAM_STATUS_REGISTER + (flashNum << 17));
|
||||
__osFlashHandler.type = 8 + flashNum;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
|
||||
s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, u32 cartAddr, void* dramAddr, size_t size) {
|
||||
s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, uintptr_t cartAddr, void* dramAddr, size_t size) {
|
||||
s32 status;
|
||||
OSPiHandle* curHandle;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
|
||||
s32 __osSiRawReadIo(u32 devAddr, u32* data) {
|
||||
s32 __osSiRawReadIo(uintptr_t devAddr, u32* data) {
|
||||
if (__osSiDeviceBusy()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
|
||||
s32 __osSiRawWriteIo(u32 devAddr, u32 data) {
|
||||
s32 __osSiRawWriteIo(uintptr_t devAddr, u32 data) {
|
||||
if (__osSiDeviceBusy() != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "z_bg_crace_movebg.h"
|
||||
#include "overlays/actors/ovl_En_Dno/z_en_dno.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10)
|
||||
|
||||
@@ -15,22 +16,30 @@ void BgCraceMovebg_Destroy(Actor* thisx, PlayState* play);
|
||||
void BgCraceMovebg_Update(Actor* thisx, PlayState* play);
|
||||
void BgCraceMovebg_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
s32 func_80A7090C(PlayState* play);
|
||||
void func_80A70970(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A7099C(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A709E4(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A70A08(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A70A84(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A70A9C(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A70C04(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A70D74(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A70DA8(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A70E2C(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A70E70(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A70F14(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A70F2C(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A70FF4(BgCraceMovebg* this, PlayState* play);
|
||||
void func_80A71040(BgCraceMovebg* this, PlayState* play);
|
||||
s32 BgCraceMovebg_GetRaceStatus(PlayState* play);
|
||||
void BgCraceMovebg_OpeningDoor_SetupIdle(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_OpeningDoor_Idle(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_OpeningDoor_SetupOpen(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_OpeningDoor_Open(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_OpeningDoor_SetupDoNothing(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_OpeningDoor_DoNothing(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_ClosingDoor_CheckIfPlayerIsBeyondDoor(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_ClosingDoor_SetupIdle(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_ClosingDoor_Idle(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_ClosingDoor_SetupWaitToClose(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_ClosingDoor_WaitToClose(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_ClosingDoor_SetupClose(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_ClosingDoor_Close(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_ClosingDoor_SetupDoNothing(BgCraceMovebg* this, PlayState* play);
|
||||
void BgCraceMovebg_ClosingDoor_DoNothing(BgCraceMovebg* this, PlayState* play);
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ BG_CRACE_MOVEBG_RACE_STATUS_BUTLER_NOT_PRESENT,
|
||||
/* 1 */ BG_CRACE_MOVEBG_RACE_STATUS_FIRST_RACE,
|
||||
/* 2 */ BG_CRACE_MOVEBG_RACE_STATUS_SUBSEQUENT_RACE
|
||||
} BgCraceMovebgRaceStatus;
|
||||
|
||||
u8 sIsLoaded[32];
|
||||
|
||||
const ActorInit Bg_Crace_Movebg_InitVars = {
|
||||
ACTOR_BG_CRACE_MOVEBG,
|
||||
@@ -44,13 +53,14 @@ const ActorInit Bg_Crace_Movebg_InitVars = {
|
||||
(ActorFunc)BgCraceMovebg_Draw,
|
||||
};
|
||||
|
||||
static u8 D_80A710A0 = 0;
|
||||
static u8 D_80A710A4 = 0;
|
||||
static u8 sHasInitializedIsLoaded = 0;
|
||||
static u8 sLoadedDoorCount = 0;
|
||||
|
||||
static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP),
|
||||
};
|
||||
static Vec3f D_80A710AC[] = { 0.0f, 0.0f, 1.0f };
|
||||
u8 D_80A711B0[32];
|
||||
|
||||
static Vec3f sUnitVecZ = { 0.0f, 0.0f, 1.0f };
|
||||
|
||||
void BgCraceMovebg_Init(Actor* thisx, PlayState* play) {
|
||||
BgCraceMovebg* this = THIS;
|
||||
@@ -58,122 +68,138 @@ void BgCraceMovebg_Init(Actor* thisx, PlayState* play) {
|
||||
s32 j;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
if (D_80A710A0 == 0) {
|
||||
for (i = 0; i < ARRAY_COUNT(D_80A711B0); i++) {
|
||||
D_80A711B0[i] = 0;
|
||||
if (!sHasInitializedIsLoaded) {
|
||||
for (i = 0; i < ARRAY_COUNT(sIsLoaded); i++) {
|
||||
sIsLoaded[i] = 0;
|
||||
}
|
||||
D_80A710A0 = 1;
|
||||
sHasInitializedIsLoaded = true;
|
||||
}
|
||||
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
DynaPolyActor_LoadMesh(play, &this->dyna, &object_crace_object_Colheader_000E00);
|
||||
DynaPolyActor_LoadMesh(play, &this->dyna, &gDekuShrineSlidingDoorCol);
|
||||
|
||||
this->unk184 = this->dyna.actor.world.rot.x;
|
||||
this->unk16C = this->dyna.actor.world.rot.z;
|
||||
this->index = BG_CRACE_MOVEBG_GET_INDEX(&this->dyna.actor);
|
||||
this->openSpeed = BG_CRACE_MOVEBG_GET_OPEN_SPEED(&this->dyna.actor);
|
||||
this->dyna.actor.world.rot.x = 0;
|
||||
this->dyna.actor.world.rot.z = 0;
|
||||
this->dyna.actor.home.rot.x = 0;
|
||||
this->dyna.actor.home.rot.z = 0;
|
||||
this->dyna.actor.flags |= ACTOR_FLAG_10000000;
|
||||
|
||||
switch (BGCRACEMOVEBG_GET_F(&this->dyna.actor)) {
|
||||
case 0:
|
||||
case 2:
|
||||
for (j = 0; j < D_80A710A4; j++) {
|
||||
if (D_80A711B0[j] == this->unk184) {
|
||||
this->unk170 |= 8;
|
||||
switch (BG_CRACE_MOVEBG_GET_TYPE(&this->dyna.actor)) {
|
||||
case BG_CRACE_MOVEBG_TYPE_CLOSING:
|
||||
case BG_CRACE_MOVEBG_TYPE_UNUSED_CLOSING:
|
||||
for (j = 0; j < sLoadedDoorCount; j++) {
|
||||
if (sIsLoaded[j] == this->index) {
|
||||
this->stateFlags |= BG_CRACE_MOVEBG_FLAG_ALREADY_LOADED;
|
||||
Actor_MarkForDeath(&this->dyna.actor);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (D_80A710A4 < ARRAY_COUNT(D_80A711B0)) {
|
||||
D_80A711B0[(s32)D_80A710A4++] = this->unk184;
|
||||
|
||||
if (sLoadedDoorCount < ARRAY_COUNT(sIsLoaded)) {
|
||||
sIsLoaded[(s32)sLoadedDoorCount] = this->index;
|
||||
sLoadedDoorCount++;
|
||||
}
|
||||
|
||||
this->dyna.actor.room = -1;
|
||||
switch (func_80A7090C(play)) {
|
||||
case 0:
|
||||
func_80A70D74(this, play);
|
||||
switch (BgCraceMovebg_GetRaceStatus(play)) {
|
||||
case BG_CRACE_MOVEBG_RACE_STATUS_BUTLER_NOT_PRESENT:
|
||||
BgCraceMovebg_ClosingDoor_SetupIdle(this, play);
|
||||
break;
|
||||
case 1:
|
||||
func_80A70D74(this, play);
|
||||
|
||||
case BG_CRACE_MOVEBG_RACE_STATUS_FIRST_RACE:
|
||||
BgCraceMovebg_ClosingDoor_SetupIdle(this, play);
|
||||
break;
|
||||
case 2:
|
||||
Flags_UnsetSwitch(play, BGCRACEMOVEBG_GET_7F0(&this->dyna.actor) + 1);
|
||||
func_80A70D74(this, play);
|
||||
|
||||
case BG_CRACE_MOVEBG_RACE_STATUS_SUBSEQUENT_RACE:
|
||||
// Makes sure no lingering switch flags are set from the last time the player did a race.
|
||||
Flags_UnsetSwitch(play, BG_CRACE_MOVEBG_GET_SWITCH_FLAG(&this->dyna.actor) + 1);
|
||||
BgCraceMovebg_ClosingDoor_SetupIdle(this, play);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
func_80A70970(this, play);
|
||||
|
||||
case BG_CRACE_MOVEBG_TYPE_OPENING:
|
||||
BgCraceMovebg_OpeningDoor_SetupIdle(this, play);
|
||||
break;
|
||||
|
||||
default:
|
||||
Actor_MarkForDeath(&this->dyna.actor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_80A7090C(PlayState* play) {
|
||||
s32 BgCraceMovebg_GetRaceStatus(PlayState* play) {
|
||||
s32 pad;
|
||||
s32 returnVal = 0;
|
||||
Actor* tempActor = SubS_FindActor(play, NULL, ACTORCAT_NPC, ACTOR_EN_DNO);
|
||||
s32 raceStatus = BG_CRACE_MOVEBG_RACE_STATUS_BUTLER_NOT_PRESENT;
|
||||
Actor* butler = SubS_FindActor(play, NULL, ACTORCAT_NPC, ACTOR_EN_DNO);
|
||||
|
||||
if (tempActor != NULL) {
|
||||
if (Flags_GetSwitch(play, BGCRACEMOVEBG_GET_3F80(tempActor))) {
|
||||
returnVal = 2;
|
||||
if (butler != NULL) {
|
||||
if (Flags_GetSwitch(play, EN_DNO_GET_RACE_STARTED_SWITCH_FLAG(butler))) {
|
||||
raceStatus = BG_CRACE_MOVEBG_RACE_STATUS_SUBSEQUENT_RACE;
|
||||
} else {
|
||||
returnVal = 1;
|
||||
raceStatus = BG_CRACE_MOVEBG_RACE_STATUS_FIRST_RACE;
|
||||
}
|
||||
}
|
||||
return returnVal;
|
||||
|
||||
return raceStatus;
|
||||
}
|
||||
|
||||
void func_80A70970(BgCraceMovebg* this, PlayState* play) {
|
||||
this->unk164 = 0.0f;
|
||||
this->unk160 = 0.0f;
|
||||
this->actionFunc = func_80A7099C;
|
||||
void BgCraceMovebg_OpeningDoor_SetupIdle(BgCraceMovebg* this, PlayState* play) {
|
||||
this->targetDoorHeight = 0.0f;
|
||||
this->doorHeight = 0.0f;
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
|
||||
this->actionFunc = BgCraceMovebg_OpeningDoor_Idle;
|
||||
}
|
||||
|
||||
void func_80A7099C(BgCraceMovebg* this, PlayState* play) {
|
||||
if (Flags_GetSwitch(play, BGCRACEMOVEBG_GET_7F0(&this->dyna.actor))) {
|
||||
func_80A709E4(this, play);
|
||||
/**
|
||||
* Wait for this door's switch flag to be set, then start opening.
|
||||
*/
|
||||
void BgCraceMovebg_OpeningDoor_Idle(BgCraceMovebg* this, PlayState* play) {
|
||||
if (Flags_GetSwitch(play, BG_CRACE_MOVEBG_GET_SWITCH_FLAG(&this->dyna.actor))) {
|
||||
BgCraceMovebg_OpeningDoor_SetupOpen(this, play);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A709E4(BgCraceMovebg* this, PlayState* play) {
|
||||
this->actionFunc = func_80A70A08;
|
||||
this->unk164 = 180.0f;
|
||||
void BgCraceMovebg_OpeningDoor_SetupOpen(BgCraceMovebg* this, PlayState* play) {
|
||||
this->targetDoorHeight = 180.0f;
|
||||
this->actionFunc = BgCraceMovebg_OpeningDoor_Open;
|
||||
}
|
||||
|
||||
void func_80A70A08(BgCraceMovebg* this, PlayState* play) {
|
||||
/**
|
||||
* Silde open, then do nothing.
|
||||
*/
|
||||
void BgCraceMovebg_OpeningDoor_Open(BgCraceMovebg* this, PlayState* play) {
|
||||
func_800B9010(&this->dyna.actor, NA_SE_EV_STONEDOOR_OPEN_S - SFX_FLAG);
|
||||
Math_SmoothStepToF(&this->unk160, this->unk164, 2.0f, this->unk16C, 0.01f);
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->unk160;
|
||||
if (this->unk160 == this->unk164) {
|
||||
func_80A70A84(this, play);
|
||||
Math_SmoothStepToF(&this->doorHeight, this->targetDoorHeight, 2.0f, this->openSpeed, 0.01f);
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->doorHeight;
|
||||
if (this->doorHeight == this->targetDoorHeight) {
|
||||
BgCraceMovebg_OpeningDoor_SetupDoNothing(this, play);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A70A84(BgCraceMovebg* this, PlayState* play) {
|
||||
this->actionFunc = func_80A70A9C;
|
||||
void BgCraceMovebg_OpeningDoor_SetupDoNothing(BgCraceMovebg* this, PlayState* play) {
|
||||
this->actionFunc = BgCraceMovebg_OpeningDoor_DoNothing;
|
||||
}
|
||||
|
||||
void func_80A70A9C(BgCraceMovebg* this, PlayState* play) {
|
||||
void BgCraceMovebg_OpeningDoor_DoNothing(BgCraceMovebg* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void BgCraceMovebg_Destroy(Actor* thisx, PlayState* play) {
|
||||
BgCraceMovebg* this = THIS;
|
||||
|
||||
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
|
||||
if (!(this->unk170 & 0x8)) {
|
||||
switch (BGCRACEMOVEBG_GET_F(&this->dyna.actor)) {
|
||||
case 0:
|
||||
case 2:
|
||||
Flags_UnsetSwitch(play, BGCRACEMOVEBG_GET_7F0(thisx));
|
||||
Flags_UnsetSwitch(play, BGCRACEMOVEBG_GET_7F0(thisx) + 1);
|
||||
if (!(this->stateFlags & BG_CRACE_MOVEBG_FLAG_ALREADY_LOADED)) {
|
||||
switch (BG_CRACE_MOVEBG_GET_TYPE(&this->dyna.actor)) {
|
||||
case BG_CRACE_MOVEBG_TYPE_CLOSING:
|
||||
case BG_CRACE_MOVEBG_TYPE_UNUSED_CLOSING:
|
||||
Flags_UnsetSwitch(play, BG_CRACE_MOVEBG_GET_SWITCH_FLAG(thisx));
|
||||
Flags_UnsetSwitch(play, BG_CRACE_MOVEBG_GET_SWITCH_FLAG(thisx) + 1);
|
||||
break;
|
||||
case 1:
|
||||
Flags_UnsetSwitch(play, BGCRACEMOVEBG_GET_7F0(thisx));
|
||||
|
||||
case BG_CRACE_MOVEBG_TYPE_OPENING:
|
||||
Flags_UnsetSwitch(play, BG_CRACE_MOVEBG_GET_SWITCH_FLAG(thisx));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -183,117 +209,147 @@ void BgCraceMovebg_Update(Actor* thisx, PlayState* play) {
|
||||
BgCraceMovebg* this = THIS;
|
||||
s32 pad;
|
||||
Player* player = GET_PLAYER(play);
|
||||
s16 tempRot;
|
||||
s16 yawDiff;
|
||||
|
||||
switch (BGCRACEMOVEBG_GET_F(&this->dyna.actor)) {
|
||||
case 0:
|
||||
case 2:
|
||||
tempRot = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.home.rot.y;
|
||||
if ((tempRot >= -0x4000) && (tempRot <= 0x4000)) {
|
||||
switch (BG_CRACE_MOVEBG_GET_TYPE(&this->dyna.actor)) {
|
||||
case BG_CRACE_MOVEBG_TYPE_CLOSING:
|
||||
case BG_CRACE_MOVEBG_TYPE_UNUSED_CLOSING:
|
||||
yawDiff = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.home.rot.y;
|
||||
if ((yawDiff >= -0x4000) && (yawDiff <= 0x4000)) {
|
||||
this->dyna.actor.shape.rot.y = this->dyna.actor.home.rot.y;
|
||||
} else {
|
||||
this->dyna.actor.shape.rot.y = this->dyna.actor.home.rot.y + 0x8000;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
this->actionFunc(this, play);
|
||||
Math_Vec3f_Copy(&this->unk188, &player->bodyPartsPos[0]);
|
||||
break;
|
||||
}
|
||||
|
||||
this->actionFunc(this, play);
|
||||
Math_Vec3f_Copy(&this->prevPlayerPos, &player->bodyPartsPos[0]);
|
||||
}
|
||||
|
||||
void func_80A70C04(BgCraceMovebg* this, PlayState* play) {
|
||||
/**
|
||||
* Updates this door's flags if the player has moved beyond it. If the door is of type
|
||||
* BG_CRACE_MOVEBG_TYPE_UNUSED_CLOSING, then nothing happens here, so the door never
|
||||
* knows the player has moved beyond it.
|
||||
*/
|
||||
void BgCraceMovebg_ClosingDoor_CheckIfPlayerIsBeyondDoor(BgCraceMovebg* this, PlayState* play) {
|
||||
s32 pad;
|
||||
Player* player = GET_PLAYER(play);
|
||||
Vec3f intersect;
|
||||
Vec3f diff;
|
||||
Vec3f posDiff;
|
||||
|
||||
if ((BGCRACEMOVEBG_GET_F(&this->dyna.actor) != 2) &&
|
||||
SubS_LineSegVsPlane(&this->dyna.actor.home.pos, &this->dyna.actor.home.rot, D_80A710AC, &this->unk188,
|
||||
if ((BG_CRACE_MOVEBG_GET_TYPE(&this->dyna.actor) != BG_CRACE_MOVEBG_TYPE_UNUSED_CLOSING) &&
|
||||
SubS_LineSegVsPlane(&this->dyna.actor.home.pos, &this->dyna.actor.home.rot, &sUnitVecZ, &this->prevPlayerPos,
|
||||
&player->bodyPartsPos[0], &intersect)) {
|
||||
Matrix_RotateYS(-this->dyna.actor.home.rot.y, MTXMODE_NEW);
|
||||
Math_Vec3f_Diff(&player->bodyPartsPos[0], &this->dyna.actor.home.pos, &diff);
|
||||
Matrix_MultVec3f(&diff, &this->unk178);
|
||||
if (fabsf(this->unk178.x) < 100.0f && this->unk178.y >= -10.0f && this->unk178.y <= 180.0f) {
|
||||
if (this->unk178.z < 0.0f) {
|
||||
Flags_SetSwitch(play, BGCRACEMOVEBG_GET_7F0(&this->dyna.actor) + 1);
|
||||
this->unk170 |= 2;
|
||||
Math_Vec3f_Diff(&player->bodyPartsPos[0], &this->dyna.actor.home.pos, &posDiff);
|
||||
Matrix_MultVec3f(&posDiff, &this->intersectionOffsetFromHome);
|
||||
|
||||
if (fabsf(this->intersectionOffsetFromHome.x) < 100.0f && this->intersectionOffsetFromHome.y >= -10.0f &&
|
||||
this->intersectionOffsetFromHome.y <= 180.0f) {
|
||||
if (this->intersectionOffsetFromHome.z < 0.0f) {
|
||||
Flags_SetSwitch(play, BG_CRACE_MOVEBG_GET_SWITCH_FLAG(&this->dyna.actor) + 1);
|
||||
this->stateFlags |= BG_CRACE_MOVEBG_FLAG_PLAYER_IS_BEYOND_DOOR;
|
||||
} else {
|
||||
Flags_UnsetSwitch(play, BGCRACEMOVEBG_GET_7F0(&this->dyna.actor) + 1);
|
||||
this->unk170 &= ~2;
|
||||
Flags_UnsetSwitch(play, BG_CRACE_MOVEBG_GET_SWITCH_FLAG(&this->dyna.actor) + 1);
|
||||
this->stateFlags &= ~BG_CRACE_MOVEBG_FLAG_PLAYER_IS_BEYOND_DOOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A70D74(BgCraceMovebg* this, PlayState* play) {
|
||||
this->unk164 = 180.0f;
|
||||
this->unk160 = 180.0f;
|
||||
this->actionFunc = func_80A70DA8;
|
||||
void BgCraceMovebg_ClosingDoor_SetupIdle(BgCraceMovebg* this, PlayState* play) {
|
||||
this->targetDoorHeight = 180.0f;
|
||||
this->doorHeight = 180.0f;
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 180.0f;
|
||||
this->actionFunc = BgCraceMovebg_ClosingDoor_Idle;
|
||||
}
|
||||
|
||||
void func_80A70DA8(BgCraceMovebg* this, PlayState* play) {
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->unk160;
|
||||
func_80A70C04(this, play);
|
||||
if (this->unk170 & 1) {
|
||||
func_80A70E2C(this, play);
|
||||
/**
|
||||
* Wait for the Deku Butler to move beyond the door, or wait for this door's switch flag
|
||||
* to be set. In either case, start closing; how long to wait before closing depends on
|
||||
* what triggered it to close.
|
||||
*/
|
||||
void BgCraceMovebg_ClosingDoor_Idle(BgCraceMovebg* this, PlayState* play) {
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->doorHeight;
|
||||
BgCraceMovebg_ClosingDoor_CheckIfPlayerIsBeyondDoor(this, play);
|
||||
|
||||
if (this->stateFlags & BG_CRACE_MOVEBG_FLAG_BUTLER_IS_BEYOND_DOOR) {
|
||||
BgCraceMovebg_ClosingDoor_SetupWaitToClose(this, play);
|
||||
}
|
||||
if (Flags_GetSwitch(play, BGCRACEMOVEBG_GET_7F0(&this->dyna.actor))) {
|
||||
func_80A70F14(this, play);
|
||||
|
||||
if (Flags_GetSwitch(play, BG_CRACE_MOVEBG_GET_SWITCH_FLAG(&this->dyna.actor))) {
|
||||
BgCraceMovebg_ClosingDoor_SetupClose(this, play);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A70E2C(BgCraceMovebg* this, PlayState* play) {
|
||||
this->unk174 = BGCRACEMOVEBG_GET_F800(&this->dyna.actor) * 10;
|
||||
this->unk164 = 180.0f;
|
||||
this->unk160 = 180.0f;
|
||||
this->actionFunc = func_80A70E70;
|
||||
void BgCraceMovebg_ClosingDoor_SetupWaitToClose(BgCraceMovebg* this, PlayState* play) {
|
||||
this->closeWaitTimer = BG_CRACE_MOVEBG_GET_CLOSE_WAIT_TIMER(&this->dyna.actor) * 10;
|
||||
this->targetDoorHeight = 180.0f;
|
||||
this->doorHeight = 180.0f;
|
||||
this->actionFunc = BgCraceMovebg_ClosingDoor_WaitToClose;
|
||||
}
|
||||
|
||||
void func_80A70E70(BgCraceMovebg* this, PlayState* play) {
|
||||
if (this->unk174 > 0) {
|
||||
this->unk174--;
|
||||
/**
|
||||
* Wait until the closeWaitTimer reaches 0, then set the door's switch flag and start closing.
|
||||
*/
|
||||
void BgCraceMovebg_ClosingDoor_WaitToClose(BgCraceMovebg* this, PlayState* play) {
|
||||
if (this->closeWaitTimer > 0) {
|
||||
this->closeWaitTimer--;
|
||||
}
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->unk160;
|
||||
func_80A70C04(this, play);
|
||||
if (this->unk174 <= 0) {
|
||||
this->unk160 = 180.0f;
|
||||
this->unk164 = 0.0f;
|
||||
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->doorHeight;
|
||||
BgCraceMovebg_ClosingDoor_CheckIfPlayerIsBeyondDoor(this, play);
|
||||
|
||||
if (this->closeWaitTimer <= 0) {
|
||||
this->doorHeight = 180.0f;
|
||||
this->targetDoorHeight = 0.0f;
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 180.0f;
|
||||
Flags_SetSwitch(play, BGCRACEMOVEBG_GET_7F0(&this->dyna.actor));
|
||||
func_80A70F14(this, play);
|
||||
Flags_SetSwitch(play, BG_CRACE_MOVEBG_GET_SWITCH_FLAG(&this->dyna.actor));
|
||||
BgCraceMovebg_ClosingDoor_SetupClose(this, play);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A70F14(BgCraceMovebg* this, PlayState* play) {
|
||||
this->actionFunc = func_80A70F2C;
|
||||
void BgCraceMovebg_ClosingDoor_SetupClose(BgCraceMovebg* this, PlayState* play) {
|
||||
this->actionFunc = BgCraceMovebg_ClosingDoor_Close;
|
||||
}
|
||||
|
||||
void func_80A70F2C(BgCraceMovebg* this, PlayState* play) {
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->unk160;
|
||||
func_80A70C04(this, play);
|
||||
if (Math_StepToF(&this->unk160, 0.0f, 1.0f)) {
|
||||
if (!(this->unk170 & 2) && !Flags_GetSwitch(play, BGCRACEMOVEBG_GET_7F0(&this->dyna.actor) + 1)) {
|
||||
play->haltAllActors = true;
|
||||
/**
|
||||
* Slowly slide closed, then check to see if the player is beyond the door. If the player has
|
||||
* not moved beyond the door, trigger a voidout. Otherwise, do nothing.
|
||||
*/
|
||||
void BgCraceMovebg_ClosingDoor_Close(BgCraceMovebg* this, PlayState* play) {
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->doorHeight;
|
||||
BgCraceMovebg_ClosingDoor_CheckIfPlayerIsBeyondDoor(this, play);
|
||||
|
||||
if (Math_StepToF(&this->doorHeight, 0.0f, 1.0f)) {
|
||||
if (!(this->stateFlags & BG_CRACE_MOVEBG_FLAG_PLAYER_IS_BEYOND_DOOR) &&
|
||||
!Flags_GetSwitch(play, BG_CRACE_MOVEBG_GET_SWITCH_FLAG(&this->dyna.actor) + 1)) {
|
||||
play->haltAllActors = 1;
|
||||
Play_TriggerRespawn(&play->state);
|
||||
play_sound(NA_SE_OC_ABYSS);
|
||||
}
|
||||
func_80A70FF4(this, play);
|
||||
|
||||
BgCraceMovebg_ClosingDoor_SetupDoNothing(this, play);
|
||||
} else {
|
||||
func_800B9010(&this->dyna.actor, NA_SE_EV_STONEDOOR_CLOSE_S - SFX_FLAG);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A70FF4(BgCraceMovebg* this, PlayState* play) {
|
||||
this->unk164 = 0.0f;
|
||||
this->unk160 = 0.0f;
|
||||
void BgCraceMovebg_ClosingDoor_SetupDoNothing(BgCraceMovebg* this, PlayState* play) {
|
||||
this->targetDoorHeight = 0.0f;
|
||||
this->doorHeight = 0.0f;
|
||||
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
|
||||
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
|
||||
this->actionFunc = func_80A71040;
|
||||
this->actionFunc = BgCraceMovebg_ClosingDoor_DoNothing;
|
||||
}
|
||||
|
||||
void func_80A71040(BgCraceMovebg* this, PlayState* play) {
|
||||
void BgCraceMovebg_ClosingDoor_DoNothing(BgCraceMovebg* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void BgCraceMovebg_Draw(Actor* thisx, PlayState* play) {
|
||||
Gfx_DrawDListOpa(play, object_crace_object_DL_0003A0);
|
||||
Gfx_DrawDListOpa(play, gDekuShrineSlidingDoorDL);
|
||||
}
|
||||
|
||||
@@ -8,23 +8,34 @@ struct BgCraceMovebg;
|
||||
|
||||
typedef void (*BgCraceMovebgActionFunc)(struct BgCraceMovebg*, PlayState*);
|
||||
|
||||
#define BGCRACEMOVEBG_GET_F(thisx) (((thisx)->params) & 0xF)
|
||||
#define BGCRACEMOVEBG_GET_7F0(thisx) (((thisx)->params >> 4) & 0x7F)
|
||||
#define BGCRACEMOVEBG_GET_3F80(thisx) (((thisx)->params >> 7) & 0x7F)
|
||||
#define BGCRACEMOVEBG_GET_F800(thisx) (((thisx)->params >> 0xB) & 0x1F)
|
||||
#define BG_CRACE_MOVEBG_GET_TYPE(thisx) (((thisx)->params) & 0xF)
|
||||
#define BG_CRACE_MOVEBG_GET_SWITCH_FLAG(thisx) (((thisx)->params >> 4) & 0x7F)
|
||||
#define BG_CRACE_MOVEBG_GET_CLOSE_WAIT_TIMER(thisx) (((thisx)->params >> 0xB) & 0x1F)
|
||||
#define BG_CRACE_MOVEBG_GET_INDEX(thisx) ((thisx)->world.rot.x)
|
||||
#define BG_CRACE_MOVEBG_GET_OPEN_SPEED(thisx) ((thisx)->world.rot.z)
|
||||
|
||||
#define BG_CRACE_MOVEBG_FLAG_BUTLER_IS_BEYOND_DOOR (1 << 0)
|
||||
#define BG_CRACE_MOVEBG_FLAG_PLAYER_IS_BEYOND_DOOR (1 << 1)
|
||||
#define BG_CRACE_MOVEBG_FLAG_ALREADY_LOADED (1 << 3)
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ BG_CRACE_MOVEBG_TYPE_CLOSING,
|
||||
/* 1 */ BG_CRACE_MOVEBG_TYPE_OPENING,
|
||||
/* 2 */ BG_CRACE_MOVEBG_TYPE_UNUSED_CLOSING // Not triggered to close by the Deku Butler, and triggers a voidout no matter which side of the door they're on.
|
||||
} BgCraceMovebgType;
|
||||
|
||||
typedef struct BgCraceMovebg {
|
||||
/* 0x000 */ DynaPolyActor dyna;
|
||||
/* 0x15C */ BgCraceMovebgActionFunc actionFunc;
|
||||
/* 0x160 */ f32 unk160;
|
||||
/* 0x164 */ f32 unk164;
|
||||
/* 0x160 */ f32 doorHeight;
|
||||
/* 0x164 */ f32 targetDoorHeight;
|
||||
/* 0x168 */ UNK_TYPE1 pad168[0x4];
|
||||
/* 0x16C */ f32 unk16C;
|
||||
/* 0x170 */ s32 unk170;
|
||||
/* 0x174 */ s32 unk174;
|
||||
/* 0x178 */ Vec3f unk178;
|
||||
/* 0x184 */ u8 unk184;
|
||||
/* 0x188 */ Vec3f unk188;
|
||||
/* 0x16C */ f32 openSpeed;
|
||||
/* 0x170 */ s32 stateFlags;
|
||||
/* 0x174 */ s32 closeWaitTimer;
|
||||
/* 0x178 */ Vec3f intersectionOffsetFromHome;
|
||||
/* 0x184 */ u8 index;
|
||||
/* 0x188 */ Vec3f prevPlayerPos;
|
||||
} BgCraceMovebg; // size = 0x194
|
||||
|
||||
extern const ActorInit Bg_Crace_Movebg_InitVars;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
void BgDblueMovebg_Init(Actor* thisx, PlayState* play);
|
||||
void BgDblueMovebg_Destroy(Actor* thisx, PlayState* play);
|
||||
void BgDblueMovebg_Update(Actor* thisx, PlayState* play);
|
||||
void BgDblueMovebg_Draw(Actor* thisx, PlayState* play);
|
||||
void BgDblueMovebg_Draw(Actor* thisx, PlayState* play2);
|
||||
|
||||
void func_80A2A1E0(BgDblueMovebg* this, PlayState* play);
|
||||
void func_80A2A32C(BgDblueMovebg* this, PlayState* play);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_bg_hakugin_post.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64rumble.h"
|
||||
#include "objects/object_hakugin_obj/object_hakugin_obj.h"
|
||||
|
||||
@@ -509,7 +510,7 @@ void func_80A9C058(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
|
||||
s32 pad;
|
||||
Vec3f sp44;
|
||||
s32 pad2[2];
|
||||
s16 quake;
|
||||
s16 quakeIndex;
|
||||
|
||||
if (this->unk_170 == 0) {
|
||||
for (i = 0; i < unkStruct->count; i++) {
|
||||
@@ -520,10 +521,12 @@ void func_80A9C058(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
|
||||
sp44.y = this->unk_16C + unkStruct1->unk_14.y;
|
||||
sp44.z = this->dyna.actor.home.pos.z + unkStruct1->unk_14.z;
|
||||
Rumble_Request(Math3D_Vec3fDistSq(&sp44, &GET_PLAYER(play)->actor.world.pos), 255, 20, 150);
|
||||
quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
|
||||
Quake_SetSpeed(quake, 20000);
|
||||
Quake_SetQuakeValues(quake, 7, 0, 0, 0);
|
||||
Quake_SetCountdown(quake, 12);
|
||||
|
||||
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
|
||||
Quake_SetSpeed(quakeIndex, 20000);
|
||||
Quake_SetQuakeValues(quakeIndex, 7, 0, 0, 0);
|
||||
Quake_SetCountdown(quakeIndex, 12);
|
||||
|
||||
if (this->unk_179 <= 0) {
|
||||
func_8019F128(NA_SE_EV_STONEDOOR_STOP);
|
||||
this->unk_179 = 40;
|
||||
@@ -538,15 +541,16 @@ void func_80A9C18C(BgHakuginPost* this, PlayState* play) {
|
||||
s32 pad;
|
||||
Player* player = GET_PLAYER(play);
|
||||
Camera* activeCam = GET_ACTIVE_CAM(play);
|
||||
s16 quake;
|
||||
s16 quakeIndex;
|
||||
|
||||
Rumble_Request(Math3D_XZDistanceSquared(player->actor.world.pos.x, player->actor.world.pos.z,
|
||||
this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.z),
|
||||
255, 20, 150);
|
||||
quake = Quake_Add(activeCam, 3);
|
||||
Quake_SetSpeed(quake, 17232);
|
||||
Quake_SetQuakeValues(quake, 6, 0, 0, 0);
|
||||
Quake_SetCountdown(quake, 20);
|
||||
|
||||
quakeIndex = Quake_Add(activeCam, QUAKE_TYPE_3);
|
||||
Quake_SetSpeed(quakeIndex, 17232);
|
||||
Quake_SetQuakeValues(quakeIndex, 6, 0, 0, 0);
|
||||
Quake_SetCountdown(quakeIndex, 20);
|
||||
}
|
||||
|
||||
void func_80A9C228(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct* unkStruct) {
|
||||
|
||||
@@ -5,13 +5,14 @@
|
||||
*/
|
||||
|
||||
#include "z_bg_ikana_dharma.h"
|
||||
#include "z64quake.h"
|
||||
#include "assets/objects/object_ikana_obj/object_ikana_obj.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10)
|
||||
|
||||
#define THIS ((BgIkanaDharma*)thisx)
|
||||
|
||||
void BgIkanaDharma_Init(Actor* thisx, PlayState* play);
|
||||
void BgIkanaDharma_Init(Actor* thisx, PlayState* play2);
|
||||
void BgIkanaDharma_Destroy(Actor* thisx, PlayState* play);
|
||||
void BgIkanaDharma_Update(Actor* thisx, PlayState* play);
|
||||
void BgIkanaDharma_Draw(Actor* thisx, PlayState* play);
|
||||
@@ -226,11 +227,12 @@ void BgIkanaDharma_Update(Actor* thisx, PlayState* play) {
|
||||
Actor_MoveWithGravity(&this->dyna.actor);
|
||||
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4);
|
||||
if (this->dyna.actor.bgCheckFlags & 2) {
|
||||
s16 quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
|
||||
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
|
||||
|
||||
Quake_SetSpeed(quakeIndex, 21536);
|
||||
Quake_SetQuakeValues(quakeIndex, 4, 0, 0, 0);
|
||||
Quake_SetCountdown(quakeIndex, 12);
|
||||
|
||||
Quake_SetSpeed(quake, 21536);
|
||||
Quake_SetQuakeValues(quake, 4, 0, 0, 0);
|
||||
Quake_SetCountdown(quake, 12);
|
||||
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#define THIS ((BgIkanaMirror*)thisx)
|
||||
|
||||
void BgIkanaMirror_Init(Actor* thisx, PlayState* play);
|
||||
void BgIkanaMirror_Init(Actor* thisx, PlayState* play2);
|
||||
void BgIkanaMirror_Destroy(Actor* thisx, PlayState* play);
|
||||
void BgIkanaMirror_Update(Actor* thisx, PlayState* play);
|
||||
void BgIkanaMirror_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "z_bg_ikana_rotaryroom.h"
|
||||
#include "z64quake.h"
|
||||
#include "overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.h"
|
||||
#include "overlays/actors/ovl_En_Torch2/z_en_torch2.h"
|
||||
#include "overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h"
|
||||
@@ -831,11 +832,11 @@ void func_80B81A80(Actor* thisx, PlayState* play) {
|
||||
|
||||
func_80B81B84(this);
|
||||
} else if (this->unk_584 == 15) {
|
||||
s16 sp26 = Quake_Add(GET_ACTIVE_CAM(play), 3);
|
||||
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
|
||||
|
||||
Quake_SetSpeed(sp26, 0x7B30);
|
||||
Quake_SetQuakeValues(sp26, 6, 0, 100, 0);
|
||||
Quake_SetCountdown(sp26, 22);
|
||||
Quake_SetSpeed(quakeIndex, 31536);
|
||||
Quake_SetQuakeValues(quakeIndex, 6, 0, 100, 0);
|
||||
Quake_SetCountdown(quakeIndex, 22);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -858,11 +859,11 @@ void func_80B81BA0(Actor* thisx, PlayState* play) {
|
||||
thisx->shape.rot.x += 0x1F4;
|
||||
|
||||
if (!(this->unk_584 & 7)) {
|
||||
s16 quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
|
||||
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
|
||||
|
||||
Quake_SetSpeed(quake, 0x7B30);
|
||||
Quake_SetQuakeValues(quake, (s32)(Rand_ZeroOne() * 2.5f) + 3, 0, 10, 0);
|
||||
Quake_SetCountdown(quake, 15);
|
||||
Quake_SetSpeed(quakeIndex, 31536);
|
||||
Quake_SetQuakeValues(quakeIndex, (s32)(Rand_ZeroOne() * 2.5f) + 3, 0, 10, 0);
|
||||
Quake_SetCountdown(quakeIndex, 15);
|
||||
}
|
||||
|
||||
if (Flags_GetSwitch(play, BGIKANAROTARYROOM_GET_FE(&this->dyna.actor))) {
|
||||
@@ -928,11 +929,11 @@ void func_80B81DC8(Actor* thisx, PlayState* play) {
|
||||
ActorCutscene_Stop(this->dyna.actor.cutscene);
|
||||
func_80B818B4(this);
|
||||
} else if (this->unk_584 == 19) {
|
||||
s16 quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
|
||||
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
|
||||
|
||||
Quake_SetSpeed(quake, 0x4E20);
|
||||
Quake_SetQuakeValues(quake, 5, 0, 40, 60);
|
||||
Quake_SetCountdown(quake, 17);
|
||||
Quake_SetSpeed(quakeIndex, 20000);
|
||||
Quake_SetQuakeValues(quakeIndex, 5, 0, 40, 60);
|
||||
Quake_SetCountdown(quakeIndex, 17);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "z_bg_ikana_shutter.h"
|
||||
#include "z64quake.h"
|
||||
#include "objects/object_ikana_obj/object_ikana_obj.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10)
|
||||
@@ -144,16 +145,17 @@ void func_80BD59F8(BgIkanaShutter* this) {
|
||||
|
||||
void func_80BD5A18(BgIkanaShutter* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
s16 quake;
|
||||
s16 quakeIndex;
|
||||
|
||||
this->dyna.actor.velocity.y += -5.0f;
|
||||
this->dyna.actor.velocity.y *= 0.978f;
|
||||
this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y;
|
||||
if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) {
|
||||
quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
|
||||
Quake_SetSpeed(quake, 0x5420);
|
||||
Quake_SetQuakeValues(quake, 4, 0, 0, 0);
|
||||
Quake_SetCountdown(quake, 12);
|
||||
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
|
||||
Quake_SetSpeed(quakeIndex, 21536);
|
||||
Quake_SetQuakeValues(quakeIndex, 4, 0, 0, 0);
|
||||
Quake_SetCountdown(quakeIndex, 12);
|
||||
|
||||
func_80BD5828(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "z_bg_iknin_susceil.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64rumble.h"
|
||||
#include "objects/object_ikninside_obj/object_ikninside_obj.h"
|
||||
|
||||
@@ -70,11 +71,12 @@ void func_80C0A838(BgIkninSusceil* this, PlayState* play) {
|
||||
|
||||
void func_80C0A86C(BgIkninSusceil* this, PlayState* play, s16 verticalMag, s16 countdown, s32 arg4) {
|
||||
s32 pad;
|
||||
s16 quake = Quake_Add(GET_ACTIVE_CAM(play), 3);
|
||||
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
|
||||
|
||||
Quake_SetSpeed(quakeIndex, 31536);
|
||||
Quake_SetQuakeValues(quakeIndex, verticalMag, 0, 0, 0);
|
||||
Quake_SetCountdown(quakeIndex, countdown);
|
||||
|
||||
Quake_SetSpeed(quake, 0x7B30);
|
||||
Quake_SetQuakeValues(quake, verticalMag, 0, 0, 0);
|
||||
Quake_SetCountdown(quake, countdown);
|
||||
if (arg4 == 1) {
|
||||
Rumble_Request(SQ(100.0f), 255, 20, 150);
|
||||
} else if (arg4 == 2) {
|
||||
|
||||
@@ -131,7 +131,7 @@ void BgIknvObj_UpdateWaterwheel(BgIknvObj* this, PlayState* play) {
|
||||
func_800B9010(&this->dyna.actor, NA_SE_EV_WOOD_WATER_WHEEL - SFX_FLAG);
|
||||
}
|
||||
|
||||
if ((play->csCtx.state != 0) && (gSaveContext.sceneSetupIndex == 1) && (play->csCtx.currentCsIndex == 4) &&
|
||||
if ((play->csCtx.state != 0) && (gSaveContext.sceneLayer == 1) && (play->csCtx.currentCsIndex == 4) &&
|
||||
(play->csCtx.frames == 1495)) {
|
||||
func_8019F128(NA_SE_EV_DOOR_UNLOCK);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user