Fix some .adpcmx [Fushigi no Gensokyo: Lotus Labyrinth (Switch)]

This commit is contained in:
bnnm 2019-08-03 12:22:09 +02:00
parent 64853876eb
commit f9c850003e
5 changed files with 41 additions and 7 deletions

View File

@ -1190,7 +1190,8 @@ static const meta_info meta_info_list[] = {
{meta_MSF_TAMASOFT, "Tama-Soft MSF header"},
{meta_XPS_DAT, "From Software .XPS+DAT header"},
{meta_ZSND, "Vicarious Visions ZSND header"},
{meta_DSP_ADPCMX, "AQUASTYLE ADPY header"},
{meta_DSP_ADPY, "AQUASTYLE ADPY header"},
{meta_DSP_ADPX, "AQUASTYLE ADPX header"},
{meta_OGG_OPUS, "Ogg Opus header"},
{meta_IMC, "iNiS .IMC header"},
{meta_GIN, "Electronic Arts Gnsu header"},

View File

@ -48,7 +48,8 @@ VGMSTREAM * init_vgmstream_dsp_mcadpcm(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_dsp_switch_audio(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_dsp_sps_n1(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_dsp_itl_ch(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_dsp_adpcmx(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_csmp(STREAMFILE *streamFile);

View File

@ -1187,8 +1187,8 @@ fail:
return NULL;
}
/* .adpcmx - AQUASTYLE wrapper [Touhou Genso Wanderer -Reloaded- (Switch)] */
VGMSTREAM * init_vgmstream_dsp_adpcmx(STREAMFILE *streamFile) {
/* ADPY - AQUASTYLE wrapper [Touhou Genso Wanderer -Reloaded- (Switch)] */
VGMSTREAM * init_vgmstream_dsp_adpy(STREAMFILE *streamFile) {
dsp_meta dspm = {0};
/* checks */
@ -1196,6 +1196,7 @@ VGMSTREAM * init_vgmstream_dsp_adpcmx(STREAMFILE *streamFile) {
goto fail;
if (read_32bitBE(0x00,streamFile) != 0x41445059) /* "ADPY" */
goto fail;
/* 0x04(2): 1? */
/* 0x08: some size? */
/* 0x0c: null */
@ -1209,7 +1210,36 @@ VGMSTREAM * init_vgmstream_dsp_adpcmx(STREAMFILE *streamFile) {
dspm.start_offset = dspm.header_offset + dspm.header_spacing*dspm.channel_count;
dspm.interleave = 0x08;
dspm.meta_type = meta_DSP_ADPCMX;
dspm.meta_type = meta_DSP_ADPY;
return init_vgmstream_dsp_common(streamFile, &dspm);
fail:
return NULL;
}
/* ADPX - AQUASTYLE wrapper [Fushigi no Gensokyo: Lotus Labyrinth (Switch)] */
VGMSTREAM * init_vgmstream_dsp_adpx(STREAMFILE *streamFile) {
dsp_meta dspm = {0};
/* checks */
if (!check_extensions(streamFile, "adpcmx"))
goto fail;
if (read_32bitBE(0x00,streamFile) != 0x41445058) /* "ADPX" */
goto fail;
/* from 0x04 *6 are probably channel sizes, so max would be 6ch; this assumes 2ch */
if (read_32bitLE(0x04,streamFile) != read_32bitLE(0x08,streamFile) &&
read_32bitLE(0x0c,streamFile) != 0)
goto fail;
dspm.channel_count = 2;
dspm.max_channels = 2;
dspm.little_endian = 1;
dspm.header_offset = 0x1c;
dspm.header_spacing = read_32bitLE(0x04,streamFile);
dspm.start_offset = dspm.header_offset + 0x60;
dspm.interleave = dspm.header_spacing;
dspm.meta_type = meta_DSP_ADPX;
return init_vgmstream_dsp_common(streamFile, &dspm);
fail:
return NULL;

View File

@ -461,7 +461,8 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
init_vgmstream_xps,
init_vgmstream_zsnd,
init_vgmstream_opus_opusx,
init_vgmstream_dsp_adpcmx,
init_vgmstream_dsp_adpy,
init_vgmstream_dsp_adpx,
init_vgmstream_ogg_opus,
init_vgmstream_nus3audio,
init_vgmstream_imc,

View File

@ -718,7 +718,8 @@ typedef enum {
meta_MSF_TAMASOFT,
meta_XPS_DAT,
meta_ZSND,
meta_DSP_ADPCMX,
meta_DSP_ADPY,
meta_DSP_ADPX,
meta_OGG_OPUS,
meta_IMC,
meta_GIN,