Appearance
Overview
The whole public API hangs off a single object of class vamiga::VAmiga. It has two kinds of members:
- Functions that act on the emulator as a whole: querying the version, launching the emulator thread, controlling the execution state, resetting, configuring, and synchronizing with the emulator thread.
- Sub-APIs, one per hardware component or subsystem. They are public data members, so a call reads like
amiga.cpu.getInfo()oramiga.df0.insertBlankDisk(...). Sub-APIs may contain further sub-APIs, for exampleamiga.cpu.breakpointsoramiga.controlPort1.joystick.
All API classes are derived from vamiga::API, which provides suspend() and resume().
Sub-APIs
| Member | Class | Purpose |
|---|---|---|
amiga | vamiga::AmigaAPI | The machine as a whole: snapshots, ROMs, media files, auto-inspection. |
agnus | vamiga::AgnusAPI | The Agnus chip. Its members copper (vamiga::CopperAPI), blitter (vamiga::BlitterAPI), xray (vamiga::XRayAPI), logicAnalyzer (vamiga::LogicAnalyzerAPI) and beamtraps (vamiga::GuardsAPI) give access to the subcomponents. |
ciaA, ciaB | vamiga::CIAAPI | The two CIA chips. |
cpu | vamiga::CPUAPI | CPU state. Its members debugger (vamiga::CPUDebuggerAPI) disassembles code, breakpoints, watchpoints and catchpoints (vamiga::GuardsAPI) manage guards. |
denise | vamiga::DeniseAPI | The Denise chip. |
mem | vamiga::MemoryAPI | Memory configuration and state. Its member debugger (vamiga::MemoryDebuggerAPI) dumps memory. |
paula | vamiga::PaulaAPI | The Paula chip with its diskController (vamiga::DiskControllerAPI) and uart (vamiga::UARTAPI). |
rtc | vamiga::RTCAPI | The real-time clock. |
audioPort, videoPort | vamiga::AudioPortAPI, vamiga::VideoPortAPI | Audio and video output. |
controlPort1, controlPort2 | vamiga::ControlPortAPI | The control ports. Their members joystick (vamiga::JoystickAPI) and mouse (vamiga::MouseAPI) control the connected device. |
serialPort | vamiga::SerialPortAPI | The serial port. |
df0 ... df3 | vamiga::FloppyDriveAPI | The floppy drives and their disks. |
hd0 ... hd3 | vamiga::HardDriveAPI | The hard drives. Their member controller (vamiga::HdControllerAPI) is the drive controller. |
keyboard | vamiga::KeyboardAPI | Key presses. |
msgQueue | vamiga::MsgQueueAPI | The message queue. |
remoteManager | vamiga::RemoteManagerAPI | Remote servers (RetroShell, RPC, DAP, ...). |
retroShell | vamiga::RetroShellAPI | The command console. |
defaults (static) | vamiga::DefaultsAPI | Persistent user defaults. Available without an emulator instance. |
Conventions
| Pattern | Meaning |
|---|---|
getConfig(), get(Opt) / set(Opt, ...) | Read and change the configuration. Options are identified by the enumeration vamiga::Opt. |
getInfo(), getCachedInfo(), getMetrics(), ... | Read the state of a component. |
foo() / fooAsync() | Blocking and asynchronous flavor of a state-changing function. |
To be notified about events, read the messages from the message queue (vamiga::MsgQueueAPI). The messages are listed in the enumeration vamiga::Msg.
Errors
API functions report failures by throwing exceptions derived from utl::Error. Each function documents what it can throw with @throw.
| Exception | Meaning |
|---|---|
| vamiga::CoreError | The request does not match the state of the emulator, e.g., an invalid option value or a missing ROM. |
| utl::IOError | A file or folder could not be accessed. |
| vamiga::MediaError | A ROM, snapshot, or disk image is invalid or not supported. |