Skip to content

MemoryAPI ​

cpp
#include <VirtualC64.h>
cpp
class MemoryAPI

Defined in VirtualC64.h:174

Memory API

Public Attributes ​

ReturnNameDescription
MemoryDebuggerAPIdebuggerMemory debugger.

debugger ​

cpp
MemoryDebuggerAPI debugger

Type: MemoryDebuggerAPI

Defined in VirtualC64.h:184

Memory debugger.

Public Methods ​

ReturnNameDescription
const MemConfig &getConfig constReturns the component's current configuration.
const MemInfo &getInfo constReturns the component's current state.
const MemInfo &getCachedInfo constReturns the most recent state snapshot recorded by the emulator thread (see getInfo()).
voiddrawHeatmap constDraws a heatmap of the recent memory accesses.

getConfig ​

const

cpp
const MemConfig & getConfig() const

Defined in VirtualC64.h:188

Returns the component's current configuration.


getInfo ​

const

cpp
const MemInfo & getInfo() const

Defined in VirtualC64.h:199

Returns the component's current state.

getInfo() reads the live state on the calling thread. The result is only consistent if the emulator is paused or suspended. getCachedInfo() returns the snapshot the emulator thread has recorded most recently, which is the one to use while the emulator runs. Both return references that can be overwritten by a later call or by the emulator thread, so copy the data if you need to keep it.


getCachedInfo ​

const

cpp
const MemInfo & getCachedInfo() const

Defined in VirtualC64.h:201

Returns the most recent state snapshot recorded by the emulator thread (see getInfo()).


drawHeatmap ​

const

cpp
void drawHeatmap(u32 * buffer, isize width, isize height) const

Defined in VirtualC64.h:219

Draws a heatmap of the recent memory accesses.

The 64 KB address space is shown as a grid of 256 x 256 cells. Neighboring addresses are mapped to neighboring cells by interleaving the address bits, so that address ranges form compact blocks. A cell lights up when its address is accessed and fades out over time. The map is updated at the end of each frame, and only while the option Opt::MEM_HEATMAP is enabled.

Parameters ​

ParameterTypeDescription
bufferu32 *Texture buffer for 256 x 256 pixels (RGBA)
widthisizeWidth of the texture, must be 256
heightisizeHeight of the texture, must be 256

Exceptions ​

ExceptionDescription
CoreError(CoreError::OPT_INV_ARG) if the size is not 256 x 256.