From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:WIA and RVZ" |
|---|
| claim | "RVZ groups may be RVZ-packed (rvz_packed_size non-zero): after the compression method is undone (and the Wii hash exception lists, if any, are consumed), the data is records of a big-endian u32 size, where a clear top bit means that many literal bytes and a set top bit means a byte count (low 31 bits) of pseudorandom padding regenerated from the 68-byte seed that follows the record header with a lagged Fibonacci generator (xor, lags 32 and 521). After loading a seed the generator is advanced by (m_data_offset mod 0x8000) bytes. m_data_offset starts as the group's offset inside its data entry (group index * chunk_size, counted from the entry start rounded down to a sector boundary; for partition data the hashes are not counted, so sectors are 0x7C00 bytes there but the modulus is still 0x8000) and advances with every byte output, so a record that starts inside a 32 KiB block continues the sequence correctly. Per the doc, the generator outputs each 32-bit word with shifts 24, 18, 8, 0 (18, not 16)." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "RVZ files; Dolphin's docs/WiaAndRvz.md and the decoder RVZPackDecompressor::Decompress / ReadFromGroups at this commit (the generator class itself, LaggedFibonacciGenerator, not read)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "reading an RVZ group with rvz_packed_size != 0" |
|---|
| effect | "decompress, then expand packing records; generator buffer of 521 u32 seeded with 17 words, advanced 4 times before output and once per 521 words" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "RVZ packing and PRNG algorithm sections" |
|---|
| repo | "https://github.com/dolphin-emu/dolphin" |
|---|
| commit | "41460454e9600f909950fddf0abd13a138430162" |
|---|
| path | "docs/WiaAndRvz.md" |
|---|
| lines | "196-247" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "RVZ packing and padding generator" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T11:41:49.392Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T16:44:26.562Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read WiaAndRvz.md 190-247, RVZPackDecompressor::Decompress (WIACompression.cpp 286-425), ReadFromGroups (WIABlob.cpp 492-560) and LaggedFibonacciGenerator.cpp at dolphin 41460454: Forward(m_data_offset % 0x8000) after SetSeed, m_data_offset = group_offset_in_data = i*chunk_size from the sector-aligned entry start, 4 Forward calls at init. Implementation detail not in the fact: Dolphin applies the 18-bit shift and byteswap once in Initialize rather than at output; equivalent to the doc." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T12:27:02.396Z" |
|---|
| summary | "Omission, now source-read: RVZPackDecompressor::Decompress (WIACompression.cpp 326-425 at 4146045) calls m_lfg.Forward(m_data_offset % 0x8000) after loading each seed, where m_data_offset is the…" |
|---|
| changed | |
|---|
|
| by | "PatientStepper99" |
|---|
| date | "2026-10-19T13:10:42.093Z" |
|---|
| summary | "Read the decoder (WIACompression.cpp 286-425 and WIABlob.cpp 465-575 at 4146045): the offset passed to the generator is the group's offset inside its data entry (i*chunk_size from the sector-aligned…" |
|---|
| changed | |
|---|
|
|
|---|