Skip to content

DBUS support

Dimitris Panokostas edited this page Mar 17, 2026 · 8 revisions

D-Bus Support

Since version 5.6.5, Amiberry has optional D-Bus support for triggering events from external applications. D-Bus is Linux-specific.

Note: For cross-platform IPC support (Linux, macOS, FreeBSD), see IPC Socket Support.

Enabling support

D-Bus support is only available if USE_DBUS is defined at build time:

cmake -DUSE_DBUS=ON ..

See Compile from Source for more details.

Interface name

The D-Bus interface name is com.blitterstudio.amiberry.

Supported Commands

Basic Control

  • QUIT: Exit Amiberry.
  • PAUSE: Pause emulation.
  • RESUME: Resume emulation.
  • RESET (string: type): Reset emulation. Type can be "HARD", "SOFT", "KEYBOARD" or empty (defaults to SOFT).

State Management

  • SAVESTATE (string: state_file, string: config_file): Save current state and config.
  • LOADSTATE (string: state_file): Load a savestate file.
  • SCREENSHOT (string: filename): Take a screenshot.

Configuration

  • LOAD_CONFIG (string: config_path): Load a .uae configuration file.
  • GET_CONFIG (string: option): Get a configuration value.
  • SET_CONFIG (string: option, string: value): Set a configuration value.

Media Control

  • DISKSWAP (string: disk_index, string: drive_index): Swap a disk from the disk list into a drive.
  • QUERYDISKSWAP (string: drive_index): Get the index of the disk currently in the specified drive.
  • INSERTFLOPPY (string: path, string: drive_index): Insert a floppy image file into a drive.
  • INSERTCD (string: path): Insert a CD image.

Status

  • GET_STATUS: Returns status information (Paused state, Config name, Floppy disks).

Advanced

  • SEND_KEY (int32: keycode, int32: state): Inject a key press (state: 1=down, 0=up).
  • READ_MEM (uint32: addr, int32: width): Read memory (width: 1, 2, or 4 bytes).
  • WRITE_MEM (uint32: addr, int32: width, uint32: value): Write memory (width: 1, 2, or 4 bytes).

GET_CONFIG / SET_CONFIG Options

Readable Options (GET_CONFIG)

Option Description
chipmem_size Chip RAM size in bytes
fastmem_size Fast RAM size in bytes
bogomem_size Slow RAM size in bytes
z3fastmem_size Zorro III Fast RAM size
cpu_model CPU model (68000, 68010, etc.)
cpu_speed CPU speed setting
cpu_compatible CPU compatibility mode (true/false)
cpu_24bit_addressing 24-bit addressing mode (true/false)
chipset Chipset mask value
ntsc NTSC mode (true/false)
floppy_speed Floppy drive speed
nr_floppies Number of floppy drives
gfx_width Display width
gfx_height Display height
gfx_fullscreen Fullscreen mode (true/false)
sound_output Sound output mode
sound_stereo Stereo mode
joyport0 Joystick port 0 ID
joyport1 Joystick port 1 ID
description Configuration description

Writable Options (SET_CONFIG)

Option Description
floppy_speed Floppy drive speed (0=turbo, 100=normal)
cpu_speed CPU speed setting
turbo_emulation Turbo mode (true/false or 1/0)
gfx_fullscreen Fullscreen mode (true/false or 1/0)
sound_output Sound output mode (0-3)
sound_stereo Stereo mode
sound_volume Master volume
ntsc NTSC mode (true/false or 1/0)

Example Usage

Using dbus-send:

# Pause emulation
dbus-send --session --dest=com.blitterstudio.amiberry \
  --type=method_call --print-reply / com.blitterstudio.amiberry.PAUSE

# Resume emulation
dbus-send --session --dest=com.blitterstudio.amiberry \
  --type=method_call --print-reply / com.blitterstudio.amiberry.RESUME

# Hard reset
dbus-send --session --dest=com.blitterstudio.amiberry \
  --type=method_call --print-reply / com.blitterstudio.amiberry.RESET string:"HARD"

# Take screenshot
dbus-send --session --dest=com.blitterstudio.amiberry \
  --type=method_call --print-reply / com.blitterstudio.amiberry.SCREENSHOT string:"/tmp/screenshot.png"

# Get status
dbus-send --session --dest=com.blitterstudio.amiberry \
  --type=method_call --print-reply / com.blitterstudio.amiberry.GET_STATUS

# Get chip RAM size
dbus-send --session --dest=com.blitterstudio.amiberry \
  --type=method_call --print-reply / com.blitterstudio.amiberry.GET_CONFIG string:"chipmem_size"

# Set floppy speed to turbo
dbus-send --session --dest=com.blitterstudio.amiberry \
  --type=method_call --print-reply / com.blitterstudio.amiberry.SET_CONFIG string:"floppy_speed" string:"0"

# Insert floppy in DF0
dbus-send --session --dest=com.blitterstudio.amiberry \
  --type=method_call --print-reply / com.blitterstudio.amiberry.INSERTFLOPPY string:"/path/to/disk.adf" string:"0"

# Load a savestate
dbus-send --session --dest=com.blitterstudio.amiberry \
  --type=method_call --print-reply / com.blitterstudio.amiberry.LOADSTATE string:"/path/to/save.uss"

Implementation Details

The implementation uses a dispatch map for efficient command handling and standard libdbus integration.

For more details, see src/osdep/amiberry_dbus.cpp.

Clone this wiki locally