Improved EA ABK support

This commit is contained in:
NicknineTheEagle 2018-08-08 17:07:01 +03:00
parent 15cc60e604
commit c88dee0ebb
2 changed files with 11 additions and 1 deletions

View File

@ -198,7 +198,8 @@ VGMSTREAM * init_vgmstream_ea_abk_new(STREAMFILE *streamFile) {
goto fail;
version = read_32bitBE(0x04, streamFile);
if (version != 0x01010202)
if (version != 0x01010100 &&
version != 0x01010202)
goto fail;
/* use table offset to check endianness */
@ -221,6 +222,9 @@ VGMSTREAM * init_vgmstream_ea_abk_new(STREAMFILE *streamFile) {
bnk_target_index = 0xFFFF;
ast_offset = 0;
if (!bnk_offset || read_32bitBE(bnk_offset, streamFile) != 0x53313041) /* "S10A" */
goto fail;
/* set up some common values */
if (header_table_offset == 0x5C) {
/* the usual variant */

View File

@ -199,6 +199,12 @@ VGMSTREAM * init_vgmstream_ea_abk(STREAMFILE *streamFile) {
target_entry_offset = 0;
total_sound_tables = 0;
/* check to avoid clashing with the newer ABK format */
if (bnk_offset &&
read_32bitBE(bnk_offset, streamFile) != EA_BNK_HEADER_LE &&
read_32bitBE(bnk_offset, streamFile) != EA_BNK_HEADER_BE)
goto fail;
for (i = 0; i < num_tables; i++) {
num_entries = read_8bit(header_table_offset + 0x24, streamFile);
base_offset = read_32bit(header_table_offset + 0x2C, streamFile);