mame: sort views according to their index

This commit is contained in:
feos 2025-03-15 17:59:35 +03:00
parent 7a0c4d398f
commit 2775b13edb
2 changed files with 3 additions and 3 deletions

View File

@ -195,7 +195,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
GameName = _gameShortName,
LuaCode = LibMAME.VIEW_LUA_CODE,
Type = SettingType.VIEW,
DefaultValue = MameGetString(MAMELuaCommand.GetViewName("1"))
DefaultValue = "1"
};
foreach (var View in Views)
@ -203,7 +203,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
if (View != string.Empty)
{
var substrings = View.Split('@');
setting.Options.Add(substrings[1], substrings[1]);
setting.Options.Add(substrings[0], 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(\"%04d@%s;\", index, name)) " +
"end " +
"table.sort(final) " +
"return table.concat(final)";