Add -official- VSV extension to PSH meta. Modified channe_count flag in VSF for test files found in FFXII:TZA (PS4).

This commit is contained in:
bxaimc 2018-03-19 15:19:30 -04:00
parent 4c8d6cffbc
commit ceaa776f83
4 changed files with 26 additions and 55 deletions

View File

@ -236,7 +236,7 @@ static const char* extension_list[] = {
"pona",
"pos",
"ps2stm", //fake extension for .stm (to be removed)
"psh",
"psh", // fake extension for VSV(?) Dawn of Mana needs to be checked again
"psnd",
"psw",
@ -351,6 +351,7 @@ static const char* extension_list[] = {
"vpk",
"vs",
"vsf",
"vsv", // official extension for PSH? TODO: recheck Dawn of Mana
"vxn",
"waa",
@ -698,7 +699,7 @@ static const meta_info meta_info_list[] = {
{meta_MUS_ACM, "InterPlay MUS ACM header"},
{meta_PS2_KCES, "Konami KCES Header"},
{meta_PS2_DXH, "Tokobot Plus DXH Header"},
{meta_PS2_PSH, "Dawn of Mana - Seiken Densetsu 4 PSH Header"},
{meta_PS2_PSH, "Square Enix PSH/VSV Header"},
{meta_RIFF_WAVE_labl, "RIFF WAVE header with loop markers"},
{meta_RIFF_WAVE_smpl, "RIFF WAVE header with sample looping info"},
{meta_RIFF_WAVE_wsmp, "RIFF WAVE header with wsmp looping info"},

View File

@ -1,11 +1,10 @@
#include "meta.h"
#include "../util.h"
/* PSH (from Dawn of Mana - Seiken Densetsu 4) */
/* PSH (from Dawn of Mana - Seiken Densetsu 4, Kingdom Hearts Re:Chain of Memories) */
/* probably Square Vag Stream */
VGMSTREAM * init_vgmstream_ps2_psh(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[PATH_LIMIT];
off_t start_offset;
uint8_t testBuffer[0x10];
off_t loopEnd = 0;
@ -15,9 +14,9 @@ VGMSTREAM * init_vgmstream_ps2_psh(STREAMFILE *streamFile) {
int loop_flag;
int channel_count;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("psh",filename_extension(filename))) goto fail;
/* check extension, case insensitive */
if (!check_extensions(streamFile, "psh,vsv")) // vsv seems to be official extension
goto fail;
/* check header */
if (read_16bitBE(0x02,streamFile) != 0x6400)
@ -65,25 +64,12 @@ VGMSTREAM * init_vgmstream_ps2_psh(STREAMFILE *streamFile) {
vgmstream->meta_type = meta_PS2_PSH;
/* open the file for reading */
{
int i;
STREAMFILE * file;
file = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!file) goto fail;
for (i=0;i<channel_count;i++) {
vgmstream->ch[i].streamfile = file;
if (!vgmstream_open_stream(vgmstream, streamFile, start_offset))
goto fail;
return vgmstream;
vgmstream->ch[i].channel_start_offset=
vgmstream->ch[i].offset=start_offset+
vgmstream->interleave_block_size*i;
}
}
return vgmstream;
/* clean up anything we may have opened */
/* clean up anything we may have opened */
fail:
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
close_vgmstream(vgmstream);
return NULL;
}

View File

@ -4,22 +4,19 @@
/* VSF (from Musashi: Samurai Legend) */
VGMSTREAM * init_vgmstream_ps2_vsf(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[PATH_LIMIT];
off_t start_offset;
int loop_flag, channel_count;
int loop_flag;
int channel_count;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("vsf",filename_extension(filename))) goto fail;
/* check extension, case insensitive */
if (!check_extensions(streamFile, "vsf"))
goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x56534600) /* "VSF" */
goto fail;
loop_flag = (read_32bitLE(0x1c,streamFile)==0x13);
if(read_32bitLE(0x8,streamFile)==0x0)
if(read_8bit(0x1C,streamFile)==0x0)
channel_count = 1;
else
channel_count = 2;
@ -43,26 +40,13 @@ VGMSTREAM * init_vgmstream_ps2_vsf(STREAMFILE *streamFile) {
vgmstream->interleave_block_size = 0x400;
vgmstream->meta_type = meta_PS2_VSF;
/* open the file for reading */
{
int i;
STREAMFILE * file;
file = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!file) goto fail;
for (i=0;i<channel_count;i++) {
vgmstream->ch[i].streamfile = file;
/* open the file for reading */
if (!vgmstream_open_stream(vgmstream, streamFile, start_offset))
goto fail;
return vgmstream;
vgmstream->ch[i].channel_start_offset=
vgmstream->ch[i].offset=start_offset+
vgmstream->interleave_block_size*i;
}
}
return vgmstream;
/* clean up anything we may have opened */
/* clean up anything we may have opened */
fail:
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
close_vgmstream(vgmstream);
return NULL;
}

View File

@ -368,7 +368,7 @@ typedef enum {
meta_PS2_RSTM, /* Midnight Club 3 */
meta_PS2_KCES, /* Dance Dance Revolution */
meta_PS2_DXH, /* Tokobot Plus - Myteries of the Karakuri */
meta_PS2_PSH, /* Dawn of Mana - Seiken Densetsu 4 */
meta_PS2_PSH, /* Square Enix PSH/VSV (Dawn of Mana/KH Re:CoM) */
meta_SCD_PCM, /* Lunar - Eternal Blue */
meta_PS2_PCM, /* Konami KCEJ East: Ephemeral Fantasia, Yu-Gi-Oh! The Duelists of the Roses, 7 Blades */
meta_PS2_RKV, /* Legacy of Kain - Blood Omen 2 */