diff --git a/src/formats.c b/src/formats.c index ac340d35..cee7b0fd 100644 --- a/src/formats.c +++ b/src/formats.c @@ -686,7 +686,7 @@ static const layout_info layout_info_list[] = { {layout_blocked_sthd, "blocked (STHD)"}, {layout_blocked_h4m, "blocked (H4M)"}, {layout_blocked_xa_aiff, "blocked (XA AIFF)"}, - {layout_blocked_vs_ffx, "blocked (Final Fantasy X VS)"}, + {layout_blocked_vs_ffx, "blocked (Square VS)"}, }; static const meta_info meta_info_list[] = { @@ -1106,7 +1106,7 @@ static const meta_info meta_info_list[] = { {meta_XWMA, "Microsoft XWMA RIFF header"}, {meta_VA3, "Konami VA3 header" }, {meta_XOPUS, "Exient XOPUS header"}, - {meta_VS_FFX, "Final Fantasy X VS header"}, + {meta_VS_FFX, "Square VS header"}, }; diff --git a/src/layout/blocked_vs_ffx.c b/src/layout/blocked_vs_ffx.c index 7c7c620b..d7a924a1 100644 --- a/src/layout/blocked_vs_ffx.c +++ b/src/layout/blocked_vs_ffx.c @@ -1,24 +1,15 @@ #include "layout.h" #include "../vgmstream.h" -/* Final Fantasy X VS headered blocks */ +/* Square "VS" headered blocks */ void block_update_vs_ffx(off_t block_offset, VGMSTREAM * vgmstream) { int i; size_t block_size = 0x800; - /* 0x00: header id - * 0x04: null - * 0x08: block number - * 0x0c: blocks left in the subfile - * 0x10: always 0x1000 - * 0x14: always 0x64 - * 0x18: null - * 0x1c: null */ - vgmstream->current_block_offset = block_offset; vgmstream->current_block_size = block_size - 0x20; vgmstream->next_block_offset = block_offset + block_size; - /* 0x08: number of remaning blocks, 0x10: some id/size? (shared in all blocks) */ + /* 0x08: number of remaning blocks, 0x0c: blocks left */ for (i = 0; i < vgmstream->channels; i++) { vgmstream->ch[i].offset = block_offset + 0x20 + 0x800*i; diff --git a/src/meta/vs_ffx.c b/src/meta/vs_ffx.c index 6fbb095b..f91fa656 100644 --- a/src/meta/vs_ffx.c +++ b/src/meta/vs_ffx.c @@ -2,7 +2,8 @@ #include "../layout/layout.h" #include "../coding/coding.h" -/* .vs/VS - from Final Fantasy X voices (PS2) */ + +/* VS - VagStream from Square games [Final Fantasy X (PS2) voices, Unlimited Saga (PS2) voices] */ VGMSTREAM * init_vgmstream_vs_ffx(STREAMFILE *streamFile) { VGMSTREAM * vgmstream = NULL; int channel_count, loop_flag, pitch; @@ -13,14 +14,20 @@ VGMSTREAM * init_vgmstream_vs_ffx(STREAMFILE *streamFile) { /* .vs: header id (probably ok like The Bouncer's .vs, very similar) */ if (!check_extensions(streamFile, "vs")) goto fail; - if (read_32bitBE(0x00,streamFile) != 0x56530000) /* "VS\0\0" */ + if (read_32bitBE(0x00,streamFile) != 0x56530000) /* "VS\0\0" */ goto fail; + /* 0x04: null (flags? used in SVS) */ + /* 0x08: block number */ + /* 0x0c: blocks left in the subfile */ + pitch = read_32bitLE(0x10,streamFile); /* usually 0x1000 = 48000 */ + /* 0x14: volume, usually 0x64 = 100 but be bigger/smaller (up to 128?) */ + /* 0x18: null */ + /* 0x1c: null */ loop_flag = 0; channel_count = 1; start_offset = 0x00; - pitch = read_32bitLE(0x10,streamFile); /* build the VGMSTREAM */ @@ -28,7 +35,7 @@ VGMSTREAM * init_vgmstream_vs_ffx(STREAMFILE *streamFile) { if (!vgmstream) goto fail; vgmstream->meta_type = meta_VS_FFX; - vgmstream->sample_rate = (48000 * pitch) / 4096; /* needed for rare files, sounds ok */ + vgmstream->sample_rate = (48000 * pitch) / 4096; /* verified, needed for rare files */ vgmstream->coding_type = coding_PSX; vgmstream->layout_type = layout_blocked_vs_ffx;