Merge remote-tracking branch 'upstream/master' into sys_math3d

This commit is contained in:
Derek Hensley
2023-04-21 22:43:24 -07:00
747 changed files with 19746 additions and 16419 deletions
+2
View File
@@ -14,6 +14,8 @@ tags
# Project-specific ignores
*.z64
*.n64
*.v64
*.sra
*.bin
*.elf
+1 -1
View File
@@ -90,7 +90,7 @@ OBJCOPY := $(MIPS_BINUTILS_PREFIX)objcopy
OBJDUMP := $(MIPS_BINUTILS_PREFIX)objdump
ASM_PROC := python3 tools/asm-processor/build.py
ASM_PROC_FLAGS := --input-enc=utf-8 --output-enc=euc-jp
ASM_PROC_FLAGS := --input-enc=utf-8 --output-enc=euc-jp --convert-statics=global-with-filename
IINC := -Iinclude -Isrc -Iassets -Ibuild -I.
+7 -5
View File
@@ -787,7 +787,7 @@
<PlayerAnimation Name="gPlayerAnim_Link_muku" Offset="0xE4E0" />
<PlayerAnimation Name="gPlayerAnim_Link_otituku_w" Offset="0xE4E8" />
<PlayerAnimation Name="gPlayerAnim_Link_ue_wait" Offset="0xE4F0" />
<DList Name="gameplay_keep_DL_00E5C0" Offset="0xE5C0" />
<!-- Deku Flower -->
@@ -1145,8 +1145,8 @@
<Texture Name="gElegyShellGoronNecklaceTex" OutName="elegy_shell_goron_necklace" Format="i8" Width="32" Height="32" Offset="0x4DDA0" />
<Texture Name="gElegyShellGoronPlatformTex" OutName="elegy_shell_goron_platform" Format="ci8" Width="8" Height="16" Offset="0x4E1A0" />
<Texture Name="gameplay_keep_Tex_04E220" OutName="tex_04E220" Format="i8" Width="64" Height="64" Offset="0x4E220" />
<DList Name="gameplay_keep_DL_04F250" Offset="0x4F250" />
<Texture Name="gHookshotReticleTex" OutName="tex_04E220" Format="i8" Width="64" Height="64" Offset="0x4E220" />
<DList Name="gHookshotReticleDL" Offset="0x4F250" />
<Texture Name="gameplay_keep_Tex_04F2C0" OutName="tex_04F2C0" Format="ia16" Width="32" Height="64" Offset="0x4F2C0" />
<DList Name="gEffIceFragment1DL" Offset="0x50550" />
<DList Name="gEffIceFragment2MaterialDL" Offset="0x50648" />
@@ -1223,7 +1223,9 @@
<DList Name="gameplay_keep_DL_054C90" Offset="0x54C90" />
<Texture Name="gameplay_keep_Tex_054D90" OutName="tex_054D90" Format="i4" Width="16" Height="16" Offset="0x54D90" />
<Texture Name="gameplay_keep_Tex_054E10" OutName="tex_054E10" Format="i8" Width="16" Height="16" Offset="0x54E10" />
<TextureAnimation Name="gameplay_keep_Matanimheader_054F18" Offset="0x54F18" />
<Texture Name="gameplay_keep_Tex_054F20" OutName="tex_054F20" Format="i8" Width="32" Height="32" Offset="0x54F20" />
<DList Name="gameplay_keep_DL_055360" Offset="0x55360" />
<DList Name="gameplay_keep_DL_055620" Offset="0x55620" />
@@ -1477,7 +1479,7 @@
<Texture Name="gElegyShellZoraPlatformTex" OutName="elegy_shell_zora_platform" Format="rgba16" Width="8" Height="16" Offset="0x8D2E0" />
<Texture Name="gameplay_keep_Tex_08D3E0" OutName="tex_08D3E0" Format="i8" Width="64" Height="32" Offset="0x8D3E0" />
<!-- Dust Textures -->
<Texture Name="gEffDust1Tex" OutName="eff_dust_1" Format="i8" Width="32" Height="32" Offset="0x8DBE0" />
<Texture Name="gEffDust2Tex" OutName="eff_dust_2" Format="i8" Width="32" Height="32" Offset="0x8DFE0" />
@@ -1487,7 +1489,7 @@
<Texture Name="gEffDust6Tex" OutName="eff_dust_6" Format="i8" Width="32" Height="32" Offset="0x8EFE0" />
<Texture Name="gEffDust7Tex" OutName="eff_dust_7" Format="i8" Width="32" Height="32" Offset="0x8F3E0" />
<Texture Name="gEffDust8Tex" OutName="eff_dust_8" Format="i8" Width="32" Height="32" Offset="0x8F7E0" />
<Texture Name="gameplay_keep_Tex_08FBE0" OutName="tex_08FBE0" Format="i8" Width="32" Height="64" Offset="0x8FBE0" />
<Texture Name="gameplay_keep_Tex_0903E0" OutName="tex_0903E0" Format="i8" Width="32" Height="64" Offset="0x903E0" />
<Texture Name="gameplay_keep_Tex_090BE0" OutName="tex_090BE0" Format="i8" Width="32" Height="64" Offset="0x90BE0" />
+1 -1
View File
@@ -46,7 +46,7 @@
<DList Name="gGyorgBubbleModelDL" Offset="0x7EB0" />
<!-- Gyorg Title Card -->
<Texture Name="gGyorgTitleCardTex" OutName="gyorg_title_card" Format="i8" Width="128" Height="40" Offset="0x7EC8" />
<Texture Name="gGyorgTitleCardTex" OutName="gyorg_title_card" Format="ia8" Width="128" Height="40" Offset="0x7EC8" />
<!-- Gyorg Limbs -->
<Limb Name="gGyorgRootLimb" Type="Standard" EnumName="GYORG_LIMB_ROOT" Offset="0x92C8" />
+3 -3
View File
@@ -200,9 +200,9 @@
<DList Name="gMajorasWrathSpinningTopDL" Offset="0x2F640" />
<!-- Majora Title Cards -->
<Texture Name="gMajorasMaskTitleCardTex" OutName="majoras_mask_title_card" Format="i8" Width="128" Height="40" Offset="0x2F840" />
<Texture Name="gMajorasIncarnationTitleCardTex" OutName="majoras_incarnation_title_card" Format="i8" Width="128" Height="40" Offset="0x30C40" />
<Texture Name="gMajorasWrathTitleCardTex" OutName="majoras_wrath_title_card" Format="i8" Width="128" Height="40" Offset="0x32040" />
<Texture Name="gMajorasMaskTitleCardTex" OutName="majoras_mask_title_card" Format="ia8" Width="128" Height="40" Offset="0x2F840" />
<Texture Name="gMajorasIncarnationTitleCardTex" OutName="majoras_incarnation_title_card" Format="ia8" Width="128" Height="40" Offset="0x30C40" />
<Texture Name="gMajorasWrathTitleCardTex" OutName="majoras_wrath_title_card" Format="ia8" Width="128" Height="40" Offset="0x32040" />
<!-- Majora's Wrath Limbs -->
<Limb Name="gMajorasWrathRootLimb" Type="Standard" EnumName="MAJORAS_WRATH_LIMB_ROOT" Offset="0x33440" />
+1 -1
View File
@@ -101,6 +101,6 @@
<Animation Name="gGohtGetUpFromSideAnim" Offset="0x14024" /> <!-- Unused. Original name is "iceb_up" -->
<!-- Goht Title Card -->
<Texture Name="gGohtTitleCardTex" OutName="goht_title_card" Format="i8" Width="128" Height="40" Offset="0x14040" />
<Texture Name="gGohtTitleCardTex" OutName="goht_title_card" Format="ia8" Width="128" Height="40" Offset="0x14040" />
</File>
</Root>
+8 -8
View File
@@ -28,8 +28,8 @@
<Texture Name="object_dt_Tex_0071D0" OutName="tex_0071D0" Format="ci8" Width="8" Height="8" Offset="0x71D0" />
<Texture Name="object_dt_Tex_007210" OutName="tex_007210" Format="rgba16" Width="8" Height="16" Offset="0x7210" />
<Texture Name="object_dt_Tex_007310" OutName="tex_007310" Format="ci8" Width="8" Height="8" Offset="0x7310" />
<Texture Name="object_dt_Tex_007350" OutName="tex_007350" Format="ci8" Width="32" Height="32" Offset="0x7350" />
<Texture Name="object_dt_Tex_007750" OutName="tex_007750" Format="ci8" Width="16" Height="16" Offset="0x7750" />
<Texture Name="gDotourEyeShockTex" OutName="dotour_eye_shock" Format="ci8" Width="32" Height="32" Offset="0x7350" TlutOffset="0x6C50" />
<Texture Name="gDotourEyebrowHighTex" OutName="dotour_eyebrow_high" Format="ci8" Width="16" Height="16" Offset="0x7750" TlutOffset="0x6E50" />
<Texture Name="object_dt_Tex_007850" OutName="tex_007850" Format="ci8" Width="32" Height="32" Offset="0x7850" />
<Texture Name="object_dt_Tex_007C50" OutName="tex_007C50" Format="ci8" Width="16" Height="16" Offset="0x7C50" />
<Texture Name="object_dt_Tex_007D50" OutName="tex_007D50" Format="ci8" Width="32" Height="32" Offset="0x7D50" />
@@ -37,15 +37,15 @@
<Texture Name="object_dt_Tex_008190" OutName="tex_008190" Format="ci8" Width="32" Height="16" Offset="0x8190" />
<Texture Name="object_dt_Tex_008390" OutName="tex_008390" Format="rgba16" Width="32" Height="64" Offset="0x8390" />
<Texture Name="object_dt_Tex_009390" OutName="tex_009390" Format="rgba16" Width="16" Height="16" Offset="0x9390" />
<Texture Name="object_dt_Tex_009590" OutName="tex_009590" Format="ci8" Width="32" Height="32" Offset="0x9590" />
<Texture Name="gDotourEyeOpenTex" OutName="dotour_eye_open" Format="ci8" Width="32" Height="32" Offset="0x9590" TlutOffset="0x6C50" />
<Texture Name="object_dt_Tex_009990" OutName="tex_009990" Format="rgba16" Width="16" Height="32" Offset="0x9990" />
<Texture Name="object_dt_Tex_009D90" OutName="tex_009D90" Format="rgba16" Width="16" Height="16" Offset="0x9D90" />
<Texture Name="object_dt_Tex_009F90" OutName="tex_009F90" Format="ci8" Width="32" Height="32" Offset="0x9F90" />
<Texture Name="object_dt_Tex_00A390" OutName="tex_00A390" Format="ci8" Width="16" Height="16" Offset="0xA390" />
<Texture Name="object_dt_Tex_00A490" OutName="tex_00A490" Format="ci8" Width="16" Height="16" Offset="0xA490" />
<Texture Name="gDotourEyeClosedTex" OutName="dotour_eye_closed" Format="ci8" Width="32" Height="32" Offset="0x9F90" TlutOffset="0x6C50" />
<Texture Name="gDotourEyebrowMidTex" OutName="dotour_eyebrow_mid" Format="ci8" Width="16" Height="16" Offset="0xA390" TlutOffset="0x6E50" />
<Texture Name="gDotourEyebrowLowTex" OutName="dotour_eyebrow_low" Format="ci8" Width="16" Height="16" Offset="0xA490" TlutOffset="0x6E50" />
<Texture Name="object_dt_Tex_00A590" OutName="tex_00A590" Format="rgba16" Width="16" Height="16" Offset="0xA590" />
<Texture Name="object_dt_Tex_00A790" OutName="tex_00A790" Format="ci8" Width="32" Height="32" Offset="0xA790" />
<Texture Name="object_dt_Tex_00AB90" OutName="tex_00AB90" Format="ci8" Width="32" Height="32" Offset="0xAB90" />
<Texture Name="gDotourEyeLookDownTex" OutName="dotour_eye_look_down" Format="ci8" Width="32" Height="32" Offset="0xA790" TlutOffset="0x6C50" />
<Texture Name="gDotourEyeSquintTex" OutName="dotour_eye_squint" Format="ci8" Width="32" Height="32" Offset="0xAB90" TlutOffset="0x6C50" />
<TextureAnimation Name="object_dt_Matanimheader_00AFDC" Offset="0xAFDC" />
<Limb Name="object_dt_Standardlimb_00AFEC" Type="Standard" EnumName="OBJECT_DT_LIMB_01" Offset="0xAFEC" />
<Limb Name="object_dt_Standardlimb_00AFF8" Type="Standard" EnumName="OBJECT_DT_LIMB_02" Offset="0xAFF8" />
+9 -9
View File
@@ -101,7 +101,7 @@
<DList Name="object_link_child_DL_017270" Offset="0x17270" />
<DList Name="gLinkHumanGildedSwordBladeDL" Offset="0x17310" />
<DList Name="gLinkHumanRazorSwordSheathDL" Offset="0x17338" />
<DList Name="gLinkHumanHylianShieldDL" Offset="0x17458" />
<DList Name="gLinkHumanHerosShieldDL" Offset="0x17458" />
<DList Name="gLinkHumanKokiriSwordSheathDL" Offset="0x17700" />
<DList Name="object_link_child_DL_017818" Offset="0x17818" />
<DList Name="gLinkHumanHookshotDL" Offset="0x17858" />
@@ -110,17 +110,17 @@
<DList Name="object_link_child_DL_018490" Offset="0x18490" />
<Texture Name="object_link_child_TLUT_018A40" OutName="tlut_018A40" Format="rgba16" Width="16" Height="16" Offset="0x18A40" />
<Texture Name="gLinkHumanHylianShieldFrontTLUT" OutName="hylian_shield_front_tlut" Format="rgba16" Width="16" Height="16" Offset="0x18C40" />
<Texture Name="gLinkHumanHylianShieldBackTLUT" OutName="hylian_shield_back_tlut" Format="rgba16" Width="16" Height="16" Offset="0x18E40" />
<Texture Name="gLinkHumanHerosShieldFrontTLUT" OutName="hylian_shield_front_tlut" Format="rgba16" Width="16" Height="16" Offset="0x18C40" />
<Texture Name="gLinkHumanHerosShieldBackTLUT" OutName="hylian_shield_back_tlut" Format="rgba16" Width="16" Height="16" Offset="0x18E40" />
<Texture Name="gLinkHumanShieldHandleTLUT" OutName="shield_handle_tlut" Format="rgba16" Width="16" Height="16" Offset="0x19040" />
<Texture Name="object_link_child_Tex_019240" OutName="tex_019240" Format="ci8" Width="8" Height="8" Offset="0x19240" />
<Texture Name="gLinkHumanHylianShieldFrontUpperTex" OutName="hylian_shield_front_upper" Format="ci8" Width="64" Height="32" Offset="0x19280" TlutOffset="0x18C40" />
<Texture Name="gLinkHumanHerosShieldFrontUpperTex" OutName="hylian_shield_front_upper" Format="ci8" Width="64" Height="32" Offset="0x19280" TlutOffset="0x18C40" />
<Texture Name="object_link_child_Tex_019A80" OutName="tex_019A80" Format="ci8" Width="32" Height="64" Offset="0x19A80" />
<Texture Name="object_link_child_Tex_01A280" OutName="tex_01A280" Format="ci8" Width="16" Height="16" Offset="0x1A280" />
<Texture Name="object_link_child_Tex_01A380" OutName="tex_01A380" Format="rgba16" Width="64" Height="32" Offset="0x1A380" />
<Texture Name="object_link_child_Tex_01B380" OutName="tex_01B380" Format="ci8" Width="16" Height="16" Offset="0x1B380" />
<Texture Name="gLinkHumanHylianShieldFrontLowerTex" OutName="hylian_shield_front_lower" Format="ci8" Width="64" Height="32" Offset="0x1B480" TlutOffset="0x18C40" />
<Texture Name="gLinkHumanHylianShieldBackTex" OutName="hylian_shield_back" Format="ci8" Width="16" Height="32" Offset="0x1BC80" TlutOffset="0x18E40" />
<Texture Name="gLinkHumanHerosShieldFrontLowerTex" OutName="hylian_shield_front_lower" Format="ci8" Width="64" Height="32" Offset="0x1B480" TlutOffset="0x18C40" />
<Texture Name="gLinkHumanHerosShieldBackTex" OutName="hylian_shield_back" Format="ci8" Width="16" Height="32" Offset="0x1BC80" TlutOffset="0x18E40" />
<Texture Name="gLinkHumanShieldHandleTex" OutName="shield_handle" Format="ci8" Width="8" Height="16" Offset="0x1BE80" TlutOffset="0x19040" />
<Texture Name="object_link_child_Tex_01BF00" OutName="tex_01BF00" Format="rgba16" Width="8" Height="8" Offset="0x1BF00" />
<Texture Name="object_link_child_Tex_01BF80" OutName="tex_01BF80" Format="rgba16" Width="16" Height="16" Offset="0x1BF80" />
@@ -143,12 +143,12 @@
<Mtx Name="gLinkHumanSheathedRazorSwordMtx" Offset="0x1DB00" />
<DList Name="gLinkHumanSheathedRazorSwordDL" Offset="0x1DB40" />
<DList Name="gLinkHumanSheathedGildedSwordDL" Offset="0x1DB60" />
<Mtx Name="gLinkHumanHylianShieldMtx" Offset="0x1DB88" />
<DList Name="gLinkHumanHylianShieldWithMtxDL" Offset="0x1DBC8" />
<Mtx Name="gLinkHumanHerosShieldMtx" Offset="0x1DB88" />
<DList Name="gLinkHumanHerosShieldWithMtxDL" Offset="0x1DBC8" />
<Mtx Name="gLinkHumanMirrorShieldMtx" Offset="0x1DBD8" />
<DList Name="gLinkHumanMirrorShieldWithMtxDL" Offset="0x1DC18" />
<DList Name="gLinkHumanRightHandHoldingHylianShieldDL" Offset="0x1DC28" />
<DList Name="gLinkHumanRightHandHoldingHerosShieldDL" Offset="0x1DC28" />
<DList Name="object_link_child_DL_01DC38" Offset="0x1DC38" />
<DList Name="gLinkHumanRightHandHoldingMirrorShieldDL" Offset="0x1DC48" />
<DList Name="object_link_child_DL_01DC58" Offset="0x1DC58" />
+1 -1
View File
@@ -90,7 +90,7 @@
<Limb Name="gLinkGoronShieldingArmsAndLegsLimb" Type="Standard" EnumName="LINK_GORON_SHIELDING_LIMB_ARMS_AND_LEGS" Offset="0x1779C" />
<Skeleton Name="gLinkGoronShieldingSkel" Type="Flex" LimbType="Standard" LimbNone="LINK_GORON_SHIELDING_LIMB_NONE" LimbMax="LINK_GORON_SHIELDING_LIMB_MAX" EnumName="LinkGoronShieldingLimb" Offset="0x177B8" />
<!-- <Blob Name="object_link_goron_Blob_0178D0" Size="0x10" Offset="0x178D0" /> -->
<Animation Name="gLinkGoronShieldingAnim" Offset="0x178D0" />
<Limb Name="gLinkGoronRootLimb" Type="LOD" EnumName="LINK_GORON_LIMB_ROOT" Offset="0x178E0" />
<Limb Name="gLinkGoronWaistLimb" Type="LOD" EnumName="LINK_GORON_LIMB_WAIST" Offset="0x178F0" />
+2 -2
View File
@@ -40,10 +40,10 @@
<DList Name="object_link_nuts_DL_008860" Offset="0x8860" />
<DList Name="object_link_nuts_DL_008908" Offset="0x8908" />
<DList Name="object_link_nuts_DL_0089F0" Offset="0x89F0" />
<DList Name="object_link_nuts_DL_008AA0" Offset="0x8AA0" />
<DList Name="gLinkDekuClosedFlowerDL" Offset="0x8AA0" />
<DList Name="object_link_nuts_DL_008AB8" Offset="0x8AB8" />
<DList Name="object_link_nuts_DL_008BA0" Offset="0x8BA0" />
<DList Name="object_link_nuts_DL_008C50" Offset="0x8C50" />
<DList Name="gLinkDekuOpenFlowerDL" Offset="0x8C50" />
<Texture Name="object_link_nuts_Tex_008C68" OutName="tex_008C68" Format="rgba16" Width="16" Height="16" Offset="0x8C68" />
<Texture Name="object_link_nuts_Tex_008E68" OutName="tex_008E68" Format="rgba16" Width="16" Height="16" Offset="0x8E68" />
<Texture Name="object_link_nuts_Tex_009068" OutName="tex_009068" Format="rgba16" Width="8" Height="8" Offset="0x9068" />
+13 -10
View File
@@ -1,14 +1,17 @@
<Root>
<!-- Object file for Chuchus -->
<File Name="object_slime" Segment="6">
<DList Name="object_slime_DL_0004C0" Offset="0x4C0" />
<DList Name="object_slime_DL_000650" Offset="0x650" />
<TextureAnimation Name="object_slime_Matanimheader_000828" Offset="0x828" />
<DList Name="object_slime_DL_000A10" Offset="0xA10" />
<DList Name="object_slime_DL_000B68" Offset="0xB68" />
<Texture Name="object_slime_Tex_000B70" OutName="tex_000B70" Format="rgba16" Width="16" Height="16" Offset="0xB70" />
<Texture Name="object_slime_Tex_000D70" OutName="tex_000D70" Format="rgba16" Width="16" Height="16" Offset="0xD70" />
<!-- <Blob Name="object_slime_Blob_000F70" Size="0x300" Offset="0xF70" /> -->
<Texture Name="object_slime_Tex_001270" OutName="tex_001270" Format="i4" Width="32" Height="32" Offset="0x1270" />
<Texture Name="object_slime_Tex_001470" OutName="tex_001470" Format="i4" Width="64" Height="64" Offset="0x1470" />
<DList Name="gChuchuBodyDL" Offset="0x4C0" />
<DList Name="gChuchuEyesDL" Offset="0x650" />
<TextureAnimation Name="gChuchuSlimeFlowTexAnim" Offset="0x828" />
<DList Name="gChuchuPuddleDL" Offset="0xA10" />
<DList Name="gChuchuEmptyDL" Offset="0xB68" />
<Texture Name="gChuchuMouthTex" OutName="chuchu_mouth" Format="rgba16" Width="16" Height="16" Offset="0xB70" />
<Texture Name="gChuchuEyeSocketTex" OutName="chuchu_eye_socket" Format="rgba16" Width="16" Height="16" Offset="0xD70" />
<Texture Name="gChuchuEyeOpenTex" OutName="chuchu_eye_open" Format="rgba16" Width="16" Height="8" Offset="0xF70" />
<Texture Name="gChuchuEyeHalfTex" OutName="chuchu_eye_half" Format="rgba16" Width="16" Height="8" Offset="0x1070" />
<Texture Name="gChuchuEyeClosedTex" OutName="chuchu_eye_closed" Format="rgba16" Width="16" Height="8" Offset="0x1170" />
<Texture Name="gChuchuSlimeFlowTex" OutName="chuchu_slime_flow" Format="i4" Width="32" Height="32" Offset="0x1270" />
<Texture Name="gChuchuSlimeBaseTex" OutName="chuchu_slime_base" Format="i4" Width="64" Height="64" Offset="0x1470" />
</File>
</Root>
+21 -21
View File
@@ -81,7 +81,7 @@ void EnMs_Destroy(Actor* thisx, PlayState* play) {
void func_80952734(EnMs* this, PlayState* play) {
s16 temp_v1 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
if (gSaveContext.save.inventory.items[10] == ITEM_NONE) {
if (gSaveContext.save.saveInfo.inventory.items[10] == ITEM_NONE) {
this->actor.textId = 0x92E;
} else {
this->actor.textId = 0x932;
@@ -187,12 +187,12 @@ void func_809527F8(EnMs* this, PlayState* play) {
return;
}
Message_CloseTextbox(play);
if ((s32) gSaveContext.save.playerData.rupees < 0xA) {
if ((s32) gSaveContext.save.saveInfo.playerData.rupees < 0xA) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x935U);
return;
}
if ((s32) gSaveContext.save.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
if ((s32) gSaveContext.save.saveInfo.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x937U);
return;
@@ -274,14 +274,14 @@ block_7:
goto block_16;
block_11:
Message_CloseTextbox(play);
if ((s32) gSaveContext.save.playerData.rupees >= 0xA) {
if ((s32) gSaveContext.save.saveInfo.playerData.rupees >= 0xA) {
goto block_13;
}
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x935U);
return;
block_13:
if ((s32) gSaveContext.save.inventory.ammo[gItemSlots[0xA]] < 0x14) {
if ((s32) gSaveContext.save.saveInfo.inventory.ammo[gItemSlots[0xA]] < 0x14) {
goto block_15;
}
play_sound(0x4806U);
@@ -312,7 +312,7 @@ which in many ways looks worse: you can see why the use of gotos in code is stro
The simplest sort of block label to eliminate is one that is only used once, and where the corresponding goto jumps over a simple block of code with no extra internal control flow structure. There are two obvious examples of this here, the first being
```C
if ((s32) gSaveContext.save.playerData.rupees >= 0xA) {
if ((s32) gSaveContext.save.saveInfo.playerData.rupees >= 0xA) {
goto block_13;
}
play_sound(0x4806U);
@@ -324,7 +324,7 @@ block_13:
Currently, this says to jump over the code block `play_sound...` if the condition in the if is satisfied. In non-goto terms, this means that the block should be run if the condition is *not* satisfied. This also illustrates a general property of goto-only mode: you have to reverse the senses of all of the ifs. Therefore the appropriate approach is to swap the if round, put the code block inside, and remove the goto and the label:
```C
if (gSaveContext.save.playerData.rupees < 0xA) {
if (gSaveContext.save.saveInfo.playerData.rupees < 0xA) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x935U);
return;
@@ -378,12 +378,12 @@ block_7:
block_11:
Message_CloseTextbox(play);
if (gSaveContext.save.playerData.rupees < 0xA) {
if (gSaveContext.save.saveInfo.playerData.rupees < 0xA) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x935U);
return;
}
if (gSaveContext.save.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
if (gSaveContext.save.saveInfo.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x937U);
return;
@@ -447,12 +447,12 @@ block_7:
block_11:
Message_CloseTextbox(play);
if (gSaveContext.save.playerData.rupees < 0xA) {
if (gSaveContext.save.saveInfo.playerData.rupees < 0xA) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x935U);
return;
}
if (gSaveContext.save.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
if (gSaveContext.save.saveInfo.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x937U);
return;
@@ -497,12 +497,12 @@ So let us rewrite the entire second half as a switch:
case 0:
Message_CloseTextbox(play);
if (gSaveContext.save.playerData.rupees < 0xA) {
if (gSaveContext.save.saveInfo.playerData.rupees < 0xA) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x935U);
return;
}
if (gSaveContext.save.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
if (gSaveContext.save.saveInfo.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x937U);
return;
@@ -533,10 +533,10 @@ There's a couple of other obvious things here:
case 0:
Message_CloseTextbox(play);
if (gSaveContext.save.playerData.rupees < 0xA) {
if (gSaveContext.save.saveInfo.playerData.rupees < 0xA) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x935U);
} else if (gSaveContext.save.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
} else if (gSaveContext.save.saveInfo.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x937U);
} else {
@@ -598,10 +598,10 @@ block_7:
case 0:
Message_CloseTextbox(play);
if (gSaveContext.save.playerData.rupees < 0xA) {
if (gSaveContext.save.saveInfo.playerData.rupees < 0xA) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x935U);
} else if (gSaveContext.save.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
} else if (gSaveContext.save.saveInfo.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x937U);
} else {
@@ -663,10 +663,10 @@ void func_809527F8(EnMs* this, PlayState* play) {
case 0:
Message_CloseTextbox(play);
if (gSaveContext.save.playerData.rupees < 0xA) {
if (gSaveContext.save.saveInfo.playerData.rupees < 0xA) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x935U);
} else if (gSaveContext.save.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
} else if (gSaveContext.save.saveInfo.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x937U);
} else {
@@ -715,10 +715,10 @@ void func_809527F8(EnMs* this, PlayState* play) {
case 0:
Message_CloseTextbox(play);
if (gSaveContext.save.playerData.rupees < 0xA) {
if (gSaveContext.save.saveInfo.playerData.rupees < 0xA) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x935U);
} else if (gSaveContext.save.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
} else if (gSaveContext.save.saveInfo.inventory.ammo[gItemSlots[0xA]] >= 0x14) {
play_sound(0x4806U);
Message_ContinueTextbox(play, 0x937U);
} else {
+6 -10
View File
@@ -185,7 +185,7 @@ void func_80C102D4(EnRecepgirl* this, PlayState* play) {
if (this->actor.textId == 0x2AD9) {
Flags_SetSwitch(play, this->actor.params);
Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 10.0f);
if ((gSaveContext.save.weekEventReg[63] & 0x80)) {
if ((gSaveContext.save.saveInfo.weekEventReg[63] & 0x80)) {
this->actor.textId = 0x2ADF;
} else {
this->actor.textId = 0x2ADA;
@@ -327,17 +327,13 @@ the fourth element is the object (it is actually an enum, but the file itself ha
## Z64Utils
The latest release of Z64Utils can be downloaded from [https://github.com/Random06457/Z64Utils/releases]. To use it with MM, you also need a json file to fill in the file names: the latest version can be obtained from [https://github.com/Random06457/Z64Utils-Config]. It should work on Wine. Some graphics cards don't love it, but the 3D graphical part is only required for skeleton and animations.
The latest release of Z64Utils can be downloaded from [https://github.com/zeldaret/Z64Utils/releases]. It should work on Wine. Some graphics cards don't love it, but the 3D graphical part is only required for skeleton and animations.
Having downloaded and unzipped it, open the baserom file. This will populate the main window with a list:
![Z64Utils' main window](images/z64utils_main.png)
Search for the object file, right-click and select "Open in Object Analyzer". It will ask you to choose a segment: this is the segment that the file is put on, and allows Z64Utils to resolve the segmented addresses it references into symbols. The json already knows it should be segment `6`, so just click okay. This will open this window:
![Z64Utils' object analyzer window](images/z64utils_object_analyzer.png)
Go to "Analysis -> Find Dlists" and press OK (the defaults are usually fine). This will automatically search for displaylists in the object, which are a sufficiently distinctive format to be easy to find. We want to see the other stuff in the object too, so also do "Analysis -> Analyze Dlists". This will populate the window with even more stuff:
Search for the object file, then either double-click it or right-click it and select "Open in Object Analyzer" to open it. It will ask you to choose a segment: this is the segment that the file is put on, and allows Z64Utils to resolve the segmented addresses it references into symbols. The json already knows it should be segment `6`, so just click okay. This will open this window; displaylists and other data will automatically be analyzed when the object is opened:
![Z64Utils, with an analyzed object](images/z64utils_object_analyzed.png)
@@ -347,7 +343,7 @@ We will talk about what all these types of data are next time, but for now, all
static void* D_80C106B0[4] = { object_bg_Tex_00F8F0, object_bg_Tex_00FCF0, object_bg_Tex_0100F0, object_bg_Tex_00FCF0 };
```
actually are. We know they are set on segment 8, so we need to find where the skeleton uses them. We know from `object_bg_Skel_011B60` that this is at `0x06011B60`, so scroll down to it, right-click on it, and choose "Open in Skeleton Viewer". Pick an animation that we know it uses (sometimes Z64Utils misidentifies other things for animations), such as `object_bg_Anim_000968`, and you will get this error:
actually are. We know they are set on segment 8, so we need to find where the skeleton uses them. We know from `object_bg_Skel_011B60` that this is at `0x06011B60`, so scroll down to it and either double-click on it or right-click on it and choose "Open in Skeleton Viewer". Pick an animation that we know it uses (sometimes Z64Utils misidentifies other things for animations), such as `object_bg_Anim_000968`, and you will get this error:
![Z64Utils, error when viewing skeleton](images/z64utils_skeleton_error.png)
@@ -447,7 +443,7 @@ void EnRecepgirl_UnkLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) {
}
```
It is used to do a rotation of whatever limb `5` is. (The `+=` is because `rot->x` is the base rotation of the limb, and we have to add the same thing to it every frame to keep the angle changed and constant.) We can use Z64Utils to : setting segment `8` to one of what we know now are the eye textures, we can view the model in the skeleton viewer. The limb numbers in the object are one smaller than those in the actor (the root limb is only a concept for the code, not the object), so we find limb 4:
It is used to do a rotation of whatever limb `5` is. (The `+=` is because `rot->x` is the base rotation of the limb, and we have to add the same thing to it every frame to keep the angle changed and constant.) We can use Z64Utils to figure this out: setting segment `8` to one of what we know now are the eye textures, we can view the model in the skeleton viewer. The limb numbers in the object are one smaller than those in the actor (the root limb is only a concept for the code, not the object), so we find limb 4:
![Z64Utils highlighting a limb](images/z64utils_skeleton_head.png)
@@ -520,7 +516,7 @@ void func_80C102D4(EnRecepgirl* this, PlayState* play) {
if (this->actor.textId == 0x2AD9) { // "Welcome..."
Flags_SetSwitch(play, this->actor.params);
Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 10.0f);
if (gSaveContext.save.weekEventReg[63] & 0x80) { // showed Couple's Mask to meeting
if (gSaveContext.save.saveInfo.weekEventReg[63] & 0x80) { // showed Couple's Mask to meeting
this->actor.textId = 0x2ADF; // Mayor's office is on the left (meeting ended)
} else {
this->actor.textId = 0x2ADA; // Mayor's office is on the left (meeting ongoing)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

+1 -1
View File
@@ -111,7 +111,7 @@ If in doubt, look at completed objects in the repo, and if still in doubt, ask.
We are very fortunate that several nice tools have been written recently that are excellent for documenting asset files:
- [Z64Utils](https://github.com/Random06457/Z64Utils/releases), for looking at displaylists, textures they reference, the skeleton, animations, etc.
- [Z64Utils](https://github.com/zeldaret/Z64Utils/releases), for looking at displaylists, textures they reference, the skeleton, animations, etc.
- [Texture64](https://github.com/queueRAM/Texture64/releases), for looking at textures in all the common N64 formats (needed since Z64Utils cannot interpret textures not explicitly referenced in displaylists currently)
## Building and investigative modding
+3 -3
View File
@@ -6,11 +6,11 @@ Let's take a look at `object_dns`, which is a pretty typical NPC object. It's us
## Step 1: Naming the skeleton and limbs
We already went through the steps of opening an object file in Z64Utils in the [documenting step](documenting.md#z64utils), but we'll do it in more detail here. First, search for the object file, then right-click and select "Open in Object Analyzer". It will ask you to choose a segment: this is the segment that the file is put on, and allows Z64Utils to resolve the segmented addresses it references into symbols. The json already knows it should be segment 6, so just click OK.
We already went through the steps of opening an object file in Z64Utils in the [documenting step](documenting.md#z64utils), but we'll do it in more detail here. First, search for the object file, then either double-click on it or right-click it and select "Open in Object Analyzer". It will ask you to choose a segment: this is the segment that the file is put on, and allows Z64Utils to resolve the segmented addresses it references into symbols. The json already knows it should be segment 6, so just click OK.
![Opening object_dns in Z64Utils](images/z64utils_open_dns.png)
In the resulting window, go to "Analysis -> Find Dlists" and press OK (the defaults are usually fine). This will only find display lists, so to find everything else in the obect, do "Analysis -> Analyze Dlists". We're looking for the skeleton, so scroll down to the SkeletonHeader, right-click it, and select "Open in Skeleton Viewer":
In the resulting window, you'll see displaylists, textures, and other assets. We're looking for the skeleton, so scroll down to the SkeletonHeader, then either double-click on it or right-click it and select "Open in Skeleton Viewer":
![Finding object_dns's SkeletonHeader in Z64Utils](images/z64utils_dns_skeletonheader.png)
@@ -186,7 +186,7 @@ For some actors, there may be a few other things left to name that are directly
gSPDisplayList(POLY_OPA_DISP++, &D_06002C48);
```
In Z64Utils, scroll to find this display list, then right-click and select "Open in Dlist Viewer":
In Z64Utils, scroll to find this display list, then either double-click it or right-click it and select "Open in Dlist Viewer":
![Opening dlist_00002C48 in Z64Utils](images/z64utils_dns_display_list.png)
+1 -1
View File
@@ -404,7 +404,7 @@ There remains one thing we need to fix before trying to compile it, namely `*(&g
/* 0x0F5C */ u32 regionsVisited; // "area_arrival"
```
so it's somewhere in `weekEventReg`. `0xF37 - 0xEF8 = 0x3F = 63`, and it's a byte array, so the access is actually `gSaveContext.save.weekEventReg[63] & 0x80`. Now it will compile. We also don't use `!= 0` for flag comparisons: just `if (gSaveContext.save.weekEventReg[63] & 0x80)` will do.
so it's somewhere in `weekEventReg`. `0xF37 - 0xEF8 = 0x3F = 63`, and it's a byte array, so the access is actually `gSaveContext.save.saveInfo.weekEventReg[63] & 0x80`. Now it will compile. We also don't use `!= 0` for flag comparisons: just `if (gSaveContext.save.saveInfo.weekEventReg[63] & 0x80)` will do.
Running `./diff.py -mwo3 func_80C102D4` and scrolling down, we discover that this doesn't match!
+112 -476
View File
File diff suppressed because it is too large Load Diff
-33
View File
@@ -1,39 +1,6 @@
#ifndef _INITVARS_H_
#define _INITVARS_H_
extern EffectSsInit Effect_Ss_Dust_InitVars;
extern EffectSsInit Effect_Ss_Kirakira_InitVars;
extern EffectSsInit Effect_Ss_Bomb2_InitVars;
extern EffectSsInit Effect_Ss_Blast_InitVars;
extern EffectSsInit Effect_Ss_G_Spk_InitVars;
extern EffectSsInit Effect_Ss_D_Fire_InitVars;
extern EffectSsInit Effect_Ss_Bubble_InitVars;
extern EffectSsInit Effect_Ss_G_Ripple_InitVars;
extern EffectSsInit Effect_Ss_G_Splash_InitVars;
extern EffectSsInit Effect_Ss_G_Fire_InitVars;
extern EffectSsInit Effect_Ss_Lightning_InitVars;
extern EffectSsInit Effect_Ss_Dt_Bubble_InitVars;
extern EffectSsInit Effect_Ss_Hahen_InitVars;
extern EffectSsInit Effect_Ss_Stick_InitVars;
extern EffectSsInit Effect_Ss_Sibuki_InitVars;
extern EffectSsInit Effect_Ss_Stone1_InitVars;
extern EffectSsInit Effect_Ss_Hitmark_InitVars;
extern EffectSsInit Effect_Ss_Fhg_Flash_InitVars;
extern EffectSsInit Effect_Ss_K_Fire_InitVars;
extern EffectSsInit Effect_Ss_Solder_Srch_Ball_InitVars;
extern EffectSsInit Effect_Ss_Kakera_InitVars;
extern EffectSsInit Effect_Ss_Ice_Piece_InitVars;
extern EffectSsInit Effect_Ss_En_Ice_InitVars;
extern EffectSsInit Effect_Ss_Fire_Tail_InitVars;
extern EffectSsInit Effect_Ss_En_Fire_InitVars;
extern EffectSsInit Effect_Ss_Extra_InitVars;
extern EffectSsInit Effect_Ss_Dead_Db_InitVars;
extern EffectSsInit Effect_Ss_Dead_Dd_InitVars;
extern EffectSsInit Effect_Ss_Dead_Ds_InitVars;
extern EffectSsInit Effect_Ss_Ice_Smoke_InitVars;
extern EffectSsInit Effect_En_Ice_Block_InitVars;
extern EffectSsInit Effect_Ss_Sbn_InitVars;
extern TransitionInit TransitionFade_InitVars;
extern TransitionInit TransitionTriforce_InitVars;
extern TransitionInit TransitionWipe1_InitVars;
+8 -7
View File
@@ -60,7 +60,7 @@
#define CUR_CAPACITY(upg) CAPACITY(upg, CUR_UPG_VALUE(upg))
// To be used with `Magic_Add`, but ensures enough magic is added to fill the magic bar to capacity
#define MAGIC_FILL_TO_CAPACITY (((void)0, gSaveContext.magicFillTarget) + (gSaveContext.save.playerData.isDoubleMagicAcquired + 1) * MAGIC_NORMAL_METER)
#define MAGIC_FILL_TO_CAPACITY (((void)0, gSaveContext.magicFillTarget) + (gSaveContext.save.saveInfo.playerData.isDoubleMagicAcquired + 1) * MAGIC_NORMAL_METER)
#define CONTROLLER1(gameState) (&(gameState)->input[0])
#define CONTROLLER2(gameState) (&(gameState)->input[1])
@@ -143,12 +143,13 @@ extern GraphicsContext* __gfxCtx;
#define ROUND(x) (s32)(((x) >= 0.0) ? ((x) + 0.5) : ((x) - 0.5))
#define SWAP(type, a, b) \
{ \
type _temp = (a); \
(a) = (b); \
(b) = _temp; \
}
#define SWAP(type, a, b) \
{ \
type _temp = (a); \
(a) = (b); \
(b) = _temp; \
} \
(void)0
#define OVERLAY_RELOCATION_OFFSET(overlayEntry) ((uintptr_t)((overlayEntry)->vramStart) - (uintptr_t)((overlayEntry)->loadedRamAddr))
#define VRAM_PTR_SIZE(entry) ((uintptr_t)((entry)->vramEnd) - (uintptr_t)((entry)->vramStart))

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