mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-17 23:36:41 +01:00
meta rewrite for Lunar: Eternal Blue (SCD)
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@738 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
065d8a12e6
commit
c56ae2fd6a
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Version="9.00"
|
||||
Name="libvgmstream"
|
||||
ProjectGUID="{54A6AD11-5369-4895-A06F-E255ABB99B11}"
|
||||
RootNamespace="libvgmstream"
|
||||
|
@ -185,7 +185,7 @@ VGMSTREAM * init_vgmstream_ps2_psh(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_mus_acm(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_pcm(STREAMFILE * streamFile);
|
||||
VGMSTREAM * init_vgmstream_pcm_scd(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_rkv(STREAMFILE * streamFile);
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* PCM (from Ephemeral Fantasia) */
|
||||
VGMSTREAM * init_vgmstream_pcm(STREAMFILE *streamFile) {
|
||||
/* PCM (from Lunar: Eternal Blue (Sega CD) */
|
||||
VGMSTREAM * init_vgmstream_pcm_scd(STREAMFILE *streamFile) {
|
||||
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[260];
|
||||
@ -15,8 +15,9 @@ VGMSTREAM * init_vgmstream_pcm(STREAMFILE *streamFile) {
|
||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("pcm",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x18,streamFile) ==0x00000000) {
|
||||
/* check header */
|
||||
if (read_32bitBE(0x0,streamFile) != 0x00020000)
|
||||
goto fail;
|
||||
|
||||
loop_flag = (read_32bitLE(0x02,streamFile)!=0);
|
||||
channel_count = 1;
|
||||
@ -31,67 +32,15 @@ VGMSTREAM * init_vgmstream_pcm(STREAMFILE *streamFile) {
|
||||
vgmstream->sample_rate = 32000;
|
||||
vgmstream->coding_type = coding_PCM8_SB_int;
|
||||
vgmstream->num_samples = read_32bitBE(0x06,streamFile)*2;
|
||||
|
||||
if(loop_flag) {
|
||||
vgmstream->loop_start_sample = read_32bitBE(0x03,streamFile)*8;
|
||||
vgmstream->loop_start_sample = read_32bitBE(0x02,streamFile)*0x800;
|
||||
vgmstream->loop_end_sample = read_32bitBE(0x06,streamFile)*2;
|
||||
}
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x2;
|
||||
vgmstream->meta_type = meta_PCM;
|
||||
vgmstream->meta_type = meta_PCM_SCD;
|
||||
|
||||
} else if (read_32bitBE(0x410,streamFile) ==0x9CDB0740) {
|
||||
|
||||
loop_flag = (read_32bitLE(0x0C,streamFile)!=0);
|
||||
channel_count = 2;
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
start_offset = 0x800;
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = 22050;
|
||||
vgmstream->coding_type = coding_PCM16LE;
|
||||
vgmstream->num_samples = read_32bitLE(0x4,streamFile);
|
||||
|
||||
if(loop_flag == 1) {
|
||||
vgmstream->loop_start_sample = read_32bitLE(0x08,streamFile);
|
||||
vgmstream->loop_end_sample = read_32bitLE(0x0C,streamFile);
|
||||
}
|
||||
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x2;
|
||||
vgmstream->meta_type = meta_PCM;
|
||||
} else if ((read_32bitBE(0x0,streamFile) ==0x786D6402) ||
|
||||
(read_32bitBE(0x0,streamFile) ==0x786D6401)) {
|
||||
loop_flag = 0;
|
||||
channel_count = read_8bit(0x03,streamFile);
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
start_offset = 0x10;
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = (int32_t)(read_16bitLE(0x4,streamFile) & 0x0000ffff);
|
||||
vgmstream->coding_type = coding_PCM8_int;
|
||||
vgmstream->num_samples = read_32bitLE(0x6,streamFile);
|
||||
|
||||
if(loop_flag == 1) {
|
||||
vgmstream->loop_start_sample = read_32bitLE(0x08,streamFile);
|
||||
vgmstream->loop_end_sample = read_32bitLE(0x0C,streamFile);
|
||||
}
|
||||
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x8;
|
||||
vgmstream->meta_type = meta_PCM;
|
||||
} else
|
||||
goto fail;
|
||||
|
||||
/* open the file for reading */
|
||||
/* open the file for reading */
|
||||
{
|
||||
int i;
|
||||
STREAMFILE * file;
|
||||
|
@ -108,7 +108,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_ps2_kces,
|
||||
init_vgmstream_ps2_dxh,
|
||||
init_vgmstream_ps2_psh,
|
||||
init_vgmstream_pcm,
|
||||
init_vgmstream_pcm_scd,
|
||||
init_vgmstream_ps2_rkv,
|
||||
init_vgmstream_ps2_psw,
|
||||
init_vgmstream_ps2_vas,
|
||||
@ -2046,7 +2046,7 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
||||
case meta_RIFX_WAVE_smpl:
|
||||
snprintf(temp,TEMPSIZE,"RIFX WAVE header with sample looping info");
|
||||
break;
|
||||
case meta_PCM:
|
||||
case meta_PCM_SCD:
|
||||
snprintf(temp,TEMPSIZE,"PCM file with custom header");
|
||||
break;
|
||||
case meta_PS2_RKV:
|
||||
|
@ -264,7 +264,7 @@ typedef enum {
|
||||
meta_PS2_KCES, /* Dance Dance Revolution */
|
||||
meta_PS2_DXH, /* Tokobot Plus - Myteries of the Karakuri */
|
||||
meta_PS2_PSH, /* Dawn of Mana - Seiken Densetsu 4 */
|
||||
meta_PCM, /* Ephemeral Fantasia, Lunar - Eternal Blue */
|
||||
meta_PCM_SCD, /* Lunar - Eternal Blue */
|
||||
meta_PS2_RKV, /* Legacy of Kain - Blood Omen 2 */
|
||||
meta_PS2_PSW, /* Rayman Raving Rabbids */
|
||||
meta_PS2_VAS, /* Pro Baseball Spirits 5 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user