Add .ogg loops [The Rumble Fish + (Switch)]

This commit is contained in:
bnnm 2024-02-04 15:26:54 +01:00
parent c511f24942
commit 1a8d62a180

View File

@ -644,16 +644,18 @@ static VGMSTREAM* _init_vgmstream_ogg_vorbis_config(STREAMFILE* sf, off_t start,
while (ogg_vorbis_get_comment(data, &comment)) {
;VGM_LOG("OGG: user_comment=%s\n", comment);
if (strstr(comment,"loop_start=") == comment || /* Phantasy Star Online: Blue Burst (PC) (no loop_end pair) */
strstr(comment,"LOOP_START=") == comment || /* Phantasy Star Online: Blue Burst (PC), common */
strstr(comment,"LOOPPOINT=") == comment || /* Sonic Robo Blast 2 */
strstr(comment,"COMMENT=LOOPPOINT=") == comment ||
strstr(comment,"LOOPSTART=") == comment ||
strstr(comment,"um3.stream.looppoint.start=") == comment ||
strstr(comment,"LOOP_BEGIN=") == comment || /* Hatsune Miku: Project Diva F (PS3) */
strstr(comment,"LoopStart=") == comment || /* Capcom games [Devil May Cry 4 (PC)] */
strstr(comment,"LOOP=") == comment || /* Duke Nukem 3D: 20th Anniversary World Tour */
strstr(comment,"XIPH_CUE_LOOPSTART=") == comment) { /* DeNa games [Super Mario Run (Android), FF Record Keeper (Android)] */
if ( strstr(comment,"loop_start=") == comment /* Phantasy Star Online: Blue Burst (PC) (no loop_end pair) */
|| strstr(comment,"LOOP_START=") == comment /* Phantasy Star Online: Blue Burst (PC), common */
|| strstr(comment,"LOOPPOINT=") == comment /* Sonic Robo Blast 2 (PC) */
|| strstr(comment,"COMMENT=LOOPPOINT=") == comment
|| strstr(comment,"LOOPSTART=") == comment /* common? */
|| strstr(comment,"um3.stream.looppoint.start=") == comment /* Ultramarine / Bruns Engine files */
|| strstr(comment,"LOOP_BEGIN=") == comment /* Hatsune Miku: Project Diva F (PS3) */
|| strstr(comment,"LoopStart=") == comment /* Capcom games [Devil May Cry 4 (PC)] */
|| strstr(comment,"LOOP=") == comment /* Duke Nukem 3D: 20th Anniversary World Tour */
|| strstr(comment,"XIPH_CUE_LOOPSTART=") == comment /* DeNa games [Super Mario Run (Android), FF Record Keeper (Android)] */
|| strstr(comment,"LOOPS=") == comment /* The Rumble Fish + (Switch) */
) {
loop_start = atol(strrchr(comment,'=')+1);
loop_flag = (loop_start >= 0);
}
@ -661,6 +663,15 @@ static VGMSTREAM* _init_vgmstream_ogg_vorbis_config(STREAMFILE* sf, off_t start,
loop_length = atol(strrchr(comment,'=')+1);
loop_length_found = 1;
}
else if ( strstr(comment,"LoopEnd=") == comment /* (LoopStart pair) */
|| strstr(comment,"LOOP_END=") == comment /* (LOOP_START/LOOP_BEGIN pair) */
|| strstr(comment, "XIPH_CUE_LOOPEND=") == comment /* (XIPH_CUE_LOOPSTART pair) */
|| strstr(comment, "LOOPE=") == comment /* (LOOPS pair) */
) {
loop_end = atol(strrchr(comment, '=') + 1);
loop_end_found = 1;
loop_flag = 1;
}
else if (strstr(comment,"title=-lps") == comment) { /* KID [Memories Off #5 (PC), Remember11 (PC)] */
loop_start = atol(comment+10);
loop_flag = (loop_start >= 0);
@ -670,14 +681,6 @@ static VGMSTREAM* _init_vgmstream_ogg_vorbis_config(STREAMFILE* sf, off_t start,
loop_end_found = 1;
loop_flag = 1;
}
else if (strstr(comment,"LoopEnd=") == comment) { /* (LoopStart pair) */
loop_end = atol(strrchr(comment,'=')+1);
loop_end_found = 1;
}
else if (strstr(comment,"LOOP_END=") == comment) { /* (LOOP_START/LOOP_BEGIN pair) */
loop_end = atol(strrchr(comment,'=')+1);
loop_end_found = 1;
}
else if (strstr(comment,"lp=") == comment) {
sscanf(strrchr(comment,'=')+1,"%d,%d", &loop_start,&loop_end);
loop_end_found = 1;
@ -685,22 +688,18 @@ static VGMSTREAM* _init_vgmstream_ogg_vorbis_config(STREAMFILE* sf, off_t start,
}
else if (strstr(comment,"LOOPDEFS=") == comment) { /* Fairy Fencer F: Advent Dark Force */
sscanf(strrchr(comment,'=')+1,"%d,%d", &loop_start,&loop_end);
loop_flag = 1;
loop_end_found = 1;
loop_flag = 1;
}
else if (strstr(comment,"COMMENT=loop(") == comment) { /* Zero Time Dilemma (PC) */
sscanf(strrchr(comment,'(')+1,"%d,%d", &loop_start,&loop_end);
loop_end_found = 1;
loop_flag = 1;
loop_end_found = 1;
}
else if (strstr(comment, "XIPH_CUE_LOOPEND=") == comment) { /* (XIPH_CUE_LOOPSTART pair) */
loop_end = atol(strrchr(comment, '=') + 1);
loop_end_found = 1;
}
else if (strstr(comment, "omment=") == comment) { /* Air (Android) */
sscanf(strstr(comment, "=LOOPSTART=") + 11, "%d,LOOPEND=%d", &loop_start, &loop_end);
loop_flag = 1;
loop_end_found = 1;
loop_flag = 1;
}
else if (strstr(comment,"MarkerNum=0002") == comment) { /* Megaman X Legacy Collection: MMX1/2/3 (PC) flag */
/* uses LoopStart=-1 LoopEnd=-1, then 3 secuential comments: "MarkerNum" + "M=7F(start)" + "M=7F(end)" */
@ -730,7 +729,6 @@ static VGMSTREAM* _init_vgmstream_ogg_vorbis_config(STREAMFILE* sf, off_t start,
* loopTime nor have wrong granules though) */
force_seek = 1;
}
else if (strstr(comment,"COMMENT=*loopsample,") == comment) { /* Tsuki ni Yorisou Otome no Sahou (PC) */
int unk0; // always 0 (delay?)
int unk1; // always -1 (loop flag? but non-looped files have no comment)