mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-19 00:04:04 +01:00
EA SBK: sbnk+sdat/BNKx
This commit is contained in:
parent
c39d1cad92
commit
09155bef1e
@ -1433,6 +1433,7 @@ static const meta_info meta_info_list[] = {
|
|||||||
{meta_GWB_GWD, "Ubisoft GWB+GWD header"},
|
{meta_GWB_GWD, "Ubisoft GWB+GWD header"},
|
||||||
{meta_CBX, "Traveller's Tales CBX header"},
|
{meta_CBX, "Traveller's Tales CBX header"},
|
||||||
{meta_VAS_ROCKSTAR, "Rockstar .VAS header"},
|
{meta_VAS_ROCKSTAR, "Rockstar .VAS header"},
|
||||||
|
{meta_EA_SBK, "Electronic Arts SBK header"},
|
||||||
};
|
};
|
||||||
|
|
||||||
void get_vgmstream_coding_description(VGMSTREAM* vgmstream, char* out, size_t out_size) {
|
void get_vgmstream_coding_description(VGMSTREAM* vgmstream, char* out, size_t out_size) {
|
||||||
|
@ -430,6 +430,7 @@
|
|||||||
<ClCompile Include="meta\ea_eaac_sbr_harmony.c" />
|
<ClCompile Include="meta\ea_eaac_sbr_harmony.c" />
|
||||||
<ClCompile Include="meta\ea_eaac_standard.c" />
|
<ClCompile Include="meta\ea_eaac_standard.c" />
|
||||||
<ClCompile Include="meta\ea_eaac_tmx.c" />
|
<ClCompile Include="meta\ea_eaac_tmx.c" />
|
||||||
|
<ClCompile Include="meta\ea_sbk.c" />
|
||||||
<ClCompile Include="meta\ea_schl.c" />
|
<ClCompile Include="meta\ea_schl.c" />
|
||||||
<ClCompile Include="meta\ea_schl_fixed.c" />
|
<ClCompile Include="meta\ea_schl_fixed.c" />
|
||||||
<ClCompile Include="meta\ea_swvr.c" />
|
<ClCompile Include="meta\ea_swvr.c" />
|
||||||
|
@ -167,9 +167,6 @@
|
|||||||
<ClInclude Include="coding\vorbis_custom_decoder.h">
|
<ClInclude Include="coding\vorbis_custom_decoder.h">
|
||||||
<Filter>coding\Header Files</Filter>
|
<Filter>coding\Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="coding\libs\utkdec.h">
|
|
||||||
<Filter>coding\libs\Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="layout\layout.h">
|
<ClInclude Include="layout\layout.h">
|
||||||
<Filter>layout\Header Files</Filter>
|
<Filter>layout\Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@ -416,6 +413,9 @@
|
|||||||
<ClInclude Include="util\text_reader.h">
|
<ClInclude Include="util\text_reader.h">
|
||||||
<Filter>util\Header Files</Filter>
|
<Filter>util\Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="coding\libs\utkdec.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="formats.c">
|
<ClCompile Include="formats.c">
|
||||||
@ -700,9 +700,6 @@
|
|||||||
<ClCompile Include="coding\yamaha_decoder.c">
|
<ClCompile Include="coding\yamaha_decoder.c">
|
||||||
<Filter>coding\Source Files</Filter>
|
<Filter>coding\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="coding\libs\utkdec.c">
|
|
||||||
<Filter>coding\libs\Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="layout\blocked.c">
|
<ClCompile Include="layout\blocked.c">
|
||||||
<Filter>layout\Source Files</Filter>
|
<Filter>layout\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@ -1111,6 +1108,9 @@
|
|||||||
<ClCompile Include="meta\ea_eaac_tmx.c">
|
<ClCompile Include="meta\ea_eaac_tmx.c">
|
||||||
<Filter>meta\Source Files</Filter>
|
<Filter>meta\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="meta\ea_sbk.c">
|
||||||
|
<Filter>meta\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="meta\ea_schl.c">
|
<ClCompile Include="meta\ea_schl.c">
|
||||||
<Filter>meta\Source Files</Filter>
|
<Filter>meta\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@ -2143,5 +2143,8 @@
|
|||||||
<ClCompile Include="util\text_reader.c">
|
<ClCompile Include="util\text_reader.c">
|
||||||
<Filter>util\Source Files</Filter>
|
<Filter>util\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="coding\libs\utkdec.c">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
82
src/meta/ea_sbk.c
Normal file
82
src/meta/ea_sbk.c
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
#include "meta.h"
|
||||||
|
#include "../util/endianness.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* .SBK - EA Redwood Shores soundbank (Simpsons Game, Godfather) */
|
||||||
|
VGMSTREAM* init_vgmstream_ea_sbk(STREAMFILE* sf) {
|
||||||
|
VGMSTREAM* vgmstream = NULL;
|
||||||
|
int target_stream = sf->stream_index;
|
||||||
|
off_t chunk_offset;
|
||||||
|
size_t chunk_size;
|
||||||
|
|
||||||
|
/* checks */
|
||||||
|
if (!is_id32be(0x00, sf, "sbnk") && /* sbnk */
|
||||||
|
!is_id32le(0x00, sf, "sbnk")) /* knbs */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (!check_extensions(sf, "sbk"))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
|
||||||
|
read_u32_t read_u32 = is_id32be(0x00, sf, "sbnk") ? read_u32le : read_u32be;
|
||||||
|
|
||||||
|
chunk_offset = read_u32(0x10, sf);
|
||||||
|
chunk_size = read_u32(0x14, sf);
|
||||||
|
|
||||||
|
if (chunk_offset + chunk_size != get_streamfile_size(sf))
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
|
||||||
|
if (!target_stream) target_stream = 1;
|
||||||
|
target_stream -= 1;
|
||||||
|
|
||||||
|
if (is_id32be(chunk_offset, sf, "BNKl") ||
|
||||||
|
is_id32be(chunk_offset, sf, "BNKb")) {
|
||||||
|
/* The Godfather */
|
||||||
|
|
||||||
|
vgmstream = load_vgmstream_ea_bnk(sf, chunk_offset, target_stream, 0); /* unsure about is_embedded */
|
||||||
|
if (!vgmstream) goto fail;
|
||||||
|
|
||||||
|
vgmstream->meta_type = meta_EA_SBK;
|
||||||
|
}
|
||||||
|
else if (is_id32be(chunk_offset, sf, "sdat") || /* sdat */
|
||||||
|
is_id32le(chunk_offset, sf, "sdat")) { /* tads */
|
||||||
|
/* The Simpsons Game */
|
||||||
|
|
||||||
|
int total_subsongs;
|
||||||
|
off_t entry_offset, stream_offset;
|
||||||
|
|
||||||
|
eaac_meta_t info = {0};
|
||||||
|
|
||||||
|
total_subsongs = read_u32(chunk_offset + 0x04, sf);
|
||||||
|
entry_offset = chunk_offset + 0x8 + target_stream * 0x10;
|
||||||
|
|
||||||
|
/* For each entry:
|
||||||
|
* 0x00: stream index
|
||||||
|
* 0x04: 0x0313BABE (?)
|
||||||
|
* 0x08: stream offset
|
||||||
|
* 0x0C: 0xFEEDFEED (?)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (read_u32(entry_offset + 0x00, sf) != target_stream)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
stream_offset = chunk_offset + read_u32(entry_offset + 0x08, sf);
|
||||||
|
|
||||||
|
info.sf_head = sf;
|
||||||
|
info.sf_body = sf;
|
||||||
|
info.head_offset = stream_offset;
|
||||||
|
info.type = meta_EA_SBK;
|
||||||
|
|
||||||
|
vgmstream = load_vgmstream_ea_eaac(&info);
|
||||||
|
if (!vgmstream) goto fail;
|
||||||
|
|
||||||
|
vgmstream->num_streams = total_subsongs;
|
||||||
|
}
|
||||||
|
|
||||||
|
return vgmstream;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
close_vgmstream(vgmstream);
|
||||||
|
return NULL;
|
||||||
|
}
|
@ -142,6 +142,10 @@ static off_t get_ea_stream_mpeg_start_offset(STREAMFILE* sf, off_t start_offset,
|
|||||||
static VGMSTREAM* init_vgmstream_ea_variable_header(STREAMFILE* sf, ea_header* ea, off_t start_offset, int is_bnk);
|
static VGMSTREAM* init_vgmstream_ea_variable_header(STREAMFILE* sf, ea_header* ea, off_t start_offset, int is_bnk);
|
||||||
static void update_ea_stream_size(STREAMFILE* sf, off_t start_offset, VGMSTREAM* vgmstream);
|
static void update_ea_stream_size(STREAMFILE* sf, off_t start_offset, VGMSTREAM* vgmstream);
|
||||||
|
|
||||||
|
VGMSTREAM* load_vgmstream_ea_bnk(STREAMFILE* sf, off_t offset, int target_stream, int is_embedded) {
|
||||||
|
return parse_bnk_header(sf, offset, target_stream, is_embedded);
|
||||||
|
}
|
||||||
|
|
||||||
/* 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 */
|
||||||
VGMSTREAM* init_vgmstream_ea_schl(STREAMFILE* sf) {
|
VGMSTREAM* init_vgmstream_ea_schl(STREAMFILE* sf) {
|
||||||
|
|
||||||
|
@ -1004,4 +1004,7 @@ VGMSTREAM* init_vgmstream_cbx(STREAMFILE* sf);
|
|||||||
|
|
||||||
VGMSTREAM* init_vgmstream_vas_rockstar(STREAMFILE* sf);
|
VGMSTREAM* init_vgmstream_vas_rockstar(STREAMFILE* sf);
|
||||||
|
|
||||||
|
VGMSTREAM* load_vgmstream_ea_bnk(STREAMFILE* sf, off_t offset, int target_stream, int is_embedded);
|
||||||
|
VGMSTREAM* init_vgmstream_ea_sbk(STREAMFILE* sf);
|
||||||
|
|
||||||
#endif /*_META_H*/
|
#endif /*_META_H*/
|
||||||
|
@ -523,6 +523,7 @@ init_vgmstream_t init_vgmstream_functions[] = {
|
|||||||
init_vgmstream_s_pack,
|
init_vgmstream_s_pack,
|
||||||
init_vgmstream_cbx,
|
init_vgmstream_cbx,
|
||||||
init_vgmstream_vas_rockstar,
|
init_vgmstream_vas_rockstar,
|
||||||
|
init_vgmstream_ea_sbk,
|
||||||
|
|
||||||
/* lower priority metas (no clean header identity, somewhat ambiguous, or need extension/companion file to identify) */
|
/* lower priority metas (no clean header identity, somewhat ambiguous, or need extension/companion file to identify) */
|
||||||
init_vgmstream_agsc,
|
init_vgmstream_agsc,
|
||||||
|
@ -707,6 +707,7 @@ typedef enum {
|
|||||||
meta_GWB_GWD,
|
meta_GWB_GWD,
|
||||||
meta_CBX,
|
meta_CBX,
|
||||||
meta_VAS_ROCKSTAR,
|
meta_VAS_ROCKSTAR,
|
||||||
|
meta_EA_SBK,
|
||||||
|
|
||||||
} meta_t;
|
} meta_t;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user