fix #3715
This commit is contained in:
parent
79baa45ca6
commit
688fb249f9
|
@ -22,6 +22,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
|
||||||
public const int BIOS_INDEX = 24;
|
public const int BIOS_INDEX = 24;
|
||||||
public const int BIOS_FIRST = 1;
|
public const int BIOS_FIRST = 1;
|
||||||
public const string BIOS_LUA_CODE = "bios";
|
public const string BIOS_LUA_CODE = "bios";
|
||||||
|
public const string VIEW_LUA_CODE = "manager.machine.video.snapshot_target.view_names[]";
|
||||||
|
|
||||||
// main launcher
|
// main launcher
|
||||||
[BizImport(cc, Compatibility = true)]
|
[BizImport(cc, Compatibility = true)]
|
||||||
|
|
|
@ -120,11 +120,6 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
|
||||||
{
|
{
|
||||||
_core.mame_lua_execute($"{ s.LuaCode }.user_value = { setting.Value }");
|
_core.mame_lua_execute($"{ s.LuaCode }.user_value = { setting.Value }");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s != null && s.Type == SettingType.VIEW)
|
|
||||||
{
|
|
||||||
_core.mame_lua_execute($"{ s.LuaCode } = { setting.Value }");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,9 +198,9 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
|
||||||
{
|
{
|
||||||
Name = "View",
|
Name = "View",
|
||||||
GameName = _gameShortName,
|
GameName = _gameShortName,
|
||||||
LuaCode = "manager.machine.video.snapshot_target.view_index",
|
LuaCode = LibMAME.VIEW_LUA_CODE,
|
||||||
Type = SettingType.VIEW,
|
Type = SettingType.VIEW,
|
||||||
DefaultValue = "1"
|
DefaultValue = MameGetString(MAMELuaCommand.GetViewName("1"))
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var View in Views)
|
foreach (var View in Views)
|
||||||
|
@ -213,7 +208,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
|
||||||
if (View != string.Empty)
|
if (View != string.Empty)
|
||||||
{
|
{
|
||||||
var substrings = View.Split(',');
|
var substrings = View.Split(',');
|
||||||
setting.Options.Add(substrings[0], substrings[1]);
|
setting.Options.Add(substrings[1], substrings[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -224,17 +224,24 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
|
||||||
|
|
||||||
if (_syncSettings.DriverSettings.TryGetValue(
|
if (_syncSettings.DriverSettings.TryGetValue(
|
||||||
MAMELuaCommand.MakeLookupKey(gameName, LibMAME.BIOS_LUA_CODE),
|
MAMELuaCommand.MakeLookupKey(gameName, LibMAME.BIOS_LUA_CODE),
|
||||||
out var value))
|
out var biosValue))
|
||||||
{
|
{
|
||||||
args.AddRange(new[] { "-bios", value });
|
args.AddRange(new[] { "-bios", biosValue });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_syncSettings.DriverSettings.TryGetValue(
|
||||||
|
MAMELuaCommand.MakeLookupKey(gameName, LibMAME.VIEW_LUA_CODE),
|
||||||
|
out var viewValue))
|
||||||
|
{
|
||||||
|
args.AddRange(new[] { "-snapview", viewValue });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_core.mame_launch(args.Count, args.ToArray()) == 0)
|
if (_core.mame_launch(args.Count, args.ToArray()) == 0)
|
||||||
{
|
{
|
||||||
CheckVersions();
|
CheckVersions();
|
||||||
UpdateGameName();
|
UpdateGameName();
|
||||||
UpdateVideo();
|
|
||||||
UpdateAspect();
|
UpdateAspect();
|
||||||
|
UpdateVideo();
|
||||||
UpdateFramerate();
|
UpdateFramerate();
|
||||||
InitMemoryDomains();
|
InitMemoryDomains();
|
||||||
GetNVRAMFilenames();
|
GetNVRAMFilenames();
|
||||||
|
@ -364,7 +371,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
|
||||||
"return v.refresh_attoseconds " +
|
"return v.refresh_attoseconds " +
|
||||||
"end";
|
"end";
|
||||||
public const string GetBoundX =
|
public const string GetBoundX =
|
||||||
"return tostring(manager.machine.video.snapshot_target.current_view.bounds.width)";
|
"return manager.machine.video.snapshot_target.current_view.bounds.width";
|
||||||
public const string GetBoundY =
|
public const string GetBoundY =
|
||||||
"return manager.machine.video.snapshot_target.current_view.bounds.height";
|
"return manager.machine.video.snapshot_target.current_view.bounds.height";
|
||||||
public const string GetROMsInfo =
|
public const string GetROMsInfo =
|
||||||
|
@ -444,6 +451,8 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
|
||||||
"end " +
|
"end " +
|
||||||
"table.sort(final) " +
|
"table.sort(final) " +
|
||||||
"return table.concat(final)";
|
"return table.concat(final)";
|
||||||
|
public static string GetViewName(string index) =>
|
||||||
|
$"return manager.machine.video.snapshot_target.view_names[{ index }]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue