Update to build with mingw, added at3plus support to Winamp plugin, Capcom mca, WiiU btsnd, MH3U dspw

This commit is contained in:
soneek 2015-01-21 19:28:43 -05:00
parent 6e4abd55e3
commit 46f21d977b
19 changed files with 645 additions and 104 deletions

View File

@ -4,7 +4,8 @@ buildrelease: clean sourceball mingwbin
sourceball:
rm -rf vgmstream-`./version.sh`
svn export . vgmstream-`./version.sh`
git checkout-index -f -a --prefix=vgmstream-`./version.sh`/
# git archive --format zip --output vgmstream-`./version.sh`.zip master
echo "#!/bin/sh" > vgmstream-`./version.sh`/version.sh
echo "echo \"`./version.sh`\"" >> vgmstream-`./version.sh`/version.sh
tar cvzf "vgmstream-`./version.sh`.tar.gz" vgmstream-`./version.sh`/*

View File

@ -1,5 +1,6 @@
export SHELL = /bin/sh
export DLLTOOL=i586-mingw32msvc-dlltool
#export DLLTOOL=i686-w64-mingw32-dlltool
libvorbis.a: libvorbis.def
$(DLLTOOL) -d libvorbis.def -l libvorbis.a
@ -10,5 +11,8 @@ libmpg123-0.a: libmpg123-0.def
libg7221_decode.a: libg7221_decode.def
$(DLLTOOL) -d libg7221_decode.def -l libg7221_decode.a
at3plusdecoder.a: at3plusdecoder.def
$(DLLTOOL) -d at3plusdecoder.def -l at3plusdecoder.a
clean:
rm -f libvorbis.a libmpg123-0.a libg7221_decode.a
rm -f libvorbis.a libmpg123-0.a libg7221_decode.a libat3plusdecoder.a

View File

@ -311,6 +311,7 @@ bool input_vgmstream::g_is_our_path(const char * p_path,const char * p_extension
if(!stricmp_utf8(p_extension,"bo2")) return 1;
if(!stricmp_utf8(p_extension,"brstmspm")) return 1;
if(!stricmp_utf8(p_extension,"brstm")) return 1;
if(!stricmp_utf8(p_extension,"btsnd")) return 1;
if(!stricmp_utf8(p_extension,"bvg")) return 1;
if(!stricmp_utf8(p_extension,"caf")) return 1;
@ -387,6 +388,7 @@ bool input_vgmstream::g_is_our_path(const char * p_path,const char * p_extension
if(!stricmp_utf8(p_extension,"lwav")) return 1;
if(!stricmp_utf8(p_extension,"matx")) return 1;
if(!stricmp_utf8(p_extension,"mca")) return 1;
if(!stricmp_utf8(p_extension,"mcg")) return 1;
if(!stricmp_utf8(p_extension,"mi4")) return 1;
if(!stricmp_utf8(p_extension,"mib")) return 1;
@ -641,6 +643,7 @@ DECLARE_MULTIPLE_FILE_TYPE("BNSF Audio File (*.BNSF)", bnsf);
DECLARE_MULTIPLE_FILE_TYPE("BO2 Audio File (*.BO2)", bo2);
DECLARE_MULTIPLE_FILE_TYPE("BRSTM Audio File (*.BRSTM)", brstm);
DECLARE_MULTIPLE_FILE_TYPE("BRSTM Audio File [2] (*.BRSTM)", brstmspm);
DECLARE_MULTIPLE_FILE_TYPE("BTSND Audio File (*.BTSND)", btsnd);
DECLARE_MULTIPLE_FILE_TYPE("BVG Audio File (*.BVG)", bvg);
DECLARE_MULTIPLE_FILE_TYPE("CAF Audio File (*.CAF)", caf);
@ -715,6 +718,7 @@ DECLARE_MULTIPLE_FILE_TYPE("LSF Audio File (*.LSF)", lsf);
DECLARE_MULTIPLE_FILE_TYPE("LWAV Audio File (*.LWAV)", lwav);
DECLARE_MULTIPLE_FILE_TYPE("MATX Audio File (*.MATX)", matx);
DECLARE_MULTIPLE_FILE_TYPE("MCA Audio File (*.MCA)", mca);
DECLARE_MULTIPLE_FILE_TYPE("MCG Audio File (*.MCG)", mcg);
DECLARE_MULTIPLE_FILE_TYPE("PS2 MI4 Audio File (*.MI4)", mi4);
DECLARE_MULTIPLE_FILE_TYPE("PS2 MIB Audio File (*.MIB)", mib);

View File

@ -10,7 +10,7 @@ Since Ogg Vorbis, MPEG audio, and G.722.1 are now supported, you will need to
have libvorbis.dll, libmpg123-0.dll, and libg7221_decode.dll.
You can get these from http://hcs64.com/files/vgmstream_external_dlls.zip
Put libvorbis.dll, libmpg123-0.dll, and libg7221_decode.dll somewhere Windows
Put libvorbis.dll, libmpg123-0.dll, libg7221_decode.dll, and at3plusdecoder.dll somewhere Windows
can find them.
For in_vgmstream this means in the directory with winamp.exe, or in a
system directory. For test.exe this means in the same directory as test.exe,

View File

@ -20,8 +20,9 @@ CODING_OBJS=coding/adx_decoder.o \
coding/l5_555_decoder.o \
coding/SASSC_decoder.o \
coding/g7221_decoder.o \
coding/lsf_decoder.o\
coding/mtaf_decoder.o
coding/lsf_decoder.o \
coding/mtaf_decoder.o \
coding/at3_decoder.o
LAYOUT_OBJS=layout/ast_blocked.o \
layout/blocked.o \
@ -296,7 +297,9 @@ META_OBJS=meta/adx_header.o \
meta/bcstm.o \
meta/bfstm.o \
meta/bfwav.o \
meta/g1l.o
meta/g1l.o \
meta/mca.o \
meta/btsnd.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)

View File

@ -240,7 +240,9 @@ libmeta_la_SOURCES += otm.c
libmeta_la_SOURCES += bcstm.c
libmeta_la_SOURCES += bfwav.c
libmeta_la_SOURCES += bfstm.c
libmeta_la_SOURCES += g1l.c
libmeta_la_SOURCES += g1l.c
libmeta_la_SOURCES += ps2_vbk.c
libmeta_la_SOURCES += mca.c
libmeta_la_SOURCES += btsnd.c
EXTRA_DIST = meta.h

69
src/meta/btsnd.c Normal file
View File

@ -0,0 +1,69 @@
/*
Wii U boot sound file for each game/app.
*/
#include "meta.h"
#include "../util.h"
VGMSTREAM * init_vgmstream_btsnd(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[PATH_LIMIT];
coding_t coding_type;
int channel_count = 2;
int loop_flag;
off_t start_offset = 0x8;
/* check extension, case insensitive */
streamFile->get_name(streamFile, filename, sizeof(filename));
if (strcasecmp("btsnd", filename_extension(filename)))
goto fail;
/* Checking for loop start */
if (read_32bitBE(0x4, streamFile) > 0)
loop_flag = 1;
else
loop_flag = 0;
if (channel_count < 1) goto fail;
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count, loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
vgmstream->sample_rate = 48000;
/* channels and loop flag are set by allocate_vgmstream */
// There's probably a better way to get the sample count...
vgmstream->num_samples = vgmstream->loop_end_sample = (get_streamfile_size(streamFile) - 8) / 4;
vgmstream->loop_start_sample = read_32bitBE(0x4, streamFile);
vgmstream->coding_type = coding_PCM16BE;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x2; // Constant for this format
vgmstream->meta_type = meta_WIIU_BTSND;
/* open the file for reading by each channel */
{
int i;
for (i = 0; i<channel_count; i++) {
vgmstream->ch[i].streamfile = streamFile->open(streamFile, filename,
STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!vgmstream->ch[i].streamfile) goto fail;
vgmstream->ch[i].channel_start_offset =
vgmstream->ch[i].offset =
start_offset + i*vgmstream->interleave_block_size;
}
}
return vgmstream;
/* clean up anything we may have opened */
fail:
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
}

