mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-12 01:30:49 +01:00
fixing xbox mono files on ima_decoder.c
fixing ea_block.c for overdumped files and pc glitch adding xbox xmu support git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@412 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
52624af78d
commit
306849ec81
@ -21,7 +21,6 @@ libcoding_la_SOURCES += ws_decoder.c
|
||||
libcoding_la_SOURCES += mpeg_decoder.c
|
||||
libcoding_la_SOURCES += acm_decoder.c
|
||||
libcoding_la_SOURCES += nwa_decoder.c
|
||||
libcoding_la_SOURCES += msadpcm_decoder.c
|
||||
libcoding_la_SOURCES += aica_decoder.c
|
||||
|
||||
EXTRA_DIST = coding.h g72x_state.h
|
||||
|
@ -112,7 +112,7 @@ void decode_xbox_ima(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspac
|
||||
}
|
||||
|
||||
// Only increment offset on complete frame
|
||||
if(offset-stream->offset==(32*channelspacing)+(4*channel)+channelspacing+1) // ??
|
||||
if(offset-stream->offset==(32*channelspacing)+(4*channel)+3) // ??
|
||||
stream->offset+=36*channelspacing;
|
||||
|
||||
stream->adpcm_history1_32=hist1;
|
||||
|
@ -11,8 +11,10 @@ void ea_block_update(off_t block_offset, VGMSTREAM * vgmstream) {
|
||||
// Search for next SCDL or SCEl block ...
|
||||
do {
|
||||
block_offset+=4;
|
||||
if(block_offset>(off_t)get_streamfile_size(vgmstream->ch[0].streamfile))
|
||||
if(block_offset>=(off_t)get_streamfile_size(vgmstream->ch[0].streamfile)) {
|
||||
vgmstream->next_block_offset=block_offset;
|
||||
return;
|
||||
}
|
||||
} while (read_32bitBE(block_offset,vgmstream->ch[0].streamfile)!=0x5343446C);
|
||||
|
||||
// reset channel offset
|
||||
|
@ -556,6 +556,10 @@
|
||||
RelativePath=".\meta\xbox_wvs.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\xbox_xmu.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\xbox_xwav.c"
|
||||
>
|
||||
|
@ -204,8 +204,14 @@ VGMSTREAM * init_vgmstream_ea(STREAMFILE *streamFile) {
|
||||
case EA_EAXA:
|
||||
if(vgmstream->ea_compression_version==0x03)
|
||||
vgmstream->meta_type=meta_EAXA_R3;
|
||||
else
|
||||
vgmstream->meta_type=meta_EAXA_R2;
|
||||
else {
|
||||
// seems there's no EAXA R2 on PC
|
||||
if(ea.platform==EA_PC) {
|
||||
vgmstream->ea_compression_version=0x03;
|
||||
vgmstream->meta_type=meta_EAXA_R3;
|
||||
} else
|
||||
vgmstream->meta_type=meta_EAXA_R2;
|
||||
}
|
||||
|
||||
vgmstream->coding_type=coding_EAXA;
|
||||
vgmstream->layout_type=layout_ea_blocked;
|
||||
@ -270,10 +276,8 @@ VGMSTREAM * init_vgmstream_ea(STREAMFILE *streamFile) {
|
||||
ea_block_update(start_offset+header_length,vgmstream);
|
||||
|
||||
init_get_high_nibble(vgmstream);
|
||||
vgmstream->ch[0].adpcm_history1_32=0;
|
||||
vgmstream->ch[1].adpcm_history1_32=0;
|
||||
|
||||
return vgmstream;
|
||||
return vgmstream;
|
||||
|
||||
/* clean up anything we may have opened */
|
||||
fail:
|
||||
|
@ -203,4 +203,6 @@ VGMSTREAM * init_vgmstream_xbox_matx(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_de2(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_xbox_xmu(STREAMFILE *streamFile);
|
||||
|
||||
#endif
|
||||
|
65
src/meta/xbox_xmu.c
Normal file
65
src/meta/xbox_xmu.c
Normal file
@ -0,0 +1,65 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* XMU
|
||||
|
||||
XMU (found in Alter Echo)
|
||||
*/
|
||||
|
||||
VGMSTREAM * init_vgmstream_xbox_xmu(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[260];
|
||||
|
||||
int loop_flag=0;
|
||||
int channel_count;
|
||||
int i;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("xmu",filename_extension(filename))) goto fail;
|
||||
|
||||
if((read_32bitBE(0x00,streamFile)!=0x584D5520) &&
|
||||
(read_32bitBE(0x08,streamFile)!=0x46524D54))
|
||||
goto fail;
|
||||
|
||||
/* No Loop found atm */
|
||||
loop_flag = read_8bit(0x16,streamFile);;
|
||||
|
||||
/* Always stereo files */
|
||||
channel_count=read_8bit(0x14,streamFile);
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitLE(0x10,streamFile);
|
||||
|
||||
vgmstream->coding_type = coding_XBOX;
|
||||
vgmstream->num_samples = read_32bitLE(0x7FC,streamFile) / 36 * 64 / vgmstream->channels;
|
||||
vgmstream->layout_type = layout_none;
|
||||
vgmstream->meta_type = meta_XBOX_XMU;
|
||||
|
||||
if(loop_flag) {
|
||||
vgmstream->loop_start_sample=0;
|
||||
vgmstream->loop_end_sample=vgmstream->num_samples;
|
||||
}
|
||||
|
||||
/* open the file for reading by each channel */
|
||||
{
|
||||
for (i=0;i<channel_count;i++) {
|
||||
vgmstream->ch[i].streamfile = streamFile->open(streamFile,filename,36);
|
||||
vgmstream->ch[i].offset = 0x800;
|
||||
|
||||
if (!vgmstream->ch[i].streamfile) goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
return vgmstream;
|
||||
|
||||
/* clean up anything we may have opened */
|
||||
fail:
|
||||
if (vgmstream) close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
@ -116,6 +116,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_xbox_matx,
|
||||
init_vgmstream_de2,
|
||||
init_vgmstream_dc_str,
|
||||
init_vgmstream_xbox_xmu,
|
||||
};
|
||||
|
||||
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
|
||||
@ -1643,6 +1644,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
||||
case meta_DC_STR:
|
||||
snprintf(temp,TEMPSIZE,"Sega Stream Asset Builder header");
|
||||
break;
|
||||
case meta_XBOX_XMU:
|
||||
snprintf(temp,TEMPSIZE,"XMU header");
|
||||
break;
|
||||
default:
|
||||
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
||||
}
|
||||
|
@ -232,6 +232,7 @@ typedef enum {
|
||||
meta_XBOX_WVS, /* XBOX WVS */
|
||||
meta_XBOX_STMA, /* XBOX STMA */
|
||||
meta_XBOX_MATX, /* XBOX MATX */
|
||||
meta_XBOX_XMU, /* XBOX XMU */
|
||||
|
||||
meta_EAXA_R2, /* EA XA Release 2 */
|
||||
meta_EAXA_R3, /* EA XA Release 3 */
|
||||
|
@ -174,6 +174,7 @@ char * extension_list[] = {
|
||||
"stma\0STMA Audio File (*.STMA)\0",
|
||||
"matx\0MATX Audio File (*.MATX)\0",
|
||||
"de2\0DE2 Audio File (*.DE2)\0",
|
||||
"xmu\0XMU Audio File (*.XMU)\0",
|
||||
};
|
||||
|
||||
void about(HWND hwndParent) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Version="8,00"
|
||||
Name="in_vgmstream"
|
||||
ProjectGUID="{42D86561-8CE4-40F5-86CE-58C986B77502}"
|
||||
RootNamespace="in_vgmstream"
|
||||
@ -17,8 +17,8 @@
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
OutputDirectory="C:\Program Files\winamp\plugins"
|
||||
IntermediateDirectory="C:\Program Files\winamp\plugins"
|
||||
ConfigurationType="2"
|
||||
>
|
||||
<Tool
|
||||
|
Loading…
Reference in New Issue
Block a user