ducky.devices.svga module

SimpleVGA is very basic implementation of VGA-like device, with text and graphic modes.

class ducky.devices.svga.Char[source]

Bases: _ctypes.Structure

bg

Structure/Union member

Structure/Union member

codepoint

Structure/Union member

fg

Structure/Union member

static from_u16(u)[source]
static from_u8(l, h)[source]
to_u8()[source]
unused

Structure/Union member

ducky.devices.svga.DEFAULT_BOOT_MODE = (t, 80, 25, 1)

Default boot mode

ducky.devices.svga.DEFAULT_MEMORY_BANKS = 8

Default number of memory banks

ducky.devices.svga.DEFAULT_MEMORY_SIZE = 65536

Default memory size, in bytes

ducky.devices.svga.DEFAULT_MODES = [(g, 320, 200, 1), (t, 80, 25, 2), (t, 80, 25, 1)]

Default list of available modes

ducky.devices.svga.DEFAULT_PORT_RANGE = 1008

Default address of command port

class ducky.devices.svga.Display(machine, name, gpu=None, stream_out=None, *args, **kwargs)[source]

Bases: ducky.devices.Device

boot()[source]
static create_from_config(machine, config, section)[source]
static get_slave_gpu(machine, config, section)[source]
halt()[source]
class ducky.devices.svga.DisplayRefreshTask(display)[source]

Bases: ducky.reactor.RunInIntervalTask

on_tick(task)[source]
class ducky.devices.svga.Mode(_type, width, height, depth)[source]

Bases: object

classmethod from_string(s)[source]

Create Mode object from its string representation. It’s a comma-separated list of for items:

  type width height depth
Text mode t chars per line lines on screen bytes per char
Graphic mode g pixels per line pixel lines on screen bites per pixel
to_pretty_string()[source]
to_string()[source]
class ducky.devices.svga.SimpleVGA(machine, name, port=None, memory_size=None, memory_address=None, memory_banks=None, modes=None, boot_mode=None, *args, **kwargs)[source]

Bases: ducky.devices.IOProvider, ducky.devices.Device

SimpleVGA is very basic implementation of VGA-like device, with text and graphic modes.

It has its own graphic memory (“buffer”), split into several banks of the same size. Always only one bank can be directly accessed, by having it mapped into CPU’s address space.

Parameters:
  • machine (ducky.machine.Machine) – machine this device belongs to.
  • name (string) – name of this device.
  • port (u16) – address of the command port.
  • memory_size (int) – size of graphic memory.
  • memory_address (u24) – address of graphic memory - to this address is graphic buffer mapped. Must be specified, there is no default value.
  • memory_banks (int) – number of memory banks.
  • modes (list) – list of ducky.devices.svga.Mode objects, list of supported modes.
  • boot_mode (tuple) – this mode will be set when device boots up.
boot()[source]
static create_from_config(machine, config, section)[source]
halt()[source]
read_u16(port)[source]
reset()[source]
set_mode(mode)[source]
write_u16(port, value)[source]
class ducky.devices.svga.SimpleVGACommands[source]

Bases: enum.IntEnum

COLS = <SimpleVGACommands.COLS: 33>
DEPTH = <SimpleVGACommands.DEPTH: 35>
GRAPHIC = <SimpleVGACommands.GRAPHIC: 32>
MEMORY_BANK_ID = <SimpleVGACommands.MEMORY_BANK_ID: 48>
REFRESH = <SimpleVGACommands.REFRESH: 2>
RESET = <SimpleVGACommands.RESET: 32769>
ROWS = <SimpleVGACommands.ROWS: 34>
class ducky.devices.svga.SimpleVGAMemoryPage(dev, *args, **kwargs)[source]

Bases: ducky.mm.ExternalMemoryPage

Memory page handling MMIO of sVGA device.

Parameters:dev (ducky.devices.svga.SimpleVGA) – sVGA device this page belongs to.
get(offset)[source]
put(offset, b)[source]