Add .dsb [Taiko no Tatsujin DS: Dororon! Yokai Daikessen!! (DS)]

This commit is contained in:
bnnm 2020-08-01 16:04:41 +02:00
parent d263b9c080
commit aa58da7ca1
7 changed files with 66 additions and 0 deletions

View File

@ -150,6 +150,7 @@ static const char* extension_list[] = {
"diva",
"dmsg",
"ds2", //txth/reserved [Star Wars Bounty Hunter (GC)]
"dsb",
"dsf",
"dsp",
"dspw",

View File

@ -660,6 +660,10 @@
RelativePath=".\meta\dmsg_segh.c"
>
</File>
<File
RelativePath=".\meta\dsb.c"
>
</File>
<File
RelativePath=".\meta\dsf.c"
>

View File

@ -316,6 +316,7 @@
<ClCompile Include="meta\derf.c" />
<ClCompile Include="meta\diva.c" />
<ClCompile Include="meta\dmsg_segh.c" />
<ClCompile Include="meta\dsb.c" />
<ClCompile Include="meta\dsf.c" />
<ClCompile Include="meta\dsp_adx.c" />
<ClCompile Include="meta\dsp_bdsp.c" />

View File

@ -457,6 +457,9 @@
<ClCompile Include="meta\dmsg_segh.c">
<Filter>meta\Source Files</Filter>
</ClCompile>
<ClCompile Include="meta\dsb.c">
<Filter>meta\Source Files</Filter>
</ClCompile>
<ClCompile Include="meta\dsf.c">
<Filter>meta\Source Files</Filter>
</ClCompile>

54
src/meta/dsb.c Normal file
View File

@ -0,0 +1,54 @@
#include "meta.h"
#include "../coding/coding.h"
/* .dsb - from Namco games [Taiko no Tatsujin DS: Dororon! Yokai Daikessen!! (DS)] */
VGMSTREAM* init_vgmstream_dsb(STREAMFILE* sf) {
VGMSTREAM* vgmstream = NULL;
STREAMFILE* temp_sf = NULL;
off_t subfile_offset;
size_t subfile_size;
/* checks */
if (!check_extensions(sf,"dsb"))
goto fail;
if (read_u32be(0x00,sf) != 0x44535342) /* "DSSB" */
goto fail;
if (read_u32be(0x40,sf) != 0x44535354) /* "DSST" */
goto fail;
/* - DDSB:
* 0x04: chunk size
* 0x08: file name
* 0x14: sample rate
* 0x18: v01?
* 0x1c: file size
* 0x20: DSST offset
*
* - DDST:
* 0x44: chunk size
* 0x48: file name
* 0x58: small signed number?
* 0x5c: data size (with padding)
* 0x60: small signed number?
* 0x64: ?
* rest: null
*/
subfile_offset = 0x80;
subfile_size = read_u32be(0x80 + 0x04, sf) + 0x08; /* files are padded so use BNSF */
temp_sf = setup_subfile_streamfile(sf, subfile_offset, subfile_size, "bnsf");
if (!temp_sf) goto fail;
vgmstream = init_vgmstream_bnsf(temp_sf);
if (!vgmstream) goto fail;
close_streamfile(temp_sf);
return vgmstream;
fail:
close_streamfile(temp_sf);
close_vgmstream(vgmstream);
return NULL;
}

View File

@ -913,4 +913,6 @@ VGMSTREAM* init_vgmstream_adp_konami(STREAMFILE* sf);
VGMSTREAM* init_vgmstream_zwv(STREAMFILE* sf);
VGMSTREAM* init_vgmstream_dsb(STREAMFILE* sf);
#endif /*_META_H*/

View File

@ -506,6 +506,7 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
init_vgmstream_ktsc,
init_vgmstream_adp_konami,
init_vgmstream_zwv,
init_vgmstream_dsb,
/* 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 */