First pool of examples.

This commit is contained in:
Xadrophonix 2018-03-04 09:48:38 -08:00
parent 439b908bdc
commit 07c07fd72a
16 changed files with 246 additions and 3 deletions

View File

@ -16,84 +16,98 @@ namespace BizHawk.Client.Common
public override string Name => "bit";
[LuaMethodExample("band", "local uibitban = bit.band( 1000, 4 );")]
[LuaMethod("band", "Bitwise AND of 'val' against 'amt'")]
public static uint Band(uint val, uint amt)
{
return val & amt;
}
[LuaMethodExample("bnot", "local uibitbno = bit.bnot( 1000 );")]
[LuaMethod("bnot", "Bitwise NOT of 'val' against 'amt'")]
public static uint Bnot(uint val)
{
return ~val;
}
[LuaMethodExample("bor", "local uibitbor = bit.bor( 1000, 4 );")]
[LuaMethod("bor", "Bitwise OR of 'val' against 'amt'")]
public static uint Bor(uint val, uint amt)
{
return val | amt;
}
[LuaMethodExample("bxor", "local uibitbxo = bit.bxor( 1000, 4 );")]
[LuaMethod("bxor", "Bitwise XOR of 'val' against 'amt'")]
public static uint Bxor(uint val, uint amt)
{
return val ^ amt;
}
[LuaMethodExample("lshift", "local uibitlsh = bit.lshift( 1000, -4 );")]
[LuaMethod("lshift", "Logical shift left of 'val' by 'amt' bits")]
public static uint Lshift(uint val, int amt)
{
return val << amt;
}
[LuaMethodExample("rol", "local uibitrol = bit.rol( 1000, -4 );")]
[LuaMethod("rol", "Left rotate 'val' by 'amt' bits")]
public static uint Rol(uint val, int amt)
{
return (val << amt) | (val >> (32 - amt));
}
[LuaMethodExample("ror", "local uibitror = bit.ror( 1000, -4 );")]
[LuaMethod("ror", "Right rotate 'val' by 'amt' bits")]
public static uint Ror(uint val, int amt)
{
return (val >> amt) | (val << (32 - amt));
}
[LuaMethodExample("rshift", "local uibitrsh = bit.rshift( 1000, -4 );")]
[LuaMethod("rshift", "Logical shift right of 'val' by 'amt' bits")]
public static uint Rshift(uint val, int amt)
{
return (uint)(val >> amt);
}
[LuaMethodExample("arshift", "local inbitars = bit.arshift( -1000, -4 );")]
[LuaMethod("arshift", "Arithmetic shift right of 'val' by 'amt' bits")]
public static int Arshift(int val, int amt)
{
return val >> amt;
}
[LuaMethodExample("check", "if ( bit.check( -12345, 35 ) ) then\r\n\tconsole.log( \"Returns result of bit 'pos' being set in 'num'\" );\r\nend;")]
[LuaMethod("check", "Returns result of bit 'pos' being set in 'num'")]
public static bool Check(long num, int pos)
{
return (num & (1 << pos)) != 0;
}
[LuaMethodExample("set", "local uibitset = bit.set( 25, 35 );")]
[LuaMethod("set", "Sets the bit 'pos' in 'num'")]
public static uint Set(uint num, int pos)
{
return (uint)(num | (uint)1 << pos);
}
[LuaMethodExample("clear", "local lobitcle = bit.clear( 25, 35 );")]
[LuaMethod("clear", "Clears the bit 'pos' in 'num'")]
public static long Clear(uint num, int pos)
{
return num & ~(1 << pos);
}
[LuaMethodExample("byteswap_16", "local usbitbyt = bit.byteswap_16( 100 );")]
[LuaMethod("byteswap_16", "Byte swaps 'short', i.e. bit.byteswap_16(0xFF00) would return 0x00FF")]
public static ushort Byteswap16(ushort val)
{
return (ushort)((val & 0xFFU) << 8 | (val & 0xFF00U) >> 8);
}
[LuaMethodExample("byteswap_32", "local uibitbyt = bit.byteswap_32( 1000 );")]
[LuaMethod("byteswap_32", "Byte swaps 'dword'")]
public static uint Byteswap32(uint val)
{
@ -101,6 +115,7 @@ namespace BizHawk.Client.Common
(val & 0x00FF0000U) >> 8 | (val & 0xFF000000U) >> 24;
}
[LuaMethodExample("byteswap_64", "local ulbitbyt = bit.byteswap_64( 10000 );")]
[LuaMethod("byteswap_64", "Byte swaps 'long'")]
public static ulong Byteswap64(ulong val)
{

View File

@ -48,24 +48,28 @@ namespace BizHawk.Client.Common
public override string Name => "emu";
[LuaMethodExample("displayvsync", "emu.displayvsync( true );")]
[LuaMethod("displayvsync", "Sets the display vsync property of the emulator")]
public static void DisplayVsync(bool enabled)
{
Global.Config.VSync = enabled;
}
[LuaMethodExample("frameadvance", "emu.frameadvance( );")]
[LuaMethod("frameadvance", "Signals to the emulator to resume emulation. Necessary for any lua script while loop or else the emulator will freeze!")]
public void FrameAdvance()
{
FrameAdvanceCallback();
}
[LuaMethodExample("framecount", "local inemufra = emu.framecount( );")]
[LuaMethod("framecount", "Returns the current frame count")]
public int FrameCount()
{
return Emulator.Frame;
}
[LuaMethodExample("disassemble", "local obemudis = emu.disassemble( uint pc );")]
[LuaMethod("disassemble", "Returns the disassembly object (disasm string and length int) for the given PC address. Uses System Bus domain if no domain name provided")]
public object Disassemble(uint pc, string name = "")
{
@ -95,6 +99,7 @@ namespace BizHawk.Client.Common
}
// TODO: what about 64 bit registers?
[LuaMethodExample("getregister", "local inemuget = emu.getregister( emu.getregisters( )[ 0 ] );")]
[LuaMethod("getregister", "returns the value of a cpu register or flag specified by name. For a complete list of possible registers or flags for a given core, use getregisters")]
public int GetRegister(string name)
{
@ -117,6 +122,7 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("getregisters", "local nlemuget = emu.getregisters( );")]
[LuaMethod("getregisters", "returns the complete set of available flags and registers for a given core")]
public LuaTable GetRegisters()
{
@ -142,6 +148,7 @@ namespace BizHawk.Client.Common
return table;
}
[LuaMethodExample("setregister", "emu.setregister( emu.getregisters( )[ 0 ], -1000 );")]
[LuaMethod("setregister", "sets the given register name to the given value")]
public void SetRegister(string register, int value)
{
@ -160,6 +167,7 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("totalexecutedcycles", "local inemutot = emu.totalexecutedcycles( );")]
[LuaMethod("totalexecutedcycles", "gets the total number of executed cpu cycles")]
public int TotalExecutedycles()
{
@ -180,12 +188,14 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("getsystemid", "local stemuget = emu.getsystemid( );")]
[LuaMethod("getsystemid", "Returns the ID string of the current core loaded. Note: No ROM loaded will return the string NULL")]
public static string GetSystemId()
{
return Global.Game.System;
}
[LuaMethodExample("islagged", "if ( emu.islagged( ) ) then\r\n\tconsole.log( \"Returns whether or not the current frame is a lag frame\" );\r\nend;")]
[LuaMethod("islagged", "Returns whether or not the current frame is a lag frame")]
public bool IsLagged()
{
@ -198,6 +208,7 @@ namespace BizHawk.Client.Common
return false;
}
[LuaMethodExample("setislagged", "emu.setislagged( true );")]
[LuaMethod("setislagged", "Sets the lag flag for the current frame. If no value is provided, it will default to true")]
public void SetIsLagged(bool value = true)
{
@ -211,6 +222,7 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("lagcount", "local inemulag = emu.lagcount( );")]
[LuaMethod("lagcount", "Returns the current lag count")]
public int LagCount()
{
@ -223,6 +235,7 @@ namespace BizHawk.Client.Common
return 0;
}
[LuaMethodExample("setlagcount", "emu.setlagcount( 50 );")]
[LuaMethod("setlagcount", "Sets the current lag count")]
public void SetLagCount(int count)
{
@ -236,18 +249,21 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("limitframerate", "emu.limitframerate( true );")]
[LuaMethod("limitframerate", "sets the limit framerate property of the emulator")]
public static void LimitFramerate(bool enabled)
{
Global.Config.ClockThrottle = enabled;
}
[LuaMethodExample("minimizeframeskip", "emu.minimizeframeskip( true );")]
[LuaMethod("minimizeframeskip", "Sets the autominimizeframeskip value of the emulator")]
public static void MinimizeFrameskip(bool enabled)
{
Global.Config.AutoMinimizeSkipping = enabled;
}
[LuaMethodExample("setrenderplanes", "emu.setrenderplanes( true, false );")]
[LuaMethod("setrenderplanes", "Toggles the drawing of sprites and background planes. Set to false or nil to disable a pane, anything else will draw them")]
public void SetRenderPlanes(params bool[] luaParam)
{
@ -322,12 +338,14 @@ namespace BizHawk.Client.Common
return true;
}
[LuaMethodExample("yield", "emu.yield( );")]
[LuaMethod("yield", "allows a script to run while emulation is paused and interact with the gui/main window in realtime ")]
public void Yield()
{
YieldCallback();
}
[LuaMethodExample("getdisplaytype", "local stemuget = emu.getdisplaytype();")]
[LuaMethod("getdisplaytype", "returns the display type (PAL vs NTSC) that the emulator is currently running in")]
public string GetDisplayType()
{
@ -339,6 +357,7 @@ namespace BizHawk.Client.Common
return "";
}
[LuaMethodExample("getboardname", "local stemuget = emu.getboardname();")]
[LuaMethod("getboardname", "returns (if available) the board name of the loaded ROM")]
public string GetBoardName()
{

View File

@ -159,6 +159,8 @@ namespace BizHawk.Client.Common
#endregion
[LuaMethodExample("onframeend", "local steveonf = event.onframeend(\r\n\tfunction()\r\n\t\tconsole.log( \"Calls the given lua function at the end of each frame, after all emulation and drawing has completed. Note: this is the default behavior of lua scripts\" );\r\n\tend\r\n\t, \"Frame name\" );")]
[LuaMethod("onframeend", "Calls the given lua function at the end of each frame, after all emulation and drawing has completed. Note: this is the default behavior of lua scripts")]
public string OnFrameEnd(LuaFunction luaf, string name = null)
{
@ -167,6 +169,7 @@ namespace BizHawk.Client.Common
return nlf.Guid.ToString();
}
[LuaMethodExample("onframestart", "local steveonf = event.onframestart(\r\n\tfunction()\r\n\t\tconsole.log( \"Calls the given lua function at the beginning of each frame before any emulation and drawing occurs\" );\r\n\tend\r\n\t, \"Frame name\" );")]
[LuaMethod("onframestart", "Calls the given lua function at the beginning of each frame before any emulation and drawing occurs")]
public string OnFrameStart(LuaFunction luaf, string name = null)
{
@ -175,6 +178,7 @@ namespace BizHawk.Client.Common
return nlf.Guid.ToString();
}
[LuaMethodExample("oninputpoll", "local steveoni = event.oninputpoll(\r\n\tfunction()\r\n\t\tconsole.log( \"Calls the given lua function after each time the emulator core polls for input\" );\r\n\tend\r\n\t, \"Frame name\" );")]
[LuaMethod("oninputpoll", "Calls the given lua function after each time the emulator core polls for input")]
public string OnInputPoll(LuaFunction luaf, string name = null)
{
@ -204,6 +208,7 @@ namespace BizHawk.Client.Common
Log($"Error: {Emulator.Attributes().CoreName} does not yet implement input polling callbacks");
}
[LuaMethodExample("onloadstate", "local steveonl = event.onloadstate(\r\n\tfunction()\r\n\tconsole.log( \"Fires after a state is loaded. Receives a lua function name, and registers it to the event immediately following a successful savestate event\" );\r\nend\", \"Frame name\" );")]
[LuaMethod("onloadstate", "Fires after a state is loaded. Receives a lua function name, and registers it to the event immediately following a successful savestate event")]
public string OnLoadState(LuaFunction luaf, string name = null)
{
@ -212,6 +217,7 @@ namespace BizHawk.Client.Common
return nlf.Guid.ToString();
}
[LuaMethodExample("onmemoryexecute", "local steveonm = event.onmemoryexecute(\r\n\tfunction()\r\n\t\tconsole.log( \"Fires after the given address is executed by the core\" );\r\n\tend\r\n\t, 0x200, \"Frame name\", \"System Bus\" );")]
[LuaMethod("onmemoryexecute", "Fires after the given address is executed by the core")]
public string OnMemoryExecute(LuaFunction luaf, uint address, string name = null, string domain = null)
{
@ -251,6 +257,7 @@ namespace BizHawk.Client.Common
return Guid.Empty.ToString();
}
[LuaMethodExample("onmemoryread", "local steveonm = event.onmemoryread(\r\n\tfunction()\r\n\t\tconsole.log( \"Fires after the given address is read by the core. If no address is given, it will attach to every memory read\" );\r\n\tend\r\n\t, 0x200, \"Frame name\" );")]
[LuaMethod("onmemoryread", "Fires after the given address is read by the core. If no address is given, it will attach to every memory read")]
public string OnMemoryRead(LuaFunction luaf, uint? address = null, string name = null, string domain = null)
{
@ -289,6 +296,7 @@ namespace BizHawk.Client.Common
return Guid.Empty.ToString();
}
[LuaMethodExample("onmemorywrite", "local steveonm = event.onmemorywrite(\r\n\tfunction()\r\n\t\tconsole.log( \"Fires after the given address is written by the core. If no address is given, it will attach to every memory write\" );\r\n\tend\r\n\t, 0x200, \"Frame name\" );")]
[LuaMethod("onmemorywrite", "Fires after the given address is written by the core. If no address is given, it will attach to every memory write")]
public string OnMemoryWrite(LuaFunction luaf, uint? address = null, string name = null, string domain = null)
{
@ -327,6 +335,7 @@ namespace BizHawk.Client.Common
return Guid.Empty.ToString();
}
[LuaMethodExample("onsavestate", "local steveons = event.onsavestate(\r\n\tfunction()\r\n\t\tconsole.log( \"Fires after a state is saved\" );\r\n\tend\r\n\t, \"Frame name\" );")]
[LuaMethod("onsavestate", "Fires after a state is saved")]
public string OnSaveState(LuaFunction luaf, string name = null)
{
@ -335,6 +344,7 @@ namespace BizHawk.Client.Common
return nlf.Guid.ToString();
}
[LuaMethodExample("onexit", "local steveone = event.onexit(\r\n\tfunction()\r\n\t\tconsole.log( \"Fires after the calling script has stopped\" );\r\n\tend\r\n\t, \"Frame name\" );")]
[LuaMethod("onexit", "Fires after the calling script has stopped")]
public string OnExit(LuaFunction luaf, string name = null)
{
@ -343,6 +353,7 @@ namespace BizHawk.Client.Common
return nlf.Guid.ToString();
}
[LuaMethodExample("unregisterbyid", "if ( event.unregisterbyid( \"4d1810b7 - 0d28 - 4acb - 9d8b - d87721641551\" ) ) then\r\n\tconsole.log( \"Removes the registered function that matches the guid.If a function is found and remove the function will return true.If unable to find a match, the function will return false.\" );\r\nend;")]
[LuaMethod("unregisterbyid", "Removes the registered function that matches the guid. If a function is found and remove the function will return true. If unable to find a match, the function will return false.")]
public bool UnregisterById(string guid)
{
@ -355,6 +366,7 @@ namespace BizHawk.Client.Common
return false;
}
[LuaMethodExample("unregisterbyname", "if ( event.unregisterbyname( \"Function name\" ) ) then\r\n\tconsole.log( \"Removes the first registered function that matches Name.If a function is found and remove the function will return true.If unable to find a match, the function will return false.\" );\r\nend;")]
[LuaMethod("unregisterbyname", "Removes the first registered function that matches Name. If a function is found and remove the function will return true. If unable to find a match, the function will return false.")]
public bool UnregisterByName(string name)
{

View File

@ -18,6 +18,7 @@ namespace BizHawk.Client.Common
public override string Name => "gameinfo";
[LuaMethodExample("getromname", "local stgamget = gameinfo.getromname( );")]
[LuaMethod("getromname", "returns the path of the currently loaded rom, if a rom is loaded")]
public string GetRomName()
{
@ -29,6 +30,7 @@ namespace BizHawk.Client.Common
return "";
}
[LuaMethodExample("getromhash", "local stgamget = gameinfo.getromhash( );")]
[LuaMethod("getromhash", "returns the hash of the currently loaded rom, if a rom is loaded")]
public string GetRomHash()
{
@ -40,6 +42,7 @@ namespace BizHawk.Client.Common
return "";
}
[LuaMethodExample("indatabase", "if ( gameinfo.indatabase( ) ) then\r\n\tconsole.log( \"returns whether or not the currently loaded rom is in the game database\" );\r\nend;")]
[LuaMethod("indatabase", "returns whether or not the currently loaded rom is in the game database")]
public bool InDatabase()
{
@ -51,6 +54,7 @@ namespace BizHawk.Client.Common
return false;
}
[LuaMethodExample("getstatus", "local stgamget = gameinfo.getstatus( );")]
[LuaMethod("getstatus", "returns the game database status of the currently loaded rom. Statuses are for example: GoodDump, BadDump, Hack, Unknown, NotInDatabase")]
public string GetStatus()
{
@ -62,6 +66,7 @@ namespace BizHawk.Client.Common
return "";
}
[LuaMethodExample("isstatusbad", "if ( gameinfo.isstatusbad( ) ) then\r\n\tconsole.log( \"returns the currently loaded rom's game database status is considered 'bad'\" );\r\nend;")]
[LuaMethod("isstatusbad", "returns the currently loaded rom's game database status is considered 'bad'")]
public bool IsStatusBad()
{
@ -73,12 +78,14 @@ namespace BizHawk.Client.Common
return true;
}
[LuaMethodExample("getboardtype", "local stgamget = gameinfo.getboardtype( );")]
[LuaMethod("getboardtype", "returns identifying information about the 'mapper' or similar capability used for this game. empty if no such useful distinction can be drawn")]
public string GetBoardType()
{
return BoardInfo?.BoardName ?? "";
}
[LuaMethodExample("getoptions", "local nlgamget = gameinfo.getoptions( );")]
[LuaMethod("getoptions", "returns the game options for the currently loaded rom. Options vary per platform")]
public LuaTable GetOptions()
{

View File

@ -37,24 +37,28 @@ namespace BizHawk.Client.Common
Genesis?.PutSettings(settings);
}
[LuaMethodExample("getlayer_bga", "if ( genesis.getlayer_bga( ) ) then\r\n\tconsole.log( \"Returns whether the bg layer A is displayed\" );\r\nend;")]
[LuaMethod("getlayer_bga", "Returns whether the bg layer A is displayed")]
public bool GetLayerBgA()
{
return GetSettings().DrawBGA;
}
[LuaMethodExample("getlayer_bgb", "if ( genesis.getlayer_bgb( ) ) then\r\n\tconsole.log( \"Returns whether the bg layer B is displayed\" );\r\nend;")]
[LuaMethod("getlayer_bgb", "Returns whether the bg layer B is displayed")]
public bool GetLayerBgB()
{
return GetSettings().DrawBGB;
}
[LuaMethodExample("getlayer_bgw", "if ( genesis.getlayer_bgw( ) ) then\r\n\tconsole.log( \"Returns whether the bg layer W is displayed\" );\r\nend;")]
[LuaMethod("getlayer_bgw", "Returns whether the bg layer W is displayed")]
public bool GetLayerBgW()
{
return GetSettings().DrawBGW;
}
[LuaMethodExample("setlayer_bga", "genesis.setlayer_bga( true );")]
[LuaMethod("setlayer_bga", "Sets whether the bg layer A is displayed")]
public void SetLayerBgA(bool value)
{
@ -63,6 +67,7 @@ namespace BizHawk.Client.Common
PutSettings(s);
}
[LuaMethodExample("setlayer_bgb", "genesis.setlayer_bgb( true );")]
[LuaMethod("setlayer_bgb", "Sets whether the bg layer B is displayed")]
public void SetLayerBgB(bool value)
{
@ -71,6 +76,7 @@ namespace BizHawk.Client.Common
PutSettings(s);
}
[LuaMethodExample("setlayer_bgw", "genesis.setlayer_bgw( true );")]
[LuaMethod("setlayer_bgw", "Sets whether the bg layer W is displayed")]
public void SetLayerBgW(bool value)
{

View File

@ -13,6 +13,7 @@ namespace BizHawk.Client.Common
public override string Name => "joypad";
[LuaMethodExample("get", "local nljoyget = joypad.get( 1 );")]
[LuaMethod("get", "returns a lua table of the controller buttons pressed. If supplied, it will only return a table of buttons for the given controller")]
public LuaTable Get(int? controller = null)
{
@ -50,6 +51,7 @@ namespace BizHawk.Client.Common
}
// TODO: what about float controls?
[LuaMethodExample("getimmediate", "local nljoyget = joypad.getimmediate( );")]
[LuaMethod("getimmediate", "returns a lua table of any controller buttons currently pressed by the user")]
public LuaTable GetImmediate()
{
@ -62,6 +64,7 @@ namespace BizHawk.Client.Common
return buttons;
}
[LuaMethodExample("setfrommnemonicstr", "joypad.setfrommnemonicstr( \"| 0, 0, 0, 100,...R..B....|\" );")]
[LuaMethod("setfrommnemonicstr", "sets the given buttons to their provided values for the current frame, string will be interpretted the same way an entry from a movie input log would be")]
public void SetFromMnemonicStr(string inputLogEntry)
{
@ -86,6 +89,7 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("set", "joypad.set( { [\"Left\"] = true, [ \"A\" ] = true, [ \"B\" ] = true } );")]
[LuaMethod("set", "sets the given buttons to their provided values for the current frame")]
public void Set(LuaTable buttons, int? controller = null)
{
@ -147,9 +151,10 @@ namespace BizHawk.Client.Common
catch
{
/*Eat it*/
}
}
}
}
[LuaMethodExample("setanalog", "joypad.setanalog( { [ \"Tilt X\" ] = true, [ \"Tilt Y\" ] = false } );")]
[LuaMethod("setanalog", "sets the given analog controls to their provided values for the current frame. Note that unlike set() there is only the logic of overriding with the given value.")]
public void SetAnalog(LuaTable controls, object controller = null)
{

View File

@ -37,12 +37,14 @@ namespace BizHawk.Client.Common
#region Unique Library Methods
[LuaMethodExample("getname", "local stmaiget = mainmemory.getname( );")]
[LuaMethod("getname", "returns the name of the domain defined as main memory for the given core")]
public string GetName()
{
return Domain.Name;
}
[LuaMethodExample("getcurrentmemorydomainsize", "local uimaiget = mainmemory.getcurrentmemorydomainsize( );")]
[LuaMethod("getcurrentmemorydomainsize", "Returns the number of bytes of the domain defined as main memory")]
public uint GetSize()
{
@ -53,36 +55,42 @@ namespace BizHawk.Client.Common
#region Common Special and Legacy Methods
[LuaMethodExample("readbyte", "local uimairea = mainmemory.readbyte( 0x100 );")]
[LuaMethod("readbyte", "gets the value from the given address as an unsigned byte")]
public uint ReadByte(int addr)
{
return ReadUnsignedByte(addr);
}
[LuaMethodExample("writebyte", "mainmemory.writebyte( 0x100, 1000 );")]
[LuaMethod("writebyte", "Writes the given value to the given address as an unsigned byte")]
public void WriteByte(int addr, uint value)
{
WriteUnsignedByte(addr, value);
}
[LuaMethodExample("readbyterange", "local nlmairea = mainmemory.readbyterange( 0x100, 64 );")]
[LuaMethod("readbyterange", "Reads the address range that starts from address, and is length long. Returns the result into a table of key value pairs (where the address is the key).")]
public LuaTable ReadByteRange(int addr, int length)
{
return base.ReadByteRange(addr, length);
}
[LuaMethodExample("writebyterange", "mainmemory.writebyterange( nluatable memoryblock <<!DUPPA!>> );")]
[LuaMethod("writebyterange", "Writes the given values to the given addresses as unsigned bytes")]
public void WriteByteRange(LuaTable memoryblock)
{
base.WriteByteRange(memoryblock);
}
[LuaMethodExample("readfloat", "local simairea = mainmemory.readfloat(0x100, false);")]
[LuaMethod("readfloat", "Reads the given address as a 32-bit float value from the main memory domain with th e given endian")]
public float ReadFloat(int addr, bool bigendian)
{
return base.ReadFloat(addr, bigendian);
}
[LuaMethodExample("writefloat", "mainmemory.writefloat( 0x100, 10.0, false );")]
[LuaMethod("writefloat", "Writes the given 32-bit float value to the given address and endian")]
public void WriteFloat(int addr, double value, bool bigendian)
{
@ -93,24 +101,28 @@ namespace BizHawk.Client.Common
#region 1 Byte
[LuaMethodExample("read_s8", "local inmairea = mainmemory.read_s8( 0x100 );")]
[LuaMethod("read_s8", "read signed byte")]
public int ReadS8(int addr)
{
return (sbyte)ReadUnsignedByte(addr);
}
[LuaMethodExample("write_s8", "mainmemory.write_s8( 0x100, 1000 );")]
[LuaMethod("write_s8", "write signed byte")]
public void WriteS8(int addr, uint value)
{
WriteUnsignedByte(addr, value);
}
[LuaMethodExample("read_u8", "local uimairea = mainmemory.read_u8( 0x100 );")]
[LuaMethod("read_u8", "read unsigned byte")]
public uint ReadU8(int addr)
{
return ReadUnsignedByte(addr);
}
[LuaMethodExample("write_u8", "mainmemory.write_u8( 0x100, 1000 );")]
[LuaMethod("write_u8", "write unsigned byte")]
public void WriteU8(int addr, uint value)
{
@ -121,48 +133,56 @@ namespace BizHawk.Client.Common
#region 2 Byte
[LuaMethodExample("read_s16_le", "local inmairea = mainmemory.read_s16_le( 0x100 );")]
[LuaMethod("read_s16_le", "read signed 2 byte value, little endian")]
public int ReadS16Little(int addr)
{
return ReadSignedLittleCore(addr, 2);
}
[LuaMethodExample("write_s16_le", "mainmemory.write_s16_le( 0x100, -1000 );")]
[LuaMethod("write_s16_le", "write signed 2 byte value, little endian")]
public void WriteS16Little(int addr, int value)
{
WriteSignedLittle(addr, value, 2);
}
[LuaMethodExample("read_s16_be", "local inmairea = mainmemory.read_s16_be( 0x100 );")]
[LuaMethod("read_s16_be", "read signed 2 byte value, big endian")]
public int ReadS16Big(int addr)
{
return ReadSignedBig(addr, 2);
}
[LuaMethodExample("write_s16_be", "mainmemory.write_s16_be( 0x100, -1000 );")]
[LuaMethod("write_s16_be", "write signed 2 byte value, big endian")]
public void WriteS16Big(int addr, int value)
{
WriteSignedBig(addr, value, 2);
}
[LuaMethodExample("read_u16_le", "local uimairea = mainmemory.read_u16_le( 0x100 );")]
[LuaMethod("read_u16_le", "read unsigned 2 byte value, little endian")]
public uint ReadU16Little(int addr)
{
return ReadSignedLittle(addr, 2);
}
[LuaMethodExample("write_u16_le", "mainmemory.write_u16_le( 0x100, 1000 );")]
[LuaMethod("write_u16_le", "write unsigned 2 byte value, little endian")]
public void WriteU16Little(int addr, uint value)
{
WriteUnsignedLittle(addr, value, 2);
}
[LuaMethodExample("read_u16_be", "local uimairea = mainmemory.read_u16_be( 0x100 );")]
[LuaMethod("read_u16_be", "read unsigned 2 byte value, big endian")]
public uint ReadU16Big(int addr)
{
return ReadUnsignedBig(addr, 2);
}
[LuaMethodExample("write_u16_be", "mainmemory.write_u16_be( 0x100, 1000 );")]
[LuaMethod("write_u16_be", "write unsigned 2 byte value, big endian")]
public void WriteU16Big(int addr, uint value)
{
@ -173,48 +193,56 @@ namespace BizHawk.Client.Common
#region 3 Byte
[LuaMethodExample("read_s24_le", "local inmairea = mainmemory.read_s24_le( 0x100 );")]
[LuaMethod("read_s24_le", "read signed 24 bit value, little endian")]
public int ReadS24Little(int addr)
{
return ReadSignedLittleCore(addr, 3);
}
[LuaMethodExample("write_s24_le", "mainmemory.write_s24_le( 0x100, -1000 );")]
[LuaMethod("write_s24_le", "write signed 24 bit value, little endian")]
public void WriteS24Little(int addr, int value)
{
WriteSignedLittle(addr, value, 3);
}
[LuaMethodExample("read_s24_be", "local inmairea = mainmemory.read_s24_be( 0x100 );")]
[LuaMethod("read_s24_be", "read signed 24 bit value, big endian")]
public int ReadS24Big(int addr)
{
return ReadSignedBig(addr, 3);
}
[LuaMethodExample("write_s24_be", "mainmemory.write_s24_be( 0x100, -1000 );")]
[LuaMethod("write_s24_be", "write signed 24 bit value, big endian")]
public void WriteS24Big(int addr, int value)
{
WriteSignedBig(addr, value, 3);
}
[LuaMethodExample("read_u24_le", "local uimairea = mainmemory.read_u24_le( 0x100 );")]
[LuaMethod("read_u24_le", "read unsigned 24 bit value, little endian")]
public uint ReadU24Little(int addr)
{
return ReadSignedLittle(addr, 3);
}
[LuaMethodExample("write_u24_le", "mainmemory.write_u24_le( 0x100, 1000 );")]
[LuaMethod("write_u24_le", "write unsigned 24 bit value, little endian")]
public void WriteU24Little(int addr, uint value)
{
WriteUnsignedLittle(addr, value, 3);
}
[LuaMethodExample("read_u24_be", "local uimairea = mainmemory.read_u24_be( 0x100 );")]
[LuaMethod("read_u24_be", "read unsigned 24 bit value, big endian")]
public uint ReadU24Big(int addr)
{
return ReadUnsignedBig(addr, 3);
}
[LuaMethodExample("write_u24_be", "mainmemory.write_u24_be( 0x100, 1000 );")]
[LuaMethod("write_u24_be", "write unsigned 24 bit value, big endian")]
public void WriteU24Big(int addr, uint value)
{
@ -225,48 +253,56 @@ namespace BizHawk.Client.Common
#region 4 Byte
[LuaMethodExample("read_s32_le", "local inmairea = mainmemory.read_s32_le( 0x100 );")]
[LuaMethod("read_s32_le", "read signed 4 byte value, little endian")]
public int ReadS32Little(int addr)
{
return ReadSignedLittleCore(addr, 4);
}
[LuaMethodExample("write_s32_le", "mainmemory.write_s32_le( 0x100, -1000 );")]
[LuaMethod("write_s32_le", "write signed 4 byte value, little endian")]
public void WriteS32Little(int addr, int value)
{
WriteSignedLittle(addr, value, 4);
}
[LuaMethodExample("read_s32_be", "local inmairea = mainmemory.read_s32_be( 0x100 );")]
[LuaMethod("read_s32_be", "read signed 4 byte value, big endian")]
public int ReadS32Big(int addr)
{
return ReadSignedBig(addr, 4);
}
[LuaMethodExample("write_s32_be", "mainmemory.write_s32_be( 0x100, -1000 );")]
[LuaMethod("write_s32_be", "write signed 4 byte value, big endian")]
public void WriteS32Big(int addr, int value)
{
WriteSignedBig(addr, value, 4);
}
[LuaMethodExample("read_u32_le", "local uimairea = mainmemory.read_u32_le( 0x100 );")]
[LuaMethod("read_u32_le", "read unsigned 4 byte value, little endian")]
public uint ReadU32Little(int addr)
{
return ReadSignedLittle(addr, 4);
}
[LuaMethodExample("write_u32_le", "mainmemory.write_u32_le( 0x100, 1000 );")]
[LuaMethod("write_u32_le", "write unsigned 4 byte value, little endian")]
public void WriteU32Little(int addr, uint value)
{
WriteUnsignedLittle(addr, value, 4);
}
[LuaMethodExample("read_u32_be", "local uimairea = mainmemory.read_u32_be( 0x100 );")]
[LuaMethod("read_u32_be", "read unsigned 4 byte value, big endian")]
public uint ReadU32Big(int addr)
{
return ReadUnsignedBig(addr, 4);
}
[LuaMethodExample("write_u32_be", "mainmemory.write_u32_be( 0x100, 1000 );")]
[LuaMethod("write_u32_be", "write unsigned 4 byte value, big endian")]
public void WriteU32Big(int addr, uint value)
{

View File

@ -49,6 +49,7 @@ namespace BizHawk.Client.Common
#region Unique Library Methods
[LuaMethodExample("getmemorydomainlist", "local nlmemget = memory.getmemorydomainlist();")]
[LuaMethod("getmemorydomainlist", "Returns a string of the memory domains for the loaded platform core. List will be a single string delimited by line feeds")]
public LuaTable GetMemoryDomainList()
{
@ -64,6 +65,7 @@ namespace BizHawk.Client.Common
return table;
}
[LuaMethodExample("getmemorydomainsize", "local uimemget = memory.getmemorydomainsize( mainmemory.getname( ) );")]
[LuaMethod("getmemorydomainsize", "Returns the number of bytes of the specified memory domain. If no domain is specified, or the specified domain doesn't exist, returns the current domain size")]
public uint GetMemoryDomainSize(string name = "")
{
@ -75,18 +77,21 @@ namespace BizHawk.Client.Common
return (uint)DomainList[VerifyMemoryDomain(name)].Size;
}
[LuaMethodExample("getcurrentmemorydomain", "local stmemget = memory.getcurrentmemorydomain( );")]
[LuaMethod("getcurrentmemorydomain", "Returns a string name of the current memory domain selected by Lua. The default is Main memory")]
public string GetCurrentMemoryDomain()
{
return Domain.Name;
}
[LuaMethodExample("getcurrentmemorydomainsize", "local uimemget = memory.getcurrentmemorydomainsize( );")]
[LuaMethod("getcurrentmemorydomainsize", "Returns the number of bytes of the current memory domain selected by Lua. The default is Main memory")]
public uint GetCurrentMemoryDomainSize()
{
return (uint)Domain.Size;
}
[LuaMethodExample("usememorydomain", "if ( memory.usememorydomain( mainmemory.getname( ) ) ) then\r\n\tconsole.log( \"Attempts to set the current memory domain to the given domain. If the name does not match a valid memory domain, the function returns false, else it returns true\" );\r\nend;")]
[LuaMethod("usememorydomain", "Attempts to set the current memory domain to the given domain. If the name does not match a valid memory domain, the function returns false, else it returns true")]
public bool UseMemoryDomain(string domain)
{
@ -109,6 +114,7 @@ namespace BizHawk.Client.Common
return false;
}
[LuaMethodExample("hash_region", "local stmemhas = memory.hash_region( 0x100, 50, mainmemory.getname( ) );")]
[LuaMethod("hash_region", "Returns a hash as a string of a region of memory, starting from addr, through count bytes. If the domain is unspecified, it uses the current region.")]
public string HashRegion(int addr, int count, string domain = null)
{
@ -144,36 +150,42 @@ namespace BizHawk.Client.Common
#region Common Special and Legacy Methods
[LuaMethodExample("readbyte", "local uimemrea = memory.readbyte( 0x100, mainmemory.getname( ) );")]
[LuaMethod("readbyte", "gets the value from the given address as an unsigned byte")]
public uint ReadByte(int addr, string domain = null)
{
return ReadUnsignedByte(addr, domain);
}
[LuaMethodExample("writebyte", "memory.writebyte( 0x100, 1000, mainmemory.getname( ) );")]
[LuaMethod("writebyte", "Writes the given value to the given address as an unsigned byte")]
public void WriteByte(int addr, uint value, string domain = null)
{
WriteUnsignedByte(addr, value, domain);
}
[LuaMethodExample("readbyterange" , "local nlmemrea = memory.readbyterange( 0x100, 30, mainmemory.getname( ) );")]
[LuaMethod("readbyterange", "Reads the address range that starts from address, and is length long. Returns the result into a table of key value pairs (where the address is the key).")]
public new LuaTable ReadByteRange(int addr, int length, string domain = null)
{
return base.ReadByteRange(addr, length, domain);
}
[LuaMethodExample("writebyterange", "memory.writebyterange( nluatable memoryblock <<!DUPPA!>>, mainmemory.getname( ) );")]
[LuaMethod("writebyterange", "Writes the given values to the given addresses as unsigned bytes")]
public new void WriteByteRange(LuaTable memoryblock, string domain = null)
{
base.WriteByteRange(memoryblock, domain);
}
[LuaMethodExample("readfloat", "local simemrea = memory.readfloat( 0x100, false, mainmemory.getname( ) );")]
[LuaMethod("readfloat", "Reads the given address as a 32-bit float value from the main memory domain with th e given endian")]
public new float ReadFloat(int addr, bool bigendian, string domain = null)
{
return base.ReadFloat(addr, bigendian, domain);
}
[LuaMethodExample("writefloat", "memory.writefloat( 0x100, 10.0, false, mainmemory.getname( ) );")]
[LuaMethod("writefloat", "Writes the given 32-bit float value to the given address and endian")]
public new void WriteFloat(int addr, double value, bool bigendian, string domain = null)
{
@ -184,24 +196,28 @@ namespace BizHawk.Client.Common
#region 1 Byte
[LuaMethodExample("read_s8", "local inmemrea = memory.read_s8( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s8", "read signed byte")]
public int ReadS8(int addr, string domain = null)
{
return (sbyte)ReadUnsignedByte(addr, domain);
}
[LuaMethodExample("write_s8", "memory.write_s8( 0x100, 1000, mainmemory.getname( ) );")]
[LuaMethod("write_s8", "write signed byte")]
public void WriteS8(int addr, uint value, string domain = null)
{
WriteUnsignedByte(addr, value, domain);
}
[LuaMethodExample("read_u8", "local uimemrea = memory.read_u8( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_u8", "read unsigned byte")]
public uint ReadU8(int addr, string domain = null)
{
return ReadUnsignedByte(addr, domain);
}
[LuaMethodExample("write_u8", "memory.write_u8( 0x100, 1000, mainmemory.getname( ) );")]
[LuaMethod("write_u8", "write unsigned byte")]
public void WriteU8(int addr, uint value, string domain = null)
{
@ -212,48 +228,56 @@ namespace BizHawk.Client.Common
#region 2 Byte
[LuaMethodExample("read_s16_le", "local inmemrea = memory.read_s16_le( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s16_le", "read signed 2 byte value, little endian")]
public int ReadS16Little(int addr, string domain = null)
{
return ReadSignedLittleCore(addr, 2, domain);
}
[LuaMethodExample("write_s16_le", "memory.write_s16_le( 0x100, -1000, mainmemory.getname( ) );")]
[LuaMethod("write_s16_le", "write signed 2 byte value, little endian")]
public void WriteS16Little(int addr, int value, string domain = null)
{
WriteSignedLittle(addr, value, 2, domain);
}
[LuaMethodExample("read_s16_be", "local inmemrea = memory.read_s16_be( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s16_be", "read signed 2 byte value, big endian")]
public int ReadS16Big(int addr, string domain = null)
{
return ReadSignedBig(addr, 2, domain);
}
[LuaMethodExample("write_s16_be", "memory.write_s16_be( 0x100, -1000, mainmemory.getname( ) );")]
[LuaMethod("write_s16_be", "write signed 2 byte value, big endian")]
public void WriteS16Big(int addr, int value, string domain = null)
{
WriteSignedBig(addr, value, 2, domain);
}
[LuaMethodExample("read_u16_le", "local uimemrea = memory.read_u16_le( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_u16_le", "read unsigned 2 byte value, little endian")]
public uint ReadU16Little(int addr, string domain = null)
{
return ReadUnsignedLittle(addr, 2, domain);
}
[LuaMethodExample("write_u16_le", "memory.write_u16_le( 0x100, 1000, mainmemory.getname( ) );")]
[LuaMethod("write_u16_le", "write unsigned 2 byte value, little endian")]
public void WriteU16Little(int addr, uint value, string domain = null)
{
WriteUnsignedLittle(addr, value, 2, domain);
}
[LuaMethodExample("read_u16_be", "local uimemrea = memory.read_u16_be( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_u16_be", "read unsigned 2 byte value, big endian")]
public uint ReadU16Big(int addr, string domain = null)
{
return ReadUnsignedBig(addr, 2, domain);
}
[LuaMethodExample("write_u16_be", "memory.write_u16_be( 0x100, 1000, mainmemory.getname( ) );")]
[LuaMethod("write_u16_be", "write unsigned 2 byte value, big endian")]
public void WriteU16Big(int addr, uint value, string domain = null)
{
@ -264,48 +288,56 @@ namespace BizHawk.Client.Common
#region 3 Byte
[LuaMethodExample("read_s24_le", "local inmemrea = memory.read_s24_le( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s24_le", "read signed 24 bit value, little endian")]
public int ReadS24Little(int addr, string domain = null)
{
return ReadSignedLittleCore(addr, 3, domain);
}
[LuaMethodExample("write_s24_le", "memory.write_s24_le( 0x100, -1000, mainmemory.getname( ) );")]
[LuaMethod("write_s24_le", "write signed 24 bit value, little endian")]
public void WriteS24Little(int addr, int value, string domain = null)
{
WriteSignedLittle(addr, value, 3, domain);
}
[LuaMethodExample("read_s24_be", "local inmemrea = memory.read_s24_be( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s24_be", "read signed 24 bit value, big endian")]
public int ReadS24Big(int addr, string domain = null)
{
return ReadSignedBig(addr, 3, domain);
}
[LuaMethodExample("write_s24_be" , "memory.write_s24_be( 0x100, -1000, mainmemory.getname( ) );")]
[LuaMethod("write_s24_be", "write signed 24 bit value, big endian")]
public void WriteS24Big(int addr, int value, string domain = null)
{
WriteSignedBig(addr, value, 3, domain);
}
[LuaMethodExample("read_u24_le", "local uimemrea = memory.read_u24_le( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_u24_le", "read unsigned 24 bit value, little endian")]
public uint ReadU24Little(int addr, string domain = null)
{
return ReadUnsignedLittle(addr, 3, domain);
}
[LuaMethodExample("write_u24_le", "memory.write_u24_le( 0x100, 1000, mainmemory.getname( ) );")]
[LuaMethod("write_u24_le", "write unsigned 24 bit value, little endian")]
public void WriteU24Little(int addr, uint value, string domain = null)
{
WriteUnsignedLittle(addr, value, 3, domain);
}
[LuaMethodExample("read_u24_be", "local uimemrea = memory.read_u24_be( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_u24_be", "read unsigned 24 bit value, big endian")]
public uint ReadU24Big(int addr, string domain = null)
{
return ReadUnsignedBig(addr, 3, domain);
}
[LuaMethodExample("write_u24_be", "memory.write_u24_be( 0x100, 1000, mainmemory.getname( ) );")]
[LuaMethod("write_u24_be", "write unsigned 24 bit value, big endian")]
public void WriteU24Big(int addr, uint value, string domain = null)
{
@ -316,48 +348,56 @@ namespace BizHawk.Client.Common
#region 4 Byte
[LuaMethodExample("read_s32_le", "local inmemrea = memory.read_s32_le( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s32_le", "read signed 4 byte value, little endian")]
public int ReadS32Little(int addr, string domain = null)
{
return ReadSignedLittleCore(addr, 4, domain);
}
[LuaMethodExample("write_s32_le", "memory.write_s32_le( 0x100, -1000, mainmemory.getname( ) );")]
[LuaMethod("write_s32_le", "write signed 4 byte value, little endian")]
public void WriteS32Little(int addr, int value, string domain = null)
{
WriteSignedLittle(addr, value, 4, domain);
}
[LuaMethodExample("read_s32_be", "local inmemrea = memory.read_s32_be( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_s32_be", "read signed 4 byte value, big endian")]
public int ReadS32Big(int addr, string domain = null)
{
return ReadSignedBig(addr, 4, domain);
}
[LuaMethodExample("write_s32_be", "memory.write_s32_be( 0x100, -1000, mainmemory.getname( ) );")]
[LuaMethod("write_s32_be", "write signed 4 byte value, big endian")]
public void WriteS32Big(int addr, int value, string domain = null)
{
WriteSignedBig(addr, value, 4, domain);
}
[LuaMethodExample("read_u32_le", "local uimemrea = memory.read_u32_le( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_u32_le", "read unsigned 4 byte value, little endian")]
public uint ReadU32Little(int addr, string domain = null)
{
return ReadUnsignedLittle(addr, 4, domain);
}
[LuaMethodExample("write_u32_le", "memory.write_u32_le( 0x100, 1000, mainmemory.getname( ) );")]
[LuaMethod("write_u32_le", "write unsigned 4 byte value, little endian")]
public void WriteU32Little(int addr, uint value, string domain = null)
{
WriteUnsignedLittle(addr, value, 4, domain);
}
[LuaMethodExample("read_u32_be", "local uimemrea = memory.read_u32_be( 0x100, mainmemory.getname( ) );")]
[LuaMethod("read_u32_be", "read unsigned 4 byte value, big endian")]
public uint ReadU32Big(int addr, string domain = null)
{
return ReadUnsignedBig(addr, 4, domain);
}
[LuaMethodExample("write_u32_be", "memory.write_u32_be( 0x100, 1000, mainmemory.getname( ) );")]
[LuaMethod("write_u32_be", "write unsigned 4 byte value, big endian")]
public void WriteU32Big(int addr, uint value, string domain = null)
{

View File

@ -23,6 +23,7 @@ namespace BizHawk.Client.Common
private readonly Dictionary<Guid, byte[]> _memorySavestates = new Dictionary<Guid, byte[]>();
[LuaMethodExample("savecorestate", "local mmsvstsvcst = memorysavestate.savecorestate( );")]
[LuaMethod("savecorestate", "creates a core savestate and stores it in memory. Note: a core savestate is only the raw data from the core, and not extras such as movie input logs, or framebuffers. Returns a unique identifer for the savestate")]
public string SaveCoreStateToMemory()
{
@ -34,6 +35,7 @@ namespace BizHawk.Client.Common
return guid.ToString();
}
[LuaMethodExample("loadcorestate", "memorysavestate.loadcorestate( \"3fcf120f-0778-43fd-b2c5-460fb7d34184\" );")]
[LuaMethod("loadcorestate", "loads an in memory state with the given identifier")]
public void LoadCoreStateFromMemory(string identifier)
{
@ -55,6 +57,7 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("removestate", "memorysavestate.removestate( \"3fcf120f-0778-43fd-b2c5-460fb7d34184\" );")]
[LuaMethod("removestate", "removes the savestate with the given identifier from memory")]
public void DeleteState(string identifier)
{
@ -62,6 +65,7 @@ namespace BizHawk.Client.Common
_memorySavestates.Remove(guid);
}
[LuaMethodExample("clearstatesfrommemory", "memorysavestate.clearstatesfrommemory( );")]
[LuaMethod("clearstatesfrommemory", "clears all savestates stored in memory")]
public void ClearInMemoryStates()
{

View File

@ -14,24 +14,28 @@ namespace BizHawk.Client.Common
public override string Name => "movie";
[LuaMethodExample("startsfromsavestate", "if ( movie.startsfromsavestate( ) ) then\r\n\tconsole.log( \"Returns whether or not the movie is a savestate-anchored movie\" );\r\nend;")]
[LuaMethod("startsfromsavestate", "Returns whether or not the movie is a savestate-anchored movie")]
public bool StartsFromSavestate()
{
return Global.MovieSession.Movie.IsActive && Global.MovieSession.Movie.StartsFromSavestate;
}
[LuaMethodExample("startsfromsaveram", "if ( movie.startsfromsaveram( ) ) then\r\n\tconsole.log( \"Returns whether or not the movie is a saveram-anchored movie\" );\r\nend;")]
[LuaMethod("startsfromsaveram", "Returns whether or not the movie is a saveram-anchored movie")]
public bool StartsFromSaveram()
{
return Global.MovieSession.Movie.IsActive && Global.MovieSession.Movie.StartsFromSaveRam;
}
[LuaMethodExample("filename", "local stmovfil = movie.filename( );")]
[LuaMethod("filename", "Returns the file name including path of the currently loaded movie")]
public static string Filename()
{
return Global.MovieSession.Movie.Filename;
}
[LuaMethodExample("getinput", "local nlmovget = movie.getinput( 500 );")]
[LuaMethod("getinput", "Returns a table of buttons pressed on a given frame of the loaded movie")]
public LuaTable GetInput(int frame)
{
@ -63,6 +67,7 @@ namespace BizHawk.Client.Common
return input;
}
[LuaMethodExample("getinputasmnemonic", "local stmovget = movie.getinputasmnemonic( 500 );")]
[LuaMethod("getinputasmnemonic", "Returns the input of a given frame of the loaded movie in a raw inputlog string")]
public string GetInputAsMnemonic(int frame)
{
@ -76,36 +81,42 @@ namespace BizHawk.Client.Common
return "";
}
[LuaMethodExample("getreadonly", "if ( movie.getreadonly( ) ) then\r\n\tconsole.log( \"Returns true if the movie is in read-only mode, false if in read+write\" );\r\nend;")]
[LuaMethod("getreadonly", "Returns true if the movie is in read-only mode, false if in read+write")]
public static bool GetReadOnly()
{
return Global.MovieSession.ReadOnly;
}
[LuaMethodExample("getrerecordcount", "local ulmovget = movie.getrerecordcount();")]
[LuaMethod("getrerecordcount", "Gets the rerecord count of the current movie.")]
public static ulong GetRerecordCount()
{
return Global.MovieSession.Movie.Rerecords;
}
[LuaMethodExample("getrerecordcounting", "if ( movie.getrerecordcounting( ) ) then\r\n\tconsole.log( \"Returns whether or not the current movie is incrementing rerecords on loadstate\" );\r\nend;")]
[LuaMethod("getrerecordcounting", "Returns whether or not the current movie is incrementing rerecords on loadstate")]
public static bool GetRerecordCounting()
{
return Global.MovieSession.Movie.IsCountingRerecords;
}
[LuaMethodExample("isloaded", "if ( movie.isloaded( ) ) then\r\n\tconsole.log( \"Returns true if a movie is loaded in memory ( play, record, or finished modes ), false if not ( inactive mode )\" );\r\nend;")]
[LuaMethod("isloaded", "Returns true if a movie is loaded in memory (play, record, or finished modes), false if not (inactive mode)")]
public static bool IsLoaded()
{
return Global.MovieSession.Movie.IsActive;
}
[LuaMethodExample("length", "local domovlen = movie.length( );")]
[LuaMethod("length", "Returns the total number of frames of the loaded movie")]
public static double Length()
{
return Global.MovieSession.Movie.FrameCount;
}
[LuaMethodExample("mode", "local stmovmod = movie.mode( );")]
[LuaMethod("mode", "Returns the mode of the current movie. Possible modes: \"PLAY\", \"RECORD\", \"FINISHED\", \"INACTIVE\"")]
public static string Mode()
{
@ -127,6 +138,7 @@ namespace BizHawk.Client.Common
return "INACTIVE";
}
[LuaMethodExample("save", "movie.save( \"C:\\moviename.ext\" );")]
[LuaMethod("save", "Saves the current movie to the disc. If the filename is provided (no extension or path needed), the movie is saved under the specified name to the current movie directory. The filename may contain a subdirectory, it will be created if it doesn't exist. Existing files won't get overwritten.")]
public void Save(string filename = "")
{
@ -151,12 +163,14 @@ namespace BizHawk.Client.Common
Global.MovieSession.Movie.Save();
}
[LuaMethodExample("setreadonly", "movie.setreadonly( false );")]
[LuaMethod("setreadonly", "Sets the read-only state to the given value. true for read only, false for read+write")]
public static void SetReadOnly(bool readOnly)
{
Global.MovieSession.ReadOnly = readOnly;
}
[LuaMethodExample("setrerecordcount", "movie.setrerecordcount( 20.0 );")]
[LuaMethod("setrerecordcount", "Sets the rerecord count of the current movie.")]
public static void SetRerecordCount(double count)
{
@ -172,18 +186,21 @@ namespace BizHawk.Client.Common
Global.MovieSession.Movie.Rerecords = (ulong)count;
}
[LuaMethodExample("setrerecordcounting", "movie.setrerecordcounting( true );")]
[LuaMethod("setrerecordcounting", "Sets whether or not the current movie will increment the rerecord counter on loadstate")]
public static void SetRerecordCounting(bool counting)
{
Global.MovieSession.Movie.IsCountingRerecords = counting;
}
[LuaMethodExample("stop", "movie.stop( );")]
[LuaMethod("stop", "Stops the current movie")]
public static void Stop()
{
Global.MovieSession.Movie.Stop();
}
[LuaMethodExample("getfps", "local domovget = movie.getfps( );")]
[LuaMethod("getfps", "If a movie is loaded, gets the frames per second used by the movie to determine the movie length time")]
public static double GetFps()
{
@ -200,6 +217,7 @@ namespace BizHawk.Client.Common
return 0.0;
}
[LuaMethodExample("getheader", "local nlmovget = movie.getheader( );")]
[LuaMethod("getheader", "If a movie is active, will return the movie header as a lua table")]
public LuaTable GetHeader()
{
@ -215,6 +233,7 @@ namespace BizHawk.Client.Common
return luaTable;
}
[LuaMethodExample("getcomments", "local nlmovget = movie.getcomments( );")]
[LuaMethod("getcomments", "If a movie is active, will return the movie comments as a lua table")]
public LuaTable GetComments()
{
@ -230,6 +249,7 @@ namespace BizHawk.Client.Common
return luaTable;
}
[LuaMethodExample("getsubtitles", "local nlmovget = movie.getsubtitles( );")]
[LuaMethod("getsubtitles", "If a movie is active, will return the movie subtitles as a lua table")]
public LuaTable GetSubtitles()
{

View File

@ -38,6 +38,7 @@ namespace BizHawk.Client.Common
public override string Name => "nes";
[LuaMethodExample("addgamegenie", "nes.addgamegenie( \"GXXZZLVI\" );")]
[LuaMethod("addgamegenie", "Adds the specified game genie code. If an NES game is not currently loaded or the code is not a valid game genie code, this will have no effect")]
public void AddGameGenie(string code)
{
@ -59,6 +60,7 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("getallowmorethaneightsprites", "if ( nes.getallowmorethaneightsprites( ) ) then\r\n\tconsole.log( \"Gets the NES setting 'Allow more than 8 sprites per scanline' value\" );\r\nend;")]
[LuaMethod("getallowmorethaneightsprites", "Gets the NES setting 'Allow more than 8 sprites per scanline' value")]
public bool GetAllowMoreThanEightSprites()
{
@ -75,6 +77,7 @@ namespace BizHawk.Client.Common
throw new InvalidOperationException();
}
[LuaMethodExample("getbottomscanline", "local innesget = nes.getbottomscanline( false );")]
[LuaMethod("getbottomscanline", "Gets the current value for the bottom scanline value")]
public int GetBottomScanline(bool pal = false)
{
@ -93,6 +96,7 @@ namespace BizHawk.Client.Common
throw new InvalidOperationException();
}
[LuaMethodExample("getclipleftandright", "if ( nes.getclipleftandright( ) ) then\r\n\tconsole.log( \"Gets the current value for the Clip Left and Right sides option\" );\r\nend;")]
[LuaMethod("getclipleftandright", "Gets the current value for the Clip Left and Right sides option")]
public bool GetClipLeftAndRight()
{
@ -109,6 +113,7 @@ namespace BizHawk.Client.Common
throw new InvalidOperationException();
}
[LuaMethodExample("getdispbackground", "if ( nes.getdispbackground( ) ) then\r\n\tconsole.log( \"Indicates whether or not the bg layer is being displayed\" );\r\nend;")]
[LuaMethod("getdispbackground", "Indicates whether or not the bg layer is being displayed")]
public bool GetDisplayBackground()
{
@ -125,6 +130,7 @@ namespace BizHawk.Client.Common
throw new InvalidOperationException();
}
[LuaMethodExample("getdispsprites", "if ( nes.getdispsprites( ) ) then\r\n\tconsole.log( \"Indicates whether or not sprites are being displayed\" );\r\nend;")]
[LuaMethod("getdispsprites", "Indicates whether or not sprites are being displayed")]
public bool GetDisplaySprites()
{
@ -141,6 +147,7 @@ namespace BizHawk.Client.Common
throw new InvalidOperationException();
}
[LuaMethodExample("gettopscanline", "local innesget = nes.gettopscanline(false);")]
[LuaMethod("gettopscanline", "Gets the current value for the top scanline value")]
public int GetTopScanline(bool pal = false)
{
@ -159,6 +166,7 @@ namespace BizHawk.Client.Common
throw new InvalidOperationException();
}
[LuaMethodExample("removegamegenie", "nes.removegamegenie( \"GXXZZLVI\" );")]
[LuaMethod("removegamegenie", "Removes the specified game genie code. If an NES game is not currently loaded or the code is not a valid game genie code, this will have no effect")]
public void RemoveGameGenie(string code)
{
@ -170,6 +178,7 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("setallowmorethaneightsprites", "nes.setallowmorethaneightsprites( true );")]
[LuaMethod("setallowmorethaneightsprites", "Sets the NES setting 'Allow more than 8 sprites per scanline'")]
public void SetAllowMoreThanEightSprites(bool allow)
{
@ -187,6 +196,7 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("setclipleftandright", "nes.setclipleftandright( true );")]
[LuaMethod("setclipleftandright", "Sets the Clip Left and Right sides option")]
public void SetClipLeftAndRight(bool leftandright)
{
@ -204,6 +214,7 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("setdispbackground", "nes.setdispbackground( true );")]
[LuaMethod("setdispbackground", "Sets whether or not the background layer will be displayed")]
public void SetDisplayBackground(bool show)
{
@ -215,6 +226,7 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("setdispsprites", "nes.setdispsprites( true );")]
[LuaMethod("setdispsprites", "Sets whether or not sprites will be displayed")]
public void SetDisplaySprites(bool show)
{
@ -232,6 +244,7 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("setscanlines", "nes.setscanlines( 10, 20, false );")]
[LuaMethod("setscanlines", "sets the top and bottom scanlines to be drawn (same values as in the graphics options dialog). Top must be in the range of 0 to 127, bottom must be between 128 and 239. Not supported in the Quick Nes core")]
public void SetScanlines(int top, int bottom, bool pal = false)
{

View File

@ -35,54 +35,63 @@ namespace BizHawk.Client.Common
Snes?.PutSettings(settings);
}
[LuaMethodExample("getlayer_bg_1", "if ( snes.getlayer_bg_1( ) ) then\r\n\tconsole.log( \"Returns whether the bg 1 layer is displayed\" );\r\nend;")]
[LuaMethod("getlayer_bg_1", "Returns whether the bg 1 layer is displayed")]
public bool GetLayerBg1()
{
return GetSettings().ShowBG1_1;
}
[LuaMethodExample("getlayer_bg_2", "if ( snes.getlayer_bg_2( ) ) then\r\n\tconsole.log( \"Returns whether the bg 2 layer is displayed\" );\r\nend;")]
[LuaMethod("getlayer_bg_2", "Returns whether the bg 2 layer is displayed")]
public bool GetLayerBg2()
{
return GetSettings().ShowBG2_1;
}
[LuaMethodExample("getlayer_bg_3", "if ( snes.getlayer_bg_3( ) ) then\r\n\tconsole.log( \"Returns whether the bg 3 layer is displayed\" );\r\nend;")]
[LuaMethod("getlayer_bg_3", "Returns whether the bg 3 layer is displayed")]
public bool GetLayerBg3()
{
return GetSettings().ShowBG3_1;
}
[LuaMethodExample("getlayer_bg_4", "if ( snes.getlayer_bg_4( ) ) then\r\n\tconsole.log( \"Returns whether the bg 4 layer is displayed\" );\r\nend;")]
[LuaMethod("getlayer_bg_4", "Returns whether the bg 4 layer is displayed")]
public bool GetLayerBg4()
{
return GetSettings().ShowBG4_1;
}
[LuaMethodExample("getlayer_obj_1" , "if ( snes.getlayer_obj_1( ) ) then\r\n\tconsole.log( \"Returns whether the obj 1 layer is displayed\" );\r\nend;")]
[LuaMethod("getlayer_obj_1", "Returns whether the obj 1 layer is displayed")]
public bool GetLayerObj1()
{
return GetSettings().ShowOBJ_0;
}
[LuaMethodExample("getlayer_obj_2", "if ( snes.getlayer_obj_2( ) ) then\r\n\tconsole.log( \"Returns whether the obj 2 layer is displayed\" );\r\nend;")]
[LuaMethod("getlayer_obj_2", "Returns whether the obj 2 layer is displayed")]
public bool GetLayerObj2()
{
return GetSettings().ShowOBJ_1;
}
[LuaMethodExample("getlayer_obj_3", "if ( snes.getlayer_obj_3( ) ) then\r\n\tconsole.log( \"Returns whether the obj 3 layer is displayed\" );\r\nend;")]
[LuaMethod("getlayer_obj_3", "Returns whether the obj 3 layer is displayed")]
public bool GetLayerObj3()
{
return GetSettings().ShowOBJ_2;
}
[LuaMethodExample("getlayer_obj_4", "if ( snes.getlayer_obj_4( ) ) then\r\n\tconsole.log( \"Returns whether the obj 4 layer is displayed\" );\r\nend;")]
[LuaMethod("getlayer_obj_4", "Returns whether the obj 4 layer is displayed")]
public bool GetLayerObj4()
{
return GetSettings().ShowOBJ_3;
}
[LuaMethodExample("setlayer_bg_1", "snes.setlayer_bg_1( true );")]
[LuaMethod("setlayer_bg_1", "Sets whether the bg 1 layer is displayed")]
public void SetLayerBg1(bool value)
{
@ -91,6 +100,7 @@ namespace BizHawk.Client.Common
PutSettings(s);
}
[LuaMethodExample("setlayer_bg_2", "snes.setlayer_bg_2( true );")]
[LuaMethod("setlayer_bg_2", "Sets whether the bg 2 layer is displayed")]
public void SetLayerBg2(bool value)
{
@ -99,6 +109,7 @@ namespace BizHawk.Client.Common
PutSettings(s);
}
[LuaMethodExample("setlayer_bg_3", "snes.setlayer_bg_3( true );")]
[LuaMethod("setlayer_bg_3", "Sets whether the bg 3 layer is displayed")]
public void SetLayerBg3(bool value)
{
@ -107,6 +118,7 @@ namespace BizHawk.Client.Common
PutSettings(s);
}
[LuaMethodExample("setlayer_bg_4", "snes.setlayer_bg_4( true );")]
[LuaMethod("setlayer_bg_4", "Sets whether the bg 4 layer is displayed")]
public void SetLayerBg4(bool value)
{
@ -115,6 +127,7 @@ namespace BizHawk.Client.Common
PutSettings(s);
}
[LuaMethodExample("setlayer_obj_1" , "snes.setlayer_obj_1( true );")]
[LuaMethod("setlayer_obj_1", "Sets whether the obj 1 layer is displayed")]
public void SetLayerObj1(bool value)
{
@ -123,6 +136,7 @@ namespace BizHawk.Client.Common
PutSettings(s);
}
[LuaMethodExample("setlayer_obj_2", "snes.setlayer_obj_2( true );")]
[LuaMethod("setlayer_obj_2", "Sets whether the obj 2 layer is displayed")]
public void SetLayerObj2(bool value)
{
@ -131,6 +145,7 @@ namespace BizHawk.Client.Common
PutSettings(s);
}
[LuaMethodExample("setlayer_obj_3", "snes.setlayer_obj_3( true );")]
[LuaMethod("setlayer_obj_3", "Sets whether the obj 3 layer is displayed")]
public void SetLayerObj3(bool value)
{
@ -139,6 +154,7 @@ namespace BizHawk.Client.Common
PutSettings(s);
}
[LuaMethodExample("setlayer_obj_4", "snes.setlayer_obj_4( true );")]
[LuaMethod("setlayer_obj_4", "Sets whether the obj 4 layer is displayed")]
public void SetLayerObj4(bool value)
{

View File

@ -21,6 +21,7 @@ namespace BizHawk.Client.Common
SQLiteConnection m_dbConnection;
string connectionString;
[LuaMethodExample("createdatabase", "local stSQLcre = SQL.createdatabase( \"eg_db\" );")]
[LuaMethod("createdatabase","Creates a SQLite Database. Name should end with .db")]
public string CreateDatabase(string name)
{
@ -37,6 +38,7 @@ namespace BizHawk.Client.Common
}
[LuaMethodExample("opendatabase", "local stSQLope = SQL.opendatabase( \"eg_db\" );")]
[LuaMethod("opendatabase", "Opens a SQLite database. Name should end with .db")]
public string OpenDatabase(string name)
{
@ -60,6 +62,7 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("writecommand", "local stSQLwri = SQL.writecommand( \"CREATE TABLE eg_tab ( eg_tab_id integer PRIMARY KEY, eg_tab_row_name text NOT NULL ); INSERT INTO eg_tab ( eg_tab_id, eg_tab_row_name ) VALUES ( 1, 'Example table row' );\" );")]
[LuaMethod("writecommand", "Runs a SQLite write command which includes CREATE,INSERT, UPDATE. " +
"Ex: create TABLE rewards (ID integer PRIMARY KEY, action VARCHAR(20)) ")]
public string WriteCommand(string query="")
@ -90,6 +93,7 @@ namespace BizHawk.Client.Common
}
}
[LuaMethodExample("readcommand", "local obSQLrea = SQL.readcommand( \"SELECT * FROM eg_tab WHERE eg_tab_id = 1;\" );")]
[LuaMethod("readcommand", "Run a SQLite read command which includes Select. Returns all rows into a LuaTable." +
"Ex: select * from rewards")]
public dynamic ReadCommand(string query="")

View File

@ -17,6 +17,7 @@ namespace BizHawk.Client.Common
public StringLuaLibrary(Lua lua, Action<string> logOutputCallback)
: base(lua, logOutputCallback) { }
[LuaMethodExample("hex", "local stbizhex = bizstring.hex( -12345 );")]
[LuaMethod("hex", "Converts the number to a string representation of the hexadecimal value of the given number")]
public static string Hex(long num)
{
@ -29,6 +30,7 @@ namespace BizHawk.Client.Common
return hex;
}
[LuaMethodExample("binary", "local stbizbin = bizstring.binary( -12345 );")]
[LuaMethod("binary", "Converts the number to a string representation of the binary value of the given number")]
public static string Binary(long num)
{
@ -37,6 +39,7 @@ namespace BizHawk.Client.Common
return binary;
}
[LuaMethodExample("octal", "local stbizoct = bizstring.octal( -12345 );")]
[LuaMethod("octal", "Converts the number to a string representation of the octal value of the given number")]
public static string Octal(long num)
{
@ -49,6 +52,7 @@ namespace BizHawk.Client.Common
return octal;
}
[LuaMethodExample("trim" , "local stbiztri = bizstring.trim( \"Some trim string\t \" );")]
[LuaMethod("trim", "returns a string that trims whitespace on the left and right ends of the string")]
public static string Trim(string str)
{
@ -60,6 +64,7 @@ namespace BizHawk.Client.Common
return str.Trim();
}
[LuaMethodExample("replace", "local stbizrep = bizstring.replace( \"Some string\", \"Some\", \"Replaced\" );")]
[LuaMethod("replace", "Returns a string that replaces all occurances of str2 in str1 with the value of replace")]
public static string Replace(string str, string str2, string replace)
{
@ -71,6 +76,7 @@ namespace BizHawk.Client.Common
return str.Replace(str2, replace);
}
[LuaMethodExample("toupper", "local stbiztou = bizstring.toupper( \"Some string\" );")]
[LuaMethod("toupper", "Returns an uppercase version of the given string")]
public static string ToUpper(string str)
{
@ -82,6 +88,7 @@ namespace BizHawk.Client.Common
return str.ToUpper();
}
[LuaMethodExample("tolower", "local stbiztol = bizstring.tolower( \"Some string\" );")]
[LuaMethod("tolower", "Returns an lowercase version of the given string")]
public static string ToLower(string str)
{
@ -93,6 +100,7 @@ namespace BizHawk.Client.Common
return str.ToLower();
}
[LuaMethodExample("substring", "local stbizsub = bizstring.substring( \"Some string\", 6, 3 );")]
[LuaMethod("substring", "Returns a string that represents a substring of str starting at position for the specified length")]
public static string SubString(string str, int position, int length)
{
@ -104,6 +112,7 @@ namespace BizHawk.Client.Common
return str.Substring(position, length);
}
[LuaMethodExample("remove", "local stbizrem = bizstring.remove( \"Some string\", 4, 5 );")]
[LuaMethod("remove", "Returns a string that represents str with the given position and count removed")]
public static string Remove(string str, int position, int count)
{
@ -115,6 +124,7 @@ namespace BizHawk.Client.Common
return str.Remove(position, count);
}
[LuaMethodExample("contains", "if ( bizstring.contains( \"Some string\", \"Some\") ) then\r\n\tconsole.log( \"Returns whether or not str contains str2\" );\r\nend;")]
[LuaMethod("contains", "Returns whether or not str contains str2")]
public static bool Contains(string str, string str2)
{
@ -126,6 +136,7 @@ namespace BizHawk.Client.Common
return str.Contains(str2);
}
[LuaMethodExample("startswith", "if ( bizstring.startswith( \"Some string\", \"Some\") ) then\r\n\tconsole.log( \"Returns whether str starts with str2\" );\r\nend;")]
[LuaMethod("startswith", "Returns whether str starts with str2")]
public static bool StartsWith(string str, string str2)
{
@ -137,6 +148,7 @@ namespace BizHawk.Client.Common
return str.StartsWith(str2);
}
[LuaMethodExample("endswith", "if ( bizstring.endswith( \"Some string\", \"string\") ) then\r\n\tconsole.log( \"Returns whether str ends wth str2\" );\r\nend;")]
[LuaMethod("endswith", "Returns whether str ends wth str2")]
public static bool EndsWith(string str, string str2)
{
@ -148,6 +160,7 @@ namespace BizHawk.Client.Common
return str.EndsWith(str2);
}
[LuaMethodExample("split", "local nlbizspl = bizstring.split( \"Some, string\", \", \" );")]
[LuaMethod("split", "Splits str based on separator into a LuaTable. Separator must be one character!. Same functionality as .NET string.Split() using the RemoveEmptyEntries option")]
public LuaTable Split(string str, string separator)
{

View File

@ -18,9 +18,10 @@ namespace BizHawk.Client.EmuHawk
public override string Name => "userdata";
[LuaMethodExample("set", "userdata.set(\"Unique key\", \"Current key data\");")]
[LuaMethod("set", "adds or updates the data with the given key with the given value")]
public void Set(string name, object value)
{
{
if (value != null)
{
var t = value.GetType();
@ -33,6 +34,7 @@ namespace BizHawk.Client.EmuHawk
Global.UserBag[name] = value;
}
[LuaMethodExample("get", "local obuseget = userdata.get( \"Unique key\" );")]
[LuaMethod("get", "gets the data with the given key, if the key does not exist it will return nil")]
public object Get(string key)
{
@ -44,18 +46,21 @@ namespace BizHawk.Client.EmuHawk
return null;
}
[LuaMethodExample("clear", "userdata.clear( );")]
[LuaMethod("clear", "clears all user data")]
public void Clear()
{
Global.UserBag.Clear();
}
[LuaMethodExample("remove", "if ( userdata.remove( \"Unique key\" ) ) then\r\n\tconsole.log( \"remove the data with the given key.Returns true if the element is successfully found and removed; otherwise, false.\" );\r\nend;")]
[LuaMethod("remove", "remove the data with the given key. Returns true if the element is successfully found and removed; otherwise, false.")]
public bool Remove(string key)
{
return Global.UserBag.Remove(key);
}
[LuaMethodExample("containskey", "if ( userdata.containskey( \"Unique key\" ) ) then\r\n\tconsole.log( \"returns whether or not there is an entry for the given key\" );\r\nend;")]
[LuaMethod("containskey", "returns whether or not there is an entry for the given key")]
public bool ContainsKey(string key)
{

View File

@ -0,0 +1,28 @@
using System;
namespace BizHawk.Client.Common
{
[AttributeUsage(AttributeTargets.Method)]
public class LuaMethodExample : Attribute
{
public LuaMethodExample(string name, string example)
{
Name = name;
Example = example;
}
public string Name { get; }
public string Example { get; }
}
[AttributeUsage(AttributeTargets.Class)]
public class LuaLibraryExample : Attribute
{
public LuaLibraryExample(bool released)
{
Released = released;
}
public bool Released { get; }
}
}