From 7a0c4d398f93c6378f081745cc8d426f4cd87fc1 Mon Sep 17 00:00:00 2001 From: feos Date: Sat, 15 Mar 2025 16:56:57 +0300 Subject: [PATCH] mame: fix crash for view names containing commas the way the initial lists are populated is kinda hacky because we need some separators and split the results using them. it's impossible to make sure they won't use that separator in a name in the future. maybe there's a better way than listing every available name in entire mame and finding which symbols never appear there and using them as separators (tho I admit for views I didn't even do that and relied on users running the thing). --- src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.ISettable.cs | 2 +- src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.ISettable.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.ISettable.cs index a310cb0cc7..2eb02d0622 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.ISettable.cs @@ -202,7 +202,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME { if (View != string.Empty) { - var substrings = View.Split(','); + var substrings = View.Split('@'); setting.Options.Add(substrings[1], substrings[1]); } } diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs index 4d6dca04e8..89cccc1b98 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs @@ -409,7 +409,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME public const string GetViewsInfo = "local final = {} " + "for index, name in pairs(manager.machine.video.snapshot_target.view_names) do " + - "table.insert(final, string.format(\"%s,%s;\", index, name)) " + + "table.insert(final, string.format(\"%s@%s;\", index, name)) " + "end " + "table.sort(final) " + "return table.concat(final)";