Updated VGMStream to r1050-1395-g454488b5.

CQTexperiment
Christopher Snowhill 2018-07-15 18:40:01 -07:00
parent e62c04204a
commit 0742206f53
4 changed files with 65 additions and 0 deletions

View File

@ -233,6 +233,7 @@ static const char* extension_list[] = {
"naac",
"ndp",
"ngca",
"nlsd",
"nop",
"nps",
"npsf", //fake extension/header id for .nps (to be removed)

View File

@ -674,6 +674,8 @@ VGMSTREAM * init_vgmstream_opus_n1(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_opus_capcom(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_opus_nop(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_opus_shinen(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_opus_nus3(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_opus_nlsd(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_pc_al2(STREAMFILE * streamFile);

View File

@ -272,3 +272,63 @@ fail:
return NULL;
}
/* Bandai Namco Opus (found in NUS3Banks) [Taiko no Tatsujin: Nintendo Switch Version!] */
VGMSTREAM * init_vgmstream_opus_nus3(STREAMFILE *streamFile) {
off_t offset = 0;
int num_samples = 0, loop_start = 0, loop_end = 0, loop_flag;
/* checks */
if (!check_extensions(streamFile, "lopus"))
goto fail;
if (read_32bitBE(0x00, streamFile) != 0x4F505553) /* "OPUS" */
goto fail;
/* Here's an interesting quirk, OPUS header contains big endian values
while the Nintendo Opus header and data that follows remain little endian as usual */
offset = read_32bitBE(0x20, streamFile);
num_samples = read_32bitBE(0x08, streamFile);
/* Check if there's a loop end value to determine loop_flag*/
loop_flag = read_32bitBE(0x18, streamFile);
if (loop_flag) {
loop_start = read_32bitBE(0x14, streamFile);
loop_end = read_32bitBE(0x18, streamFile);
}
return init_vgmstream_opus(streamFile, meta_OPUS, offset, num_samples, loop_start, loop_end);
fail:
return NULL;
}
/* Nihon Falcom NLSD Opus [Ys VIII: Lacrimosa of Dana (Switch)]
Similar to Nippon Ichi Software "AT9" Opus (Penny Punching Princess (Switch)
Unlike Penny Punching Princess, this is not segmented */
VGMSTREAM * init_vgmstream_opus_nlsd(STREAMFILE *streamFile) {
off_t offset = 0;
int num_samples = 0, loop_start = 0, loop_end = 0, loop_flag;
/* checks */
if (!check_extensions(streamFile, "nlsd"))
goto fail;
/* File type check - DSP is 0x8, Opus is 0x9 */
if (read_32bitBE(0x00, streamFile) != 0x09000000)
goto fail;
offset = 0x1C;
num_samples = read_32bitLE(0x0C, streamFile);
/* Check if there's a loop_end "adjuster" value to determine loop_flag
Setting loop_flag to loop_start would work too but it may cause conflicts
With files that may have a 0 sample loop_start. */
// Not sure why this is a thing but let's roll with it.
loop_flag = read_32bitLE(0x18, streamFile);
if (loop_flag) {
loop_start = read_32bitLE(0x10, streamFile);
/* They were being really creative here */
loop_end = (num_samples - read_32bitLE(0x18, streamFile));
}
return init_vgmstream_opus(streamFile, meta_OPUS, offset, num_samples, loop_start, loop_end);
fail:
return NULL;
}

View File

@ -368,6 +368,8 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
init_vgmstream_opus_capcom,
init_vgmstream_opus_nop,
init_vgmstream_opus_shinen,
init_vgmstream_opus_nus3,
init_vgmstream_opus_nlsd,
init_vgmstream_pc_al2,
init_vgmstream_pc_ast,
init_vgmstream_naac,