mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-12 01:30:49 +01:00
.capdsp added
changed some case sensitive things removed the sample counting from .emff git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@528 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
d642767990
commit
471c926f10
@ -169,7 +169,8 @@ META_OBJS=meta/adx_header.o \
|
||||
meta/ss_stream.o \
|
||||
meta/emff.o \
|
||||
meta/thp.o \
|
||||
meta/wii_sts.o
|
||||
meta/wii_sts.o \
|
||||
meta/capdsp.o
|
||||
|
||||
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
|
||||
|
||||
|
@ -236,6 +236,10 @@
|
||||
RelativePath=".\meta\brstm.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\capdsp.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\Cstr.c"
|
||||
>
|
||||
@ -390,10 +394,6 @@
|
||||
RelativePath=".\meta\ngc_tydsp.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ngc_vjdsp.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ngc_waa_wac_wad_wam.c"
|
||||
>
|
||||
|
@ -133,5 +133,6 @@ libmeta_la_SOURCES += ss_stream.c
|
||||
libmeta_la_SOURCES += emff.c
|
||||
libmeta_la_SOURCES += thp.c
|
||||
libmeta_la_SOURCES += wii_sts.c
|
||||
libmeta_la_SOURCES += capdsp.c
|
||||
|
||||
EXTRA_DIST = meta.h
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* VJDSP (found in Viewtiful Joe) */
|
||||
VGMSTREAM * init_vgmstream_ngc_vjdsp(STREAMFILE *streamFile) {
|
||||
/* CAPDSP (found in Capcom games) */
|
||||
VGMSTREAM * init_vgmstream_capdsp(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[260];
|
||||
off_t start_offset;
|
||||
@ -12,9 +12,9 @@ VGMSTREAM * init_vgmstream_ngc_vjdsp(STREAMFILE *streamFile) {
|
||||
|
||||
/* check extension, case insensitive */
|
||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("vjdsp",filename_extension(filename))) goto fail;
|
||||
if (strcasecmp("capdsp",filename_extension(filename))) goto fail;
|
||||
|
||||
loop_flag = read_32bitBE(0x14,streamFile);
|
||||
loop_flag = (read_32bitBE(0x14,streamFile) !=2);
|
||||
channel_count = read_32bitBE(0x10,streamFile);
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
@ -26,25 +26,23 @@ VGMSTREAM * init_vgmstream_ngc_vjdsp(STREAMFILE *streamFile) {
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitBE(0x0C,streamFile);
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
vgmstream->num_samples = read_32bitBE(0x18,streamFile);
|
||||
vgmstream->num_samples = read_32bitBE(0x04,streamFile);
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = read_32bitBE(0x14,streamFile);
|
||||
vgmstream->loop_end_sample = read_32bitBE(0x18,streamFile);
|
||||
vgmstream->loop_start_sample = read_32bitBE(0x14,streamFile)/8/channel_count*14;
|
||||
vgmstream->loop_end_sample = read_32bitBE(0x18,streamFile)/8/channel_count*14;
|
||||
}
|
||||
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x2000;
|
||||
vgmstream->meta_type = meta_NGC_VJDSP;
|
||||
vgmstream->meta_type = meta_CAPDSP;
|
||||
|
||||
if (vgmstream->coding_type == coding_NGC_DSP) {
|
||||
int i;
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[0].adpcm_coef[i] = read_16bitBE(0x20+i*2,streamFile);
|
||||
}
|
||||
if (vgmstream->channels) {
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[1].adpcm_coef[i] = read_16bitBE(0x40+i*2,streamFile);
|
||||
}
|
||||
for (i=0;i<8;i++) {
|
||||
vgmstream->ch[0].adpcm_coef[i*2]=read_16bitBE(0x20+i*2,streamFile);
|
||||
vgmstream->ch[0].adpcm_coef[i*2+1]=read_16bitBE(0x30+i*2,streamFile);
|
||||
vgmstream->ch[1].adpcm_coef[i*2]=read_16bitBE(0x40+i*2,streamFile);
|
||||
vgmstream->ch[1].adpcm_coef[i*2+1]=read_16bitBE(0x50+i*2,streamFile);
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ VGMSTREAM * init_vgmstream_dc_wav_dcs(STREAMFILE *streamFile) {
|
||||
|
||||
/* Getting the Header file name... */
|
||||
strcpy(filenameWAV,filename);
|
||||
strcpy(filenameWAV+strlen(filenameWAV)-3,"WAV");
|
||||
strcpy(filenameWAV+strlen(filenameWAV)-3,"wav");
|
||||
|
||||
/* Look if the Header file is present, else cancel vgmstream */
|
||||
streamFileWAV = streamFile->open(streamFile,filenameWAV,STREAMFILE_DEFAULT_BUFFER_SIZE);
|
||||
|
@ -43,10 +43,6 @@ VGMSTREAM * init_vgmstream_emff_ps2(STREAMFILE *streamFile) {
|
||||
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);
|
||||
}
|
||||
|
||||
vgmstream->layout_type = layout_emff_ps2_blocked;
|
||||
vgmstream->interleave_block_size = 0x10;
|
||||
@ -63,16 +59,12 @@ VGMSTREAM * init_vgmstream_emff_ps2(STREAMFILE *streamFile) {
|
||||
}
|
||||
|
||||
/* Calc num_samples */
|
||||
emff_ps2_block_update(start_offset,vgmstream);
|
||||
vgmstream->num_samples=0;
|
||||
|
||||
do {
|
||||
|
||||
vgmstream->num_samples += vgmstream->current_block_size*28/16;
|
||||
emff_ps2_block_update(vgmstream->next_block_offset,vgmstream);
|
||||
} while (vgmstream->next_block_offset<get_streamfile_size(streamFile));
|
||||
|
||||
emff_ps2_block_update(start_offset,vgmstream);
|
||||
emff_ps2_block_update(start_offset,vgmstream);
|
||||
vgmstream->num_samples = read_32bitLE(0x8,streamFile);;
|
||||
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);
|
||||
}
|
||||
|
||||
return vgmstream;
|
||||
|
||||
@ -143,10 +135,6 @@ VGMSTREAM * init_vgmstream_emff_ngc(STREAMFILE *streamFile) {
|
||||
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 &&
|
||||
@ -161,10 +149,6 @@ VGMSTREAM * init_vgmstream_emff_ngc(STREAMFILE *streamFile) {
|
||||
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;
|
||||
}
|
||||
@ -185,15 +169,11 @@ VGMSTREAM * init_vgmstream_emff_ngc(STREAMFILE *streamFile) {
|
||||
|
||||
/* Calc num_samples */
|
||||
emff_ngc_block_update(start_offset,vgmstream);
|
||||
vgmstream->num_samples=0;
|
||||
|
||||
do {
|
||||
|
||||
vgmstream->num_samples += vgmstream->current_block_size*14/8;
|
||||
emff_ngc_block_update(vgmstream->next_block_offset,vgmstream);
|
||||
} while (vgmstream->next_block_offset<get_streamfile_size(streamFile));
|
||||
|
||||
emff_ngc_block_update(start_offset,vgmstream);
|
||||
vgmstream->num_samples = read_32bitBE(0x8,streamFile);;
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = (read_32bitBE(0x28,streamFile))*14/8/channel_count;
|
||||
vgmstream->loop_end_sample = read_32bitBE(0x8,streamFile);
|
||||
}
|
||||
|
||||
return vgmstream;
|
||||
|
||||
|
@ -24,7 +24,7 @@ VGMSTREAM * init_vgmstream_gsp_gsb(STREAMFILE *streamFile) {
|
||||
|
||||
|
||||
strcpy(filenameGSP,filename);
|
||||
strcpy(filenameGSP+strlen(filenameGSP)-3,"GSP");
|
||||
strcpy(filenameGSP+strlen(filenameGSP)-3,"gsp");
|
||||
|
||||
streamFileGSP = streamFile->open(streamFile,filenameGSP,STREAMFILE_DEFAULT_BUFFER_SIZE);
|
||||
if (!streamFileGSP) goto fail;
|
||||
|
@ -20,7 +20,7 @@ VGMSTREAM * init_vgmstream_ish_isd(STREAMFILE *streamFile) {
|
||||
if (strcasecmp("isd",filename_extension(filename))) goto fail;
|
||||
|
||||
strcpy(filenameISH,filename);
|
||||
strcpy(filenameISH+strlen(filenameISH)-3,"ISH");
|
||||
strcpy(filenameISH+strlen(filenameISH)-3,"ish");
|
||||
|
||||
streamFileISH = streamFile->open(streamFile,filenameISH,STREAMFILE_DEFAULT_BUFFER_SIZE);
|
||||
if (!streamFileISH) goto fail;
|
||||
|
@ -199,7 +199,7 @@ VGMSTREAM * init_vgmstream_ngc_tydsp(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_swd(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_vjdsp(STREAMFILE * streamFile);
|
||||
VGMSTREAM * init_vgmstream_capdsp(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_xbox_wvs(STREAMFILE *streamFile);
|
||||
|
||||
|
@ -23,7 +23,7 @@ VGMSTREAM * init_vgmstream_spt_spd(STREAMFILE *streamFile) {
|
||||
|
||||
|
||||
strcpy(filenameSPT,filename);
|
||||
strcpy(filenameSPT+strlen(filenameSPT)-3,"SPT");
|
||||
strcpy(filenameSPT+strlen(filenameSPT)-3,"spt");
|
||||
|
||||
streamFileSPT = streamFile->open(streamFile,filenameSPT,STREAMFILE_DEFAULT_BUFFER_SIZE);
|
||||
|
||||
|
@ -114,7 +114,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_aix,
|
||||
init_vgmstream_ngc_tydsp,
|
||||
init_vgmstream_ngc_swd,
|
||||
init_vgmstream_ngc_vjdsp,
|
||||
init_vgmstream_capdsp,
|
||||
init_vgmstream_xbox_wvs,
|
||||
init_vgmstream_dc_str,
|
||||
init_vgmstream_xbox_stma,
|
||||
|
@ -243,7 +243,7 @@ typedef enum {
|
||||
meta_SDT, /* Baldur's Gate - Dark Alliance */
|
||||
meta_NGC_TYDSP, /* Ty - The Tasmanian Tiger */
|
||||
meta_NGC_SWD, /* Conflict - Desert Storm 1 & 2 */
|
||||
meta_NGC_VJDSP, /* Viewtiful Joe */
|
||||
meta_CAPDSP, /* Capcom DSP Header */
|
||||
meta_DC_STR, /* Evil Dead */
|
||||
meta_NGC_BH2PCM, /* Bio Hazard 2 */
|
||||
meta_SAT_SAP, /* Bubble Symphony */
|
||||
|
@ -169,7 +169,7 @@ char * extension_list[] = {
|
||||
"aix\0AIX Audio File (*.AIX)\0",
|
||||
"tydsp\0TYDSP Audio File (*.TYDSP)\0",
|
||||
"swd\0SWD Audio File (*.SWD)\0",
|
||||
"vjdsp\0VJDSP Audio File (*.VJDSP)\0",
|
||||
"capdsp\0CAPDSP Audio File (*.CAPDSP)\0",
|
||||
"wvs\0WVS Audio File (*.WVS)\0",
|
||||
"stma\0STMA Audio File (*.STMA)\0",
|
||||
"matx\0MATX Audio File (*.MATX)\0",
|
||||
|
Loading…
Reference in New Issue
Block a user