mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-25 07:20:10 +01:00
Add Capcom .adpcm [Resident Evil: Revelations (Switch)]
This commit is contained in:
parent
0e4ee632b9
commit
f29012edb7
@ -1092,6 +1092,7 @@ static const meta_info meta_info_list[] = {
|
|||||||
{meta_DERF, "Xilam DERF header"},
|
{meta_DERF, "Xilam DERF header"},
|
||||||
{meta_UTK, "Maxis UTK header"},
|
{meta_UTK, "Maxis UTK header"},
|
||||||
{meta_NXA, "Entergram NXA header"},
|
{meta_NXA, "Entergram NXA header"},
|
||||||
|
{meta_ADPCM_CAPCOM, "Capcom .ADPCM header"},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -332,6 +332,10 @@
|
|||||||
RelativePath=".\meta\acm.c"
|
RelativePath=".\meta\acm.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\meta\adpcm_capcom.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\meta\ads.c"
|
RelativePath=".\meta\ads.c"
|
||||||
>
|
>
|
||||||
|
@ -204,6 +204,7 @@
|
|||||||
<ClCompile Include="meta\xau_konami.c" />
|
<ClCompile Include="meta\xau_konami.c" />
|
||||||
<ClCompile Include="meta\aax.c" />
|
<ClCompile Include="meta\aax.c" />
|
||||||
<ClCompile Include="meta\acm.c" />
|
<ClCompile Include="meta\acm.c" />
|
||||||
|
<ClCompile Include="meta\adpcm_capcom.c" />
|
||||||
<ClCompile Include="meta\ads.c" />
|
<ClCompile Include="meta\ads.c" />
|
||||||
<ClCompile Include="meta\adx.c" />
|
<ClCompile Include="meta\adx.c" />
|
||||||
<ClCompile Include="meta\afc.c" />
|
<ClCompile Include="meta\afc.c" />
|
||||||
|
@ -211,6 +211,9 @@
|
|||||||
<ClCompile Include="meta\acm.c">
|
<ClCompile Include="meta\acm.c">
|
||||||
<Filter>meta\Source Files</Filter>
|
<Filter>meta\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="meta\adpcm_capcom.c">
|
||||||
|
<Filter>meta\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="meta\ads.c">
|
<ClCompile Include="meta\ads.c">
|
||||||
<Filter>meta\Source Files</Filter>
|
<Filter>meta\Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
49
src/meta/adpcm_capcom.c
Normal file
49
src/meta/adpcm_capcom.c
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
#include "meta.h"
|
||||||
|
#include "../coding/coding.h"
|
||||||
|
#include "../util.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* .ADX - from Capcom games [Resident Evil: Revelations (Switch), Monster Hunter XX (Switch)] */
|
||||||
|
VGMSTREAM * init_vgmstream_adpcm_capcom(STREAMFILE *streamFile) {
|
||||||
|
VGMSTREAM * vgmstream = NULL;
|
||||||
|
off_t start_offset;
|
||||||
|
int loop_flag, channel_count;
|
||||||
|
|
||||||
|
|
||||||
|
/* checks */
|
||||||
|
if (!check_extensions(streamFile,"adpcm"))
|
||||||
|
goto fail;
|
||||||
|
if (read_32bitBE(0x00,streamFile) != 0x02000000)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
channel_count = read_16bitLE(0x04, streamFile);
|
||||||
|
if (channel_count > 2) goto fail; /* header size seems fixed for mono/stereo */
|
||||||
|
/* 0x08: channel size */
|
||||||
|
/* 0x0c-14: some config/id? (may be shared between files) */
|
||||||
|
loop_flag = read_16bitLE(0x68, streamFile);
|
||||||
|
|
||||||
|
start_offset = 0xd8; /* also fixed for mono/stereo */
|
||||||
|
|
||||||
|
|
||||||
|
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||||
|
if (!vgmstream) goto fail;
|
||||||
|
|
||||||
|
vgmstream->meta_type = meta_ADPCM_CAPCOM;
|
||||||
|
vgmstream->sample_rate = read_32bitLE(0x64,streamFile); /* from first headerm repeated at +0x60 */
|
||||||
|
vgmstream->num_samples = read_32bitLE(0x60, streamFile);
|
||||||
|
vgmstream->loop_start_sample = read_32bitLE(0x6c, streamFile);
|
||||||
|
vgmstream->loop_end_sample = read_32bitLE(0x70, streamFile) + 1;
|
||||||
|
|
||||||
|
vgmstream->coding_type = coding_NGC_DSP;
|
||||||
|
vgmstream->layout_type = layout_interleave;
|
||||||
|
vgmstream->interleave_block_size = read_16bitLE(0x06, streamFile);
|
||||||
|
dsp_read_coefs_le(vgmstream,streamFile, 0x18, 0x60);
|
||||||
|
|
||||||
|
if (!vgmstream_open_stream(vgmstream,streamFile, start_offset))
|
||||||
|
goto fail;
|
||||||
|
return vgmstream;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
close_vgmstream(vgmstream);
|
||||||
|
return NULL;
|
||||||
|
}
|
@ -789,4 +789,6 @@ VGMSTREAM * init_vgmstream_derf(STREAMFILE *streamFile);
|
|||||||
|
|
||||||
VGMSTREAM * init_vgmstream_utk(STREAMFILE *streamFile);
|
VGMSTREAM * init_vgmstream_utk(STREAMFILE *streamFile);
|
||||||
|
|
||||||
|
VGMSTREAM * init_vgmstream_adpcm_capcom(STREAMFILE *streamFile);
|
||||||
|
|
||||||
#endif /*_META_H*/
|
#endif /*_META_H*/
|
||||||
|
@ -439,6 +439,7 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
|
|||||||
init_vgmstream_xau_konami,
|
init_vgmstream_xau_konami,
|
||||||
init_vgmstream_derf,
|
init_vgmstream_derf,
|
||||||
init_vgmstream_utk,
|
init_vgmstream_utk,
|
||||||
|
init_vgmstream_adpcm_capcom,
|
||||||
|
|
||||||
|
|
||||||
/* 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) */
|
||||||
|
@ -704,6 +704,7 @@ typedef enum {
|
|||||||
meta_DERF, /* Stupid Invaders (PC) */
|
meta_DERF, /* Stupid Invaders (PC) */
|
||||||
meta_UTK,
|
meta_UTK,
|
||||||
meta_NXA,
|
meta_NXA,
|
||||||
|
meta_ADPCM_CAPCOM,
|
||||||
|
|
||||||
} meta_t;
|
} meta_t;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user