EA SCHl: Removed IDX/BIG parser

This commit is contained in:
NicknineTheEagle 2018-12-27 13:52:09 +03:00
parent 462a033bc1
commit 39b5480ca6
3 changed files with 0 additions and 91 deletions

View File

@ -351,95 +351,6 @@ fail:
return NULL; return NULL;
} }
/* EA IDX/BIG combo - basically a set of HDR/DAT compiled into one file */
VGMSTREAM * init_vgmstream_ea_idx_big(STREAMFILE *streamFile) {
int target_stream = streamFile->stream_index, total_sounds, subsound_index;
uint32_t i, num_hdr;
uint16_t hdr_id, hdr_subid;
uint8_t userdata_size, hdr_sounds;
off_t entry_offset, hdr_offset, base_offset, schl_offset, offset_mult;
//size_t hdr_size;
char stream_name[STREAM_NAME_SIZE];
STREAMFILE *bigFile = NULL;
VGMSTREAM *vgmstream = NULL;
int32_t (*read_32bit)(off_t,STREAMFILE*);
int16_t (*read_16bit)(off_t,STREAMFILE*);
/* seems to always start with 0x00000001 */
if (read_32bitLE(0x00, streamFile) != 0x00000001 &&
read_32bitBE(0x00, streamFile) != 0x00000001)
goto fail;
bigFile = open_streamfile_by_ext(streamFile, "big");
if (!bigFile)
goto fail;
if (read_32bitBE(0x00, bigFile) != EA_BLOCKID_HEADER)
goto fail;
/* use number of files for endianness check */
if (guess_endianness32bit(0x04,streamFile)) {
read_32bit = read_32bitBE;
read_16bit = read_16bitBE;
} else {
read_32bit = read_32bitLE;
read_16bit = read_16bitLE;
}
num_hdr = read_32bit(0x04, streamFile);
if (read_32bit(0x54,streamFile) != num_hdr)
goto fail;
if (target_stream == 0) target_stream = 1;
schl_offset = 0;
total_sounds = 0;
schl_offset = 0xFFFFFFFF;
for (i = 0; i < num_hdr; i++) {
entry_offset = 0x58 + 0x10 * i;
//hdr_size = read_32bit(entry_offset + 0x04, streamFile);
hdr_offset = read_32bit(entry_offset + 0x08, streamFile);
base_offset = read_32bit(entry_offset + 0x0C, streamFile);
hdr_id = read_16bit(hdr_offset + 0x00, streamFile);
hdr_subid = read_16bit(hdr_offset + 0x02, streamFile);
userdata_size = read_8bit(hdr_offset + 0x04, streamFile) & 0x0F;
hdr_sounds = read_8bit(hdr_offset + 0x05, streamFile);
offset_mult = (off_t)read_8bit(hdr_offset + 0x07, streamFile) * 0x0100 + 0x0100;
if (target_stream > total_sounds && target_stream <= total_sounds + hdr_sounds) {
schl_offset = base_offset + (off_t)read_16bitBE(hdr_offset + 0x0C + (0x02+userdata_size) * (target_stream-total_sounds-1), streamFile) * offset_mult;
subsound_index = target_stream - total_sounds;
/* There are no filenames but we can add IDs to stream name for better organization */
if (hdr_subid != 0xFFFF)
snprintf(stream_name, STREAM_NAME_SIZE, "%03d_%02d_%d", hdr_id, hdr_subid, subsound_index);
else
snprintf(stream_name, STREAM_NAME_SIZE, "%03d_%d", hdr_id, subsound_index);
}
total_sounds += hdr_sounds;
}
if (schl_offset == 0xFFFFFFFF)
goto fail;
if (read_32bitBE(schl_offset, bigFile) != EA_BLOCKID_HEADER)
goto fail;
vgmstream = parse_schl_block(bigFile, schl_offset, total_sounds);
if (!vgmstream)
goto fail;
strncpy(vgmstream->stream_name, stream_name, STREAM_NAME_SIZE);
close_streamfile(bigFile);
return vgmstream;
fail:
close_streamfile(bigFile);
return NULL;
}
/* EA SCHl with variable header - from EA games (roughly 1997~2010); generated by EA Canada's sx.exe/Sound eXchange */ /* EA SCHl with variable header - from EA games (roughly 1997~2010); generated by EA Canada's sx.exe/Sound eXchange */
static VGMSTREAM * parse_schl_block(STREAMFILE *streamFile, off_t offset, int total_streams) { static VGMSTREAM * parse_schl_block(STREAMFILE *streamFile, off_t offset, int total_streams) {
off_t start_offset, header_offset; off_t start_offset, header_offset;

View File

@ -645,7 +645,6 @@ VGMSTREAM * init_vgmstream_ea_schl(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_ea_bnk(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_ea_bnk(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_ea_abk(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_ea_abk(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_ea_hdr_dat(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_ea_hdr_dat(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_ea_idx_big(STREAMFILE * steeamFile);
VGMSTREAM * init_vgmstream_ea_schl_fixed(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_ea_schl_fixed(STREAMFILE * streamFile);

View File

@ -352,7 +352,6 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
init_vgmstream_ea_bnk, init_vgmstream_ea_bnk,
init_vgmstream_ea_abk, init_vgmstream_ea_abk,
init_vgmstream_ea_hdr_dat, init_vgmstream_ea_hdr_dat,
init_vgmstream_ea_idx_big,
init_vgmstream_ea_schl_fixed, init_vgmstream_ea_schl_fixed,
init_vgmstream_sk_aud, init_vgmstream_sk_aud,
init_vgmstream_stm, init_vgmstream_stm,