add support for Gunvari MCG Audio Files

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@602 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
fastelbja 2009-03-13 22:00:33 +00:00
parent a0023d2580
commit 000879f407
8 changed files with 284 additions and 201 deletions

View File

@ -1,199 +1,200 @@
CODING_OBJS=coding/adx_decoder.o \
coding/g721_decoder.o \
coding/ima_decoder.o \
coding/ngc_afc_decoder.o \
coding/ngc_dsp_decoder.o \
coding/ngc_dtk_decoder.o \
coding/pcm_decoder.o \
coding/psx_decoder.o \
coding/xa_decoder.o \
coding/eaxa_decoder.o \
coding/ogg_vorbis_decoder.o \
coding/sdx2_decoder.o \
coding/ws_decoder.o \
coding/mpeg_decoder.o \
coding/acm_decoder.o \
coding/nwa_decoder.o \
coding/msadpcm_decoder.o \
coding/aica_decoder.o \
coding/nds_procyon_decoder.o \
coding/l5_555_decoder.o
LAYOUT_OBJS=layout/ast_blocked.o \
layout/blocked.o \
layout/halpst_blocked.o \
layout/interleave.o \
layout/nolayout.o \
layout/xa_blocked.o \
layout/caf_blocked.o \
layout/ea_block.o \
layout/wsi_blocked.o \
layout/str_snds_blocked.o \
layout/ws_aud_blocked.o \
layout/interleave_byte.o \
layout/mus_acm_layout.o \
layout/aix_layout.o \
layout/ims_block.o \
layout/de2_blocked.o \
layout/xvas_block.o \
layout/vs_blocked.o \
layout/emff_blocked.o \
layout/thp_blocked.o \
layout/gsb_blocked.o \
layout/filp_blocked.o \
layout/aax_layout.o
META_OBJS=meta/adx_header.o \
meta/afc_header.o \
meta/agsc.o \
meta/ast.o \
meta/brstm.o \
meta/halpst.o \
meta/nds_strm.o \
meta/ngc_adpdtk.o \
meta/rsf.o \
meta/rs03.o \
meta/ngc_dsp_std.o \
meta/Cstr.o \
meta/gcsw.o \
meta/ps2_ads.o \
meta/ps2_npsf.o \
meta/rwsd.o \
meta/psx_cdxa.o \
meta/ps2_rxw.o \
meta/ps2_int.o \
meta/ps2_exst.o \
meta/ps2_svag.o \
meta/ps2_mib.o \
meta/ps2_mic.o \
meta/raw.o \
meta/ps2_vag.o \
meta/psx_gms.o \
meta/ps2_str.o \
meta/ps2_ild.o \
meta/ps2_pnb.o \
meta/xbox_wavm.o \
meta/xbox_xwav.o \
meta/ea_header.o \
meta/ngc_caf.o \
meta/ps2_vpk.o \
meta/genh.o \
meta/ogg_vorbis_file.o \
meta/ps2_bmdx.o \
meta/aifc.o \
meta/str_snds.o \
meta/ws_aud.o \
meta/ahx.o \
meta/ivb.o \
meta/svs.o \
meta/riff.o \
meta/pos.o \
meta/nwa.o \
meta/ps2_rws.o \
meta/ps2_hgc1.o \
meta/xss.o \
meta/ps2_sl3.o \
meta/ps2_aus.o \
meta/fsb.o \
meta/rsd.o \
meta/rwx.o \
meta/xwb.o \
meta/ea_old.o \
meta/ps2_xa30.o \
meta/musc.o \
meta/musx.o \
meta/ps2_leg.o \
meta/ps2_filp.o \
meta/ps2_ikm.o \
meta/ps2_sfs.o \
meta/sat_dvi.o \
meta/ps2_bg00.o \
meta/dc_kcey.o \
meta/ps2_rstm.o \
meta/acm.o \
meta/mus_acm.o \
meta/ps2_kces.o \
meta/ps2_dxh.o \
meta/ps2_psh.o \
meta/sli.o \
meta/sfl.o \
meta/pcm.o \
meta/ps2_psw.o \
meta/ps2_rkv.o \
meta/ps2_vas.o \
meta/ps2_tec.o \
meta/ps2_enth.o \
meta/sdt.o \
meta/aix.o \
meta/ngc_tydsp.o \
meta/xbox_wvs.o \
meta/xbox_ims.o \
meta/xbox_stma.o \
meta/de2.o \
meta/dc_str.o \
meta/xbox_xmu.o \
meta/ngc_bh2pcm.o \
meta/xbox_xvas.o \
meta/sat_sap.o \
meta/sat_sap.o \
meta/dc_idvi.o \
meta/ps2_rnd.o \
meta/kraw.o \
meta/ps2_xa2.o \
meta/idsp.o \
meta/ngc_ymf.o \
meta/nds_sad.o \
meta/ps2_ccc.o \
meta/psx_fag.o \
meta/ps2_mihb.o \
meta/ngc_pdt.o \
meta/wii_mus.o \
meta/dc_asd.o \
meta/naomi_spsd.o \
meta/bgw.o \
meta/ps2_ass.o \
meta/ngc_waa_wac_wad_wam.o \
meta/ps2_seg.o \
meta/str_asr.o \
meta/zwdsp.o \
meta/gca.o \
meta/ish_isd.o \
meta/spt_spd.o \
meta/ydsp.o \
meta/gsp_gsb.o \
meta/ngc_ssm.o \
meta/msvp.o \
meta/ps2_joe.o \
meta/vgs.o \
meta/vs.o \
meta/dc_wav_dcs.o \
meta/wii_smp.o \
meta/ss_stream.o \
meta/emff.o \
meta/thp.o \
meta/wii_sts.o \
meta/capdsp.o \
meta/wii_sng.o \
meta/aax.o \
meta/ps2_p2bt.o \
meta/ps2_gbts.o \
meta/ngc_ffcc_str.o \
meta/sat_baka.o \
meta/nds_swav.o \
meta/vsf.o \
meta/nds_rrds.o \
meta/ps2_tk5.o \
meta/ads.o \
meta/wii_str.o \
meta/zsd.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
libvgmstream.a: $(OBJECTS)
$(AR) crs libvgmstream.a $(OBJECTS)
vgmstream-deps:
$(CC) $(CFLAGS) -M -o vgmstream-deps
clean:
rm -f $(OBJECTS) libvgmstream.a
CODING_OBJS=coding/adx_decoder.o \
coding/g721_decoder.o \
coding/ima_decoder.o \
coding/ngc_afc_decoder.o \
coding/ngc_dsp_decoder.o \
coding/ngc_dtk_decoder.o \
coding/pcm_decoder.o \
coding/psx_decoder.o \
coding/xa_decoder.o \
coding/eaxa_decoder.o \
coding/ogg_vorbis_decoder.o \
coding/sdx2_decoder.o \
coding/ws_decoder.o \
coding/mpeg_decoder.o \
coding/acm_decoder.o \
coding/nwa_decoder.o \
coding/msadpcm_decoder.o \
coding/aica_decoder.o \
coding/nds_procyon_decoder.o \
coding/l5_555_decoder.o
LAYOUT_OBJS=layout/ast_blocked.o \
layout/blocked.o \
layout/halpst_blocked.o \
layout/interleave.o \
layout/nolayout.o \
layout/xa_blocked.o \
layout/caf_blocked.o \
layout/ea_block.o \
layout/wsi_blocked.o \
layout/str_snds_blocked.o \
layout/ws_aud_blocked.o \
layout/interleave_byte.o \
layout/mus_acm_layout.o \
layout/aix_layout.o \
layout/ims_block.o \
layout/de2_blocked.o \
layout/xvas_block.o \
layout/vs_blocked.o \
layout/emff_blocked.o \
layout/thp_blocked.o \
layout/gsb_blocked.o \
layout/filp_blocked.o \
layout/aax_layout.o
META_OBJS=meta/adx_header.o \
meta/afc_header.o \
meta/agsc.o \
meta/ast.o \
meta/brstm.o \
meta/halpst.o \
meta/nds_strm.o \
meta/ngc_adpdtk.o \
meta/rsf.o \
meta/rs03.o \
meta/ngc_dsp_std.o \
meta/Cstr.o \
meta/gcsw.o \
meta/ps2_ads.o \
meta/ps2_npsf.o \
meta/rwsd.o \
meta/psx_cdxa.o \
meta/ps2_rxw.o \
meta/ps2_int.o \
meta/ps2_exst.o \
meta/ps2_svag.o \
meta/ps2_mib.o \
meta/ps2_mic.o \
meta/raw.o \
meta/ps2_vag.o \
meta/psx_gms.o \
meta/ps2_str.o \
meta/ps2_ild.o \
meta/ps2_pnb.o \
meta/xbox_wavm.o \
meta/xbox_xwav.o \
meta/ea_header.o \
meta/ngc_caf.o \
meta/ps2_vpk.o \
meta/genh.o \
meta/ogg_vorbis_file.o \
meta/ps2_bmdx.o \
meta/aifc.o \
meta/str_snds.o \
meta/ws_aud.o \
meta/ahx.o \
meta/ivb.o \
meta/svs.o \
meta/riff.o \
meta/pos.o \
meta/nwa.o \
meta/ps2_rws.o \
meta/ps2_hgc1.o \
meta/xss.o \
meta/ps2_sl3.o \
meta/ps2_aus.o \
meta/fsb.o \
meta/rsd.o \
meta/rwx.o \
meta/xwb.o \
meta/ea_old.o \
meta/ps2_xa30.o \
meta/musc.o \
meta/musx.o \
meta/ps2_leg.o \
meta/ps2_filp.o \
meta/ps2_ikm.o \
meta/ps2_sfs.o \
meta/sat_dvi.o \
meta/ps2_bg00.o \
meta/dc_kcey.o \
meta/ps2_rstm.o \
meta/acm.o \
meta/mus_acm.o \
meta/ps2_kces.o \
meta/ps2_dxh.o \
meta/ps2_psh.o \
meta/sli.o \
meta/sfl.o \
meta/pcm.o \
meta/ps2_psw.o \
meta/ps2_rkv.o \
meta/ps2_vas.o \
meta/ps2_tec.o \
meta/ps2_enth.o \
meta/sdt.o \
meta/aix.o \
meta/ngc_tydsp.o \
meta/xbox_wvs.o \
meta/xbox_ims.o \
meta/xbox_stma.o \
meta/de2.o \
meta/dc_str.o \
meta/xbox_xmu.o \
meta/ngc_bh2pcm.o \
meta/xbox_xvas.o \
meta/sat_sap.o \
meta/sat_sap.o \
meta/dc_idvi.o \
meta/ps2_rnd.o \
meta/kraw.o \
meta/ps2_xa2.o \
meta/idsp.o \
meta/ngc_ymf.o \
meta/nds_sad.o \
meta/ps2_ccc.o \
meta/psx_fag.o \
meta/ps2_mihb.o \
meta/ngc_pdt.o \
meta/wii_mus.o \
meta/dc_asd.o \
meta/naomi_spsd.o \
meta/bgw.o \
meta/ps2_ass.o \
meta/ngc_waa_wac_wad_wam.o \
meta/ps2_seg.o \
meta/str_asr.o \
meta/zwdsp.o \
meta/gca.o \
meta/ish_isd.o \
meta/spt_spd.o \
meta/ydsp.o \
meta/gsp_gsb.o \
meta/ngc_ssm.o \
meta/msvp.o \
meta/ps2_joe.o \
meta/vgs.o \
meta/vs.o \
meta/dc_wav_dcs.o \
meta/wii_smp.o \
meta/ss_stream.o \
meta/emff.o \
meta/thp.o \
meta/wii_sts.o \
meta/capdsp.o \
meta/wii_sng.o \
meta/aax.o \
meta/ps2_p2bt.o \
meta/ps2_gbts.o \
meta/ngc_ffcc_str.o \
meta/sat_baka.o \
meta/nds_swav.o \
meta/vsf.o \
meta/nds_rrds.o \
meta/ps2_tk5.o \
meta/ads.o \
meta/wii_str.o \
meta/zsd.o \
meta/ps2_mcg.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
libvgmstream.a: $(OBJECTS)
$(AR) crs libvgmstream.a $(OBJECTS)
vgmstream-deps:
$(CC) $(CFLAGS) -M -o vgmstream-deps
clean:
rm -f $(OBJECTS) libvgmstream.a

