Skip to content

LuaConnector ​

Implements several IConsoleConnector types with a LUA script run in an emulator.

Kind: Class

Namespace: ConnectorLib

Inheritance: ConsoleBase → I16BitConnector → I32BitConnector → I64BitConnector → I8BitConnector → IAddressableConnector → IConsoleConnector → IDisposable → IDomainMappableConnector → IDomainMappableConnector\<LuaConnector\> → IFreezableConnector → IGBAConnector → IGBConnector → IGameConnector → IGameGearConnector → IGenesisConnector → IN3DSConnector → IN64Connector → INDSConnector → INESConnector → INESProConnector → IPS1Connector → IROMProcessor → ISNESConnector

Public Constructors

LuaConnector()

Creates a new instance of the ConnectorLib.LuaConnector class.

LuaConnector(IPAddress endpoint)

Creates a new instance of the ConnectorLib.LuaConnector class.

LuaConnector(Action messageHandler, IPAddress endpoint = null)

Creates a new instance of the ConnectorLib.LuaConnector class.

Public Member Functions

virtual override

void

KeepAlive()

virtual override

Task>

Connect()

bool

SetBits(ulong address, byte value, byte out oldValue)

virtual override

bool

SetBits(ulong address, string domain, byte value, byte out oldValue)

bool

UnsetBits(ulong address, byte value, byte out oldValue)

virtual override

bool

UnsetBits(ulong address, string domain, byte value, byte out oldValue)

bool

CompareSwap(ulong address, byte test, byte newVal, byte out orig)

virtual override

bool

Freeze(ulong address, string domain, ulong value, byte size, WriteType writeType, ulong cmpAddress, ulong cmpValue, byte cmpSize, CompareType cmpType)

Freezes an unsigned 32-bit value on the game system.

virtual override

bool

Freeze(ulong address, string domain, ulong value, ulong mask, byte size, WriteType writeType, ulong cmpAddress, ulong cmpValue, byte cmpSize, CompareType cmpType)

Freezes an unsigned 32-bit value on the game system.

virtual override

bool

Freeze(ulong address, ulong value, byte size, WriteType writeType, ulong cmpAddress, ulong cmpValue, byte cmpSize, CompareType cmpType)

Freezes an unsigned 32-bit value on the game system.

virtual override

bool

Freeze(ulong address, ulong value, ulong mask, byte size, WriteType writeType, ulong cmpAddress, ulong cmpValue, byte cmpSize, CompareType condition)

Freezes an unsigned 32-bit value on the game system.

bool

FreezeU8(ulong address, byte value)

bool

FreezeU16(ulong address, ushort value)

bool

FreezeU32(ulong address, uint value)

bool

FreezeU64(ulong address, ulong value)

virtual override

bool

Unfreeze(ulong address)

virtual override

bool

Unfreeze(ulong address, string domain)

DomainMappedConnector

WithDomain(string domain)

bool

Write8(ulong address, byte value)

bool

Write16(ulong address, ushort value)

bool

Write32(ulong address, uint value)

bool

Write64(ulong address, ulong value)

bool

Read8(ulong address, byte out value)

bool

Read16(ulong address, ushort out value)

bool

Read32(ulong address, uint out value)

bool

Read64(ulong address, ulong out value)

bool

StateCycle(string out key, bool keep = true)

Saves then immediately reloads a savestate and returns a key to identify the state.

bool

StateSave(string out key)

Saves a savestate and returns a key to identify the state.

bool

StateLoad(string key)

Loads a savestate.

bool

StateDelete(string key)

Deletes a savestate.

virtual override

bool

Write(ulong address, ReadOnlySpan buffer, int offset, int length)

virtual override

bool

Write(ulong address, string domain, ReadOnlySpan buffer, int offset, int length)

virtual override

bool

Read(ulong address, Span buffer, int offset, int length)

virtual override

bool

Read(ulong address, string domain, Span buffer, int offset, int length)

virtual override

bool

SendMessage(string message)

virtual override

string

GetROMPath()

virtual override

bool

OpenROM(string localPath)

virtual override

bool

CloseROM()

virtual override

bool

PatchROM(IROMPatch patch)

virtual override

bool

PatchROM(byte[] data)

virtual override

bool

ResetConsole()

Public Attributes

uint

VERSION_MAJOR

The major version of the Lua connector protocol.

uint

VERSION_MINOR

The minor version of the Lua connector protocol.

uint

VERSION_PATCH

The patch version of the Lua connector protocol.

uint

VERSION

The full version of the Lua connector protocol.

Properties

static

int

CommandResponseTimeoutMS

[get, set]

Allows globally configuring the default timeout before messages from a connected Lua connector script will be considered lost/never arriving. Defaults to 1000ms

Endianness

Endianness

[get, ]

PointerFormat

PointerFormat

[get, ]

IFeatureAware

Features

[get, ]

PointerFormat

RelativePointerFormat

[get, ]

bool

Connected

[get, ]