Table of Contents

Interface IMemoryAccess

Namespace
RetroEditor.Plugins
Assembly
RetroEditor.dll

Interface for accessing memory

public interface IMemoryAccess

Properties

Endian

Memory Endian of the system

MemoryEndian Endian { get; }

Property Value

MemoryEndian

Endianess of memory

RomSize

Size of the loaded rom (only applies to cartridge based systems)

int RomSize { get; }

Property Value

int

Size of rom in bytes

Methods

FetchMachineOrder16(int, ReadOnlySpan<byte>)

Given a byte array and offset, returns a 16 bit value in machine order

ushort FetchMachineOrder16(int offset, ReadOnlySpan<byte> bytes)

Parameters

offset int

offset in bytes

bytes ReadOnlySpan<byte>

array of bytes

Returns

ushort

16 bit value from requested offset

FetchMachineOrder32(int, ReadOnlySpan<byte>)

Given a byte array and offset, returns a 32 bit value in machine order

uint FetchMachineOrder32(int offset, ReadOnlySpan<byte> bytes)

Parameters

offset int

offset in bytes

bytes ReadOnlySpan<byte>

array of bytes

Returns

uint

32 bit value from requested offset

FetchOppositeMachineOrder16(int, ReadOnlySpan<byte>)

Given a byte array and offset, returns a 16 bit value in opposite machine order

ushort FetchOppositeMachineOrder16(int offset, ReadOnlySpan<byte> bytes)

Parameters

offset int

offset in bytes

bytes ReadOnlySpan<byte>

array of bytes

Returns

ushort

16 bit value from requested offset

FetchOppositeMachineOrder32(int, ReadOnlySpan<byte>)

Given a byte array and offset, returns a 32 bit value in opposite machine order

uint FetchOppositeMachineOrder32(int offset, ReadOnlySpan<byte> bytes)

Parameters

offset int

offset in bytes

bytes ReadOnlySpan<byte>

array of bytes

Returns

uint

32 bit value from requested offset

ReadBytes(ReadKind, uint, uint)

Read a number of bytes from the specified memory area

ReadOnlySpan<byte> ReadBytes(ReadKind kind, uint address, uint length)

Parameters

kind ReadKind

Memory kind

address uint

Address of first byte

length uint

Number of bytes to retrieve

Returns

ReadOnlySpan<byte>

WriteBytes(WriteKind, uint, ReadOnlySpan<byte>)

Write a number of bytes to the specified memory area

void WriteBytes(WriteKind kind, uint address, ReadOnlySpan<byte> bytes)

Parameters

kind WriteKind

Memory kind

address uint

Address to write to

bytes ReadOnlySpan<byte>

Bytes to write to address

WriteMachineOrder16(int, Span<byte>, ushort)

Given a byte array and offset, writes a 16bit value in machine order

void WriteMachineOrder16(int offset, Span<byte> bytes, ushort value)

Parameters

offset int

offset in bytes

bytes Span<byte>

array of bytes

value ushort

value to write

WriteMachineOrder32(int, Span<byte>, uint)

Given a byte array and offset, writes a 32bit value in machine order

void WriteMachineOrder32(int offset, Span<byte> bytes, uint value)

Parameters

offset int

offset in bytes

bytes Span<byte>

array of bytes

value uint

value to write

WriteOppositeMachineOrder16(int, Span<byte>, ushort)

Given a byte array and offset, writes a 16bit value in opposite machine order

void WriteOppositeMachineOrder16(int offset, Span<byte> bytes, ushort value)

Parameters

offset int

offset in bytes

bytes Span<byte>

array of bytes

value ushort

value to write

WriteOppositeMachineOrder32(int, Span<byte>, uint)

Given a byte array and offset, writes a 32bit value in opposite machine order

void WriteOppositeMachineOrder32(int offset, Span<byte> bytes, uint value)

Parameters

offset int

offset in bytes

bytes Span<byte>

array of bytes

value uint

value to write