Fix stereo .vs [All Star Pro-Wrestling 2/3 (PS2)]

This commit is contained in:
bnnm 2018-12-21 22:38:48 +01:00
parent 3ead9f7f4a
commit 28f4896818
2 changed files with 10 additions and 5 deletions

View File

@ -8,7 +8,7 @@ void block_update_vs_ffx(off_t block_offset, VGMSTREAM * vgmstream) {
vgmstream->current_block_offset = block_offset;
vgmstream->current_block_size = block_size - 0x20;
vgmstream->next_block_offset = block_offset + block_size;
vgmstream->next_block_offset = block_offset + block_size*vgmstream->channels;
/* 0x08: number of remaning blocks, 0x0c: blocks left */
for (i = 0; i < vgmstream->channels; i++) {

View File

@ -3,10 +3,10 @@
#include "../coding/coding.h"
/* VS - VagStream from Square games [Final Fantasy X (PS2) voices, Unlimited Saga (PS2) voices] */
/* VS - VagStream from Square games [Final Fantasy X (PS2) voices, Unlimited Saga (PS2) voices, All Star Pro-Wrestling 2/3 (PS2) music] */
VGMSTREAM * init_vgmstream_vs_ffx(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
int channel_count, loop_flag, pitch;
int channel_count, loop_flag, pitch, flags;
off_t start_offset;
@ -17,7 +17,7 @@ VGMSTREAM * init_vgmstream_vs_ffx(STREAMFILE *streamFile) {
if (read_32bitBE(0x00,streamFile) != 0x56530000) /* "VS\0\0" */
goto fail;
/* 0x04: null (flags? used in SVS) */
flags = read_32bitLE(0x04,streamFile);
/* 0x08: block number */
/* 0x0c: blocks left in the subfile */
pitch = read_32bitLE(0x10,streamFile); /* usually 0x1000 = 48000 */
@ -25,8 +25,13 @@ VGMSTREAM * init_vgmstream_vs_ffx(STREAMFILE *streamFile) {
/* 0x18: null */
/* 0x1c: null */
if (flags != 0x00 && flags != 0x01) {
VGM_LOG("VS: unknown flags\n");
goto fail;
}
loop_flag = 0;
channel_count = 1;
channel_count = (flags & 1) ? 2 : 1;
start_offset = 0x00;