do away with LuaCommon.cs
This commit is contained in:
parent
3324759799
commit
c7fbcbca40
|
@ -444,7 +444,6 @@
|
|||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="tools\Lua\Libraries\EmuLuaLibrary.Client.cs" />
|
||||
<Compile Include="tools\Lua\Libraries\EmuLuaLibrary.Common.cs" />
|
||||
<Compile Include="tools\Lua\Libraries\EmuLuaLibrary.Console.cs" />
|
||||
<Compile Include="tools\Lua\Libraries\EmuLuaLibrary.cs" />
|
||||
<Compile Include="tools\Lua\Libraries\EmuLuaLibrary.Emu.cs" />
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace BizHawk.MultiClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Generic helper functions for Lua Libraries
|
||||
/// </summary>
|
||||
public static class LuaCommon
|
||||
{
|
||||
public static int LuaInt(object lua_arg)
|
||||
{
|
||||
return Convert.ToInt32((double)lua_arg);
|
||||
}
|
||||
|
||||
public static uint LuaUInt(object lua_arg)
|
||||
{
|
||||
return Convert.ToUInt32((double)lua_arg);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -177,7 +177,7 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
else
|
||||
{
|
||||
_addr = LuaCommon.LuaInt(address);
|
||||
_addr = LuaInt(address);
|
||||
}
|
||||
|
||||
Global.Emulator.CoreComm.MemoryCallbackSystem.ReadAddr = _addr;
|
||||
|
@ -214,7 +214,7 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
else
|
||||
{
|
||||
_addr = LuaCommon.LuaInt(address);
|
||||
_addr = LuaInt(address);
|
||||
}
|
||||
|
||||
Global.Emulator.CoreComm.MemoryCallbackSystem.WriteAddr = _addr;
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private LuaWinform GetForm(object form_handle)
|
||||
{
|
||||
IntPtr ptr = new IntPtr(LuaCommon.LuaInt(form_handle));
|
||||
IntPtr ptr = new IntPtr(LuaInt(form_handle));
|
||||
return LuaForms.FirstOrDefault(form => form.Handle == ptr);
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void forms_addclick(object handle, LuaFunction lua_event)
|
||||
{
|
||||
IntPtr ptr = new IntPtr(LuaCommon.LuaInt(handle));
|
||||
IntPtr ptr = new IntPtr(LuaInt(handle));
|
||||
foreach (LuaWinform form in LuaForms)
|
||||
{
|
||||
foreach (Control control in form.Controls)
|
||||
|
@ -129,7 +129,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void forms_clearclicks(object handle)
|
||||
{
|
||||
IntPtr ptr = new IntPtr(LuaCommon.LuaInt(handle));
|
||||
IntPtr ptr = new IntPtr(LuaInt(handle));
|
||||
foreach (LuaWinform form in LuaForms)
|
||||
{
|
||||
foreach (Control control in form.Controls)
|
||||
|
@ -148,7 +148,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public bool forms_destroy(object handle)
|
||||
{
|
||||
IntPtr ptr = new IntPtr(LuaCommon.LuaInt(handle));
|
||||
IntPtr ptr = new IntPtr(LuaInt(handle));
|
||||
foreach (LuaWinform form in LuaForms)
|
||||
{
|
||||
if (form.Handle == ptr)
|
||||
|
@ -174,7 +174,7 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
try
|
||||
{
|
||||
IntPtr ptr = new IntPtr(LuaCommon.LuaInt(handle));
|
||||
IntPtr ptr = new IntPtr(LuaInt(handle));
|
||||
foreach (LuaWinform form in LuaForms)
|
||||
{
|
||||
if (form.Handle == ptr)
|
||||
|
@ -205,7 +205,7 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
try
|
||||
{
|
||||
IntPtr ptr = new IntPtr(LuaCommon.LuaInt(handle));
|
||||
IntPtr ptr = new IntPtr(LuaInt(handle));
|
||||
foreach (LuaWinform form in LuaForms)
|
||||
{
|
||||
if (form.Handle == ptr)
|
||||
|
@ -256,7 +256,7 @@ namespace BizHawk.MultiClient
|
|||
LuaForms.Add(theForm);
|
||||
if (Width != null && Height != null)
|
||||
{
|
||||
theForm.Size = new Size(LuaCommon.LuaInt(Width), LuaCommon.LuaInt(Height));
|
||||
theForm.Size = new Size(LuaInt(Width), LuaInt(Height));
|
||||
}
|
||||
|
||||
theForm.Text = (string)title;
|
||||
|
@ -296,7 +296,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void forms_setlocation(object handle, object X, object Y)
|
||||
{
|
||||
IntPtr ptr = new IntPtr(LuaCommon.LuaInt(handle));
|
||||
IntPtr ptr = new IntPtr(LuaInt(handle));
|
||||
foreach (LuaWinform form in LuaForms)
|
||||
{
|
||||
if (form.Handle == ptr)
|
||||
|
@ -318,7 +318,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void forms_setproperty(object handle, object property, object value)
|
||||
{
|
||||
IntPtr ptr = new IntPtr(LuaCommon.LuaInt(handle));
|
||||
IntPtr ptr = new IntPtr(LuaInt(handle));
|
||||
foreach (LuaWinform form in LuaForms)
|
||||
{
|
||||
if (form.Handle == ptr)
|
||||
|
@ -340,7 +340,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void forms_setsize(object handle, object Width, object Height)
|
||||
{
|
||||
IntPtr ptr = new IntPtr(LuaCommon.LuaInt(handle));
|
||||
IntPtr ptr = new IntPtr(LuaInt(handle));
|
||||
foreach (LuaWinform form in LuaForms)
|
||||
{
|
||||
if (form.Handle == ptr)
|
||||
|
@ -362,7 +362,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void forms_settext(object handle, object caption)
|
||||
{
|
||||
IntPtr ptr = new IntPtr(LuaCommon.LuaInt(handle));
|
||||
IntPtr ptr = new IntPtr(LuaInt(handle));
|
||||
foreach (LuaWinform form in LuaForms)
|
||||
{
|
||||
if (form.Handle == ptr)
|
||||
|
|
|
@ -156,8 +156,8 @@ namespace BizHawk.MultiClient
|
|||
if (background == null)
|
||||
background = "black";
|
||||
}
|
||||
int dx = LuaCommon.LuaInt(luaX);
|
||||
int dy = LuaCommon.LuaInt(luaY);
|
||||
int dx = LuaInt(luaX);
|
||||
int dy = LuaInt(luaY);
|
||||
int a = 0;
|
||||
if (anchor != null)
|
||||
{
|
||||
|
@ -175,7 +175,7 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
else
|
||||
{
|
||||
a = LuaCommon.LuaInt(anchor);
|
||||
a = LuaInt(anchor);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -224,7 +224,7 @@ namespace BizHawk.MultiClient
|
|||
int i = 0;
|
||||
foreach (LuaTable point in points.Values)
|
||||
{
|
||||
Points[i] = new Point(LuaCommon.LuaInt(point[1]), LuaCommon.LuaInt(point[2]));
|
||||
Points[i] = new Point(LuaInt(point[1]), LuaInt(point[2]));
|
||||
i++;
|
||||
if (i >= 4)
|
||||
break;
|
||||
|
@ -245,10 +245,10 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
try
|
||||
{
|
||||
int int_x = LuaCommon.LuaInt(X);
|
||||
int int_y = LuaCommon.LuaInt(Y);
|
||||
int int_width = LuaCommon.LuaInt(X2);
|
||||
int int_height = LuaCommon.LuaInt(Y2);
|
||||
int int_x = LuaInt(X);
|
||||
int int_y = LuaInt(Y);
|
||||
int int_width = LuaInt(X2);
|
||||
int int_height = LuaInt(Y2);
|
||||
|
||||
if (int_x < int_width)
|
||||
{
|
||||
|
@ -291,11 +291,11 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
try
|
||||
{
|
||||
g.DrawEllipse(GetPen(line ?? "white"), LuaCommon.LuaInt(X), LuaCommon.LuaInt(Y), LuaCommon.LuaInt(width), LuaCommon.LuaInt(height));
|
||||
g.DrawEllipse(GetPen(line ?? "white"), LuaInt(X), LuaInt(Y), LuaInt(width), LuaInt(height));
|
||||
if (background != null)
|
||||
{
|
||||
var brush = GetBrush(background);
|
||||
g.FillEllipse(brush, LuaCommon.LuaInt(X), LuaCommon.LuaInt(Y), LuaCommon.LuaInt(width), LuaCommon.LuaInt(height));
|
||||
g.FillEllipse(brush, LuaInt(X), LuaInt(Y), LuaInt(width), LuaInt(height));
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
|
@ -316,14 +316,14 @@ namespace BizHawk.MultiClient
|
|||
Icon icon;
|
||||
if (width != null && height != null)
|
||||
{
|
||||
icon = new Icon(Path.ToString(), LuaCommon.LuaInt(width), LuaCommon.LuaInt(height));
|
||||
icon = new Icon(Path.ToString(), LuaInt(width), LuaInt(height));
|
||||
}
|
||||
else
|
||||
{
|
||||
icon = new Icon(Path.ToString());
|
||||
}
|
||||
|
||||
g.DrawIcon(icon, LuaCommon.LuaInt(x), LuaCommon.LuaInt(y));
|
||||
g.DrawIcon(icon, LuaInt(x), LuaInt(y));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
@ -346,7 +346,7 @@ namespace BizHawk.MultiClient
|
|||
if (height == null || height.GetType() != typeof(int))
|
||||
height = img.Height.ToString();
|
||||
|
||||
g.DrawImage(img, LuaCommon.LuaInt(x), LuaCommon.LuaInt(y), int.Parse(width.ToString()), int.Parse(height.ToString()));
|
||||
g.DrawImage(img, LuaInt(x), LuaInt(y), int.Parse(width.ToString()), int.Parse(height.ToString()));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
@ -362,7 +362,7 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
try
|
||||
{
|
||||
g.DrawLine(GetPen(color ?? "white"), LuaCommon.LuaInt(x1), LuaCommon.LuaInt(y1), LuaCommon.LuaInt(x2), LuaCommon.LuaInt(y2));
|
||||
g.DrawLine(GetPen(color ?? "white"), LuaInt(x1), LuaInt(y1), LuaInt(x2), LuaInt(y2));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
@ -379,11 +379,11 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
try
|
||||
{
|
||||
g.DrawPie(GetPen(line), LuaCommon.LuaInt(X), LuaCommon.LuaInt(Y), LuaCommon.LuaInt(width), LuaCommon.LuaInt(height), LuaCommon.LuaInt(startangle), LuaCommon.LuaInt(sweepangle));
|
||||
g.DrawPie(GetPen(line), LuaInt(X), LuaInt(Y), LuaInt(width), LuaInt(height), LuaInt(startangle), LuaInt(sweepangle));
|
||||
if (background != null)
|
||||
{
|
||||
var brush = GetBrush(background);
|
||||
g.FillPie(brush, LuaCommon.LuaInt(X), LuaCommon.LuaInt(Y), LuaCommon.LuaInt(width), LuaCommon.LuaInt(height), LuaCommon.LuaInt(startangle), LuaCommon.LuaInt(sweepangle));
|
||||
g.FillPie(brush, LuaInt(X), LuaInt(Y), LuaInt(width), LuaInt(height), LuaInt(startangle), LuaInt(sweepangle));
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
|
@ -400,10 +400,10 @@ namespace BizHawk.MultiClient
|
|||
GlobalWinF.DisplayManager.NeedsToPaint = true;
|
||||
using (var g = GetGraphics())
|
||||
{
|
||||
float x = LuaCommon.LuaInt(X) + 0.1F;
|
||||
float x = LuaInt(X) + 0.1F;
|
||||
try
|
||||
{
|
||||
g.DrawLine(GetPen(color ?? "white"), LuaCommon.LuaInt(X), LuaCommon.LuaInt(Y), x, LuaCommon.LuaInt(Y));
|
||||
g.DrawLine(GetPen(color ?? "white"), LuaInt(X), LuaInt(Y), x, LuaInt(Y));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
@ -424,7 +424,7 @@ namespace BizHawk.MultiClient
|
|||
int i = 0;
|
||||
foreach (LuaTable point in points.Values)
|
||||
{
|
||||
Points[i] = new Point(LuaCommon.LuaInt(point[1]), LuaCommon.LuaInt(point[2]));
|
||||
Points[i] = new Point(LuaInt(point[1]), LuaInt(point[2]));
|
||||
i++;
|
||||
}
|
||||
|
||||
|
@ -448,10 +448,10 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
try
|
||||
{
|
||||
int int_x = LuaCommon.LuaInt(X);
|
||||
int int_y = LuaCommon.LuaInt(Y);
|
||||
int int_width = LuaCommon.LuaInt(width);
|
||||
int int_height = LuaCommon.LuaInt(height);
|
||||
int int_x = LuaInt(X);
|
||||
int int_y = LuaInt(Y);
|
||||
int int_width = LuaInt(width);
|
||||
int int_height = LuaInt(height);
|
||||
g.DrawRectangle(GetPen(line ?? "white"), int_x, int_y, int_width, int_height);
|
||||
if (background != null)
|
||||
{
|
||||
|
@ -481,7 +481,7 @@ namespace BizHawk.MultiClient
|
|||
int fsize = 12;
|
||||
if (fontsize != null)
|
||||
{
|
||||
fsize = LuaCommon.LuaInt(fontsize);
|
||||
fsize = LuaInt(fontsize);
|
||||
}
|
||||
|
||||
FontFamily family = FontFamily.GenericMonospace;
|
||||
|
@ -515,7 +515,7 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
|
||||
Font font = new Font(family, fsize, fstyle, GraphicsUnit.Pixel);
|
||||
g.DrawString(message.ToString(), font, GetBrush(color ?? "white"), LuaCommon.LuaInt(X), LuaCommon.LuaInt(Y));
|
||||
g.DrawString(message.ToString(), font, GetBrush(color ?? "white"), LuaInt(X), LuaInt(Y));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
|
|
@ -141,14 +141,14 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public uint mainmemory_readbyte(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_U8(addr);
|
||||
}
|
||||
|
||||
public LuaTable mainmemory_readbyterange(object address, object length)
|
||||
{
|
||||
int l = LuaCommon.LuaInt(length);
|
||||
int addr = LuaCommon.LuaInt(address);
|
||||
int l = LuaInt(length);
|
||||
int addr = LuaInt(address);
|
||||
int last_addr = l + addr;
|
||||
LuaTable table = _lua.NewTable();
|
||||
for (int i = addr; i <= last_addr; i++)
|
||||
|
@ -163,7 +163,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public float mainmemory_readfloat(object lua_addr, bool bigendian)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint val = Global.Emulator.MainMemory.PeekDWord(addr, bigendian ? Endian.Big : Endian.Little);
|
||||
|
||||
byte[] bytes = BitConverter.GetBytes(val);
|
||||
|
@ -173,8 +173,8 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void mainmemory_writebyte(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
MM_W_U8(addr, v);
|
||||
}
|
||||
|
||||
|
@ -182,8 +182,8 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
foreach (var address in memoryblock.Keys)
|
||||
{
|
||||
int a = LuaCommon.LuaInt(address);
|
||||
int v = LuaCommon.LuaInt(memoryblock[address]);
|
||||
int a = LuaInt(address);
|
||||
int v = LuaInt(memoryblock[address]);
|
||||
|
||||
Global.Emulator.MainMemory.PokeByte(a, (byte)v);
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void mainmemory_writefloat(object lua_addr, object lua_v, bool bigendian)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
float dv = (float)(double)lua_v;
|
||||
byte[] bytes = BitConverter.GetBytes(dv);
|
||||
uint v = BitConverter.ToUInt32(bytes, 0);
|
||||
|
@ -201,183 +201,183 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public int mainmemory_read_s8(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return (sbyte)MM_R_U8(addr);
|
||||
}
|
||||
|
||||
public uint mainmemory_read_u8(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_U8(addr);
|
||||
}
|
||||
|
||||
public int mainmemory_read_s16_le(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_S_LE(addr, 2);
|
||||
}
|
||||
|
||||
public int mainmemory_read_s24_le(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_S_LE(addr, 3);
|
||||
}
|
||||
|
||||
public int mainmemory_read_s32_le(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_S_LE(addr, 4);
|
||||
}
|
||||
|
||||
public uint mainmemory_read_u16_le(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_U_LE(addr, 2);
|
||||
}
|
||||
|
||||
public uint mainmemory_read_u24_le(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_U_LE(addr, 3);
|
||||
}
|
||||
|
||||
public uint mainmemory_read_u32_le(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_U_LE(addr, 4);
|
||||
}
|
||||
|
||||
public int mainmemory_read_s16_be(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_S_BE(addr, 2);
|
||||
}
|
||||
|
||||
public int mainmemory_read_s24_be(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_S_BE(addr, 3);
|
||||
}
|
||||
|
||||
public int mainmemory_read_s32_be(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_S_BE(addr, 4);
|
||||
}
|
||||
|
||||
public uint mainmemory_read_u16_be(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_U_BE(addr, 2);
|
||||
}
|
||||
|
||||
public uint mainmemory_read_u24_be(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_U_BE(addr, 3);
|
||||
}
|
||||
|
||||
public uint mainmemory_read_u32_be(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return MM_R_U_BE(addr, 4);
|
||||
}
|
||||
|
||||
public void mainmemory_write_s8(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
MM_W_U8(addr, (uint)v);
|
||||
}
|
||||
|
||||
public void mainmemory_write_u8(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
MM_W_U8(addr, v);
|
||||
}
|
||||
|
||||
public void mainmemory_write_s16_le(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
MM_W_S_LE(addr, v, 2);
|
||||
}
|
||||
|
||||
public void mainmemory_write_s24_le(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
MM_W_S_LE(addr, v, 3);
|
||||
}
|
||||
|
||||
public void mainmemory_write_s32_le(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
MM_W_S_LE(addr, v, 4);
|
||||
}
|
||||
|
||||
public void mainmemory_write_u16_le(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
MM_W_U_LE(addr, v, 2);
|
||||
}
|
||||
|
||||
public void mainmemory_write_u24_le(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
MM_W_U_LE(addr, v, 3);
|
||||
}
|
||||
|
||||
public void mainmemory_write_u32_le(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
MM_W_U_LE(addr, v, 4);
|
||||
}
|
||||
|
||||
public void mainmemory_write_s16_be(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
MM_W_S_BE(addr, v, 2);
|
||||
}
|
||||
|
||||
public void mainmemory_write_s24_be(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
MM_W_S_BE(addr, v, 3);
|
||||
}
|
||||
|
||||
public void mainmemory_write_s32_be(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
MM_W_S_BE(addr, v, 4);
|
||||
}
|
||||
|
||||
public void mainmemory_write_u16_be(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
MM_W_U_BE(addr, v, 2);
|
||||
}
|
||||
|
||||
public void mainmemory_write_u24_be(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
MM_W_U_BE(addr, v, 3);
|
||||
}
|
||||
|
||||
public void mainmemory_write_u32_be(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
MM_W_U_BE(addr, v, 4);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,13 +147,13 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public uint memory_readbyte(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_U8(addr);
|
||||
}
|
||||
|
||||
public float memory_readfloat(object lua_addr, bool bigendian)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint val = Global.Emulator.MemoryDomains[_current_memory_domain].PeekDWord(addr, bigendian ? Endian.Big : Endian.Little);
|
||||
|
||||
byte[] bytes = BitConverter.GetBytes(val);
|
||||
|
@ -163,14 +163,14 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void memory_writebyte(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
M_W_U8(addr, v);
|
||||
}
|
||||
|
||||
public void memory_writefloat(object lua_addr, object lua_v, bool bigendian)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
float dv = (float)(double)lua_v;
|
||||
byte[] bytes = BitConverter.GetBytes(dv);
|
||||
uint v = BitConverter.ToUInt32(bytes, 0);
|
||||
|
@ -196,183 +196,183 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public int memory_read_s8(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return (sbyte)M_R_U8(addr);
|
||||
}
|
||||
|
||||
public uint memory_read_u8(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_U8(addr);
|
||||
}
|
||||
|
||||
public int memory_read_s16_le(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_S_LE(addr, 2);
|
||||
}
|
||||
|
||||
public int memory_read_s24_le(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_S_LE(addr, 3);
|
||||
}
|
||||
|
||||
public int memory_read_s32_le(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_S_LE(addr, 4);
|
||||
}
|
||||
|
||||
public uint memory_read_u16_le(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_U_LE(addr, 2);
|
||||
}
|
||||
|
||||
public uint memory_read_u24_le(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_U_LE(addr, 3);
|
||||
}
|
||||
|
||||
public uint memory_read_u32_le(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_U_LE(addr, 4);
|
||||
}
|
||||
|
||||
public int memory_read_s16_be(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_S_BE(addr, 2);
|
||||
}
|
||||
|
||||
public int memory_read_s24_be(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_S_BE(addr, 3);
|
||||
}
|
||||
|
||||
public int memory_read_s32_be(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_S_BE(addr, 4);
|
||||
}
|
||||
|
||||
public uint memory_read_u16_be(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_U_BE(addr, 2);
|
||||
}
|
||||
|
||||
public uint memory_read_u24_be(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_U_BE(addr, 3);
|
||||
}
|
||||
|
||||
public uint memory_read_u32_be(object lua_addr)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int addr = LuaInt(lua_addr);
|
||||
return M_R_U_BE(addr, 4);
|
||||
}
|
||||
|
||||
public void memory_write_s8(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
M_W_U8(addr, (uint)v);
|
||||
}
|
||||
|
||||
public void memory_write_u8(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
M_W_U8(addr, v);
|
||||
}
|
||||
|
||||
public void memory_write_s16_le(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
M_W_S_LE(addr, v, 2);
|
||||
}
|
||||
|
||||
public void memory_write_s24_le(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
M_W_S_LE(addr, v, 3);
|
||||
}
|
||||
|
||||
public void memory_write_s32_le(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
M_W_S_LE(addr, v, 4);
|
||||
}
|
||||
|
||||
public void memory_write_u16_le(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
M_W_U_LE(addr, v, 2);
|
||||
}
|
||||
|
||||
public void memory_write_u24_le(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
M_W_U_LE(addr, v, 3);
|
||||
}
|
||||
|
||||
public void memory_write_u32_le(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
M_W_U_LE(addr, v, 4);
|
||||
}
|
||||
|
||||
public void memory_write_s16_be(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
M_W_S_BE(addr, v, 2);
|
||||
}
|
||||
|
||||
public void memory_write_s24_be(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
M_W_S_BE(addr, v, 3);
|
||||
}
|
||||
|
||||
public void memory_write_s32_be(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
int v = LuaCommon.LuaInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
int v = LuaInt(lua_v);
|
||||
M_W_S_BE(addr, v, 4);
|
||||
}
|
||||
|
||||
public void memory_write_u16_be(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
M_W_U_BE(addr, v, 2);
|
||||
}
|
||||
|
||||
public void memory_write_u24_be(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
M_W_U_BE(addr, v, 3);
|
||||
}
|
||||
|
||||
public void memory_write_u32_be(object lua_addr, object lua_v)
|
||||
{
|
||||
int addr = LuaCommon.LuaInt(lua_addr);
|
||||
uint v = LuaCommon.LuaUInt(lua_v);
|
||||
int addr = LuaInt(lua_addr);
|
||||
uint v = LuaUInt(lua_v);
|
||||
M_W_U_BE(addr, v, 4);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
MovieControllerAdapter m = new MovieControllerAdapter { Type = Global.MovieSession.MovieControllerAdapter.Type };
|
||||
m.SetControllersAsMnemonic(
|
||||
Global.MovieSession.Movie.GetInput(LuaCommon.LuaInt(frame))
|
||||
Global.MovieSession.Movie.GetInput(LuaInt(frame))
|
||||
);
|
||||
|
||||
foreach (string button in m.Type.BoolButtons)
|
||||
|
|
Loading…
Reference in New Issue