From f0737b679f3894b3d7be5ac521bd519dbbfcad44 Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 19 Mar 2019 14:18:02 -0400 Subject: [PATCH] winport - change mic sequence loading to use _0 as a signal, and fix bug in paths with . earlier in the name before the extension --- desmume/src/frontend/windows/mic-win.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/desmume/src/frontend/windows/mic-win.cpp b/desmume/src/frontend/windows/mic-win.cpp index faf4757e0..c74db3393 100644 --- a/desmume/src/frontend/windows/mic-win.cpp +++ b/desmume/src/frontend/windows/mic-win.cpp @@ -243,22 +243,26 @@ bool LoadSamples(const char *name) //if we're disabling the mic samples system, just bail now if (!name || !*name) return true; - //analyze the filename for 0 at the end. anything with 0 at the end is assumed to be the beginning of a series of files + //analyze the filename for _0 at the end. anything with _0 at the end is assumed to be the beginning of a series of files //(and if not, it can still be loaded just fine) - const char* ext = strchr(name,'.'); + const char* ext = strrchr(name,'.'); //in case the filename had no extension... it's an error. if(!ext) return false; - const char* maybe0 = ext-1; + const char* maybe_0 = ext-2; + + //in case this was an absurdly short filename + if(ext