mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-20 20:41:08 +01:00
cleanup: wad matx
- Remove fake extension .matx (use TXTH) - Remove fake format .wad (use TXTH)
This commit is contained in:
parent
61f6ba6cfd
commit
13bfa15e2f
@ -274,7 +274,6 @@ int render_layout(sample_t* buf, int32_t sample_count, VGMSTREAM* vgmstream) {
|
||||
case layout_blocked_wsi:
|
||||
case layout_blocked_str_snds:
|
||||
case layout_blocked_ws_aud:
|
||||
case layout_blocked_matx:
|
||||
case layout_blocked_dec:
|
||||
case layout_blocked_vs:
|
||||
case layout_blocked_mul:
|
||||
|
@ -325,7 +325,6 @@ static const char* extension_list[] = {
|
||||
"mab",
|
||||
"mad",
|
||||
"map",
|
||||
"matx",
|
||||
"mc3",
|
||||
"mca",
|
||||
"mcadpcm",
|
||||
@ -930,7 +929,6 @@ static const layout_info layout_info_list[] = {
|
||||
{layout_blocked_xvas, "blocked (.xvas)"},
|
||||
{layout_blocked_str_snds, "blocked (.str SNDS)"},
|
||||
{layout_blocked_ws_aud, "blocked (Westwood Studios .aud)"},
|
||||
{layout_blocked_matx, "blocked (Matrix .matx)"},
|
||||
{layout_blocked_dec, "blocked (DEC)"},
|
||||
{layout_blocked_vs, "blocked (Melbourne House VS)"},
|
||||
{layout_blocked_mul, "blocked (MUL)"},
|
||||
@ -1077,7 +1075,6 @@ static const meta_info meta_info_list[] = {
|
||||
{meta_SDT, "High Voltage .sdt header"},
|
||||
{meta_NGC_TYDSP, ".tydsp Header"},
|
||||
{meta_WVS, "Swingin' Ape .WVS header"},
|
||||
{meta_XBOX_MATX, "assumed Matrix file by .matx extension"},
|
||||
{meta_DEC, "Falcom DEC RIFF header"},
|
||||
{meta_VS, "Melbourne House .VS header"},
|
||||
{meta_DC_STR, "Sega Stream Asset Builder header"},
|
||||
@ -1181,7 +1178,6 @@ static const meta_info meta_info_list[] = {
|
||||
{meta_DSP_STR_IG, "Infogrames .DSP header"},
|
||||
{meta_EA_SWVR, "Electronic Arts SWVR header"},
|
||||
{meta_PS2_B1S, "B1S header"},
|
||||
{meta_PS2_WAD, "WAD header"},
|
||||
{meta_DSP_XIII, "XIII dsp header"},
|
||||
{meta_DSP_CABELAS, "Cabelas games .DSP header"},
|
||||
{meta_PS2_ADM, "Dragon Quest V .ADM raw header"},
|
||||
|
@ -123,9 +123,6 @@ void block_update(off_t block_offset, VGMSTREAM* vgmstream) {
|
||||
case layout_blocked_ws_aud:
|
||||
block_update_ws_aud(block_offset,vgmstream);
|
||||
break;
|
||||
case layout_blocked_matx:
|
||||
block_update_matx(block_offset,vgmstream);
|
||||
break;
|
||||
case layout_blocked_dec:
|
||||
block_update_dec(block_offset,vgmstream);
|
||||
break;
|
||||
|
@ -1,18 +0,0 @@
|
||||
#include "layout.h"
|
||||
#include "../vgmstream.h"
|
||||
|
||||
/* set up for the block at the given offset */
|
||||
void block_update_matx(off_t block_offset, VGMSTREAM * vgmstream) {
|
||||
int i;
|
||||
|
||||
vgmstream->current_block_offset = block_offset;
|
||||
vgmstream->current_block_size = read_32bitLE(
|
||||
vgmstream->current_block_offset,
|
||||
vgmstream->ch[0].streamfile);
|
||||
vgmstream->next_block_offset = vgmstream->current_block_offset + vgmstream->current_block_size + 8;
|
||||
vgmstream->current_block_size/=vgmstream->channels;
|
||||
|
||||
for (i=0;i<vgmstream->channels;i++) {
|
||||
vgmstream->ch[i].offset = vgmstream->current_block_offset + 8;
|
||||
}
|
||||
}
|
@ -20,7 +20,6 @@ void block_update_caf(off_t block_offset, VGMSTREAM* vgmstream);
|
||||
void block_update_wsi(off_t block_offset, VGMSTREAM* vgmstream);
|
||||
void block_update_str_snds(off_t block_offset, VGMSTREAM* vgmstream);
|
||||
void block_update_ws_aud(off_t block_offset, VGMSTREAM* vgmstream);
|
||||
void block_update_matx(off_t block_offset, VGMSTREAM* vgmstream);
|
||||
void block_update_dec(off_t block_offset, VGMSTREAM* vgmstream);
|
||||
void block_update_vs(off_t block_offset, VGMSTREAM* vgmstream);
|
||||
void block_update_mul(off_t block_offset, VGMSTREAM* vgmstream);
|
||||
|
@ -265,8 +265,6 @@ VGMSTREAM* init_vgmstream_wvs_ngc(STREAMFILE* sf);
|
||||
VGMSTREAM * init_vgmstream_dc_str(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_dc_str_v2(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_xbox_matx(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_dec(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_vs(STREAMFILE *streamFile);
|
||||
@ -455,8 +453,6 @@ VGMSTREAM * init_vgmstream_ea_swvr(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_b1s(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_wad(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_adm(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM* init_vgmstream_lpcm_shade(STREAMFILE* sf);
|
||||
|
@ -1,71 +0,0 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* WAD (from The golden Compass) */
|
||||
VGMSTREAM * init_vgmstream_ps2_wad(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[PATH_LIMIT];
|
||||
int loop_flag = 0;
|
||||
int channel_count;
|
||||
off_t start_offset;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("wad",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if ((read_32bitLE(0x00,streamFile)+0x40) != get_streamfile_size(streamFile))
|
||||
goto fail;
|
||||
|
||||
loop_flag = 0;
|
||||
channel_count = (uint16_t) read_16bitLE(0x4,streamFile);
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
start_offset = 0x40;
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = (uint16_t) read_16bitLE(0x6,streamFile);;
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->num_samples = read_32bitLE(0x0,streamFile)/channel_count/16*28;
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = 0;
|
||||
vgmstream->loop_end_sample = read_32bitLE(0x0,streamFile)/channel_count/16*28;
|
||||
}
|
||||
|
||||
if (channel_count == 1)
|
||||
{
|
||||
vgmstream->layout_type = layout_none;
|
||||
}
|
||||
else
|
||||
{
|
||||
goto fail;
|
||||
}
|
||||
|
||||
vgmstream->meta_type = meta_PS2_WAD;
|
||||
|
||||
/* 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,61 +0,0 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
#include "../layout/layout.h"
|
||||
|
||||
/* matx
|
||||
|
||||
MATX (found in Matrix)
|
||||
*/
|
||||
|
||||
VGMSTREAM * init_vgmstream_xbox_matx(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[PATH_LIMIT];
|
||||
|
||||
int loop_flag=0;
|
||||
int channel_count;
|
||||
int i;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("matx",filename_extension(filename))) goto fail;
|
||||
|
||||
loop_flag = 0;
|
||||
channel_count=read_16bitLE(0x4,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_16bitLE(0x06,streamFile) & 0xffff;
|
||||
|
||||
vgmstream->coding_type = coding_XBOX_IMA;
|
||||
vgmstream->layout_type = layout_blocked_matx;
|
||||
vgmstream->meta_type = meta_XBOX_MATX;
|
||||
|
||||
/* open the file for reading by each channel */
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/* Calc num_samples */
|
||||
block_update_matx(0,vgmstream);
|
||||
vgmstream->num_samples=0;
|
||||
|
||||
do {
|
||||
vgmstream->num_samples += vgmstream->current_block_size/36*64;
|
||||
block_update_matx(vgmstream->next_block_offset,vgmstream);
|
||||
} while (vgmstream->next_block_offset<get_streamfile_size(streamFile));
|
||||
|
||||
block_update_matx(0,vgmstream);
|
||||
return vgmstream;
|
||||
|
||||
/* clean up anything we may have opened */
|
||||
fail:
|
||||
if (vgmstream) close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
@ -108,7 +108,6 @@ init_vgmstream_t init_vgmstream_functions[] = {
|
||||
init_vgmstream_wvs_ngc,
|
||||
init_vgmstream_dc_str,
|
||||
init_vgmstream_dc_str_v2,
|
||||
init_vgmstream_xbox_matx,
|
||||
init_vgmstream_dec,
|
||||
init_vgmstream_vs,
|
||||
init_vgmstream_dc_str,
|
||||
@ -214,7 +213,6 @@ init_vgmstream_t init_vgmstream_functions[] = {
|
||||
init_vgmstream_dsp_str_ig,
|
||||
init_vgmstream_ea_swvr,
|
||||
init_vgmstream_ps2_b1s,
|
||||
init_vgmstream_ps2_wad,
|
||||
init_vgmstream_dsp_xiii,
|
||||
init_vgmstream_dsp_cabelas,
|
||||
init_vgmstream_lpcm_shade,
|
||||
|
@ -202,7 +202,6 @@ typedef enum {
|
||||
layout_blocked_wsi,
|
||||
layout_blocked_str_snds,
|
||||
layout_blocked_ws_aud,
|
||||
layout_blocked_matx,
|
||||
layout_blocked_dec,
|
||||
layout_blocked_xvas,
|
||||
layout_blocked_vs,
|
||||
@ -392,7 +391,6 @@ typedef enum {
|
||||
meta_UBI_CKD, /* Ubisoft CKD RIFF header (Rayman Origins Wii) */
|
||||
meta_RAW_WAVM,
|
||||
meta_WVS,
|
||||
meta_XBOX_MATX, /* XBOX MATX */
|
||||
meta_XMU,
|
||||
meta_XVAS,
|
||||
meta_EA_SCHL, /* Electronic Arts SCHl with variable header */
|
||||
@ -469,7 +467,6 @@ typedef enum {
|
||||
meta_DSP_STR_IG, /* Micro Machines, Superman Superman: Shadow of Apokolis */
|
||||
meta_EA_SWVR, /* Future Cop L.A.P.D., Freekstyle */
|
||||
meta_PS2_B1S, /* 7 Wonders of the ancient world */
|
||||
meta_PS2_WAD, /* The golden Compass */
|
||||
meta_DSP_XIII, /* XIII, possibly more (Ubisoft header???) */
|
||||
meta_DSP_CABELAS, /* Cabelas games */
|
||||
meta_PS2_ADM, /* Dragon Quest V (PS2) */
|
||||
|
Loading…
x
Reference in New Issue
Block a user