View File

@ -510,6 +510,10 @@
RelativePath=".\meta\ps2_leg.c"
>
</File>
<File
RelativePath=".\meta\ps2_mcg.c"
>
</File>
<File
RelativePath=".\meta\ps2_mib.c"
>

View File

@ -146,5 +146,6 @@ libmeta_la_SOURCES += ps2_tk5.c
libmeta_la_SOURCES += ads.c
libmeta_la_SOURCES += wii_str.c
libmeta_la_SOURCES += zsd.c
libmeta_la_SOURCES += ps2_mcg.c
EXTRA_DIST = meta.h

View File

@ -355,6 +355,8 @@ VGMSTREAM * init_vgmstream_ads(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_wii_str(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_ps2_mcg(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_zsd(STREAMFILE *streamFile);
#endif

67
src/meta/ps2_mcg.c Normal file
View File

@ -0,0 +1,67 @@
#include "meta.h"
#include "../util.h"
/* GUN (Gunvari Streams) */
VGMSTREAM * init_vgmstream_ps2_mcg(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("mcg",filename_extension(filename))) goto fail;
/* check header */
if (!((read_32bitBE(0x00,streamFile) == 0x4D434700) &&
(read_32bitBE(0x20,streamFile) == 0x56414770) &&
(read_32bitBE(0x50,streamFile) == 0x56414770)))
goto fail;
loop_flag = (read_32bitLE(0x34,streamFile)!=0);
channel_count = 2;
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
start_offset = 0x80;
vgmstream->channels = channel_count;
vgmstream->sample_rate = read_32bitBE(0x30,streamFile);
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = read_32bitBE(0x2C,streamFile)*2;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = read_32bitLE(0x14,streamFile);
vgmstream->meta_type = meta_PS2_MCG;
if (vgmstream->loop_flag)
{
vgmstream->loop_start_sample = read_32bitLE(0x34,streamFile);
vgmstream->loop_end_sample = vgmstream->num_samples;
}
/* 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;
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 */
fail:
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
}

View File

@ -197,6 +197,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_ps2_vsf_tta,
init_vgmstream_ads,
init_vgmstream_wii_str,
init_vgmstream_ps2_mcg,
init_vgmstream_zsd,
};
@ -2101,14 +2102,19 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
case meta_ADS:
snprintf(temp,TEMPSIZE,"dhSS Header");
break;
case meta_WII_STR:
case meta_WII_STR:
snprintf(temp,TEMPSIZE,"HOTD Overkill - STR+STH WII Header");
break;
break;
case meta_PS2_MCG:
snprintf(temp,TEMPSIZE,"Gunvari MCG Header");
break;
case meta_ZSD:
snprintf(temp,TEMPSIZE,"ZSD Header");
break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
break;
}
concatn(length,desc,temp);
}

View File

@ -376,6 +376,7 @@ typedef enum {
meta_NGC_IADP, /* Gamecube Interleave DSP */
meta_PS2_TK5, /* Tekken 5 Stream Files */
meta_WII_STR, /* House of The Dead Overkill STR+STH */
meta_PS2_MCG, /* Gunvari MCG Files (was name .GCM on disk) */
meta_ZSD, /* Dragon Booster ZSD */
} meta_t;

View File

@ -229,6 +229,7 @@ char * extension_list[] = {
"vb\0VB Audio File (*.VB)\0",
"tk5\0TK5 Audio File (*.TK5)\0",
"rrds\0RRDS Audio File (*.RRDS)\0",
"mcg\0MCG Audio File (*.MCG)\0",
"zsd\0ZSD Audio File (*.ZSD)\0",
};