View File

@ -1,6 +1,6 @@
#include "meta.h"
#include "../util.h"
// Koei Tecmo G1L, found in the Warriors games
VGMSTREAM * init_vgmstream_g1l(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[PATH_LIMIT];
@ -26,7 +26,6 @@ VGMSTREAM * init_vgmstream_g1l(STREAMFILE *streamFile) {
goto fail;
/* check type details */
// loop_flag = read_8bit(head_offset + 0x21, streamFile);
if (read_32bitBE(0x30, streamFile) > 0)
loop_flag = 1;
else
@ -69,17 +68,21 @@ VGMSTREAM * init_vgmstream_g1l(STREAMFILE *streamFile) {
int i, j;
int coef_spacing = 0x60;
for (j = 0; j<vgmstream->channels; j++) {
for (i = 0; i<16; i++) {
vgmstream->ch[j].adpcm_coef[i] = read_16bitBE(coef_offset + j*coef_spacing + i * 2, streamFile);
}
}
start_offset = 0x81c;
}
if (vgmstream->coding_type == coding_NGC_DSP)
start_offset = 0x81c;
else // Will add AT3 G1L support later
#ifdef VGM_USE_MAIATRAC3PLUS
else if (vgmstream->coding_type == coding_AT3plus) {
start_offset = 0xc4;
}
#endif
else
goto fail;

100
src/meta/mca.c Normal file
View File

@ -0,0 +1,100 @@
/*
Capcom MADP format found in Capcom 3DS games.
*/
#include "meta.h"
#include "../util.h"
VGMSTREAM * init_vgmstream_mca(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[PATH_LIMIT];
coding_t coding_type;
int channel_count;
int loop_flag;
off_t start_offset;
/* check extension, case insensitive */
streamFile->get_name(streamFile, filename, sizeof(filename));
if (strcasecmp("mca", filename_extension(filename)))
goto fail;
/* check header */
if ((uint32_t)read_32bitBE(0, streamFile) != 0x4D414450) /* "MADP" */
goto fail;
start_offset = (get_streamfile_size(streamFile) - read_32bitLE(0x20, streamFile));
channel_count = read_8bit(0x8, streamFile);
if (read_32bitLE(0x18, streamFile) > 0)
loop_flag = 1;
else
loop_flag = 0;
coding_type = coding_NGC_DSP;
if (channel_count < 1) goto fail;
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count, loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
vgmstream->num_samples = read_32bitLE(0xc, streamFile);
vgmstream->sample_rate = (uint16_t)read_16bitLE(0x10, streamFile);
/* channels and loop flag are set by allocate_vgmstream */
vgmstream->loop_start_sample = read_32bitLE(0x14, streamFile);
vgmstream->loop_end_sample = read_32bitLE(0x18, streamFile);
vgmstream->coding_type = coding_type;
if (channel_count == 1)
vgmstream->layout_type = layout_none;
else
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x100; // Constant for this format
vgmstream->meta_type = meta_MCA;
off_t coef_offset = start_offset - (vgmstream->channels * 0x30);
int i, j;
int coef_spacing = 0x30;
for (j = 0; j<vgmstream->channels; j++) {
for (i = 0; i<16; i++) {
vgmstream->ch[j].adpcm_coef[i] = read_16bitLE(coef_offset + j*coef_spacing + i * 2, streamFile);
}
}
/* open the file for reading by each channel */
{
int i;
for (i = 0; i<channel_count; i++) {
if (vgmstream->layout_type == layout_interleave_shortblock)
vgmstream->ch[i].streamfile = streamFile->open(streamFile, filename,
vgmstream->interleave_block_size);
else if (vgmstream->layout_type == layout_interleave)
vgmstream->ch[i].streamfile = streamFile->open(streamFile, filename,
STREAMFILE_DEFAULT_BUFFER_SIZE);
else
vgmstream->ch[i].streamfile = streamFile->open(streamFile, filename,
0x1000);
if (!vgmstream->ch[i].streamfile) goto fail;
vgmstream->ch[i].channel_start_offset =
vgmstream->ch[i].offset =
start_offset + i*vgmstream->interleave_block_size;
}
}
return vgmstream;
/* clean up anything we may have opened */
fail:
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
}

View File

@ -642,4 +642,8 @@ VGMSTREAM * init_vgmstream_bfwav(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_g1l(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_mca(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_btsnd(STREAMFILE* streamFile);
#endif

View File

@ -2366,117 +2366,129 @@ fail:
}
/* .dspw files, two DSP files stuck together */
/* .dspw files, multiple DSP files stuck together */
/* found in Sengoku Basara 3 Wii */
VGMSTREAM * init_vgmstream_dsp_dspw(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[PATH_LIMIT];
off_t channel_1_start, channel_2_start;
struct dsp_header ch0_header,ch1_header;
off_t streamSize, mrkrOffset, channelSpacing;
int channel_count, i, j;
int found_mrkr = 0;
channel_count = read_8bit(0x1B, streamFile);
struct dsp_header ch_header[channel_count];
off_t channel_start[channel_count];
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("dspw",filename_extension(filename))) goto fail;
if (strcasecmp("dspw",filename_extension(filename))) goto fail;
if (read_32bitBE(0x0,streamFile) != 0x44535057) // DSPW
goto fail;
goto fail;
streamSize = read_32bitBE(0x8, streamFile);
if (read_32bitBE(streamSize - 0x10, streamFile) == 0x74494D45) // tIME
streamSize -= 0x10;
mrkrOffset = streamSize - 4;
while ((mrkrOffset > streamSize - 0x1000) && !(found_mrkr)) { // some files have a mrkr section with multiple loop regions at the end
if (read_32bitBE(mrkrOffset, streamFile) != 0x6D726B72) // mrkr
mrkrOffset -= 4;
else {
streamSize = mrkrOffset;
found_mrkr++;
}
}
streamSize -= 0x20; // minus the main header
channelSpacing = streamSize / channel_count;
/* read .dspw header */
channel_1_start = 0x20;
channel_2_start = (get_streamfile_size(streamFile)/2)+0x10;
for (i = 0; i < channel_count; i++) {
channel_start[i] = 0x20 + i*channelSpacing;
/* get DSP headers */
if (read_dsp_header(&ch0_header, channel_1_start, streamFile)) goto fail;
if (read_dsp_header(&ch1_header, channel_2_start, streamFile)) goto fail;
/* get DSP headers */
if (read_dsp_header(&ch_header[i], channel_start[i], streamFile)) goto fail;
/* check initial predictor/scale */
if (ch0_header.initial_ps !=
(uint8_t)read_8bit(channel_1_start + 0x60, streamFile))
goto fail;
/* check initial predictor/scale */
if (ch_header[i].initial_ps !=
(uint8_t)read_8bit(channel_start[i] + 0x60, streamFile))
goto fail;
if (ch1_header.initial_ps !=
(uint8_t)read_8bit(channel_2_start + 0x60, streamFile))
goto fail;
/* check type==0 and gain==0 */
if (ch0_header.format || ch0_header.gain ||
ch1_header.format || ch1_header.gain)
goto fail;
/* check for agreement */
if (
ch0_header.sample_count != ch1_header.sample_count ||
ch0_header.nibble_count != ch1_header.nibble_count ||
ch0_header.sample_rate != ch1_header.sample_rate ||
ch0_header.loop_flag != ch1_header.loop_flag ||
ch0_header.loop_start_offset != ch1_header.loop_start_offset ||
ch0_header.loop_end_offset != ch1_header.loop_end_offset
) goto fail;
if (ch0_header.loop_flag) {
off_t loop_off;
/* check loop predictor/scale */
loop_off = ch0_header.loop_start_offset/16*8;
if (ch0_header.loop_ps !=
(uint8_t)read_8bit(channel_1_start+0x60+loop_off,streamFile))
goto fail;
if (ch1_header.loop_ps !=
(uint8_t)read_8bit(channel_2_start+0x60+loop_off,streamFile))
goto fail;
}
/* check type==0 and gain==0 */
if (ch_header[i].format || ch_header[i].gain)
goto fail;
/* check for agreement */
if (i > 0) {
if (
ch_header[i].sample_count != ch_header[i-1].sample_count ||
ch_header[i].nibble_count != ch_header[i-1].nibble_count ||
ch_header[i].sample_rate != ch_header[i-1].sample_rate ||
ch_header[i].loop_flag != ch_header[i-1].loop_flag ||
ch_header[i].loop_start_offset != ch_header[i-1].loop_start_offset ||
ch_header[i].loop_end_offset != ch_header[i-1].loop_end_offset
) goto fail;
}
if (ch_header[0].loop_flag) {
off_t loop_off;
/* check loop predictor/scale */
loop_off = ch_header[0].loop_start_offset/16*8;
if (ch_header[i].loop_ps !=
(uint8_t)read_8bit(channel_start[i]+0x60+loop_off,streamFile))
goto fail;
}
}
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(2,ch0_header.loop_flag);
vgmstream = allocate_vgmstream(channel_count,ch_header[0].loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
vgmstream->num_samples = ch0_header.sample_count;
vgmstream->sample_rate = ch0_header.sample_rate;
vgmstream->num_samples = ch_header[0].sample_count;
vgmstream->sample_rate = ch_header[0].sample_rate;
vgmstream->loop_start_sample = dsp_nibbles_to_samples(
ch0_header.loop_start_offset);
ch_header[0].loop_start_offset);
vgmstream->loop_end_sample = dsp_nibbles_to_samples(
ch0_header.loop_end_offset)+1;
ch_header[0].loop_end_offset)+1;
vgmstream->coding_type = coding_NGC_DSP;
vgmstream->layout_type = layout_none;
// vgmstream->layout_type = layout_interleave;
// vgmstream->interleave_block_size = channelSpacing;
vgmstream->meta_type = meta_DSP_DSPW;
/* coeffs */
{
int i;
for (i=0;i<16;i++) {
vgmstream->ch[0].adpcm_coef[i] = ch0_header.coef[i];
vgmstream->ch[1].adpcm_coef[i] = ch1_header.coef[i];
for (i=0;i<channel_count;i++){
for (j=0;j<16;j++) {
vgmstream->ch[i].adpcm_coef[j] = ch_header[i].coef[j];
}
/* initial history */
/* always 0 that I've ever seen, but for completeness... */
vgmstream->ch[i].adpcm_history1_16 = ch_header[i].initial_hist1;
vgmstream->ch[i].adpcm_history2_16 = ch_header[i].initial_hist2;
}
/* initial history */
/* always 0 that I've ever seen, but for completeness... */
vgmstream->ch[0].adpcm_history1_16 = ch0_header.initial_hist1;
vgmstream->ch[0].adpcm_history2_16 = ch0_header.initial_hist2;
vgmstream->ch[1].adpcm_history1_16 = ch1_header.initial_hist1;
vgmstream->ch[1].adpcm_history2_16 = ch1_header.initial_hist2;
/* open the file for reading */
vgmstream->ch[0].streamfile = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!vgmstream->ch[0].streamfile) goto fail;
for (i=0;i<channel_count;i++) {
vgmstream->ch[i].streamfile = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!vgmstream->ch[i].streamfile) goto fail;
vgmstream->ch[1].streamfile = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!vgmstream->ch[1].streamfile) goto fail;
vgmstream->ch[0].channel_start_offset =
vgmstream->ch[0].offset=channel_1_start+0x60;
vgmstream->ch[1].channel_start_offset =
vgmstream->ch[1].offset=channel_2_start+0x60;
vgmstream->ch[i].channel_start_offset =
vgmstream->ch[i].offset=channel_start[i]+0x60;
}
return vgmstream;
fail:
/* clean up anything we may have opened */
fail:
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
}

View File

@ -19,6 +19,8 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_brstm,
init_vgmstream_bfwav,
init_vgmstream_bfstm,
init_vgmstream_mca,
init_vgmstream_btsnd,
init_vgmstream_nds_strm,
init_vgmstream_agsc,
init_vgmstream_ngc_adpdtk,
@ -3083,9 +3085,15 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
case meta_G1L:
snprintf(temp,TEMPSIZE,"Tecmo Koei G1L Header");
break;
case meta_3DS_IDSP:
case meta_3DS_IDSP:
snprintf(temp,TEMPSIZE,"Nintendo 3DS IDSP Header");
break;
case meta_WIIU_BTSND:
snprintf(temp,TEMPSIZE,"Wii U Menu Boot Sound");
break;
case meta_MCA:
snprintf(temp,TEMPSIZE,"Capcom MCA Header");
break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
}

