Skip to content

Commit

Permalink
blender_io_ttyd: Fix display list alignment
Browse files Browse the repository at this point in the history
Display lists must be aligned by 32 bytes. On Dolphin this doesn't seem
to matter, but on real hardware this is required. We previously ensured
internal alignment of the mesh section but didn't ensure that the
section itself is placed with 32-byte alignment.
  • Loading branch information
PistonMiner committed Aug 6, 2024
1 parent de53a89 commit c9a36bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ttyd-tools/blender_io_ttyd/io_scene_ttyd/dmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1641,9 +1641,9 @@ def link_reference_table(linker, blob_name, section_name, references):
linker.place_section("information")
linker.place_section("texture_data")
linker.place_section("sampler_data")
linker.place_section("vertex_attribute_data", 32)
linker.place_section("vertex_attribute_data", 32) # Align by 32 for vertex cache efficiency
linker.place_section("materials")
linker.place_section("meshs")
linker.place_section("meshs", 32) # Align by 32 since this contains display lists
linker.place_section("joints")
linker.place_section("vcd_table")
linker.place_section("material_name_table")
Expand Down
1 change: 1 addition & 0 deletions ttyd-tools/docs/MarioSt_WorldData.bt
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ typedef struct
// - color data (referenced by vcd_table)
// - Material[] table (referenced by material_name_table)

// <align to 0x20>
// - Polygon data for following Mesh (referenced by Mesh) (size aligned upwards to 0x20)
// - Mesh (size aligned upwards to 0x20)
// - Repeat for all meshes (referenced by joints)
Expand Down

0 comments on commit c9a36bb

Please sign in to comment.