Updated vgmstream
This commit is contained in:
parent
d70a5b5b88
commit
bb7fcd31da
3 changed files with 15 additions and 14 deletions
|
@ -15,6 +15,8 @@ VGMSTREAM * init_vgmstream_bfstm(STREAMFILE *streamFile) {
|
||||||
int loop_flag;
|
int loop_flag;
|
||||||
int ima = 0;
|
int ima = 0;
|
||||||
off_t start_offset;
|
off_t start_offset;
|
||||||
|
int founddata;
|
||||||
|
off_t tempoffset1;
|
||||||
|
|
||||||
/* check extension, case insensitive */
|
/* check extension, case insensitive */
|
||||||
streamFile->get_name(streamFile, filename, sizeof(filename));
|
streamFile->get_name(streamFile, filename, sizeof(filename));
|
||||||
|
@ -25,11 +27,11 @@ VGMSTREAM * init_vgmstream_bfstm(STREAMFILE *streamFile) {
|
||||||
/* check header */
|
/* check header */
|
||||||
if ((uint32_t)read_32bitBE(0, streamFile) != 0x4653544D) /* "FSTM" */
|
if ((uint32_t)read_32bitBE(0, streamFile) != 0x4653544D) /* "FSTM" */
|
||||||
goto fail;
|
goto fail;
|
||||||
if ((uint32_t)read_32bitBE(4, streamFile) != 0xFEFF0040)
|
if ((uint32_t)read_16bitBE(4, streamFile) != 0xFEFF)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
int founddata = 0;
|
founddata = 0;
|
||||||
off_t tempoffset1 = 0x8;
|
tempoffset1 = 0x8;
|
||||||
|
|
||||||
while (!(founddata))
|
while (!(founddata))
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,10 +9,8 @@ VGMSTREAM * init_vgmstream_bfwav(STREAMFILE *streamFile) {
|
||||||
|
|
||||||
int ima = 0;
|
int ima = 0;
|
||||||
int nsmbu_flag = 0;
|
int nsmbu_flag = 0;
|
||||||
int32_t(*read_32bit)(off_t, STREAMFILE*) = NULL;
|
int32_t(*read_32bit)(off_t, STREAMFILE*) = read_32bitBE;
|
||||||
int16_t(*read_16bit)(off_t, STREAMFILE*) = NULL;
|
int16_t(*read_16bit)(off_t, STREAMFILE*) = read_16bitBE;
|
||||||
read_16bit = read_16bitBE;
|
|
||||||
read_32bit = read_32bitBE;
|
|
||||||
|
|
||||||
off_t data_offset;
|
off_t data_offset;
|
||||||
off_t head_offset;
|
off_t head_offset;
|
||||||
|
@ -96,10 +94,8 @@ VGMSTREAM * init_vgmstream_bfwav(STREAMFILE *streamFile) {
|
||||||
|
|
||||||
if (vgmstream->coding_type == coding_NGC_DSP) {
|
if (vgmstream->coding_type == coding_NGC_DSP) {
|
||||||
off_t coef_offset;
|
off_t coef_offset;
|
||||||
int coef_spacing;
|
|
||||||
int i, j;
|
int i, j;
|
||||||
|
int coef_spacing = 0x2E;
|
||||||
coef_spacing = 0x2E;
|
|
||||||
|
|
||||||
off_t coeffheader = head_offset + 0x28;
|
off_t coeffheader = head_offset + 0x28;
|
||||||
int foundcoef = 0;
|
int foundcoef = 0;
|
||||||
|
|
|
@ -2593,6 +2593,8 @@ struct csmp_chunk {
|
||||||
VGMSTREAM * init_vgmstream_ngc_dsp_csmp(STREAMFILE *streamFile) {
|
VGMSTREAM * init_vgmstream_ngc_dsp_csmp(STREAMFILE *streamFile) {
|
||||||
VGMSTREAM * vgmstream = NULL;
|
VGMSTREAM * vgmstream = NULL;
|
||||||
char filename[PATH_LIMIT];
|
char filename[PATH_LIMIT];
|
||||||
|
off_t current_offset;
|
||||||
|
int tries;
|
||||||
|
|
||||||
struct dsp_header header;
|
struct dsp_header header;
|
||||||
const off_t start_offset = 0x60;
|
const off_t start_offset = 0x60;
|
||||||
|
@ -2604,7 +2606,7 @@ VGMSTREAM * init_vgmstream_ngc_dsp_csmp(STREAMFILE *streamFile) {
|
||||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||||
if (strcasecmp("csmp",filename_extension(filename))) goto fail;
|
if (strcasecmp("csmp",filename_extension(filename))) goto fail;
|
||||||
|
|
||||||
off_t current_offset = 0;
|
current_offset = 0;
|
||||||
|
|
||||||
csmp_magic = read_32bitBE(current_offset, streamFile);
|
csmp_magic = read_32bitBE(current_offset, streamFile);
|
||||||
if (csmp_magic != CSMP_MAGIC) goto fail;
|
if (csmp_magic != CSMP_MAGIC) goto fail;
|
||||||
|
@ -2616,13 +2618,14 @@ VGMSTREAM * init_vgmstream_ngc_dsp_csmp(STREAMFILE *streamFile) {
|
||||||
|
|
||||||
current_offset += 4;
|
current_offset += 4;
|
||||||
|
|
||||||
int tries =0;
|
tries =0;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
struct csmp_chunk chunk;
|
||||||
|
|
||||||
if (tries > 4)
|
if (tries > 4)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
struct csmp_chunk chunk;
|
|
||||||
chunk.id = read_32bitBE(current_offset, streamFile);
|
chunk.id = read_32bitBE(current_offset, streamFile);
|
||||||
chunk.length = read_32bitBE(current_offset + 4, streamFile);
|
chunk.length = read_32bitBE(current_offset + 4, streamFile);
|
||||||
current_offset += 8;
|
current_offset += 8;
|
||||||
|
|
Loading…
Reference in a new issue