View File

@ -39,7 +39,7 @@ enum { PATH_LIMIT = 32768 };
#endif
#ifdef VGM_USE_MAIATRAC3PLUS
#include <maiatrac3plus.h>
#include "maiatrac3plus.h"
#endif
#include "coding/acm_decoder.h"
@ -250,6 +250,7 @@ typedef enum {
meta_NDS_RRDS, /* Ridge Racer DS */
meta_WII_BNS, /* Wii BNS Banner Sound (similar to RSTM) */
meta_STX, /* Pikmin .stx */
meta_WIIU_BTSND, /* Wii U Boot Sound */
/* CRI ADX */
meta_ADX_03, /* ADX "type 03" */
@ -571,6 +572,7 @@ typedef enum {
meta_FSTM, // Nintendo Wii U FSTM
meta_3DS_IDSP, // Nintendo 3DS IDSP
meta_G1L, // Tecmo Koei G1L
meta_MCA, // Capcom MCA "MADP"
#ifdef VGM_USE_MP4V2
meta_MP4,
#endif

View File

@ -1,18 +1,18 @@
export SHELL = /bin/sh
export CFLAGS=-Wall -ggdb
export LDFLAGS= -L../src -lvgmstream -lvorbisfile -lmpg123 -lm
export CFLAGS=-Wall -O3 -I../ext_includes
export LDFLAGS=-L../src -L ../ext_libs -lvgmstream -lvorbisfile -lmpg123 -lm
export CC=gcc
export AR=ar
export STRIP=strip
.PHONY: libvgmstream.a
test: libvgmstream.a test.o
$(CC) test.o $(LDFLAGS) $(CFLAGS) -o test
test.o: test.c
$(CC) $(CFLAGS) -c "-DVERSION=\"`../version.sh`\"" test.c -o test.o
test.exe: libvgmstream.a
$(CC) $(CFLAGS) $(LDFLAGS) "-DVERSION=\"`../version.sh`\"" test.c $(LDFLAGS) -o test
$(STRIP) test
libvgmstream.a:
$(MAKE) -C ../src libvgmstream.a
$(MAKE) -C ../src $@
clean:
rm -f test test.o

View File

@ -1,13 +1,16 @@
export SHELL = /bin/sh
export CFLAGS=-Wall -O3 -DVGM_USE_G7221 -I../ext_includes
export LDFLAGS=-L../src -L../ext_libs -lvgmstream -lvorbis -lmpg123-0 -lg7221_decode -lm
export CFLAGS=-Wall -O3 -DVGM_USE_G7221 -DVGM_USE_MAIATRAC3PLUS -I../ext_includes
export LDFLAGS=-L../src -L../ext_libs -lvgmstream -lvorbis -lmpg123-0 -lg7221_decode -lat3plusdecoder -lm
export CC=i586-mingw32msvc-gcc
export AR=i586-mingw32msvc-ar
export STRIP=i586-mingw32msvc-strip
#export CC=i686-w64-mingw32-gcc
#export AR=i686-w64-mingw32-ar
#export STRIP=i686-w64-mingw32-strip
.PHONY: libvgmstream.a libvorbis.a libmpg123-0.a libg7221_decode.a
.PHONY: libvgmstream.a libvorbis.a libmpg123-0.a libg7221_decode.a at3plusdecoder.a
test.exe: libvgmstream.a libvorbis.a libmpg123-0.a libg7221_decode.a
test.exe: libvgmstream.a libvorbis.a libmpg123-0.a libg7221_decode.a at3plusdecoder.a
$(CC) $(CFLAGS) "-DVERSION=\"`../version.sh`\"" test.c $(LDFLAGS) -o test.exe
$(STRIP) test.exe
@ -23,5 +26,7 @@ libmpg123-0.a:
libg7221_decode.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
at3plusdecoder.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
clean:
rm -f test.exe

313
unix/data.c Normal file
View File

@ -0,0 +1,313 @@
#include <audacious/util.h>
void vgmstream_init();
void vgmstream_about();
void vgmstream_configure();
void vgmstream_destroy();
void vgmstream_play(InputPlayback *context);
void vgmstream_stop(InputPlayback *context);
void vgmstream_pause(InputPlayback *context,gshort paused);
void vgmstream_seek(InputPlayback *context,gint time);
int vgmstream_get_time(InputPlayback *context);
void vgmstream_mseek(InputPlayback *context,gulong ms);
void vgmstream_file_info_box(const gchar *pFile);
Tuple * vgmstream_probe_for_tuple(const gchar *uri, VFSFile *fd);
gchar *vgmstream_exts [] = {
"2dx9",
"2pfs",
"aax",
"acm",
"adm",
"adp",
"adpcm",
"ads",
"adx",
"afc",
"agsc",
"ahx",
"aifc",
"aix",
"amts",
"as4",
"asd",
"asf",
"asr",
"ass",
"ast",
"aud",
"aus",
"baka",
"baf",
"bar",
"bcstm",
"bcwav",
"bfstm",
"bfwav",
"bg00",
"bgw",
"bh2pcm",
"bmdx",
"bms",
"bns",
"bnsf",
"bo2",
"brstm",
"brstmspm",
"btsnd",
"bvg",
"caf",
"capdsp",
"cbd2",
"ccc",
"cfn",
"ckd",
"cnk",
"cps",
"dcs",
"de2",
"ddsp",
"dmsg",
"dsp",
"dspw",
"dtk",
"dvi",
"dxh",
"eam",
"emff",
"enth",
"fag",
"filp",
"fsb",
"g1l",
"gbts",
"gca",
"gcm",
"gcub",
"gcw",
"genh",
"gms",
"gsb",
"hgc1",
"his",
"hlwav",
"hps",
"hsf",
"hwas",
"iab",
"idsp",
"idvi",
"ikm",
"ild",
"int",
"isd",
"ivaud",
"ivag",
"ivb",
"joe",
"jstm",
"kces",
"kcey",
"khv",
"klbs",
"kovs",
"kraw",
"leg",
"logg",
"lpcm",
"lps",
"lsf",
"lwav",
"matx",
"mca",
"mcg",
"mi4",
"mib",
"mic",
"mihb",
"mpdsp",
"mpds",
"msa",
"msf",
"mss",
"msvp",
"mtaf",
"mus",
"musc",
"musx",
"mwv",
"mxst",
"myspd",
"ndp",
"ngca",
"npsf",
"nwa",
"omu",
"otm",
"p2bt",
"p3d",
"past",
"pcm",
"pdt",
"pnb",
"pos",
"ps2stm",
"psh",
"psnd",
"psw",
"ras",
"raw",
"rkv",
"rnd",
"rrds",
"rsd",
"rsf",
"rstm",
"rvws",
"rwar",
"rwav",
"rws",
"rwsd",
"rwx",
"rxw",
"s14",
"sab",
"sad",
"sap",
"sc",
"scd",
"sck",
"sd9",
"sdt",
"seg",
"sf0",
"sfl",
"sfs",
"sfx",
"sgb",
"sgd",
"sl3",
"sli",
"smp",
"smpl",
"snd",
"snds",
"sng",
"sns",
"spd",
"spm",
"sps",
"spsd",
"spw",
"ss2",
"ss3",
"ss7",
"ssm",
"sss",
"ster",
"stma",
"str",
"strm",
"sts",
"stx",
"svag",
"svs",
"swav",
"swd",
"tec",
"thp",
"tk1",
"tk5",
"tra",
"tun",
"tydsp",
"um3",
"vag",
"vas",
"vawx",
"vb",
"vbk",
"vgs",
"vgv",
"vig",
"vms",
"voi",
"vpk",
"vs",
"vsf",
"waa",
"wac",
"wad",
"wam",
"wavm",
"wb",
"wii",
"wmus",
"wp2",
"wpd",
"wsd",
"wsi",
"wvs",
"xa",
"xa2",
"xa30",
"xau",
"xmu",
"xnb",
"xsf",
"xss",
"xvag",
"xvas",
"xwav",
"xwb",
"ydsp",
"ymf",
"zsd",
"zwdsp",
/* terminator */
NULL
};
InputPlugin vgmstream_iplug = {
.description = "VGMStream Decoder",
.init = vgmstream_init,
.about = vgmstream_about,
.configure = vgmstream_configure,
.cleanup = vgmstream_destroy,
.probe_for_tuple = vgmstream_probe_for_tuple,
.play_file = vgmstream_play,
.stop = vgmstream_stop,
.pause = vgmstream_pause,
.seek = vgmstream_seek,
.vfs_extensions = vgmstream_exts,
.mseek = vgmstream_mseek,
.file_info_box = vgmstream_file_info_box,
};

View File

@ -1,4 +1,4 @@
#!/bin/sh
DIR="`dirname "$0"`"
VERSION="`svnversion "$DIR" | tr : _`"
echo "r$VERSION"
VERSION="`git describe --always --tag | tr : _`"
echo "$VERSION"

View File

@ -1,12 +1,17 @@
export SHELL = /bin/sh
export CFLAGS=-Wall -O3 "-DVGM_USE_G7221" -I../ext_includes
export LDFLAGS=-L../src -L../ext_libs -lvgmstream -lvorbis -lmpg123-0 -lg7221_decode -lm
export CFLAGS=-Wall -O3 "-DVGM_USE_G7221" "-DVGM_USE_MAIATRAC3PLUS" -I../ext_includes
export LDFLAGS=-L../src -L../ext_libs -lvgmstream -lvorbis -lmpg123-0 -lg7221_decode -lat3plusdecoder -lm
export CC=i586-mingw32msvc-gcc
export AR=i586-mingw32msvc-ar
export STRIP=i586-mingw32msvc-strip
export WINDRES=i586-mingw32msvc-windres
.PHONY: libvgmstream.a libvorbis.a libmpg123-0.a libg7221_decode.a
#export CC=i686-w64-mingw32-gcc
#export AR=i686-w64-mingw32-ar
#export STRIP=i686-w64-mingw32-strip
#export WINDRES=i686-w64-mingw32-windres
.PHONY: libvgmstream.a libvorbis.a libmpg123-0.a libg7221_decode.a at3plusdecoder.a
in_vgmstream.dll: libvgmstream.a libvorbis.a libmpg123-0.a libg7221_decode.a in_vgmstream.c resource.o
$(CC) -shared -static-libgcc $(CFLAGS) "-DVERSION=\"`../version.sh`\"" in_vgmstream.c resource.o $(LDFLAGS) -o in_vgmstream.dll
@ -27,5 +32,8 @@ libmpg123-0.a:
libg7221_decode.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
at3plusdecoder.a:
$(MAKE) -C ../ext_libs -f Makefile.mingw $@
clean:
rm -f in_vgmstream.dll resource.o

View File

@ -99,9 +99,10 @@ char * extension_list[] = {
"ast\0AST Audio File (*.AST)\0",
"asr\0ASR Audio File (*.ASR)\0",
"ass\0ASS Audio File (*.ASS)\0",
"at3\0AT3 Audio File (*.AT3)\0",
"aud\0AUD Audio File (*.AUD)\0",
"aus\0AUS Audio File (*.AUS)\0",
"b1s\0B1S Audio File (*.B1S)\0",
"baka\0BAKA Audio File (*.BAKA)\0",
"baf\0BAF Audio File (*.BAF)\0",
@ -121,6 +122,7 @@ char * extension_list[] = {
"bnsf\0BNSF Audio File (*.BNSF)\0",
"bo2\0BO2 Audio File (*.BO2)\0",
"brstm;brstmspm\0BRSTM Audio File (*.BRSTM)\0",
"btsnd\0BTSND Audio File (*.BTSND)\0",
"bvg\0BVG Audio File (*.BVG)\0",
"caf\0CAF Audio File (*.CAF)\0",
@ -198,6 +200,7 @@ char * extension_list[] = {
"lwav\0LWAV Audio File (*.LWAV)\0",
"matx\0MATX Audio File (*.MATX)\0",
"mca\0MCA Audio File (*.MCA)\0",
"mcg\0MCG Audio File (*.MCG)\0",
"mi2\0PS2 MI2 Audio File (*.MI2)\0",
"mi4\0PS2 MI4 Audio File (*.MI4)\0",