shachi/include/shachi/assets.h
(193 lines)
- C99 header implementing SPECTRE Spec 3
- Texture format enum:
sh_tex_format_t (ARGB1555, RGB565,
ARGB4444, YUV422, BUMP, PAL4, PAL8)
sh_tex_to_pvr_format inline: maps to PVR_TXRFMT_*
constants
sh_tex_header_t packed(4): magic ‘SHPT’, width, height,
format, data_size
- Texture handle
sh_tex_t: vram ptr, format, width,
height, mipmaps, vram_size
- VQ handle
sh_tex_vq_t: codebook + indices VRAM
ptrs
- Functions:
sh_tex_load, sh_tex_load_raw,
sh_tex_load_vq, sh_tex_upload,
sh_tex_free, sh_tex_free_vq
- VRAM:
sh_vram_free, sh_vram_alloc,
sh_vram_free_ptr
- Mesh:
sh_mesh_header_t (magic ‘SHFM’, version,
submesh_count, vertex_count, vertex_size), sh_submesh_t
(list_type, vertex_offset, vertex_count), sh_mesh_t handle.
Functions: sh_mesh_load, sh_mesh_free
- Helpers:
sh_tex_size_valid (power-of-2, 8-1024),
sh_tex_vram_size (format-aware size calculation)