Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Various PAL GC asset offset issues #3052

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_circle.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Root>
<File Name="code" OutName="z_fbdemo_circle" RangeStart="0xE90E0" RangeEnd="0x12CBB0">
<Texture Name="sTransCircleNormalTex" Format="i8" Width="16" Height="64" Offset="0xE90E0"/>
<Texture Name="sTransCircleWaveTex" Format="i8" Width="16" Height="64" Offset="0xE94E0"/>
<Texture Name="sTransCircleRippleTex" Format="i8" Width="16" Height="64" Offset="0xE98E0"/>
<Texture Name="sTransCircleStarburstTex" Format="i8" Width="16" Height="64" Offset="0xE9CE0"/>
<Array Name="sCircleWipeVtx" Count="34" Offset="0xEA0E0">
<File Name="code" OutName="z_fbdemo_circle" RangeStart="0xE90C8" RangeEnd="0x106F10">
<Texture Name="sTransCircleNormalTex" Format="i8" Width="16" Height="64" Offset="0xE90C8"/>
<Texture Name="sTransCircleWaveTex" Format="i8" Width="16" Height="64" Offset="0xE94C8"/>
<Texture Name="sTransCircleRippleTex" Format="i8" Width="16" Height="64" Offset="0xE98C8"/>
<Texture Name="sTransCircleStarburstTex" Format="i8" Width="16" Height="64" Offset="0xE9CC8"/>
<Array Name="sCircleWipeVtx" Count="34" Offset="0xEA0C8">
<Vtx/>
</Array>
<!-- ZAPD isn't finding symbols correctly, instead finding them much later in `code`-->
<!--<DList Name="sCircleWipeDL" Offset="0x10FF68"/>-->
<DList Name="sCircleDList" Offset="0xEA2E0"/>
<DList Name="sCircleDList" Offset="0xEA2C8"/>
</File>
</Root>
16 changes: 8 additions & 8 deletions soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ganon_Mant.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Root>
<File Name="ovl_En_Ganon_Mant" BaseAddress="0x80A23D60" RangeStart="0x1218" RangeEnd="0x4118">
<Texture Name="gMantTex" OutName="mant" Format="rgba16" Width="32" Height="64" Offset="0x1218"/>
<File Name="ovl_En_Ganon_Mant" BaseAddress="0x80A0BCC0" RangeStart="0x11F8" RangeEnd="0x40F8">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confident about all the changes I made except for the BaseAddress= in these three files. I'm not sure the proper way to find them out.

Instead what I did was run ZAPD, and during the DL parsing it would throw an error saying the referenced texture address is below the base address.
In this case, the referenced texture is the first in each of these files, so I took the textures address, subtracted the offset, and used that as the BaseAddress. Obviously I tested the changes and everything works. Just want to make sure that anyone who understands it better can verify.

/cc @NEstelami

<Texture Name="gMantTex" OutName="mant" Format="rgba16" Width="32" Height="64" Offset="0x11F8"/>

<Texture Name="gMantUnusedTex" OutName="mant_unused" Format="rgba16" Width="32" Height="32" Offset="0x2218"/>
<Texture Name="gMantUnusedTex" OutName="mant_unused" Format="rgba16" Width="32" Height="32" Offset="0x21F8"/>

<Array Name="gMant1Vtx" Count="144" Offset="0x2A18">
<Array Name="gMant1Vtx" Count="144" Offset="0x29F8">
<Vtx/>
</Array>

<DList Name="gMantMaterialDL" Offset="0x3318"/>
<DList Name="gMantMaterialDL" Offset="0x32F8"/>

<!-- ! @bug gMantUnusedTex is 32x32 not 32x64, however this dlist is unused -->
<DList Name="gMantUnusedMaterialDL" Offset="0x3370"/>
<DList Name="gMantUnusedMaterialDL" Offset="0x3350"/>

<DList Name="gMantDL" Offset="0x33C8"/>
<DList Name="gMantDL" Offset="0x33A8"/>

<Array Name="gMant2Vtx" Count="144" Offset="0x3818">
<Array Name="gMant2Vtx" Count="144" Offset="0x37F8">
<Vtx/>
</Array>
</File>
Expand Down
10 changes: 5 additions & 5 deletions soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Spot.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Root>
<File Name="ovl_Oceff_Spot" BaseAddress="0x80BA6070" RangeStart="0x7F0" RangeEnd="0xEC8">
<Texture Name="sTex" OutName="sun_song_effect" Format="i8" Width="32" Height="32" Offset="0x7F0"/>
<Array Name="sCylinderVtx" Count="27" Offset="0xBF0">
<File Name="ovl_Oceff_Spot" BaseAddress="0x80B7CDC0" RangeStart="0x780" RangeEnd="0xE58">
<Texture Name="sTex" OutName="sun_song_effect" Format="i8" Width="32" Height="32" Offset="0x780"/>
<Array Name="sCylinderVtx" Count="27" Offset="0xB80">
<Vtx/>
</Array>
<DList Name="sCylinderMaterialDL" Offset="0xDA0"/>
<DList Name="sCylinderModelDL" Offset="0xE38"/>
<DList Name="sCylinderMaterialDL" Offset="0xD30"/>
<DList Name="sCylinderModelDL" Offset="0xDC8"/>
</File>
</Root>
10 changes: 5 additions & 5 deletions soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe3.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Root>
<File Name="ovl_Oceff_Wipe3" BaseAddress="0x80BAB3F0" RangeStart="0x480" RangeEnd="0x16C8">
<Texture Name="sTex" OutName="saria_song_effect" Format="i8" Width="64" Height="64" Offset="0x480"/>
<Array Name="sFrustumVtx" Count="22" Offset="0x1480">
<File Name="ovl_Oceff_Wipe3" BaseAddress="0x80B81D90" RangeStart="0x430" RangeEnd="0x1678">
<Texture Name="sTex" OutName="saria_song_effect" Format="i8" Width="64" Height="64" Offset="0x430"/>
<Array Name="sFrustumVtx" Count="22" Offset="0x1430">
<Vtx/>
</Array>
<DList Name="sMaterialDL" Offset="0x15E0"/>
<DList Name="sFrustumDL" Offset="0x1668"/>
<DList Name="sMaterialDL" Offset="0x1590"/>
<DList Name="sFrustumDL" Offset="0x1618"/>
</File>
</Root>