added new dsp type in .emff.c

added block format for gsp+gsb
cleaned some metas from useless stuff

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@519 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
manakoAT 2008-12-16 15:48:21 +00:00
parent 1adb36b000
commit 06e43e9c00
52 changed files with 237 additions and 344 deletions

View File

@ -25,5 +25,6 @@ liblayout_la_SOURCES += xvas_block.c
liblayout_la_SOURCES += vs_blocked.c
liblayout_la_SOURCES += emff_blocked.c
liblayout_la_SOURCES += thp_blocked.c
liblayout_la_SOURCES += gsb_blocked.c
EXTRA_DIST = layout.h

View File

@ -91,6 +91,9 @@ void render_vgmstream_blocked(sample * buffer, int32_t sample_count, VGMSTREAM *
case layout_emff_ngc_blocked:
emff_ngc_block_update(vgmstream->next_block_offset,vgmstream);
break;
case layout_gsb_blocked:
gsb_block_update(vgmstream->next_block_offset,vgmstream);
break;
case layout_vs_blocked:
vs_block_update(vgmstream->next_block_offset,vgmstream);
break;

18
src/layout/gsb_blocked.c Normal file
View File

@ -0,0 +1,18 @@
#include "layout.h"
#include "../vgmstream.h"
/* set up for the block at the given offset */
void gsb_block_update(off_t block_offset, VGMSTREAM * vgmstream) {
int i;
vgmstream->current_block_offset = block_offset;
vgmstream->current_block_size = 0x10000; /*read_32bitLE(
vgmstream->current_block_offset+0x10,
vgmstream->ch[0].streamfile); */
vgmstream->next_block_offset = vgmstream->current_block_offset + vgmstream->current_block_size+0x20;
vgmstream->current_block_size/=vgmstream->channels;
for (i=0;i<vgmstream->channels;i++) {
vgmstream->ch[i].offset = vgmstream->current_block_offset+0x20+(vgmstream->current_block_size*i);
}
}

View File

@ -34,6 +34,8 @@ void emff_ps2_block_update(off_t block_offset, VGMSTREAM * vgmstream);
void emff_ngc_block_update(off_t block_offset, VGMSTREAM * vgmstream);
void gsb_block_update(off_t block_offset, VGMSTREAM * vgmstream);
void xvas_block_update(off_t block_offset, VGMSTREAM * vgmstream);
void thp_block_update(off_t block_offset, VGMSTREAM * vgmstream);

View File

@ -874,6 +874,10 @@
RelativePath=".\layout\emff_blocked.c"
>
</File>
<File
RelativePath=".\layout\gsb_blocked.c"
>
</File>
<File
RelativePath=".\layout\halpst_blocked.c"
>

View File

@ -15,19 +15,17 @@ VGMSTREAM * init_vgmstream_dc_asd(STREAMFILE *streamFile) {
if (strcasecmp("asd",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x20,streamFile) != 0x00000000)
goto fail;
if (read_32bitBE(0x24,streamFile) != 0x00000000)
goto fail;
if (read_32bitBE(0x20,streamFile) != 0x00000000 &&
read_32bitBE(0x24,streamFile) != 0x00000000)
goto fail;
loop_flag = 0; /* (read_32bitLE(0x144,streamFile)!=0); */
loop_flag = 0;
channel_count = read_16bitLE(0x0A,streamFile);
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
start_offset = 0x800;
vgmstream->channels = channel_count;
@ -35,12 +33,10 @@ VGMSTREAM * init_vgmstream_dc_asd(STREAMFILE *streamFile) {
vgmstream->coding_type = coding_PCM16LE;
vgmstream->num_samples = read_32bitLE(0x0,streamFile)/2/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = 0; /* read_32bitLE(0x144,streamFile)/2/channel_count; */
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = read_32bitLE(0x0,streamFile)/2/channel_count;
}
switch (channel_count) {
case 1:
vgmstream->layout_type = layout_none;
@ -53,7 +49,6 @@ VGMSTREAM * init_vgmstream_dc_asd(STREAMFILE *streamFile) {
goto fail;
}
vgmstream->meta_type = meta_DC_ASD;
/* open the file for reading */

View File

@ -30,24 +30,22 @@ VGMSTREAM * init_vgmstream_dc_idvi(STREAMFILE *streamFile) {
start_offset = 0x800;
vgmstream->sample_rate = read_32bitLE(0x08,streamFile);
vgmstream->coding_type = coding_INT_DVI_IMA;
vgmstream->num_samples = (get_streamfile_size(streamFile)-start_offset);
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitLE(0x0C,streamFile);
vgmstream->loop_end_sample = (get_streamfile_size(streamFile)-start_offset);
}
vgmstream->meta_type = meta_DC_IDVI;
vgmstream->interleave_block_size = 0x400;
if (channel_count > 1) {
vgmstream->interleave_smallblock_size = ((get_streamfile_size(streamFile)-start_offset)%(vgmstream->channels*vgmstream->interleave_block_size))/vgmstream->channels;
/* Calculating the short block... */
if (channel_count > 1) {
vgmstream->interleave_block_size = 0x400;
vgmstream->interleave_smallblock_size = ((get_streamfile_size(streamFile)-start_offset)%(vgmstream->channels*vgmstream->interleave_block_size))/vgmstream->channels;
vgmstream->layout_type = layout_interleave_shortblock;
} else {
vgmstream->layout_type = layout_none;
}
vgmstream->meta_type = meta_DC_IDVI;
/* open the file for reading */
{
int i;

View File

@ -23,7 +23,6 @@ VGMSTREAM * init_vgmstream_dc_str(STREAMFILE *streamFile) {
channel_count = read_32bitLE(0x18,streamFile);
samples=read_32bitLE(0x08,streamFile);
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
@ -66,7 +65,6 @@ VGMSTREAM * init_vgmstream_dc_str(STREAMFILE *streamFile) {
vgmstream->sample_rate = read_32bitLE(0x04,streamFile);
vgmstream->meta_type = meta_DC_STR;
/* open the file for reading */
{
int i;

View File

@ -45,14 +45,10 @@ VGMSTREAM * init_vgmstream_dc_wav_dcs(STREAMFILE *streamFile) {
read_32bitBE(0x3C,streamFileWAV) != 0x406E616D) /* "@nam" */
goto fail;
/* scan file until we find a "data" string */
file_size = get_streamfile_size(streamFileWAV);
{
current_chunk = 0;
/* Start at 0 and loop until we reached the
file size, or until we found a "data string */
while (!Founddata && current_chunk < file_size) {
@ -68,7 +64,6 @@ VGMSTREAM * init_vgmstream_dc_wav_dcs(STREAMFILE *streamFile) {
}
}
if (Founddata == 0) {
goto fail;
} else if (Founddata == 1) {
@ -78,8 +73,8 @@ VGMSTREAM * init_vgmstream_dc_wav_dcs(STREAMFILE *streamFile) {
loop_flag = 0;
/* build the VGMSTREAM */
/* Seems we're dealing with a vaild file+header,
now we can finally build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
@ -118,8 +113,6 @@ VGMSTREAM * init_vgmstream_dc_wav_dcs(STREAMFILE *streamFile) {
}
}
close_streamfile(streamFileWAV); streamFileWAV=NULL;
return vgmstream;

View File

@ -2,11 +2,8 @@
#include "../layout/layout.h"
#include "../util.h"
/*
EMFF - Eidos Music File Format (PS2),
found in Tomb Raider Legend/Anniversary, Legacy of Kain - Defiance, possibly more...
*/
/* EMFF - Eidos Music File Format (PS2),
found in Tomb Raider Legend/Anniversary, Legacy of Kain - Defiance, possibly more... */
VGMSTREAM * init_vgmstream_emff_ps2(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
@ -15,7 +12,6 @@ VGMSTREAM * init_vgmstream_emff_ps2(STREAMFILE *streamFile) {
int channel_count;
int frequency;
int i;
int j;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
@ -24,16 +20,13 @@ VGMSTREAM * init_vgmstream_emff_ps2(STREAMFILE *streamFile) {
/* do some checks on the file, cause we have no magic words to check the header...
it seems if 0x800 and 0x804 = 0 then the file has only audio, if 0x800 = 1
it has a text section, if both are 1 it's video with a text section included... */
if (read_32bitBE(0x800,streamFile) == 0x01000000 || /* "0x01000000" */
read_32bitBE(0x804,streamFile) == 0x01000000) /* "0x01000000" */
goto fail;
frequency = read_32bitLE(0x0,streamFile);
frequency = read_32bitLE(0x0,streamFile);
channel_count = read_32bitLE(0xC,streamFile);
if (frequency > 48000 ||
channel_count > 8) {
goto fail;
@ -41,19 +34,15 @@ VGMSTREAM * init_vgmstream_emff_ps2(STREAMFILE *streamFile) {
loop_flag = (read_32bitLE(0x4,streamFile) != 0xFFFFFFFF);
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
start_offset = 0x800;
vgmstream->sample_rate = frequency;
vgmstream->channels = channel_count;
vgmstream->coding_type = coding_PSX;
if (loop_flag) {
vgmstream->loop_start_sample = (read_32bitLE(0x28,streamFile)-start_offset)*28/16/channel_count;
vgmstream->loop_end_sample = read_32bitLE(0x8,streamFile);
@ -85,21 +74,17 @@ VGMSTREAM * init_vgmstream_emff_ps2(STREAMFILE *streamFile) {
emff_ps2_block_update(start_offset,vgmstream);
return vgmstream;
/* clean up anything we may have opened */
/* clean up anything we may have opened */
fail:
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
}
/*
EMFF - Eidos Music File Format (NGC/WII),
found in Tomb Raider Legend/Anniversary, Legacy of Kain - Defiance, possibly more...
*/
/* EMFF - Eidos Music File Format (NGC/WII),
found in Tomb Raider Legend/Anniversary, Legacy of Kain - Defiance, possibly more... */
VGMSTREAM * init_vgmstream_emff_ngc(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
@ -109,25 +94,23 @@ VGMSTREAM * init_vgmstream_emff_ngc(STREAMFILE *streamFile) {
int frequency;
int i;
int j;
off_t coef_table[8] = {0xC8,0xF6,0x124,0x152,0x180,0x1AE,0x1DC,0x20A};
off_t coef_table1[8] = {0xC8,0xF6,0x124,0x152,0x180,0x1AE,0x1DC,0x20A};
off_t coef_table2[8] = {0x2D0,0x2FE,0x32C,0x35A,0x388,0x3B6,0x3E4,0x412};
/* check extension, case insensitive */
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("emff",filename_extension(filename))) goto fail;
/* do some checks on the file, cause we have no magic words to check the header...
it seems if 0x800 and 0x804 = 0 then the file has only audio, if 0x800 = 1
it has a text section, if both are 1 it's video with a text section included... */
if (read_32bitBE(0x800,streamFile) == 0x00000001 || /* "0x00000001" */
read_32bitBE(0x804,streamFile) == 0x00000001) /* "0x00000001" */
goto fail;
frequency = read_32bitBE(0x0,streamFile);
channel_count = read_32bitBE(0xC,streamFile);
if (frequency > 48000 ||
channel_count > 8) {
goto fail;
@ -135,23 +118,56 @@ VGMSTREAM * init_vgmstream_emff_ngc(STREAMFILE *streamFile) {
loop_flag = (read_32bitBE(0x4,streamFile) != 0xFFFFFFFF);
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
start_offset = 0x800;
vgmstream->sample_rate = frequency;
vgmstream->channels = channel_count;
vgmstream->coding_type = coding_NGC_DSP;
/* Retrieving coefs and loops, depending on the file layout... */
if (read_32bitBE(0xC8,streamFile) == 0x0 &&
read_32bitBE(0xCC,streamFile) == 0x0 &&
read_32bitBE(0xD0,streamFile) == 0x0 &&
read_32bitBE(0xD4,streamFile) == 0x0 &&
read_32bitBE(0xD8,streamFile) == 0x0 &&
read_32bitBE(0xDC,streamFile) == 0x0 &&
read_32bitBE(0xE0,streamFile) == 0x0 &&
read_32bitBE(0xE4,streamFile) == 0x0) {
for (j=0;j<vgmstream->channels;j++) {
for (i=0;i<16;i++) {
vgmstream->ch[j].adpcm_coef[i] = read_16bitBE(coef_table2[j]+i*2,streamFile);
}
}
if (loop_flag) {
vgmstream->loop_start_sample = (read_32bitBE(0x28,streamFile))*14/8/channel_count;
vgmstream->loop_end_sample = read_32bitBE(0x8,streamFile);
}
} else if (read_32bitBE(0x2D0,streamFile) == 0x0 &&
read_32bitBE(0x2D4,streamFile) == 0x0 &&
read_32bitBE(0x2D8,streamFile) == 0x0 &&
read_32bitBE(0x2DC,streamFile) == 0x0 &&
read_32bitBE(0x2E0,streamFile) == 0x0 &&
read_32bitBE(0x2E4,streamFile) == 0x0 &&
read_32bitBE(0x2E8,streamFile) == 0x0 &&
read_32bitBE(0x2EC,streamFile) == 0x0) {
for (j=0;j<vgmstream->channels;j++) {
for (i=0;i<16;i++) {
vgmstream->ch[j].adpcm_coef[i] = read_16bitBE(coef_table1[j]+i*2,streamFile);
}
}
if (loop_flag) {
vgmstream->loop_start_sample = (read_32bitBE(0x28,streamFile)-start_offset)*14/8/channel_count;
vgmstream->loop_end_sample = read_32bitBE(0x8,streamFile);
}
}
} else {
goto fail;
}
vgmstream->layout_type = layout_emff_ngc_blocked;
vgmstream->interleave_block_size = 0x10;
@ -167,15 +183,6 @@ VGMSTREAM * init_vgmstream_emff_ngc(STREAMFILE *streamFile) {
}
}
if (vgmstream->coding_type == coding_NGC_DSP) {
for (j=0;j<vgmstream->channels;j++) {
for (i=0;i<16;i++) {
vgmstream->ch[j].adpcm_coef[i] = read_16bitBE(coef_table[j]+i*2,streamFile);
}
}
}
/* Calc num_samples */
emff_ngc_block_update(start_offset,vgmstream);
vgmstream->num_samples=0;
@ -188,10 +195,9 @@ VGMSTREAM * init_vgmstream_emff_ngc(STREAMFILE *streamFile) {
emff_ngc_block_update(start_offset,vgmstream);
return vgmstream;
/* clean up anything we may have opened */
/* clean up anything we may have opened */
fail:
if (vgmstream) close_vgmstream(vgmstream);
return NULL;

View File

@ -1,6 +1,10 @@
#include "meta.h"
#include "../util.h"
/* comment from hcs:
((uint8_t)read_8bit(offset, file))&0xf for the low nibble,
((uint8_t)read_8bit(offset, file)) >> 4 for the high one
*/
/* FSB1 */
VGMSTREAM * init_vgmstream_fsb1(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;

View File

@ -6,9 +6,8 @@ VGMSTREAM * init_vgmstream_gca(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;
int channel_count = 1;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
@ -18,9 +17,6 @@ VGMSTREAM * init_vgmstream_gca(STREAMFILE *streamFile) {
if (read_32bitBE(0x00,streamFile) != 0x47434131) /* "GCA1" */
goto fail;
loop_flag = 0;
channel_count = 1;
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
@ -49,7 +45,7 @@ VGMSTREAM * init_vgmstream_gca(STREAMFILE *streamFile) {
for (i=0;i<channel_count;i++) {
vgmstream->ch[i].streamfile = file;
vgmstream->ch[i].channel_start_offset=
vgmstream->ch[i].channel_start_offset=
vgmstream->ch[i].offset=start_offset+
vgmstream->interleave_block_size*i;
@ -64,7 +60,6 @@ VGMSTREAM * init_vgmstream_gca(STREAMFILE *streamFile) {
}
}
return vgmstream;
/* clean up anything we may have opened */

View File

@ -1,10 +1,10 @@
#include "meta.h"
#include "../util.h"
/* GSP+GSB
/* GSP+GSB - 2008-11-28 - manakoAT
2008-11-28 - manakoAT
*/
Super Swing Golf 1 & 2 (WII)
Note: Block Format missing!!! */
VGMSTREAM * init_vgmstream_gsp_gsb(STREAMFILE *streamFile) {
@ -12,13 +12,13 @@ VGMSTREAM * init_vgmstream_gsp_gsb(STREAMFILE *streamFile) {
STREAMFILE * streamFileGSP = NULL;
char filename[260];
char filenameGSP[260];
off_t start_offset;
int i;
int channel_count;
int loop_flag;
int header_len;
int coef1_start;
int coef2_start;
off_t coef1_start;
off_t coef2_start;
int dsp_blocks;
/* check extension, case insensitive */
@ -37,11 +37,11 @@ VGMSTREAM * init_vgmstream_gsp_gsb(STREAMFILE *streamFile) {
goto fail;
channel_count = (uint16_t)read_16bitBE(0x3A,streamFileGSP);
loop_flag = 0; /* read_32bitBE(0x20,streamFileGSP); */
loop_flag = (read_32bitBE(0x64,streamFileGSP) !=0xFFFFFFFF);
header_len = read_32bitBE(0x1C,streamFileGSP);
coef1_start = read_32bitBE(header_len-0x4C,streamFileGSP);
coef2_start = read_32bitBE(header_len-0x1C,streamFileGSP);
coef1_start = header_len-0x4C;
coef2_start = header_len-0x1C;
dsp_blocks = read_32bitBE(header_len-0x5C,streamFileGSP);
/* build the VGMSTREAM */
@ -51,41 +51,31 @@ VGMSTREAM * init_vgmstream_gsp_gsb(STREAMFILE *streamFile) {
/* fill in the vital statistics */
vgmstream->channels = channel_count;
vgmstream->sample_rate = read_32bitBE(0x34,streamFileGSP);
vgmstream->num_samples=read_32bitBE(0x2C,streamFileGSP)*14/8/channel_count;
vgmstream->coding_type = coding_NGC_DSP;
if(loop_flag) {
vgmstream->loop_start_sample = 0; /* read_32bitBE(0x20,streamFileGSP)*14/8/channel_count; */
vgmstream->loop_end_sample = read_32bitBE(0x48,streamFileGSP)*14/8/channel_count;
vgmstream->loop_start_sample = read_32bitBE(0x64,streamFileGSP);
vgmstream->loop_end_sample = read_32bitBE(0x68,streamFileGSP);
}
if (channel_count == 1) {
vgmstream->layout_type = layout_none;
} else if (channel_count == 2) {
vgmstream->layout_type = layout_interleave;
vgmstream->layout_type = layout_gsb_blocked;
} else if (channel_count > 1) {
vgmstream->layout_type = layout_gsb_blocked;
vgmstream->interleave_block_size = read_32bitBE(header_len-0x64,streamFileGSP);
}
vgmstream->meta_type = meta_GSP_GSB;
/* open the file for reading */
vgmstream->ch[0].streamfile = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!vgmstream->ch[0].streamfile) goto fail;
vgmstream->ch[0].channel_start_offset=0;
vgmstream->ch[0].channel_start_offset=0;
if (channel_count == 2) {
vgmstream->ch[1].streamfile = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!vgmstream->ch[1].streamfile) goto fail;
vgmstream->ch[1].channel_start_offset=vgmstream->interleave_block_size;
}
if (vgmstream->coding_type == coding_NGC_DSP) {
int i;
for (i=0;i<16;i++) {
@ -98,6 +88,18 @@ VGMSTREAM * init_vgmstream_gsp_gsb(STREAMFILE *streamFile) {
}
}
/* Calc num_samples */
start_offset = 0x0;
gsb_block_update(start_offset,vgmstream);
vgmstream->num_samples=0;
do {
vgmstream->num_samples += vgmstream->current_block_size*14/8;
gsb_block_update(vgmstream->next_block_offset,vgmstream);
} while (vgmstream->next_block_offset<get_streamfile_size(streamFile));
gsb_block_update(start_offset,vgmstream);
close_streamfile(streamFileGSP); streamFileGSP=NULL;

View File

@ -1,9 +1,8 @@
#include "meta.h"
#include "../util.h"
/* SPT+SPT
2008-11-27 - manakoAT : First try for splitted files...
/*
ISH+ISD
*/
VGMSTREAM * init_vgmstream_ish_isd(STREAMFILE *streamFile) {
@ -12,7 +11,6 @@ VGMSTREAM * init_vgmstream_ish_isd(STREAMFILE *streamFile) {
STREAMFILE * streamFileISH = NULL;
char filename[260];
char filenameISH[260];
int i;
int channel_count;
int loop_flag;
@ -21,7 +19,6 @@ VGMSTREAM * init_vgmstream_ish_isd(STREAMFILE *streamFile) {
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("isd",filename_extension(filename))) goto fail;
strcpy(filenameISH,filename);
strcpy(filenameISH+strlen(filenameISH)-3,"ISH");
@ -44,7 +41,6 @@ VGMSTREAM * init_vgmstream_ish_isd(STREAMFILE *streamFile) {
vgmstream->sample_rate = read_32bitBE(0x08,streamFileISH);
vgmstream->num_samples=read_32bitBE(0x0C,streamFileISH);
vgmstream->coding_type = coding_NGC_DSP;
if(loop_flag) {
vgmstream->loop_start_sample = read_32bitBE(0x20,streamFileISH)*14/8/channel_count;
vgmstream->loop_end_sample = read_32bitBE(0x24,streamFileISH)*14/8/channel_count;
@ -57,8 +53,6 @@ VGMSTREAM * init_vgmstream_ish_isd(STREAMFILE *streamFile) {
vgmstream->interleave_block_size = read_32bitBE(0x18,streamFileISH);
}
vgmstream->meta_type = meta_ISH_ISD;
/* open the file for reading */
@ -71,8 +65,6 @@ VGMSTREAM * init_vgmstream_ish_isd(STREAMFILE *streamFile) {
}
}
if (vgmstream->coding_type == coding_NGC_DSP) {
int i;
for (i=0;i<16;i++) {
@ -85,7 +77,6 @@ VGMSTREAM * init_vgmstream_ish_isd(STREAMFILE *streamFile) {
}
}
close_streamfile(streamFileISH); streamFileISH=NULL;
return vgmstream;

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_kraw(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;
@ -37,7 +36,6 @@ VGMSTREAM * init_vgmstream_kraw(STREAMFILE *streamFile) {
}
vgmstream->layout_type = layout_none;
/* vgmstream->interleave_block_size = 0x10; */
vgmstream->meta_type = meta_KRAW;
/* open the file for reading */

View File

@ -1,12 +1,11 @@
#include "meta.h"
#include "../util.h"
/* MSV (from Pocap Hits) */
/* MSVP (from PoPcap Hits Vol. 1) */
VGMSTREAM * init_vgmstream_msvp(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;
@ -36,7 +35,6 @@ VGMSTREAM * init_vgmstream_msvp(STREAMFILE *streamFile) {
vgmstream->loop_end_sample = (read_32bitBE(0x0C,streamFile))*28/16/channel_count;
}
/* Just to be sure that there comes a 2 channel file */
if (channel_count == 1) {
vgmstream->layout_type = layout_none;
@ -45,7 +43,6 @@ VGMSTREAM * init_vgmstream_msvp(STREAMFILE *streamFile) {
vgmstream->interleave_block_size = 0x10; /* Unknown for now */
}
vgmstream->meta_type = meta_MSVP;
/* open the file for reading */

View File

@ -1,12 +1,11 @@
#include "meta.h"
#include "../util.h"
/* MUSC/MUSX (near all Spyro games and many other using this) */
/* MUSC (near all Spyro games and many other using this) */
VGMSTREAM * init_vgmstream_musc(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int musc_version;
int loop_flag = 0;
int channel_count = 2;
@ -19,7 +18,7 @@ VGMSTREAM * init_vgmstream_musc(STREAMFILE *streamFile) {
if (read_32bitBE(0x0,streamFile) != 0x4D555343) /* MUSC */
goto fail;
loop_flag = 0; /* (read_32bitLE(0x08,streamFile)!=0); */
loop_flag = 0;
channel_count = 2;
/* build the VGMSTREAM */
@ -36,7 +35,7 @@ VGMSTREAM * init_vgmstream_musc(STREAMFILE *streamFile) {
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = (read_32bitLE(0x14,streamFile))*28/16/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = 0; /*(read_32bitLE(0x08,streamFile)-1)*28; */
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = (read_32bitLE(0x14,streamFile))*28/16/channel_count;
}
break;
@ -49,8 +48,6 @@ VGMSTREAM * init_vgmstream_musc(STREAMFILE *streamFile) {
vgmstream->interleave_block_size = (read_32bitLE(0x18,streamFile))/2;
vgmstream->meta_type = meta_MUSC;
/* open the file for reading */
{
int i;
@ -63,7 +60,6 @@ VGMSTREAM * init_vgmstream_musc(STREAMFILE *streamFile) {
vgmstream->ch[i].channel_start_offset=
vgmstream->ch[i].offset=start_offset+
vgmstream->interleave_block_size*i;
}
}

View File

@ -7,9 +7,8 @@ VGMSTREAM * init_vgmstream_musx_v004(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int musx_type; /* determining the decoder by strings like "PS2_", "GC__" and so on */
int musx_version; /* 0x08 provides a "version" byte??? */
int musx_version; /* 0x08 provides a "version" byte */
int loop_flag = 0;
int channel_count;
@ -18,16 +17,11 @@ VGMSTREAM * init_vgmstream_musx_v004(STREAMFILE *streamFile) {
if (strcasecmp("musx",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x4D555358) /* "MUSX" */
goto fail;
if (read_32bitBE(0x00,streamFile) != 0x4D555358 && /* "MUSX" */
read_32bitBE(0x08,streamFile) != 0x04000000) /* "0x04000000" */
goto fail;
if (read_32bitBE(0x08,streamFile) != 0x04000000) /* "0x04000000" */
goto fail;
/* Determine if we have an old MUSX file,
hope this will work, but it seems every new MUSX type has a new "identifer" byte */
/* This is tricky, the header changes it's layout if the file is unlooped */
/* This is tricky, the header changes it's layout if the file is unlooped */
loop_flag = (read_32bitLE(0x840,streamFile)!=0xFFFFFFFF);
channel_count = 2;
@ -91,9 +85,8 @@ VGMSTREAM * init_vgmstream_musx_v006(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int musx_type; /* determining the decoder by strings like "PS2_", "GC__" and so on */
int musx_version; /* 0x08 provides a "version" byte??? */
int musx_version; /* 0x08 provides a "version" byte */
int loop_flag = 0;
int channel_count;
@ -102,16 +95,10 @@ VGMSTREAM * init_vgmstream_musx_v006(STREAMFILE *streamFile) {
if (strcasecmp("musx",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x4D555358) /* "MUSX" */
goto fail;
if (read_32bitBE(0x00,streamFile) != 0x4D555358 && /* "MUSX" */
read_32bitBE(0x08,streamFile) != 0x06000000) /* "0x06000000" */
goto fail;
if (read_32bitBE(0x08,streamFile) != 0x06000000) /* "0x06000000" */
goto fail;
/* Determine if we have an old MUSX file,
hope this will work, but it seems every new MUSX type has a new "identifer" byte */
/* This is tricky, the header changes it's layout if the file is unlooped */
loop_flag = (read_32bitLE(0x840,streamFile)!=0xFFFFFFFF);
channel_count = 2;
@ -119,7 +106,6 @@ VGMSTREAM * init_vgmstream_musx_v006(STREAMFILE *streamFile) {
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
musx_type=(read_32bitBE(0x10,streamFile));
@ -168,19 +154,14 @@ fail:
}
/* MUSX */
/* New MUSX formats, found in Quantum of Solace, The Mummy 3, possibly more */
VGMSTREAM * init_vgmstream_musx_v010(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int musx_type; /* determining the decoder by strings like "PS2_", "GC__" and so on */
int musx_version; /* 0x08 provides a "version" byte??? */
int musx_version; /* 0x08 provides a "version" byte */
int loop_flag = 0;
int channel_count;
@ -189,16 +170,11 @@ VGMSTREAM * init_vgmstream_musx_v010(STREAMFILE *streamFile) {
if (strcasecmp("musx",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x4D555358) /* "MUSX" */
goto fail;
if (read_32bitBE(0x00,streamFile) != 0x4D555358 && /* "MUSX" */
read_32bitBE(0x08,streamFile) != 0x0A000000) /* "0x0A000000" */
goto fail;
/* Determine if we have an old MUSX file,
hope this will work, but it seems every new MUSX type has a new "identifer" byte */
if (read_32bitBE(0x08,streamFile) != 0x0A000000) /* "0x0A000000" */
goto fail;
/* This is tricky, the header changes it's layout if the file is unlooped */
loop_flag = (read_32bitLE(0x34,streamFile)!=0x00000000);
loop_flag = (read_32bitLE(0x34,streamFile)!=0x00000000);
channel_count = 2;
/* build the VGMSTREAM */
@ -252,16 +228,13 @@ fail:
return NULL;
}
/* MUSX */
/* Old MUSX format, this one handles "Sphinx and the cursed Mummy", it's different from the other formats */
VGMSTREAM * init_vgmstream_musx_v201(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int musx_version; /* 0x08 provides a "version" byte??? */
int musx_version; /* 0x08 provides a "version" byte */
int loop_flag;
int channel_count;
int loop_detect;
@ -272,18 +245,13 @@ VGMSTREAM * init_vgmstream_musx_v201(STREAMFILE *streamFile) {
if (strcasecmp("musx",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x4D555358) /* "MUSX" */
goto fail;
if (read_32bitBE(0x00,streamFile) != 0x4D555358 && /* "MUSX" */
read_32bitBE(0x08,streamFile) != 0xC9000000) /* "0xC9000000" */
goto fail;
/* Determine if we have an old MUSX file,
hope this will work, but it seems every new MUSX type has a new "identifer" byte */
if (read_32bitBE(0x08,streamFile) != 0xC9000000) /* "0xC9000000" */
goto fail;
/* This is tricky, the header changes it's layout if the file is unlooped */
channel_count = 2;
loop_detect = read_32bitBE(0x800,streamFile);
loop_detect = read_32bitBE(0x800,streamFile);
switch (loop_detect) {
case 0x02000000:
loop_offsets = 0x8E0;
@ -306,28 +274,23 @@ VGMSTREAM * init_vgmstream_musx_v201(STREAMFILE *streamFile) {
loop_flag = (read_32bitLE(loop_offsets+0x10,streamFile) !=0x00000000);
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
start_offset = read_32bitLE(0x18,streamFile);
vgmstream->channels = channel_count;
vgmstream->sample_rate = 32000;
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = read_32bitLE(loop_offsets,streamFile)*28/16/channel_count;
if (loop_flag) {
start_offset = read_32bitLE(0x18,streamFile);
vgmstream->channels = channel_count;
vgmstream->sample_rate = 32000;
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = read_32bitLE(loop_offsets,streamFile)*28/16/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitLE(loop_offsets+0x10,streamFile)*28/16/channel_count;
vgmstream->loop_end_sample = read_32bitLE(loop_offsets,streamFile)*28/16/channel_count;
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x80;
vgmstream->meta_type = meta_MUSX_V201;
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x80;
vgmstream->meta_type = meta_MUSX_V201;
/* open the file for reading */
{

View File

@ -6,9 +6,8 @@ VGMSTREAM * init_vgmstream_naomi_spsd(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag;
int channel_count;
int channel_count;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
@ -60,7 +59,6 @@ VGMSTREAM * init_vgmstream_naomi_spsd(STREAMFILE *streamFile) {
vgmstream->ch[i].channel_start_offset=
vgmstream->ch[i].offset=start_offset+
vgmstream->interleave_block_size*i;
vgmstream->ch[i].adpcm_step_index = 0x7f; /* AICA */
}
}

View File

@ -6,67 +6,61 @@ VGMSTREAM * init_vgmstream_ngc_bh2pcm(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int channel_count=2;
int channel_count;
int format_detect;
int loop_flag;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("bh2pcm",filename_extension(filename))) goto fail;
#if 0
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x53565300) /* "SVS\0" */
if (read_32bitBE(0x00,streamFile) != 0x00000000)
goto fail;
#endif
loop_flag = 0; /* (read_32bitLE(0x08,streamFile)!=0); */
loop_flag = 0;
channel_count = 2;
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
format_detect=read_32bitLE(0x00,streamFile);
switch (format_detect) {
case 1:
start_offset = 0x20;
channel_count = 2;
vgmstream->channels = channel_count;
vgmstream->sample_rate = 32000;
vgmstream->num_samples = read_32bitLE(0x04,streamFile)/2;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = read_32bitLE(0x04,streamFile);
if (loop_flag) {
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = read_32bitLE(0x14,streamFile);
}
break;
case 0:
start_offset = 0x20;
channel_count = 1;
vgmstream->channels = channel_count;
vgmstream->sample_rate = 32000;
vgmstream->num_samples = read_32bitLE(0x0C,streamFile);
vgmstream->layout_type = layout_none;
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitLE(0x08,streamFile);
vgmstream->loop_end_sample = read_32bitLE(0x0C,streamFile);
}
break;
default:
goto fail;
}
format_detect=read_32bitLE(0x00,streamFile);
switch (format_detect) {
case 1:
start_offset = 0x20;
channel_count = 2;
vgmstream->channels = channel_count;
vgmstream->sample_rate = 32000;
vgmstream->num_samples = read_32bitLE(0x04,streamFile)/2;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = read_32bitLE(0x04,streamFile);
if (loop_flag) {
vgmstream->loop_start_sample = 0; /* read_32bitLE(0x10,streamFile)/2; */
vgmstream->loop_end_sample = read_32bitLE(0x14,streamFile);
}
break;
case 0:
start_offset = 0x20;
channel_count = 1;
vgmstream->channels = channel_count;
vgmstream->sample_rate = 32000;
vgmstream->num_samples = read_32bitLE(0x0C,streamFile);
vgmstream->layout_type = layout_none;
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitLE(0x08,streamFile);
vgmstream->loop_end_sample = read_32bitLE(0x0C,streamFile);
}
break;
default:
goto fail;
}
vgmstream->coding_type = coding_PCM16BE;
vgmstream->meta_type = meta_NGC_BH2PCM;
vgmstream->coding_type = coding_PCM16BE;
vgmstream->meta_type = meta_NGC_BH2PCM;
/* open the file for reading */
{

View File

@ -1,12 +1,11 @@
#include "meta.h"
#include "../util.h"
/* PDT (Mario Party) */
/* PDT - Custom Generated File (Mario Party) */
VGMSTREAM * init_vgmstream_ngc_pdt(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag;
int channel_count;
@ -38,9 +37,8 @@ VGMSTREAM * init_vgmstream_ngc_pdt(STREAMFILE *streamFile) {
vgmstream->loop_end_sample = read_32bitBE(0x08,streamFile)*14/8/channel_count;
}
/* dealing with no interleave, 'cause the interleave
for 2 channels is larger than the sample count */
for 2 channels is larger than the sample count/2 */
vgmstream->layout_type = layout_none;
vgmstream->meta_type = meta_NGC_PDT;

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_ngc_ssm(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag;
int channel_count;
int coef1_start;

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_ngc_tydsp(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag;
int channel_count;
@ -36,7 +35,6 @@ VGMSTREAM * init_vgmstream_ngc_tydsp(STREAMFILE *streamFile) {
vgmstream->interleave_block_size = read_32bitBE(0x04,streamFile);
vgmstream->meta_type = meta_NGC_TYDSP;
if (vgmstream->coding_type == coding_NGC_DSP) {
int i;
for (i=0;i<16;i++) {

View File

@ -36,7 +36,6 @@ VGMSTREAM * init_vgmstream_ngc_vjdsp(STREAMFILE *streamFile) {
vgmstream->interleave_block_size = 0x2000;
vgmstream->meta_type = meta_NGC_VJDSP;
if (vgmstream->coding_type == coding_NGC_DSP) {
int i;
for (i=0;i<16;i++) {

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_waa_wac_wad_wam(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag;
int channel_count;
int coef1_start;

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_ngc_ymf(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag;
int channel_count;
@ -26,7 +25,7 @@ VGMSTREAM * init_vgmstream_ngc_ymf(STREAMFILE *streamFile) {
if (!vgmstream) goto fail;
/* fill in the vital statistics */
start_offset = 0x180; /* read_32bitBE(0x00,streamFile); */
start_offset = 0x180;
vgmstream->channels = channel_count;
vgmstream->sample_rate = read_32bitBE(0xA8,streamFile);
vgmstream->coding_type = coding_NGC_DSP;
@ -37,7 +36,7 @@ VGMSTREAM * init_vgmstream_ngc_ymf(STREAMFILE *streamFile) {
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x20000; /* read_32bitBE(0x04,streamFile); */
vgmstream->interleave_block_size = 0x20000;
vgmstream->meta_type = meta_NGC_YMF;

View File

@ -5,7 +5,6 @@
VGMSTREAM * init_vgmstream_ps2_ass(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
uint8_t testBuffer[0x10];
@ -21,7 +20,7 @@ VGMSTREAM * init_vgmstream_ps2_ass(STREAMFILE *streamFile) {
if (strcasecmp("ass",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x02000000) /* "00000000" */
if (read_32bitBE(0x00,streamFile) != 0x02000000) /* "0x02000000" */
goto fail;
loop_flag = 1;
@ -38,14 +37,11 @@ VGMSTREAM * init_vgmstream_ps2_ass(STREAMFILE *streamFile) {
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = (read_32bitLE(0x08,streamFile)*2)*28/16/channel_count;
fileLength = get_streamfile_size(streamFile);
do {
readOffset+=(off_t)read_streamfile(testBuffer,readOffset,0x10,streamFile);
/* Loop Start */
if(testBuffer[0x01]==0x06) {
if(loopStart == 0) loopStart = readOffset-0x10;
@ -56,11 +52,8 @@ VGMSTREAM * init_vgmstream_ps2_ass(STREAMFILE *streamFile) {
if(loopEnd == 0) loopEnd = readOffset-0x10;
/* break; */
}
} while (streamFile->get_offset(streamFile)<(int32_t)fileLength);
if(loopStart == 0) {
loop_flag = 0;
vgmstream->num_samples = read_32bitLE(0x4,streamFile)*28/16/channel_count;
@ -70,15 +63,6 @@ VGMSTREAM * init_vgmstream_ps2_ass(STREAMFILE *streamFile) {
vgmstream->loop_end_sample = (loopEnd-start_offset)*28/16/channel_count;
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = read_32bitLE(0x0C,streamFile);
vgmstream->meta_type = meta_PS2_ASS;

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_aus(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;

View File

@ -1,12 +1,12 @@
#include "meta.h"
#include "../util.h"
/* BG0 (from Ibara, Mushihimesama) */
/* BG0 (from Ibara, Mushihimesama)
Note: Seems the Loop Infos are stored external... */
VGMSTREAM * init_vgmstream_bg00(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;
@ -32,7 +32,7 @@ VGMSTREAM * init_vgmstream_bg00(STREAMFILE *streamFile) {
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = (read_32bitBE(0x4C,streamFile)*2)*28/16/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = 0; /* (read_32bitBE(0x4C,streamFile))*28/16/channel_count; */
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = (read_32bitBE(0x4C,streamFile)*2)*28/16/channel_count;
}

View File

@ -4,7 +4,6 @@
VGMSTREAM * init_vgmstream_ps2_bmdx(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
int loop_flag=0;
int channel_count;
off_t start_offset;

View File

@ -1,12 +1,11 @@
#include "meta.h"
#include "../util.h"
/* CCC (from Unlimited Saga) */
/* CCC */
VGMSTREAM * init_vgmstream_ps2_ccc(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_ps2_dxh(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_ps2_enth(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int header_check;
int loop_flag;
int channel_count;
@ -15,7 +14,6 @@ VGMSTREAM * init_vgmstream_ps2_enth(STREAMFILE *streamFile) {
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("enth",filename_extension(filename))) goto fail;
/* check header and loop_flag */
header_check = read_32bitBE(0x00,streamFile);
switch (header_check) {
@ -51,7 +49,6 @@ VGMSTREAM * init_vgmstream_ps2_enth(STREAMFILE *streamFile) {
}
vgmstream->interleave_block_size = read_32bitLE(0x0C,streamFile);
break;
case 0x4C455020: /* LEP */
start_offset = 0x800;
vgmstream->channels = channel_count;

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_hgc1(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;
@ -18,7 +17,7 @@ VGMSTREAM * init_vgmstream_hgc1(STREAMFILE *streamFile) {
if (read_32bitBE(0x00,streamFile) != 0x68674331) /* "hgC1" */
goto fail;
loop_flag = 0; /* (read_32bitLE(0x08,streamFile)!=0); */
loop_flag = 0;
channel_count = read_32bitLE(0x08,streamFile);
/* build the VGMSTREAM */
@ -32,7 +31,7 @@ VGMSTREAM * init_vgmstream_hgc1(STREAMFILE *streamFile) {
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = (read_32bitLE(0x0C,streamFile)*32)/channel_count/16*28;
if (loop_flag) {
vgmstream->loop_start_sample = 0; /* (read_32bitLE(0x08,streamFile)-1)*28; */
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = (read_32bitLE(0x0C,streamFile)*32)/channel_count/16*28;
}

View File

@ -15,10 +15,9 @@ VGMSTREAM * init_vgmstream_ikm(STREAMFILE *streamFile) {
if (strcasecmp("ikm",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x494B4D00) /* "IKM\0" */
goto fail;
if (read_32bitBE(0x40,streamFile) != 0x41535400) /* AST\0 */
goto fail;
if (read_32bitBE(0x00,streamFile) != 0x494B4D00 && /* "IKM\0" */
read_32bitBE(0x40,streamFile) != 0x41535400) /* AST\0 */
goto fail;
loop_flag = (read_32bitLE(0x14,streamFile)!=0);
channel_count = read_32bitLE(0x50,streamFile);

View File

@ -6,7 +6,6 @@
VGMSTREAM * init_vgmstream_ps2_ild(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
int loop_flag=0;
int channel_count;
off_t start_offset;

View File

@ -1,15 +1,7 @@
#include "meta.h"
#include "../util.h"
/*
JOE (found in Wall-E and some more Pixar games)
... 2008-12-03 misses loop searching for now...
*/
/* JOE (found in Wall-E and some more Pixar games) */
VGMSTREAM * init_vgmstream_ps2_joe(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
@ -19,7 +11,6 @@ VGMSTREAM * init_vgmstream_ps2_joe(STREAMFILE *streamFile) {
off_t loopEnd = 0;
off_t readOffset = 0;
size_t fileLength;
int loop_flag;
int channel_count;
@ -65,8 +56,6 @@ VGMSTREAM * init_vgmstream_ps2_joe(STREAMFILE *streamFile) {
} while (streamFile->get_offset(streamFile)<(int32_t)fileLength);
if(loopStart == 0) {
loop_flag = 0;
vgmstream->num_samples = read_32bitLE(0x4,streamFile)*28/16/channel_count;
@ -76,11 +65,9 @@ VGMSTREAM * init_vgmstream_ps2_joe(STREAMFILE *streamFile) {
vgmstream->loop_end_sample = (loopEnd-start_offset+0x20)*28/16/channel_count;
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x10;
vgmstream->meta_type = meta_PS2_JOE;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x10;
vgmstream->meta_type = meta_PS2_JOE;
/* open the file for reading */
{

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_leg(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;
@ -15,7 +14,7 @@ VGMSTREAM * init_vgmstream_leg(STREAMFILE *streamFile) {
if (strcasecmp("leg",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x10,streamFile) != 0x00000000) /* 0000" */
if (read_32bitBE(0x10,streamFile) != 0x00000000) /* 0x00000000" */
goto fail;
loop_flag = (read_32bitLE(0x44,streamFile)!=0);

View File

@ -6,10 +6,9 @@ VGMSTREAM * init_vgmstream_ps2_mihb(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int mib_blocks;
int mib_blocks;
int loop_flag = 0;
int channel_count;
int channel_count;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
@ -19,7 +18,7 @@ VGMSTREAM * init_vgmstream_ps2_mihb(STREAMFILE *streamFile) {
if (read_32bitBE(0x00,streamFile) != 0x40000000)
goto fail;
mib_blocks = read_32bitLE(0x14,streamFile);
mib_blocks = read_32bitLE(0x14,streamFile);
loop_flag = 0;
channel_count = read_32bitLE(0x08,streamFile);

View File

@ -1,12 +1,12 @@
#include "meta.h"
#include "../util.h"
/* PSW (from Rayman Raving Rabbids) */
/* PSW (from Rayman Raving Rabbids)
...coefs are missing for the dsp type... */
VGMSTREAM * init_vgmstream_ps2_psw(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;
@ -27,7 +27,7 @@ VGMSTREAM * init_vgmstream_ps2_psw(STREAMFILE *streamFile) {
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
switch ((uint16_t)read_16bitBE(0x14,streamFile)) {
case 0xFFFF:
start_offset = 0x2E;
@ -58,17 +58,11 @@ VGMSTREAM * init_vgmstream_ps2_psw(STREAMFILE *streamFile) {
vgmstream->interleave_block_size = 0x12C00;
vgmstream->meta_type = meta_PS2_PSW;
break;
default:
goto fail;
}
/* fill in the vital statistics */
/* open the file for reading */
{
int i;

View File

@ -6,8 +6,7 @@ VGMSTREAM * init_vgmstream_ps2_rkv(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = (read_32bitLE(0x10,streamFile)!=0);
int loop_flag;
int channel_count;
/* check extension, case insensitive */
@ -18,7 +17,7 @@ VGMSTREAM * init_vgmstream_ps2_rkv(STREAMFILE *streamFile) {
if (read_32bitBE(0x00,streamFile) != 0x00000000) /* "\0000" */
goto fail;
loop_flag = (read_32bitLE(0x10,streamFile)!=0);
channel_count = 2;
/* build the VGMSTREAM */

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_ps2_rstm(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;

View File

@ -2,11 +2,9 @@
#include "../util.h"
/* RXW file (Arc the Lad) */
VGMSTREAM * init_vgmstream_ps2_rxw(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
int loop_flag=0;
int channel_count;
off_t start_offset;

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_ps2_seg(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag;
int channel_count;

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_sfs(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag;
int channel_count;

View File

@ -18,7 +18,7 @@ VGMSTREAM * init_vgmstream_sl3(STREAMFILE *streamFile) {
if (read_32bitBE(0x00,streamFile) != 0x534C3300) /* "SL3\0" */
goto fail;
loop_flag = 0; /* (read_32bitLE(0x08,streamFile)!=0); */
loop_flag = 0;
channel_count = read_32bitLE(0x14,streamFile);
/* build the VGMSTREAM */
@ -32,7 +32,7 @@ VGMSTREAM * init_vgmstream_sl3(STREAMFILE *streamFile) {
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = (get_streamfile_size(streamFile)-0x8000)*28/16/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = 0; /* (read_32bitLE(0x08,streamFile)-1)*28; */
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = read_32bitLE(0x1C,streamFile);
}

View File

@ -7,7 +7,6 @@ VGMSTREAM * init_vgmstream_ps2_tec(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag;
int channel_count;
@ -15,10 +14,6 @@ VGMSTREAM * init_vgmstream_ps2_tec(STREAMFILE *streamFile) {
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("tec",filename_extension(filename))) goto fail;
/* check header */
/* if (read_16bitBE(0x01,streamFile) != 0x6700) */
/* goto fail; */
loop_flag = 0;
channel_count = 2;
@ -27,7 +22,7 @@ VGMSTREAM * init_vgmstream_ps2_tec(STREAMFILE *streamFile) {
if (!vgmstream) goto fail;
/* fill in the vital statistics */
start_offset = 0x00;
start_offset = 0x0;
vgmstream->channels = channel_count;
vgmstream->sample_rate = 44100;
vgmstream->coding_type = coding_PSX_badflags;

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_ps2_vas(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag;
int channel_count;
@ -16,7 +15,7 @@ VGMSTREAM * init_vgmstream_ps2_vas(STREAMFILE *streamFile) {
/* check header */
#if 0
if (read_32bitBE(0x00,streamFile) != 0x53565300) /* "SVS\0" */
if (read_32bitBE(0x00,streamFile) != 0x00000000) /* 0x0 */
goto fail;
#endif

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_xa30(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;
@ -37,7 +36,6 @@ VGMSTREAM * init_vgmstream_xa30(STREAMFILE *streamFile) {
}
vgmstream->layout_type = layout_none;
/* vgmstream->interleave_block_size = 0x10; */
vgmstream->meta_type = meta_XA30;
/* open the file for reading */

View File

@ -6,7 +6,6 @@ VGMSTREAM * init_vgmstream_psx_fag(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;
@ -15,6 +14,8 @@ VGMSTREAM * init_vgmstream_psx_fag(STREAMFILE *streamFile) {
if (strcasecmp("fag",filename_extension(filename))) goto fail;
/* check header */
/* Look if there's more than 1 one file... */
if (read_32bitBE(0x00,streamFile) != 0x01000000)
goto fail;

View File

@ -535,6 +535,7 @@ void render_vgmstream(sample * buffer, int32_t sample_count, VGMSTREAM * vgmstre
case layout_vs_blocked:
case layout_emff_ps2_blocked:
case layout_emff_ngc_blocked:
case layout_gsb_blocked:
case layout_xvas_blocked:
case layout_thp_blocked:
render_vgmstream_blocked(buffer,sample_count,vgmstream);
@ -1367,6 +1368,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
case layout_emff_ngc_blocked:
snprintf(temp,TEMPSIZE,"EMFF (NGC/WII) blocked");
break;
case layout_gsb_blocked:
snprintf(temp,TEMPSIZE,"GSB blocked");
break;
case layout_thp_blocked:
snprintf(temp,TEMPSIZE,"THP Movie Audio blocked");
break;

View File

@ -122,6 +122,7 @@ typedef enum {
layout_vs_blocked,
layout_emff_ps2_blocked,
layout_emff_ngc_blocked,
layout_gsb_blocked,
layout_thp_blocked,
#if 0