Add .acx ADX container [Baroque (SAT), Persona 3 (PS2)]

This commit is contained in:
bnnm 2021-01-03 19:22:32 +01:00
parent 404b1cd672
commit 25c48aba22
7 changed files with 55 additions and 0 deletions

View File

@ -39,6 +39,7 @@ static const char* extension_list[] = {
//"ac3", //common, FFmpeg/not parsed (AC3)
"acb",
"acm",
"acx",
"ad", //txth/reserved [Xenosaga Freaks (PS2)]
"adc", //txth/reserved [Tomb Raider The Last Revelation (DC), Tomb Raider Chronicles (DC)]
"adm",

View File

@ -500,6 +500,10 @@
RelativePath=".\meta\acm.c"
>
</File>
<File
RelativePath=".\meta\acx.c"
>
</File>
<File
RelativePath=".\meta\adp_konami.c"
>

View File

@ -282,6 +282,7 @@
<ClCompile Include="meta\aax.c" />
<ClCompile Include="meta\acb.c" />
<ClCompile Include="meta\acm.c" />
<ClCompile Include="meta\acx.c" />
<ClCompile Include="meta\adp_konami.c" />
<ClCompile Include="meta\adpcm_capcom.c" />
<ClCompile Include="meta\ads.c" />

View File

@ -364,6 +364,9 @@
<ClCompile Include="meta\acm.c">
<Filter>meta\Source Files</Filter>
</ClCompile>
<ClCompile Include="meta\acx.c">
<Filter>meta\Source Files</Filter>
</ClCompile>
<ClCompile Include="meta\adp_konami.c">
<Filter>meta\Source Files</Filter>
</ClCompile>

43
src/meta/acx.c Normal file
View File

@ -0,0 +1,43 @@
#include "meta.h"
#include "../coding/coding.h"
/* .acx - CRI container [Baroque (SAT), Persona 3 (PS2), THE iDOLM@STER: Live For You (X360)] */
VGMSTREAM* init_vgmstream_acx(STREAMFILE* sf) {
VGMSTREAM* vgmstream = NULL;
STREAMFILE* temp_sf = NULL;
off_t subfile_offset;
size_t subfile_size;
int total_subsongs, target_subsong = sf->stream_index;
/* checks */
if (!check_extensions(sf,"acx"))
goto fail;
if (read_u32be(0x00,sf) != 0x00000000)
goto fail;
/* simple container for sfx and rarely music [Burning Rangers (SAT)],
* mainly used until .csb was introduced */
total_subsongs = read_u32be(0x04,sf);
if (target_subsong == 0) target_subsong = 1;
if (target_subsong < 0 || target_subsong > total_subsongs || total_subsongs < 1) goto fail;
subfile_offset = read_u32be(0x08 + (target_subsong-1) * 0x08 + 0x00,sf);
subfile_size = read_u32be(0x08 + (target_subsong-1) * 0x08 + 0x04,sf);
temp_sf = setup_subfile_streamfile(sf, subfile_offset, subfile_size, "adx");
if (!temp_sf) goto fail;
vgmstream = init_vgmstream_adx(temp_sf);
if (!vgmstream) goto fail;
vgmstream->num_streams = total_subsongs;
close_streamfile(temp_sf);
return vgmstream;
fail:
close_streamfile(temp_sf);
close_vgmstream(vgmstream);
return NULL;
}

View File

@ -934,4 +934,6 @@ VGMSTREAM *init_vgmstream_sbk(STREAMFILE *sf);
VGMSTREAM* init_vgmstream_ifs(STREAMFILE* sf);
VGMSTREAM* init_vgmstream_acx(STREAMFILE* sf);
#endif /*_META_H*/

View File

@ -516,6 +516,7 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
init_vgmstream_dsp_wiiadpcm,
init_vgmstream_dsp_cwac,
init_vgmstream_ifs,
init_vgmstream_acx,
/* 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 */