diff --git a/doc/TXTH.md b/doc/TXTH.md index 70f6d80f..4bba17c9 100644 --- a/doc/TXTH.md +++ b/doc/TXTH.md @@ -512,7 +512,7 @@ num_samples = data_size ### Chunks Chunks affect some values (padding size, data size, etc) and are a bit sensitive to order at the moment, due to technical complexities: ``` -# Street Fighter EX3 +# Street Fighter EX3 (PS2) # base config is defined normally codec = PSX @@ -532,3 +532,19 @@ start_offset = 0x00 padding_size = auto-empty num_samples = data_size ``` + +Subfiles and chunks can coexist: +``` +# Gitaroo Man (PSP) + +# 3 interleaved RIFF files +subsong_count = 3 +chunk_start = 0 +chunk_size = 0x2800 +chunk_count = 3 + +# the 3 de-interleaved chunks are treated and parsed as a subsong +subfile_offset = 0 +subfile_size = @0x04 + 0x08 #RIFF size +subfile_extension = at3 +``` diff --git a/src/meta/txth.c b/src/meta/txth.c index 4c572a9f..b42e12c3 100644 --- a/src/meta/txth.c +++ b/src/meta/txth.c @@ -557,6 +557,12 @@ static VGMSTREAM *init_subfile(txth_header * txth) { vgmstream_force_loop(vgmstream, 0, 0, 0); } + if (txth->chunk_count && txth->subsong_count) { + vgmstream->num_streams = txth->subsong_count; + } + //todo: other combos with subsongs + subfile? + + close_streamfile(streamSubfile); return vgmstream;