Skip to content

SIDAPI ​

cpp
#include <VirtualC64.h>
cpp
class SIDAPI

Defined in VirtualC64.h:547

SID Public API

Public Methods ​

ReturnNameDescription
floatdraw constDraws the waveform of a SID chip or of the audio output.
const SIDInfo &getInfo constReturns the current state of a specific SID.
const SIDInfo &getCachedInfo constReturns the most recent state snapshot recorded by the emulator thread (see getInfo()).

draw ​

const

cpp
float draw(u32 * buffer, isize width, isize height, float maxAmp, u32 color, isize sid = -1) const

Defined in VirtualC64.h:590

Draws the waveform of a SID chip or of the audio output.

The waveform is plotted into a texture buffer. The function returns the highest amplitude found. To implement auto-scaling, pass the returned value as parameter 'maxAmp' in the next call.

Returns ​

The highest amplitude that was found.

Parameters ​

ParameterTypeDescription
bufferu32 *Texture buffer of size width * height
widthisizeWidth of the texture in pixels
heightisizeHeight of the texture in pixels
maxAmpfloatAmplitude that is mapped to the full height
coloru32Color of the waveform
sidisizeNumber of the SID chip (0 - 3). Any other value draws the stereo audio output, with the left channel in the upper and the right channel in the lower half.

getInfo ​

const

cpp
const SIDInfo & getInfo(isize nr) const

Defined in VirtualC64.h:567

Returns the current state of a specific SID.

getInfo() reads the live state on the calling thread and 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.

Parameters ​

ParameterTypeDescription
nrisizeSID number (0 - 3). 0 is the primary SID.

Exceptions ​

ExceptionDescription
CoreError(CoreError::OPT_INV_ARG) if the SID number is out of range.

getCachedInfo ​

const

cpp
const SIDInfo & getCachedInfo(isize nr) const

Defined in VirtualC64.h:569

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