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).
This commit is contained in:
feos 2025-03-15 16:56:57 +03:00
parent 38f8e3a9b4
commit 7a0c4d398f
2 changed files with 2 additions and 2 deletions

View File

@ -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]);
}
}

View File

@ -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)";