Add .zwv [THE iDOLM@STER Shiny TV (PS3)]

This commit is contained in:
bnnm 2020-08-01 15:28:12 +02:00
parent b61908f3af
commit 230aa56a8c
7 changed files with 68 additions and 4 deletions

View File

@ -610,6 +610,7 @@ static const char* extension_list[] = {
"zsm",
"zss",
"zwdsp",
"zwv",
"vgmstream" /* fake extension, catch-all for FFmpeg/txth/etc */

View File

@ -1946,10 +1946,14 @@
RelativePath=".\meta\zsnd.c"
>
</File>
<File
RelativePath=".\meta\zwdsp.c"
>
</File>
<File
RelativePath=".\meta\zwdsp.c"
>
</File>
<File
RelativePath=".\meta\zwv.c"
>
</File>
</Filter>
</Filter>
<Filter

View File

@ -575,6 +575,7 @@
<ClCompile Include="meta\zsd.c" />
<ClCompile Include="meta\zsnd.c" />
<ClCompile Include="meta\zwdsp.c" />
<ClCompile Include="meta\zwv.c" />
<ClCompile Include="coding\acm_decoder.c" />
<ClCompile Include="coding\acm_decoder_decode.c" />
<ClCompile Include="coding\acm_decoder_util.c" />

View File

@ -1216,6 +1216,9 @@
<ClCompile Include="meta\zwdsp.c">
<Filter>meta\Source Files</Filter>
</ClCompile>
<ClCompile Include="meta\zwv.c">
<Filter>meta\Source Files</Filter>
</ClCompile>
<ClCompile Include="coding\acm_decoder.c">
<Filter>coding\Source Files</Filter>
</ClCompile>

View File

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

52
src/meta/zwv.c Normal file
View File

@ -0,0 +1,52 @@
#include "meta.h"
#include "../coding/coding.h"
/* .zwv - from Namco games [THE iDOLM@STER Shiny TV (PS3)] */
VGMSTREAM* init_vgmstream_zwv(STREAMFILE* sf) {
VGMSTREAM* vgmstream = NULL;
STREAMFILE* temp_sf = NULL;
off_t subfile_offset;
size_t subfile_size;
/* checks */
if (!check_extensions(sf,"zwv"))
goto fail;
if (read_u32be(0x00,sf) != 0x77617665) /* "wave" */
goto fail;
/* has a mini header then a proper MSF:
* 0x04: null
* 0x08: null
* 0x0c: version/config? (0x06040000)
* 0x10: version/config? (0x00030210)
* 0x14: sample rate
* 0x18: ? (related to sample rate)
* 0x1c: null
* 0x20: data offset
* 0x24: data size
* 0x28: loop flag (0x30+ is removed if no loop)
* 0x2c: ? (related to loop, or null)
* 0x30: null
* 0x30: loop start offset (same as MSF)
* 0x30: loop end offset (same as MSF start+length)
* 0x3c: null
*/
subfile_offset = read_u32be(0x20, sf) - 0x40;
subfile_size = read_u32be(0x24, sf) + 0x40;
temp_sf = setup_subfile_streamfile(sf, subfile_offset, subfile_size, "msf");
if (!temp_sf) goto fail;
vgmstream = init_vgmstream_msf(temp_sf);
if (!vgmstream) goto fail;
close_streamfile(temp_sf);
return vgmstream;
fail:
close_streamfile(temp_sf);
close_vgmstream(vgmstream);
return NULL;
}

View File

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