From c511f24942d6e3eeab90f35b23647eac638852b5 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sun, 4 Feb 2024 15:25:53 +0100 Subject: [PATCH] Add .caf AIFC/RIFF extension [Topple (iOS)] --- src/meta/aifc.c | 26 +++++++++++++++----------- src/meta/riff.c | 9 +++++---- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/meta/aifc.c b/src/meta/aifc.c index a3693a30..3dde4523 100644 --- a/src/meta/aifc.c +++ b/src/meta/aifc.c @@ -82,35 +82,39 @@ VGMSTREAM* init_vgmstream_aifc(STREAMFILE* sf) { /* checks */ if (!is_id32be(0x00,sf, "FORM")) - goto fail; + return NULL; - /* .aif: common (AIFF or AIFC), .aiff: common AIFF, .aifc: common AIFC - * .laif/laiff/laifc: for plugins + /* .aif: common (AIFF or AIFC) + * .wav: SimCity 3000 (Mac) (both AIFF and AIFC) + * (extensionless): Doom (3DO) + * + * .aifc: renamed AIFC? + * .afc: ? * .cbd2: M2 games * .bgm: Super Street Fighter II Turbo (3DO) + * .fda: Homeworld 2 (PC) + * .n64: Turok (N64) src + * .xa: SimCity 3000 (Mac) + * .caf: Topple (iOS) + * + * .aiff: renamed AIFF? * .acm: Crusader - No Remorse (SAT) * .adp: Sonic Jam (SAT) * .ai: Dragon Force (SAT) - * (extensionless: Doom (3DO) - * .fda: Homeworld 2 (PC) - * .n64: Turok (N64) src * .pcm: Road Rash (SAT) - * .wav: SimCity 3000 (Mac) (both AIFC and AIFF) - * .lwav: for media players that may confuse this format with the usual RIFF WAVE file. - * .xa: SimCity 3000 (Mac) */ if (check_extensions(sf, "aif,laif,wav,lwav,")) { is_aifc_ext = 1; is_aiff_ext = 1; } - else if (check_extensions(sf, "aifc,laifc,afc,cbd2,bgm,fda,n64,xa")) { + else if (check_extensions(sf, "aifc,laifc,afc,cbd2,bgm,fda,n64,xa,caf")) { is_aifc_ext = 1; } else if (check_extensions(sf, "aiff,laiff,acm,adp,ai,pcm")) { is_aiff_ext = 1; } else { - goto fail; + return NULL; } file_size = get_streamfile_size(sf); diff --git a/src/meta/riff.c b/src/meta/riff.c index e574530b..0f1bb0e3 100644 --- a/src/meta/riff.c +++ b/src/meta/riff.c @@ -354,12 +354,12 @@ VGMSTREAM* init_vgmstream_riff(STREAMFILE* sf) { /* checks*/ if (!is_id32be(0x00,sf,"RIFF")) - goto fail; + return NULL; riff_size = read_u32le(0x04,sf); if (!is_id32be(0x08,sf, "WAVE")) - goto fail; + return NULL; file_size = get_streamfile_size(sf); @@ -398,9 +398,10 @@ VGMSTREAM* init_vgmstream_riff(STREAMFILE* sf) { * .mus: Burnout Legends/Dominator (PSP) * .dat/ldat: RollerCoaster Tycoon 1/2 (PC) * .wma/lwma: SRS: Street Racing Syndicate (Xbox), Fast and the Furious (Xbox) + * .caf: Topple (iOS) */ - if (!check_extensions(sf, "wav,lwav,xwav,mwv,da,dax,cd,med,snd,adx,adp,xss,xsew,adpcm,adw,wd,,sbv,wvx,str,at3,rws,aud,at9,ckd,saf,ima,nsa,pcm,xvag,ogg,logg,p1d,xms,mus,dat,ldat,wma,lwma")) { - goto fail; + if (!check_extensions(sf, "wav,lwav,xwav,mwv,da,dax,cd,med,snd,adx,adp,xss,xsew,adpcm,adw,wd,,sbv,wvx,str,at3,rws,aud,at9,ckd,saf,ima,nsa,pcm,xvag,ogg,logg,p1d,xms,mus,dat,ldat,wma,lwma,caf")) { + return NULL; } /* some games have wonky sizes, selectively fix to catch bad rips and new mutations */