mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-30 11:57:27 +01:00
Add TK1 from Tekken (NamCollection) to avoid conflict with TK5 infos. Add ADSC .ads from Kenka Bancho 2: Full Throttle
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@776 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
2c292eb086
commit
a1797ac9ee
@ -232,8 +232,10 @@ META_OBJS=meta/adx_header.o \
|
|||||||
meta/ps2_smpl.o \
|
meta/ps2_smpl.o \
|
||||||
meta/ps2_msa.o \
|
meta/ps2_msa.o \
|
||||||
meta/pc_smp.o \
|
meta/pc_smp.o \
|
||||||
meta/p3d.o
|
meta/p3d.o \
|
||||||
|
meta/ps2_tk1.o \
|
||||||
|
meta/ps2_adsc.o
|
||||||
|
|
||||||
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
|
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
|
||||||
|
|
||||||
libvgmstream.a: $(OBJECTS)
|
libvgmstream.a: $(OBJECTS)
|
||||||
|
@ -534,6 +534,10 @@
|
|||||||
RelativePath=".\meta\ps2_ads.c"
|
RelativePath=".\meta\ps2_ads.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\meta\ps2_adsc.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\meta\ps2_ass.c"
|
RelativePath=".\meta\ps2_ass.c"
|
||||||
>
|
>
|
||||||
|
@ -189,5 +189,6 @@ libmeta_la_SOURCES += ps2_smpl.c
|
|||||||
libmeta_la_SOURCES += ps2_msa.c
|
libmeta_la_SOURCES += ps2_msa.c
|
||||||
libmeta_la_SOURCES += pc_smp.c
|
libmeta_la_SOURCES += pc_smp.c
|
||||||
libmeta_la_SOURCES += p3d.c
|
libmeta_la_SOURCES += p3d.c
|
||||||
|
libmeta_la_SOURCES += ps2_adsc.c
|
||||||
|
|
||||||
EXTRA_DIST = meta.h
|
EXTRA_DIST = meta.h
|
||||||
|
@ -463,4 +463,8 @@ VGMSTREAM * init_vgmstream_pc_smp(STREAMFILE* streamFile);
|
|||||||
|
|
||||||
VGMSTREAM * init_vgmstream_p3d(STREAMFILE* streamFile);
|
VGMSTREAM * init_vgmstream_p3d(STREAMFILE* streamFile);
|
||||||
|
|
||||||
|
VGMSTREAM * init_vgmstream_ps2_tk1(STREAMFILE* streamFile);
|
||||||
|
|
||||||
|
VGMSTREAM * init_vgmstream_ps2_adsc(STREAMFILE* streamFile);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
63
src/meta/ps2_adsc.c
Normal file
63
src/meta/ps2_adsc.c
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#include "meta.h"
|
||||||
|
#include "../util.h"
|
||||||
|
|
||||||
|
/* ADSC (from Kenka Bancho 2: Full Throttle) */
|
||||||
|
VGMSTREAM * init_vgmstream_ps2_adsc(STREAMFILE *streamFile) {
|
||||||
|
VGMSTREAM * vgmstream = NULL;
|
||||||
|
char filename[260];
|
||||||
|
off_t start_offset;
|
||||||
|
|
||||||
|
int loop_flag;
|
||||||
|
int channel_count;
|
||||||
|
|
||||||
|
/* check extension, case insensitive */
|
||||||
|
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||||
|
if (strcasecmp("ads",filename_extension(filename))) goto fail;
|
||||||
|
|
||||||
|
/* check header */
|
||||||
|
if (read_32bitBE(0x00,streamFile) != 0x41445343) /* ADSC */
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
loop_flag = 0;
|
||||||
|
channel_count = read_32bitLE(0x18,streamFile);
|
||||||
|
|
||||||
|
/* build the VGMSTREAM */
|
||||||
|
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||||
|
if (!vgmstream) goto fail;
|
||||||
|
|
||||||
|
/* fill in the vital statistics */
|
||||||
|
start_offset = 0x1000;
|
||||||
|
vgmstream->channels = channel_count;
|
||||||
|
vgmstream->sample_rate = read_32bitLE(0x14,streamFile);
|
||||||
|
vgmstream->coding_type = coding_PSX;
|
||||||
|
if(read_32bitLE(0x18,streamFile)==0x01)
|
||||||
|
vgmstream->num_samples = read_32bitLE(0x2c,streamFile)*56/32;
|
||||||
|
else
|
||||||
|
vgmstream->num_samples = read_32bitLE(0x2c,streamFile)*28/32;
|
||||||
|
vgmstream->layout_type = layout_interleave;
|
||||||
|
vgmstream->interleave_block_size = 0x400;
|
||||||
|
vgmstream->meta_type = meta_PS2_ADSC;
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
}
|
@ -1,75 +1,129 @@
|
|||||||
|
|
||||||
#include "meta.h"
|
#include "meta.h"
|
||||||
#include "../util.h"
|
#include "../util.h"
|
||||||
|
|
||||||
/* TK5 (Tekken 5 Streams) */
|
/* TK5 (Tekken 5 Streams) */
|
||||||
VGMSTREAM * init_vgmstream_ps2_tk5(STREAMFILE *streamFile) {
|
VGMSTREAM * init_vgmstream_ps2_tk5(STREAMFILE *streamFile) {
|
||||||
VGMSTREAM * vgmstream = NULL;
|
VGMSTREAM * vgmstream = NULL;
|
||||||
char filename[260];
|
char filename[260];
|
||||||
off_t start_offset;
|
off_t start_offset;
|
||||||
int loop_flag = 0;
|
int loop_flag = 0;
|
||||||
int channel_count;
|
int channel_count;
|
||||||
int freq_switch;
|
|
||||||
|
/* check extension, case insensitive */
|
||||||
/* check extension, case insensitive */
|
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
if (strcasecmp("tk5",filename_extension(filename))) goto fail;
|
||||||
if (strcasecmp("tk5",filename_extension(filename))) goto fail;
|
|
||||||
|
/* check header */
|
||||||
/* check header */
|
if (read_32bitBE(0x00,streamFile) != 0x544B3553)
|
||||||
if (read_32bitBE(0x00,streamFile) != 0x544B3553)
|
goto fail;
|
||||||
goto fail;
|
|
||||||
|
loop_flag = (read_32bitLE(0x0C,streamFile)!=0);
|
||||||
loop_flag = (read_32bitLE(0x0C,streamFile)!=0);
|
channel_count = 2;
|
||||||
channel_count = 2;
|
|
||||||
|
/* build the VGMSTREAM */
|
||||||
/* build the VGMSTREAM */
|
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
if (!vgmstream) goto fail;
|
||||||
if (!vgmstream) goto fail;
|
|
||||||
|
/* fill in the vital statistics */
|
||||||
/* fill in the vital statistics */
|
start_offset = 0x800;
|
||||||
start_offset = 0x800;
|
vgmstream->channels = channel_count;
|
||||||
vgmstream->channels = channel_count;
|
vgmstream->sample_rate = 48000;
|
||||||
freq_switch = read_16bitLE(0x7,streamFile);
|
vgmstream->coding_type = coding_PSX_badflags;
|
||||||
switch (freq_switch){
|
vgmstream->num_samples = ((get_streamfile_size(streamFile)-0x800))/16*28/2;
|
||||||
case 0x30:
|
vgmstream->layout_type = layout_interleave;
|
||||||
vgmstream->sample_rate = 48000;
|
vgmstream->interleave_block_size = 0x10;
|
||||||
break;
|
vgmstream->meta_type = meta_PS2_TK5;
|
||||||
case 0x31:
|
|
||||||
vgmstream->sample_rate = 44100;
|
if (vgmstream->loop_flag)
|
||||||
break;
|
{
|
||||||
}
|
vgmstream->loop_start_sample = read_32bitLE(0x08,streamFile)/16*28;
|
||||||
vgmstream->coding_type = coding_PSX_badflags;
|
vgmstream->loop_end_sample = vgmstream->loop_start_sample + (read_32bitLE(0x0C,streamFile)/16*28);
|
||||||
vgmstream->num_samples = ((get_streamfile_size(streamFile)-0x800))/16*28/2;
|
}
|
||||||
vgmstream->layout_type = layout_interleave;
|
|
||||||
vgmstream->interleave_block_size = 0x10;
|
/* open the file for reading */
|
||||||
vgmstream->meta_type = meta_PS2_TK5;
|
{
|
||||||
|
int i;
|
||||||
if (vgmstream->loop_flag)
|
STREAMFILE * file;
|
||||||
{
|
file = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
|
||||||
vgmstream->loop_start_sample = read_32bitLE(0x08,streamFile)/16*28;
|
if (!file) goto fail;
|
||||||
vgmstream->loop_end_sample = vgmstream->loop_start_sample + (read_32bitLE(0x0C,streamFile)/16*28);
|
for (i=0;i<channel_count;i++) {
|
||||||
}
|
vgmstream->ch[i].streamfile = file;
|
||||||
|
|
||||||
/* open the file for reading */
|
vgmstream->ch[i].channel_start_offset=
|
||||||
{
|
vgmstream->ch[i].offset=start_offset+
|
||||||
int i;
|
vgmstream->interleave_block_size*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;
|
return vgmstream;
|
||||||
|
|
||||||
vgmstream->ch[i].channel_start_offset=
|
/* clean up anything we may have opened */
|
||||||
vgmstream->ch[i].offset=start_offset+
|
fail:
|
||||||
vgmstream->interleave_block_size*i;
|
if (vgmstream) close_vgmstream(vgmstream);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/* TK1 (Tekken 5 Streams from Tekken (NamCollection)) */
|
||||||
return vgmstream;
|
VGMSTREAM * init_vgmstream_ps2_tk1(STREAMFILE *streamFile) {
|
||||||
|
VGMSTREAM * vgmstream = NULL;
|
||||||
/* clean up anything we may have opened */
|
char filename[260];
|
||||||
fail:
|
off_t start_offset;
|
||||||
if (vgmstream) close_vgmstream(vgmstream);
|
int loop_flag = 0;
|
||||||
return NULL;
|
int channel_count;
|
||||||
}
|
|
||||||
|
/* check extension, case insensitive */
|
||||||
|
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||||
|
if (strcasecmp("tk1",filename_extension(filename))) goto fail;
|
||||||
|
|
||||||
|
/* check header */
|
||||||
|
if (read_32bitBE(0x00,streamFile) != 0x544B3553)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
loop_flag = (read_32bitLE(0x0C,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 = 0x800;
|
||||||
|
vgmstream->channels = channel_count;
|
||||||
|
vgmstream->sample_rate = 44100;
|
||||||
|
vgmstream->coding_type = coding_PSX_badflags;
|
||||||
|
vgmstream->num_samples = read_32bitLE(0x08,streamFile)/16*28;
|
||||||
|
vgmstream->layout_type = layout_interleave;
|
||||||
|
vgmstream->interleave_block_size = 0x10;
|
||||||
|
vgmstream->meta_type = meta_PS2_TK1;
|
||||||
|
|
||||||
|
if (vgmstream->loop_flag)
|
||||||
|
{
|
||||||
|
vgmstream->loop_start_sample = read_32bitLE(0x08,streamFile)/16*28;
|
||||||
|
vgmstream->loop_end_sample = vgmstream->loop_start_sample + (read_32bitLE(0x0C,streamFile)/16*28);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
}
|
||||||
|
@ -254,6 +254,8 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
|||||||
init_vgmstream_ps2_msa,
|
init_vgmstream_ps2_msa,
|
||||||
init_vgmstream_pc_smp,
|
init_vgmstream_pc_smp,
|
||||||
init_vgmstream_p3d,
|
init_vgmstream_p3d,
|
||||||
|
init_vgmstream_ps2_tk1,
|
||||||
|
init_vgmstream_ps2_adsc,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
|
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
|
||||||
@ -2521,6 +2523,12 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
|||||||
break;
|
break;
|
||||||
case meta_P3D:
|
case meta_P3D:
|
||||||
snprintf(temp,TEMPSIZE,"P3D Header");
|
snprintf(temp,TEMPSIZE,"P3D Header");
|
||||||
|
break;
|
||||||
|
case meta_PS2_TK1:
|
||||||
|
snprintf(temp,TEMPSIZE,"Tekken TK5STRM1 Header");
|
||||||
|
break;
|
||||||
|
case meta_PS2_ADSC:
|
||||||
|
snprintf(temp,TEMPSIZE,"ADSC Header");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
||||||
|
@ -453,6 +453,8 @@ typedef enum {
|
|||||||
meta_PS2_MSA, /* Psyvariar -Complete Edition- */
|
meta_PS2_MSA, /* Psyvariar -Complete Edition- */
|
||||||
meta_PC_SMP, /* unknown PC game .smp */
|
meta_PC_SMP, /* unknown PC game .smp */
|
||||||
meta_P3D, /* Prototype P3D */
|
meta_P3D, /* Prototype P3D */
|
||||||
|
meta_PS2_TK1, /* Tekken (NamCollection) */
|
||||||
|
meta_PS2_ADSC, /* Kenka Bancho 2: Full Throttle */
|
||||||
} meta_t;
|
} meta_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -191,6 +191,7 @@ gchar *vgmstream_exts [] = {
|
|||||||
|
|
||||||
"tec",
|
"tec",
|
||||||
"thp",
|
"thp",
|
||||||
|
"tk1",
|
||||||
"tk5",
|
"tk5",
|
||||||
"tydsp",
|
"tydsp",
|
||||||
|
|
||||||
|
@ -259,6 +259,7 @@ char * extension_list[] = {
|
|||||||
|
|
||||||
"tec\0TEC Audio File (*.TEC)\0",
|
"tec\0TEC Audio File (*.TEC)\0",
|
||||||
"thp\0THP Audio File (*.THP)\0",
|
"thp\0THP Audio File (*.THP)\0",
|
||||||
|
"tk1\0TK1 Audio File (*.TK1)\0",
|
||||||
"tk5\0TK5 Audio File (*.TK5)\0",
|
"tk5\0TK5 Audio File (*.TK5)\0",
|
||||||
"tydsp\0TYDSP Audio File (*.TYDSP)\0",
|
"tydsp\0TYDSP Audio File (*.TYDSP)\0",
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user