yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::zelda3::SheetLoadResult Struct Reference

Public Attributes

std::vector< uint8_t > data
 
bool is_compressed = false
 
bool decompression_succeeded = false
 
bool is_bpp3 = false
 
uint32_t pc_offset = 0
 

Detailed Description

Loads all 223 graphics sheets from the ROM into bitmap format.

ALTTP uses 223 graphics sheets (kNumGfxSheets) stored in three formats:

Sheet Categories:

  • Sheets 0-112: Compressed 3BPP (overworld, dungeons, sprites)
  • Sheets 113-114: 2BPP sheets (skipped here, loaded separately)
  • Sheets 115-126: Uncompressed 3BPP (special graphics)
  • Sheets 127-217: Compressed 3BPP (additional graphics)
  • Sheets 218+: 2BPP sheets (skipped here)

Compression Format: Graphics data is compressed using Nintendo's LC-LZ2 algorithm. Each sheet is decompressed to a 0x800 (2048) byte buffer, then converted from SNES planar format to linear 8BPP for easier manipulation.

Graphics Buffer: All sheet data is also appended to data.graphics_buffer for legacy compatibility. Sheets that fail to load are filled with 0xFF bytes to maintain correct indexing.

Parameters
romThe loaded ROM to read graphics from
dataThe GameData structure to populate with graphics
Returns
OkStatus on success, or error status
Warning
The DecompressV2 size parameter MUST be 0x800, not 0. Passing size=0 causes immediate return of empty data, which was a regression bug that caused all graphics to appear as solid purple/brown (0xFF fill).

Definition at line 340 of file game_data.cc.

Member Data Documentation

◆ data

std::vector<uint8_t> yaze::zelda3::SheetLoadResult::data

Definition at line 341 of file game_data.cc.

Referenced by yaze::zelda3::LoadSheetRaw(), and yaze::zelda3::ProcessSheetBitmap().

◆ is_compressed

bool yaze::zelda3::SheetLoadResult::is_compressed = false

Definition at line 342 of file game_data.cc.

Referenced by yaze::zelda3::LoadSheetRaw().

◆ decompression_succeeded

bool yaze::zelda3::SheetLoadResult::decompression_succeeded = false

Definition at line 343 of file game_data.cc.

Referenced by yaze::zelda3::LoadSheetRaw().

◆ is_bpp3

bool yaze::zelda3::SheetLoadResult::is_bpp3 = false

Definition at line 344 of file game_data.cc.

Referenced by yaze::zelda3::LoadSheetRaw(), and yaze::zelda3::ProcessSheetBitmap().

◆ pc_offset

uint32_t yaze::zelda3::SheetLoadResult::pc_offset = 0

Definition at line 345 of file game_data.cc.

Referenced by yaze::zelda3::LoadSheetRaw().


The documentation for this struct was generated from the following file: