VirtualC64 v5.0 beta
Commodore 64 Emulator
Loading...
Searching...
No Matches
C64API Struct Reference

C64 API. More...

#include <VirtualC64.h>

Public Member Functions

Analyzing the emulator
const C64Info & getInfo () const
 Returns the component's current state.
 
const C64Info & getCachedInfo () const
 Returns the component's current state.
 
EventSlotInfo getSlotInfo (isize nr) const
 Returns the current state of an event slot.
 
RomTraits getRomTraits (RomType type) const
 Returns information about one of the installed Roms.
 
Resetting the C64
void hardReset ()
 Performs a hard reset.
 
void softReset ()
 Performs a hard reset.
 
Setting up auto-inspection
InspectionTarget getInspectionTarget () const
 Returns the current inspection target.
 
void setInspectionTarget (InspectionTarget target)
 Sets the current inspection target.
 
void removeInspectionTarget ()
 Removes the current inspection target.
 
Handling snapshots
MediaFile * takeSnapshot ()
 Takes a snapshot.
 
void loadSnapshot (const MediaFile &snapshot)
 Loads a snapshot into the emulator.
 
Handling ROMs
void loadRom (const fs::path &path)
 Loads a ROM from a file The ROM type is determined automatically.
 
void loadRom (const MediaFile &file)
 Loads a ROM, provided by a RomFile object.
 
void deleteRom (RomType type)
 Removes an installed ROM The ROM contents is overwritten with zeroes.
 
void saveRom (RomType rom, const std::filesystem::path &path)
 Saves a ROM to disk.
 
Handling media files
void flash (const MediaFile &file)
 Flashes a file into memory.
 
void flash (const MediaFile &file, isize item)
 Flashes a file from a collection into memory.
 
void flash (const FileSystem &fs, isize item)
 Flashes a file from a file system into memory.
 

Detailed Description

C64 API.

Member Function Documentation

◆ getInspectionTarget()

InspectionTarget getInspectionTarget ( ) const

Returns the current inspection target.

If you open the inspector panel in the Mac app while the emulator is running, you will see continuous updates of the emulator state. The displayed information is recorded via the auto-inspection mechanism. If auto-inspection is active, the emulator schedules an inspect event which calls function cacheInfo() on the inspection target in constant intervals. The recorded information is later picked up by the GUI.

If you change to a different panel in the inspector window, the emulator will change the inspection target to only record the information you're seeing in the currently open panel.

◆ getRomTraits()

RomTraits getRomTraits ( RomType type) const

Returns information about one of the installed Roms.

Parameters
typeThe ROM type

◆ getSlotInfo()

EventSlotInfo getSlotInfo ( isize nr) const

Returns the current state of an event slot.

Parameters
nrNumber of the event slot.

◆ hardReset()

void hardReset ( )

Performs a hard reset.

A hard reset affects all components. The effect is similar to switching power off and on.

◆ loadRom()

void loadRom ( const fs::path & path)

Loads a ROM from a file The ROM type is determined automatically.

Exceptions
VC64Error(ERROR_ROM_BASIC_MISSING) VC64Error (ERROR_FILE_TYPE_MISMATCH)

◆ loadSnapshot()

void loadSnapshot ( const MediaFile & snapshot)

Loads a snapshot into the emulator.

Parameters
snapshotReference to a snapshot.

◆ saveRom()

void saveRom ( RomType rom,
const std::filesystem::path & path )

Saves a ROM to disk.

Exceptions
VC64Error(ERROR_FILE_CANT_WRITE)

◆ softReset()

void softReset ( )

Performs a hard reset.

A soft reset emulates a real reset of the C64 which can be initiated via the reset line on the expansion port.

◆ takeSnapshot()

MediaFile * takeSnapshot ( )

Takes a snapshot.

Returns
A pointer to the created Snapshot object.
Note
The function transfers the ownership to the caller. It is his responsibility of the caller to free the object.

The documentation for this struct was generated from the following files: