Skip to content

Commit

Permalink
[research] tpGxTexHead
Browse files Browse the repository at this point in the history
  • Loading branch information
yretenai committed Apr 25, 2021
1 parent 7ee9fd0 commit dc46ab5
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 24 deletions.
24 changes: 0 additions & 24 deletions research/bxon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,3 @@ header:
project_id (4)
rel_offset_typename (4) -> null terminated string
rel_offset_data (4) -> buffer -> polymorphic based on typename

type tpArchiveFileParam:
header:
archive_count (4)
rel_offset_arc_list (4) -> arc[]
xap_count (4)
rel_offset_xap_list (4) -> xap[]

arc:
rel_offset_name (4) -> null terminated string
rel_offset_flags (4) -> arc_flags; note: you can inline this

arc_flags:
is_streamed (1) note: if 0 decompress the entire arc before slicing

xap:
id (4) note: probably hash
rel_offset_name (4) -> null terminated string
arc_offset (4) note: shift left by 4.
compressed_size (4) note: zstd
size (4)
buffer_size (4) note: add to size to get total size
arc_index (1)
is_compressed (1) note: zstd
27 changes: 27 additions & 0 deletions research/bxon_types/tpArchiveFileParam.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
tpArchiveFileParam format

note: everything is aligned to 4 bytes.
note: rel_offset is from the start of that field.

header:
archive_count (4)
rel_offset_arc_list (4) -> arc[]
xap_count (4)
rel_offset_xap_list (4) -> xap[]

arc:
rel_offset_name (4) -> null terminated string
rel_offset_flags (4) -> arc_flags; note: you can inline this

arc_flags:
is_streamed (1) note: if 0 decompress the entire arc before slicing

xap:
id (4) note: probably hash
rel_offset_name (4) -> null terminated string
arc_offset (4) note: shift left by 4.
compressed_size (4) note: zstd
size (4)
buffer_size (4) note: add to size to get total size
arc_index (1)
is_compressed (1) note: zstd
40 changes: 40 additions & 0 deletions research/bxon_types/tpGxTexHead.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
tpGxTexHead format

note: everything is aligned to 4 bytes.
note: rel_offset is from the start of that field.

header:
width (4)
height (4)
surfaces (4)
rel_offset_imaging (4) -> imaging
total_image_size (4)
unknown (4) note: probably flags
format (4) note: see format_map, maybe 1 byte?
mip_surface_count (4)
rel_offset_mip_surface (4) -> mip_surface

mip_surface:
offset (4)
unknown (4)
unknown (4) note: seems to be powers of 2?
unknown (4)
size (4)
unknown (4)
width (4)
height (4)
unknown (4)
unknown (4) note: seems to be powers of 2?

format_map:
0x00010800 = R8G8B8A8_UNORM
0x00010B00 = R8G8B8A8_UNORM_SRGB
0x00010F00 = BC1_UNORM
0x00011000 = BC1_UNORM_SRGB
0x00011100 = BC2_UNORM
0x00011200 = BC2_UNORM_SRGB
0x00011300 = BC3_UNORM
0x00011400 = BC3_UNORM_SRGB
0x00011500 = BC4_UNORM
0x00011600 = BC5_UNORM
0x00030000 = R32G32B32A32_FLOAT
1 change: 1 addition & 0 deletions research/pack.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ header:
total_size (4)
serialized_size (4) note: this is the size of the PACK data, seeking to this number will be where resource data starts.
resource_size (4) note: this is data that exists inherently in the pack, always after all the files.
note 2: keep track of the offset, each bxon doesn't specify resource offset. alignment is 0x80.
preload_count (4)
rel_offset_preload_table (4) -> preload[]
pack_count (4)
Expand Down

0 comments on commit dc46ab5

Please sign in to comment.