mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-19 00:04:04 +01:00
Improve Tiger .com validations and lower priority
This commit is contained in:
parent
1849395b8e
commit
61e82459b2
@ -2,24 +2,36 @@
|
|||||||
#include "../coding/coding.h"
|
#include "../coding/coding.h"
|
||||||
|
|
||||||
/* Tiger Game.com ADPCM file */
|
/* Tiger Game.com ADPCM file */
|
||||||
VGMSTREAM * init_vgmstream_tgc(STREAMFILE *streamFile) {
|
VGMSTREAM* init_vgmstream_tgc(STREAMFILE* sf) {
|
||||||
VGMSTREAM * vgmstream = NULL;
|
VGMSTREAM* vgmstream = NULL;
|
||||||
|
uint16_t size;
|
||||||
|
off_t start_offset;
|
||||||
|
|
||||||
|
|
||||||
/* checks */
|
/* checks */
|
||||||
if (!check_extensions(streamFile, "4"))
|
if (read_u8(0x00, sf) != 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
if (!check_extensions(sf, "4"))
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
size = read_u16be(0x01, sf);
|
||||||
|
if (size != get_streamfile_size(sf))
|
||||||
|
goto fail;
|
||||||
|
start_offset = 0x03;
|
||||||
|
|
||||||
|
|
||||||
/* build the VGMSTREAM */
|
/* build the VGMSTREAM */
|
||||||
vgmstream = allocate_vgmstream(1, 0);
|
vgmstream = allocate_vgmstream(1, 0);
|
||||||
if (!vgmstream) goto fail;
|
if (!vgmstream) goto fail;
|
||||||
|
|
||||||
vgmstream->sample_rate = 8000;
|
vgmstream->sample_rate = 8000;
|
||||||
vgmstream->num_samples = ((uint16_t)read_16bitBE(1, streamFile) - 3) * 2;
|
vgmstream->num_samples = (size - 0x03) * 2;
|
||||||
vgmstream->meta_type = meta_TGC;
|
vgmstream->meta_type = meta_TGC;
|
||||||
vgmstream->layout_type = layout_none;
|
vgmstream->layout_type = layout_none;
|
||||||
vgmstream->coding_type = coding_TGC;
|
vgmstream->coding_type = coding_TGC;
|
||||||
|
|
||||||
if (!vgmstream_open_stream(vgmstream, streamFile, 3))
|
if (!vgmstream_open_stream(vgmstream, sf, start_offset))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
return vgmstream;
|
return vgmstream;
|
||||||
|
@ -470,7 +470,6 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
|
|||||||
init_vgmstream_csb,
|
init_vgmstream_csb,
|
||||||
init_vgmstream_fwse,
|
init_vgmstream_fwse,
|
||||||
init_vgmstream_fda,
|
init_vgmstream_fda,
|
||||||
init_vgmstream_tgc,
|
|
||||||
init_vgmstream_kwb,
|
init_vgmstream_kwb,
|
||||||
init_vgmstream_lrmd,
|
init_vgmstream_lrmd,
|
||||||
init_vgmstream_bkhd,
|
init_vgmstream_bkhd,
|
||||||
@ -538,6 +537,7 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
|
|||||||
init_vgmstream_seb,
|
init_vgmstream_seb,
|
||||||
init_vgmstream_ps2_pnb,
|
init_vgmstream_ps2_pnb,
|
||||||
init_vgmstream_sli_ogg,
|
init_vgmstream_sli_ogg,
|
||||||
|
init_vgmstream_tgc,
|
||||||
|
|
||||||
/* lowest priority metas (should go after all metas, and TXTH should go before raw formats) */
|
/* lowest priority metas (should go after all metas, and TXTH should go before raw formats) */
|
||||||
init_vgmstream_txth, /* proper parsers should supersede TXTH, once added */
|
init_vgmstream_txth, /* proper parsers should supersede TXTH, once added */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user