remove struct hack, it's not actually needed

out double is System.Double& while double is System.Double, so it doesn't actually trip paramenter verifier
This commit is contained in:
CasualPokePlayer 2022-11-15 01:12:31 -08:00
parent eec86ad81a
commit a0de42b1b3
2 changed files with 4 additions and 14 deletions

View File

@ -98,19 +98,9 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
[BizImport(cc)] [BizImport(cc)]
public abstract long mame_lua_get_long(string code); public abstract long mame_lua_get_long(string code);
/// <summary>
/// Struct for indirectly returning doubles
/// This is needed due to floating point types
/// being unsupported by the msabi to sysv adapter
/// </summary>
public struct IndirectDouble
{
public double val;
}
// get double // get double
[BizImport(cc)] [BizImport(cc)]
public abstract void mame_lua_get_double(string code, out IndirectDouble ret); public abstract void mame_lua_get_double(string code, out double ret);
// get string // get string
[BizImport(cc)] [BizImport(cc)]

View File

@ -36,10 +36,10 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
{ {
_core.mame_lua_get_double(MAMELuaCommand.GetBoundX, out var x); _core.mame_lua_get_double(MAMELuaCommand.GetBoundX, out var x);
_core.mame_lua_get_double(MAMELuaCommand.GetBoundY, out var y); _core.mame_lua_get_double(MAMELuaCommand.GetBoundY, out var y);
VirtualHeight = BufferWidth > BufferHeight * x.val / y.val VirtualHeight = BufferWidth > BufferHeight * x / y
? (int)Math.Round(BufferWidth * y.val / x.val) ? (int)Math.Round(BufferWidth * y / x)
: BufferHeight; : BufferHeight;
VirtualWidth = (int)Math.Round(VirtualHeight * x.val / y.val); VirtualWidth = (int)Math.Round(VirtualHeight * x / y);
} }
private void UpdateVideo() private void UpdateVideo()