Merge pull request #1099 from bnnm/psb-etc

- Add .vm4 extension [Elder Gate (PS1)]
- Fix some .psb loops [Senxin Aleste (AC)]
- Add HCA key
This commit is contained in:
bnnm 2022-03-30 00:09:15 +02:00 committed by GitHub
commit 3255f38b35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 9 deletions

View File

@ -563,6 +563,7 @@ static const char* extension_list[] = {
"vid",
"vig",
"vis",
"vm4", //txth/reserved [Elder Gate (PS1)]
"vms",
"vmu", //txth/reserved [Red Faction (PS2)]
"voi",

View File

@ -858,6 +858,7 @@ static const hcakey_info hcakey_list[] = {
{0x0a5d0fc8cc5c4502}, // Sng018
{0x198ea1a17416050b}, // Sng019
{0x2aa3b8abad207a1e}, // Sng020
{0x4ee10a3e3bb19e57}, // Sng021
{0x08ad2fe12c79bca9}, // Sng022
{0x18488992b1632ef5}, // Sng023
{0x1175edbbacc1fc18}, // Sng024

View File

@ -51,7 +51,7 @@ typedef struct {
int loop_flag;
int32_t loop_start;
int32_t loop_end;
int duration_test;
int loop_test;
} psb_header_t;
@ -155,8 +155,6 @@ VGMSTREAM* init_vgmstream_psb(STREAMFILE* sf) {
default: goto fail;
}
if (psb.duration_test && psb.loop_start + psb.loop_end <= vgmstream->num_samples)
vgmstream->loop_end_sample += psb.loop_start;
break;
case MSADPCM: /* [Senxin Aleste (AC)] */
@ -222,14 +220,25 @@ VGMSTREAM* init_vgmstream_psb(STREAMFILE* sf) {
}
vgmstream->num_samples = read_u32le(psb.stream_offset[0] + 0x00, sf);
if (psb.duration_test && psb.loop_start + psb.loop_end < vgmstream->num_samples)
vgmstream->loop_end_sample += psb.loop_start;
break;
default:
goto fail;
}
/* loop meaning varies, no apparent flags, seen in PCM/DSP/MSADPCM/WMAv2:
* - loop_start + loop_length [LoM (PC), Namco Museum V1 (PC), Senxin Aleste (PC)]
* - loop_start + loop_end [G-Darius (Sw)]
* (only in some cases of "loop" field so shouldn't happen to often) */
if (psb.loop_test) {
if (psb.loop_start + psb.loop_end <= vgmstream->num_samples) {
vgmstream->loop_end_sample += psb.loop_start;
/* assumed, matches num_samples in LoM and Namco but not in Senjin Aleste (unknown in G-Darius) */
if (vgmstream->loop_end_sample < vgmstream->num_samples)
vgmstream->loop_end_sample += 1;
}
}
strncpy(vgmstream->stream_name, psb.readable_name, STREAM_NAME_SIZE);
if (!vgmstream_open_stream(vgmstream, sf, psb.stream_offset[0]))
@ -598,9 +607,9 @@ static int parse_psb_channels(psb_header_t* psb, psb_node_t* nchans) {
psb->loop_start = psb_node_get_result(&nsub).num;
psb_node_by_index(&node, 1, &nsub);
psb->loop_end = psb_node_get_result(&nsub).num + 1; /* assumed, matches num_samples */
/* duration [LoM (PC), Namco Museum V1 (PC)] or standard [G-Darius (Sw)] (no apparent flags) */
psb->duration_test = 1;
psb->loop_end = psb_node_get_result(&nsub).num;
psb->loop_test = 1; /* loop end meaning varies*/
}
}

View File

@ -244,7 +244,7 @@ static int xa_read_subsongs(STREAMFILE* sf, int target_subsong, off_t start, uin
is_audio = !(xa_submode & 0x08) && (xa_submode & 0x04) && !(xa_submode & 0x02);
is_eof = (xa_submode & 0x80);
VGM_ASSERT((xa_submode & 0x01), "XA: end of audio at %lx\n", offset); /* used? */
VGM_ASSERT((xa_submode & 0x01), "XA: end of audio at %lx\n", offset); /* rare, signals last sector [Tetris (CD-i)] */
//;VGM_ASSERT(is_eof, "XA: eof at %lx\n", offset);
//;VGM_ASSERT(!is_audio, "XA: not audio at %lx\n", offset);