Skip to content

ExpansionPortAPI ​

cpp
#include <VirtualC64.h>
cpp
class ExpansionPortAPI

Defined in VirtualC64.h:1197

Expansion Port Public API

Public Methods ​

ReturnNameDescription
CartridgeTraitsgetCartridgeTraits constReturns the traits of the current cartridge.
const CartridgeInfo &getInfo constReturns the state of the current cartridge.
const CartridgeInfo &getCachedInfo constReturns the most recent state snapshot recorded by the emulator thread (see getInfo()).
CartridgeRomInfogetRomInfo constReturns the state of one of the cartridge ROM packets.
voidattachCartridgeAttaches a cartridge to the expansion port.
voidattachCartridgeAsyncAsynchronous version of attachCartridge(): queues the request and returns at once.
voidattachReuAttaches a RAM Expansion Unit to the expansion port.
voidattachGeoRamAttaches a GeoRAM module to the expansion port.
voidattachIsepicCartridgeAttaches an Isepic module to the expansion port.
voiddetachCartridgeDetaches the currently plugged in cartridge.
voidexportCRT constExport cartridge.

getCartridgeTraits ​

const

cpp
CartridgeTraits getCartridgeTraits() const

Defined in VirtualC64.h:1210

Returns the traits of the current cartridge.


getInfo ​

const

cpp
const CartridgeInfo & getInfo() const

Defined in VirtualC64.h:1221

Returns the state of the current cartridge.

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 CartridgeInfo & getCachedInfo() const

Defined in VirtualC64.h:1223

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


getRomInfo ​

const

cpp
CartridgeRomInfo getRomInfo(isize nr) const

Defined in VirtualC64.h:1228

Returns the state of one of the cartridge ROM packets.

Parameters ​

ParameterTypeDescription
nrisizeNumber of the ROM packet.

attachCartridge ​

cpp
void attachCartridge(const std::filesystem::path & path, bool reset = true)

Defined in VirtualC64.h:1238

Attaches a cartridge to the expansion port.

Exceptions ​

ExceptionDescription
Errorif the file cannot be read or does not contain valid data.

attachCartridgeAsync ​

cpp
void attachCartridgeAsync(const std::filesystem::path & path, bool reset = true)

Defined in VirtualC64.h:1245

Asynchronous version of attachCartridge(): queues the request and returns at once.

The file is read on the emulator thread. Success and failure are both reported by the usual message (e.g., CRT_ATTACHED). If the request failed, the message carries the exception.


attachReu ​

cpp
void attachReu(isize capacity)

Defined in VirtualC64.h:1249

Attaches a RAM Expansion Unit to the expansion port.


attachGeoRam ​

cpp
void attachGeoRam(isize capacity)

Defined in VirtualC64.h:1253

Attaches a GeoRAM module to the expansion port.


attachIsepicCartridge ​

cpp
void attachIsepicCartridge()

Defined in VirtualC64.h:1257

Attaches an Isepic module to the expansion port.


detachCartridge ​

cpp
void detachCartridge()

Defined in VirtualC64.h:1261

Detaches the currently plugged in cartridge.


exportCRT ​

const

cpp
void exportCRT(const std::filesystem::path & path) const

Defined in VirtualC64.h:1265

Export cartridge.