mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-01 04:25:48 +01:00
Fix some .ads/ss2 [Katamari Damacy (PS2)]
This commit is contained in:
parent
e32630efda
commit
510ed0e1da
@ -14,6 +14,9 @@ VGMSTREAM* init_vgmstream_ads(STREAMFILE* sf) {
|
|||||||
|
|
||||||
|
|
||||||
/* checks */
|
/* checks */
|
||||||
|
if (!is_id32be(0x00,sf,"SShd"))
|
||||||
|
goto fail;
|
||||||
|
|
||||||
/* .ads: actual extension
|
/* .ads: actual extension
|
||||||
* .ss2: demuxed videos (fake?)
|
* .ss2: demuxed videos (fake?)
|
||||||
* .pcm: Taisho Mononoke Ibunroku (PS2)
|
* .pcm: Taisho Mononoke Ibunroku (PS2)
|
||||||
@ -23,20 +26,20 @@ VGMSTREAM* init_vgmstream_ads(STREAMFILE* sf) {
|
|||||||
if (!check_extensions(sf, "ads,ss2,pcm,adx,,800"))
|
if (!check_extensions(sf, "ads,ss2,pcm,adx,,800"))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (!is_id32be(0x00,sf,"SShd") &&
|
if (read_u32le(0x04,sf) != 0x18 && /* standard header size */
|
||||||
!is_id32be(0x20,sf,"SSbd"))
|
read_u32le(0x04,sf) != 0x20 && /* True Fortune (PS2) */
|
||||||
goto fail;
|
read_u32le(0x04,sf) != get_streamfile_size(sf) - 0x08) /* Katamari Damacy videos */
|
||||||
if (read_32bitLE(0x04,sf) != 0x18 && /* standard header size */
|
|
||||||
read_32bitLE(0x04,sf) != 0x20) /* True Fortune (PS2) */
|
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
if (!is_id32be(0x20,sf,"SSbd"))
|
||||||
|
goto fail;
|
||||||
|
|
||||||
/* base values (a bit unorderly since devs hack ADS too much and detection is messy) */
|
/* base values (a bit unorderly since devs hack ADS too much and detection is messy) */
|
||||||
{
|
{
|
||||||
codec = read_32bitLE(0x08,sf);
|
codec = read_u32le(0x08,sf);
|
||||||
sample_rate = read_32bitLE(0x0C,sf);
|
sample_rate = read_s32le(0x0C,sf);
|
||||||
channels = read_32bitLE(0x10,sf); /* up to 4 [Eve of Extinction (PS2)] */
|
channels = read_s32le(0x10,sf); /* up to 4 [Eve of Extinction (PS2)] */
|
||||||
interleave = read_32bitLE(0x14,sf); /* set even when mono */
|
interleave = read_s32le(0x14,sf); /* set even when mono */
|
||||||
|
|
||||||
|
|
||||||
switch(codec) {
|
switch(codec) {
|
||||||
@ -61,7 +64,7 @@ VGMSTREAM* init_vgmstream_ads(STREAMFILE* sf) {
|
|||||||
|
|
||||||
case 0x00: /* PCM16BE from official docs, probably never used */
|
case 0x00: /* PCM16BE from official docs, probably never used */
|
||||||
default:
|
default:
|
||||||
VGM_LOG("ADS: unknown codec\n");
|
vgm_logi("ADS: unknown codec\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,8 +130,8 @@ VGMSTREAM* init_vgmstream_ads(STREAMFILE* sf) {
|
|||||||
{
|
{
|
||||||
uint32_t loop_start, loop_end;
|
uint32_t loop_start, loop_end;
|
||||||
|
|
||||||
loop_start = read_32bitLE(0x18,sf);
|
loop_start = read_u32le(0x18,sf);
|
||||||
loop_end = read_32bitLE(0x1C,sf);
|
loop_end = read_u32le(0x1C,sf);
|
||||||
|
|
||||||
loop_flag = 0;
|
loop_flag = 0;
|
||||||
|
|
||||||
@ -144,7 +147,7 @@ VGMSTREAM* init_vgmstream_ads(STREAMFILE* sf) {
|
|||||||
loop_start_offset = loop_start * 0x10;
|
loop_start_offset = loop_start * 0x10;
|
||||||
ignore_silent_frame_capcom = 1;
|
ignore_silent_frame_capcom = 1;
|
||||||
}
|
}
|
||||||
else if (read_32bitBE(0x28,sf) == 0x50414421) { /* "PAD!" padding until 0x800 */
|
else if (is_id32be(0x28,sf, "PAD!")) { /* padding until 0x800 */
|
||||||
/* Super Galdelic Hour: loop_start is PCM bytes */
|
/* Super Galdelic Hour: loop_start is PCM bytes */
|
||||||
loop_flag = 1;
|
loop_flag = 1;
|
||||||
loop_start_sample = loop_start / 2 / channels;
|
loop_start_sample = loop_start / 2 / channels;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user