From c9da7642b451384af33b4da1779d0fb3be3f08fe Mon Sep 17 00:00:00 2001 From: bnnm Date: Fri, 16 Sep 2022 23:39:05 +0200 Subject: [PATCH] Fix some Sony .bnk [Ikaruga (PS4)] --- src/meta/bnk_sony.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/meta/bnk_sony.c b/src/meta/bnk_sony.c index 41056574..896ce0f6 100644 --- a/src/meta/bnk_sony.c +++ b/src/meta/bnk_sony.c @@ -127,6 +127,7 @@ VGMSTREAM* init_vgmstream_bnk_sony(STREAMFILE* sf) { case 0x0d: /* Polara (Vita), Crypt of the Necrodancer (Vita) */ case 0x0e: /* Yakuza 6's Puyo Puyo (PS4) */ + case 0x0f: /* Ikaruga (PS4) */ table1_offset = sblk_offset + read_u32(sblk_offset+0x18,sf); table2_offset = sblk_offset + read_u32(sblk_offset+0x1c,sf); table3_offset = sblk_offset + read_u32(sblk_offset+0x2c,sf); @@ -298,6 +299,7 @@ VGMSTREAM* init_vgmstream_bnk_sony(STREAMFILE* sf) { case 0x0d: case 0x0e: + case 0x0f: flags = read_u8 (table3_offset+table3_entry_offset+0x12,sf); stream_offset = read_u32(table3_offset+table3_entry_offset+0x44,sf); stream_size = read_u32(table3_offset+table3_entry_offset+0x48,sf); @@ -471,6 +473,7 @@ VGMSTREAM* init_vgmstream_bnk_sony(STREAMFILE* sf) { case 0x0d: case 0x0e: + case 0x0f: type = read_u16(start_offset+0x00,sf); if (read_u32(start_offset+0x04,sf) != 0x01) /* type? */ goto fail; @@ -509,16 +512,18 @@ VGMSTREAM* init_vgmstream_bnk_sony(STREAMFILE* sf) { codec = PCM16; break; - case 0x00: /* PS-ADPCM (test banks) */ + case 0x00: /* HEVAG (test banks) */ + case 0x03: /* HEVAG (Ikaruga) */ /* 0x10: null? */ channels = read_u32(start_offset+0x14,sf); - interleave = 0x02; + interleave = 0x10; loop_start = read_u32(start_offset+0x18,sf); loop_length = read_u32(start_offset+0x1c,sf); loop_end = loop_start + loop_length; /* loop_start is -1 if not set */ codec = HEVAG; + //TODO: in v0x0f right before start_offset is the .vag filename, see if offset can be found break; default: