mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-25 07:20:10 +01:00
Tweak .vs doc
This commit is contained in:
parent
ec63b8ff38
commit
2e2eeb8723
@ -686,7 +686,7 @@ static const layout_info layout_info_list[] = {
|
|||||||
{layout_blocked_sthd, "blocked (STHD)"},
|
{layout_blocked_sthd, "blocked (STHD)"},
|
||||||
{layout_blocked_h4m, "blocked (H4M)"},
|
{layout_blocked_h4m, "blocked (H4M)"},
|
||||||
{layout_blocked_xa_aiff, "blocked (XA AIFF)"},
|
{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[] = {
|
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_XWMA, "Microsoft XWMA RIFF header"},
|
||||||
{meta_VA3, "Konami VA3 header" },
|
{meta_VA3, "Konami VA3 header" },
|
||||||
{meta_XOPUS, "Exient XOPUS header"},
|
{meta_XOPUS, "Exient XOPUS header"},
|
||||||
{meta_VS_FFX, "Final Fantasy X VS header"},
|
{meta_VS_FFX, "Square VS header"},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,24 +1,15 @@
|
|||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
#include "../vgmstream.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) {
|
void block_update_vs_ffx(off_t block_offset, VGMSTREAM * vgmstream) {
|
||||||
int i;
|
int i;
|
||||||
size_t block_size = 0x800;
|
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_offset = block_offset;
|
||||||
vgmstream->current_block_size = block_size - 0x20;
|
vgmstream->current_block_size = block_size - 0x20;
|
||||||
vgmstream->next_block_offset = block_offset + block_size;
|
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++) {
|
for (i = 0; i < vgmstream->channels; i++) {
|
||||||
vgmstream->ch[i].offset = block_offset + 0x20 + 0x800*i;
|
vgmstream->ch[i].offset = block_offset + 0x20 + 0x800*i;
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
#include "../layout/layout.h"
|
#include "../layout/layout.h"
|
||||||
#include "../coding/coding.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 * init_vgmstream_vs_ffx(STREAMFILE *streamFile) {
|
||||||
VGMSTREAM * vgmstream = NULL;
|
VGMSTREAM * vgmstream = NULL;
|
||||||
int channel_count, loop_flag, pitch;
|
int channel_count, loop_flag, pitch;
|
||||||
@ -16,11 +17,17 @@ VGMSTREAM * init_vgmstream_vs_ffx(STREAMFILE *streamFile) {
|
|||||||
if (read_32bitBE(0x00,streamFile) != 0x56530000) /* "VS\0\0" */
|
if (read_32bitBE(0x00,streamFile) != 0x56530000) /* "VS\0\0" */
|
||||||
goto fail;
|
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;
|
loop_flag = 0;
|
||||||
channel_count = 1;
|
channel_count = 1;
|
||||||
start_offset = 0x00;
|
start_offset = 0x00;
|
||||||
pitch = read_32bitLE(0x10,streamFile);
|
|
||||||
|
|
||||||
|
|
||||||
/* build the VGMSTREAM */
|
/* build the VGMSTREAM */
|
||||||
@ -28,7 +35,7 @@ VGMSTREAM * init_vgmstream_vs_ffx(STREAMFILE *streamFile) {
|
|||||||
if (!vgmstream) goto fail;
|
if (!vgmstream) goto fail;
|
||||||
|
|
||||||
vgmstream->meta_type = meta_VS_FFX;
|
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->coding_type = coding_PSX;
|
||||||
vgmstream->layout_type = layout_blocked_vs_ffx;
|
vgmstream->layout_type = layout_blocked_vs_ffx;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user