Skip to content

Instantly share code, notes, and snippets.

@simi
Created December 4, 2023 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simi/d4a590fc46daeee89c86ed39c7a3bbc1 to your computer and use it in GitHub Desktop.
Save simi/d4a590fc46daeee89c86ed39c7a3bbc1 to your computer and use it in GitHub Desktop.
meta:
id: paa
file-extension: paa
endian: le
seq:
- id: type
type: u2
enum: pax_type
- id: tags
type: tag
repeat: until
repeat-until: _.next_signature != "GGAT"
- id: palette
type: palette
- id: mipmaps
type: mipmap
repeat: until
repeat-until: _.next_mipmap_width == 0
types:
mipmap:
seq:
- id: width
type: u2
- id: height
type: u2
- id: size12
type: u2
- id: size3
type: u1
- id: data
size: size
instances:
size:
value: 'size12 | (size3 << 16)'
next_mipmap_width:
pos: _io.pos
type: u2
palette:
seq:
- id: triplets
type: u2
tag:
seq:
- id: signature
type: str
size: 4
encoding: ASCII
- id: type
type: str
size: 4
encoding: ASCII
- id: data_len
type: u4
- id: data
size: data_len
instances:
next_signature:
pos: _io.pos
type: str
size: 4
encoding: ASCII
enums:
pax_type:
0x8080: gray_w_alpha
0xFF01: dxt1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment