add support for .OMU (.INT with Header)

fixed .MIB & .INT issues
fixed EA XA Decoder
fixed resource.rc for vs2008 (& 2005 ?)



git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@430 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
fastelbja 2008-09-08 18:55:01 +00:00
parent bb30e09275
commit e70a110ea5
6 changed files with 72 additions and 4 deletions

View File

@ -63,7 +63,7 @@ void Parse_Header(STREAMFILE* streamFile,EA_STRUCT* ea, off_t offset, int length
if(read_32bitBE(offset, streamFile)==0x47535452) { // GSTR
ea->compression_version=0x03;
offset+=8;
ea->platform=(uint8_t)read_8bit(offset,streamFile);
ea->platform=6;
} else {
if(read_16bitBE(offset,streamFile)!=0x5054) // PT
offset+=4;

View File

@ -219,4 +219,8 @@ VGMSTREAM * init_vgmstream_wii_idsp(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_kraw(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_ps2_omu(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_ps2_xa2(STREAMFILE * streamFile);
#endif

View File

@ -48,7 +48,61 @@ VGMSTREAM * init_vgmstream_ps2_int(STREAMFILE *streamFile) {
if (!vgmstream->ch[i].streamfile) goto fail;
vgmstream->ch[i].channel_start_offset=
vgmstream->ch[i].offset=0;
vgmstream->ch[i].offset=i*vgmstream->interleave_block_size;
}
}
return vgmstream;
/* clean up anything we may have opened */
fail:
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
}
// OMU is a PS2 .INT file with header ...
// found in Alter Echo
VGMSTREAM * init_vgmstream_ps2_omu(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
int i,channel_count;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("omu",filename_extension(filename))) goto fail;
/* check header */
if((read_32bitBE(0,streamFile)!=0x4F4D5520) && (read_32bitBE(0x08,streamFile)!=0x46524D54))
goto fail;
channel_count = (int)read_8bit(0x14,streamFile);
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,1);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
vgmstream->channels=channel_count;
vgmstream->sample_rate = read_32bitLE(0x10,streamFile);
vgmstream->coding_type = coding_PCM16LE;
vgmstream->num_samples = (int32_t)(read_32bitLE(0x3C,streamFile)/(vgmstream->channels*2));
vgmstream->interleave_block_size = 0x200;
vgmstream->layout_type = layout_interleave;
vgmstream->meta_type = meta_PS2_OMU;
vgmstream->loop_start_sample=0;
vgmstream->loop_end_sample=vgmstream->num_samples;
/* open the file for reading by each channel */
{
for (i=0;i<vgmstream->channels;i++) {
vgmstream->ch[i].streamfile = streamFile->open(streamFile,filename,0x8000);
if (!vgmstream->ch[i].streamfile) goto fail;
vgmstream->ch[i].channel_start_offset=
vgmstream->ch[i].offset=0x40+(i*vgmstream->interleave_block_size);
}
}

View File

@ -149,7 +149,7 @@ VGMSTREAM * init_vgmstream_ps2_mib(STREAMFILE *streamFile) {
if (!vgmstream->ch[i].streamfile) goto fail;
vgmstream->ch[i].channel_start_offset=
vgmstream->ch[i].offset=0;
vgmstream->ch[i].offset=i*vgmstream->interleave_block_size;
}
}

View File

@ -125,6 +125,8 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_ps2_rnd,
init_vgmstream_wii_idsp,
init_vgmstream_kraw,
init_vgmstream_ps2_omu,
init_vgmstream_ps2_xa2,
};
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@ -1372,6 +1374,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
break;
case meta_PS2_RAW:
snprintf(temp,TEMPSIZE,"assumed RAW Interleaved PCM by .int extension");
break;
case meta_PS2_OMU:
snprintf(temp,TEMPSIZE,"Alter Echo OMU Header");
break;
case meta_DSP_STM:
snprintf(temp,TEMPSIZE,"Nintendo STM header");
@ -1661,6 +1666,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
break;
case meta_XBOX_XVAS:
snprintf(temp,TEMPSIZE,"assumed TMNT file by .xvas extension");
break;
case meta_PS2_XA2:
snprintf(temp,TEMPSIZE,"assumed XA2 file by .xa2 extension");
break;
case meta_DC_IDVI:
snprintf(temp,TEMPSIZE,"IDVI Header");

View File

@ -231,6 +231,8 @@ typedef enum {
meta_SAT_SAP, /* Bubble Symphony */
meta_DC_IDVI, /* Eldorado Gate */
meta_KRAW, /* Geometry Wars - Galaxies */
meta_PS2_OMU, /* PS2 Int file with Header */
meta_PS2_XA2, /* XA2 XG3 file */
meta_XBOX_WAVM, /* XBOX WAVM File */
meta_XBOX_RIFF, /* XBOX RIFF/WAVE File */