add Square Enix Opus for Dragon Quest I-III (Switch)

This commit is contained in:
bxaimc 2019-10-03 11:46:37 -04:00
parent 60d9895f00
commit 122e65ca5f
3 changed files with 28 additions and 0 deletions

View File

@ -645,6 +645,7 @@ VGMSTREAM * init_vgmstream_opus_nxa(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_opus_opusx(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_opus_prototype(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_opus_opusnx(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_opus_sqex(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_pc_al2(STREAMFILE * streamFile);

View File

@ -411,3 +411,29 @@ VGMSTREAM * init_vgmstream_opus_opusnx(STREAMFILE *streamFile) {
fail:
return NULL;
}
/* Square Enix variation [Dragon Quest I-III (Switch)] */
VGMSTREAM * init_vgmstream_opus_sqex(STREAMFILE *streamFile) {
off_t offset = 0;
int num_samples = 0, loop_start = 0, loop_end = 0, loop_flag;
/* checks */
if (!check_extensions(streamFile, "opus,lopus"))
goto fail;
if (read_64bitBE(0x00, streamFile) != 0x0100000002000000)
goto fail;
offset = read_32bitLE(0x0C, streamFile);
num_samples = read_32bitLE(0x1C, streamFile);
/* Check if there's a loop end value to determine loop_flag*/
loop_flag = read_32bitLE(0x18, streamFile);
if (loop_flag) {
loop_start = read_32bitLE(0x14, streamFile);
loop_end = read_32bitLE(0x18, streamFile);
}
return init_vgmstream_opus(streamFile, meta_OPUS, offset, num_samples, loop_start, loop_end);
fail:
return NULL;
}

View File

@ -480,6 +480,7 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
init_vgmstream_ubi_hx,
init_vgmstream_bmp_konami,
init_vgmstream_opus_opusnx,
init_vgmstream_opus_sqex,
/* 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 */