mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-29 19:37:30 +01:00
Add Incinerator .itl [Cars Race-o-rama (Wii), MX vs ATV Untamed (Wii)]
This commit is contained in:
parent
b3a8f2b280
commit
9a4c80cdd5
@ -1189,6 +1189,7 @@ static const meta_info meta_info_list[] = {
|
||||
{meta_MZRT, "id Software MZRT header"},
|
||||
{meta_XAVS, "Reflections XAVS header"},
|
||||
{meta_PSF, "Pivotal PSF header"},
|
||||
{meta_DSP_ITL_i, "Infernal .ITL DSP header"},
|
||||
|
||||
};
|
||||
|
||||
|
@ -29,7 +29,7 @@ void render_vgmstream_interleave(sample_t * buffer, int32_t sample_count, VGMSTR
|
||||
if (frame_size_f == 0 || samples_per_frame_f == 0) goto fail;
|
||||
samples_this_block_f = vgmstream->interleave_first_block_size / frame_size_f * samples_per_frame_f;
|
||||
}
|
||||
else if (has_interleave_last) {
|
||||
if (has_interleave_last) {
|
||||
int frame_size_l = get_vgmstream_shortframe_size(vgmstream);
|
||||
samples_per_frame_l = get_vgmstream_samples_per_shortframe(vgmstream);
|
||||
if (frame_size_l == 0 || samples_per_frame_l == 0) goto fail;
|
||||
|
@ -50,6 +50,7 @@ VGMSTREAM * init_vgmstream_dsp_itl_ch(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_dsp_adpy(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_dsp_adpx(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_dsp_ds2(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_dsp_itl(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_csmp(STREAMFILE *streamFile);
|
||||
|
||||
|
@ -79,6 +79,8 @@ typedef struct {
|
||||
size_t header_spacing; /* distance between DSP header of other channels */
|
||||
off_t start_offset; /* data start */
|
||||
size_t interleave; /* distance between data of other channels */
|
||||
size_t interleave_first; /* same, in the first block */
|
||||
size_t interleave_first_skip; /* extra info */
|
||||
size_t interleave_last; /* same, in the last block */
|
||||
|
||||
meta_t meta_type;
|
||||
@ -208,6 +210,8 @@ static VGMSTREAM * init_vgmstream_dsp_common(STREAMFILE *streamFile, dsp_meta *d
|
||||
if (dspm->interleave == 0 || vgmstream->coding_type == coding_NGC_DSP_subint)
|
||||
vgmstream->layout_type = layout_none;
|
||||
vgmstream->interleave_block_size = dspm->interleave;
|
||||
vgmstream->interleave_first_block_size = dspm->interleave_first;
|
||||
vgmstream->interleave_first_skip = dspm->interleave_first_skip;
|
||||
vgmstream->interleave_last_block_size = dspm->interleave_last;
|
||||
|
||||
{
|
||||
@ -1251,3 +1255,34 @@ VGMSTREAM * init_vgmstream_dsp_ds2(STREAMFILE *streamFile) {
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* .itl - Incinerator Studios interleaved dsp [Cars Race-o-rama (Wii), MX vs ATV Untamed (Wii)] */
|
||||
VGMSTREAM * init_vgmstream_dsp_itl(STREAMFILE *streamFile) {
|
||||
dsp_meta dspm = {0};
|
||||
size_t stream_size;
|
||||
|
||||
/* checks */
|
||||
/* .itl: standard
|
||||
* .dsp: default to catch a similar file, not sure which devs */
|
||||
if (!check_extensions(streamFile, "itl,dsp"))
|
||||
goto fail;
|
||||
|
||||
stream_size = get_streamfile_size(streamFile);
|
||||
dspm.channel_count = 2;
|
||||
dspm.max_channels = 2;
|
||||
|
||||
dspm.start_offset = 0x60;
|
||||
dspm.interleave = 0x10000;
|
||||
dspm.interleave_first_skip = dspm.start_offset;
|
||||
dspm.interleave_first = dspm.interleave - dspm.interleave_first_skip;
|
||||
dspm.interleave_last = (stream_size / dspm.channel_count) % dspm.interleave;
|
||||
dspm.header_offset = 0x00;
|
||||
dspm.header_spacing = dspm.interleave;
|
||||
|
||||
//todo some files end in half a frame and may click at the very end
|
||||
//todo when .dsp should refer to Ultimate Board Collection (Wii), not sure about dev
|
||||
dspm.meta_type = meta_DSP_ITL_i;
|
||||
return init_vgmstream_dsp_common(streamFile, &dspm);
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
@ -470,6 +470,7 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_xavs,
|
||||
init_vgmstream_psf_single,
|
||||
init_vgmstream_psf_segmented,
|
||||
init_vgmstream_dsp_itl,
|
||||
|
||||
/* lowest priority metas (should go after all metas, and TXTH should go before raw formats) */
|
||||
init_vgmstream_txth, /* proper parsers should supersede TXTH, once added */
|
||||
@ -2422,8 +2423,8 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
||||
snprintf(temp,TEMPSIZE, "interleave: %#x bytes\n", (int32_t)vgmstream->interleave_block_size);
|
||||
concatn(length,desc,temp);
|
||||
|
||||
if (vgmstream->interleave_first) {
|
||||
snprintf(temp,TEMPSIZE, "interleave first block: %#x bytes\n", (int32_t)vgmstream->interleave_first);
|
||||
if (vgmstream->interleave_first_block_size) {
|
||||
snprintf(temp,TEMPSIZE, "interleave first block: %#x bytes\n", (int32_t)vgmstream->interleave_first_block_size);
|
||||
concatn(length,desc,temp);
|
||||
}
|
||||
|
||||
|
@ -713,6 +713,7 @@ typedef enum {
|
||||
meta_MZRT,
|
||||
meta_XAVS,
|
||||
meta_PSF,
|
||||
meta_DSP_ITL_i,
|
||||
|
||||
} meta_t;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user