MGS3 VAG1

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@945 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
halleyscometsw 2011-05-08 03:47:20 +00:00
parent 3f1f45ba07
commit 72aca13617
3 changed files with 22 additions and 2 deletions

View File

@ -48,6 +48,9 @@ VGMSTREAM * init_vgmstream_ps2_vag(STREAMFILE *streamFile) {
vagID=read_8bit(0x03,streamFile);
switch(vagID) {
case '1':
channel_count=1;
break;
case 'i':
channel_count=2;
break;
@ -104,6 +107,15 @@ VGMSTREAM * init_vgmstream_ps2_vag(STREAMFILE *streamFile) {
vgmstream->channels = channel_count;
switch(vagID) {
case '1': // VAG1
vgmstream->layout_type=layout_none;
vgmstream->sample_rate = read_32bitBE(0x10,streamFile);
vgmstream->num_samples = read_32bitBE(0x0C,streamFile)/16*28;
interleave = read_32bitLE(0x08,streamFile);
if (interleave != 0) goto fail;
vgmstream->meta_type=meta_PS2_VAG1;
start_offset=0x40;
break;
case 'i': // VAGi
vgmstream->layout_type=layout_interleave;
vgmstream->sample_rate = read_32bitBE(0x10,streamFile);
@ -181,7 +193,11 @@ VGMSTREAM * init_vgmstream_ps2_vag(STREAMFILE *streamFile) {
/* open the file for reading by each channel */
{
for (i=0;i<channel_count;i++) {
vgmstream->ch[i].streamfile = streamFile->open(streamFile,filename,vgmstream->interleave_block_size);
if (vgmstream->interleave_block_size > 0) {
vgmstream->ch[i].streamfile = streamFile->open(streamFile,filename,vgmstream->interleave_block_size);
} else {
vgmstream->ch[i].streamfile = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
}
if (!vgmstream->ch[i].streamfile) goto fail;

View File

@ -2847,7 +2847,10 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
snprintf(temp,TEMPSIZE,"PS3 SGXD/WAVE header");
break;
case meta_PS2_MTAF:
snprintf(temp,TEMPSIZE,"PS2 MTAF header");
snprintf(temp,TEMPSIZE,"Konami MTAF header");
break;
case meta_PS2_VAG1:
snprintf(temp,TEMPSIZE,"Konami VAG Mono header (VAG1)");
break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");

View File

@ -522,6 +522,7 @@ typedef enum {
meta_PS3_KLBS, // L@VE ONCE (PS3)
meta_PS3_SGX,
meta_PS2_MTAF, // Metal Gear Solid 3 MTAF
meta_PS2_VAG1, // Metal Gear Solid 3 VAG1
} meta_t;
typedef struct {