Documentation
¶
Overview ¶
Package ultimate is a Go client for the Commodore 64 Ultimate family of devices.
Quick start ¶
client, err := ultimate.New("c64u")
if err != nil {
log.Fatal(err)
}
err = client.Machine.Reset(context.Background())
Services ¶
The Client exposes grouped services:
- Machine: Control power, reset, and read/write RAM over DMA.
- Runners: Upload and run programs (.PRG, .CRT) or play music (.SID, .MOD).
- Drives: Mount disk images and control emulated floppy drives.
- Files: Query file metadata and create blank disk images.
- Configs: Read and write device settings. All values are strings on the wire; use Configs.GetItem to discover valid values and Configs.Set to write them, with ConfigMap.Bool/Int/String and Configs.SetBool/SetInt for typed convenience.
- Keyboard: Inject text and keystrokes into C64 (latter is best-effort).
- Streams: Multiplex video and audio streams into AVI format.
- Debug: Read and decode C64 state: screen, registers, memory.
- Raw: Send binary commands to the TCP port 64 socket for lower latency than the REST API.
C64-specific data formats and decoders live in the c64 subpackage.
Authentication ¶
For password-protected devices set credentials via WithPassword:
client, err := ultimate.New("c64u", ultimate.WithPassword("secret"))
Device failures return *APIError. Inspect the HTTP status and firmware messages with errors.As:
var apiErr *ultimate.APIError
if errors.As(err, &apiErr) && apiErr.StatusCode == http.StatusNotFound {
// resource not found
}
Index ¶
- type APIError
- type AVISession
- type AVISessionOptions
- type Client
- type ConfigItem
- type ConfigItems
- type ConfigMap
- type ConfigOptions
- type ConfigsService
- func (s *ConfigsService) Apply(ctx context.Context, cfg ConfigMap) error
- func (s *ConfigsService) Bool(ctx context.Context, category, item string) (bool, error)
- func (s *ConfigsService) Get(ctx context.Context, category string) (ConfigMap, error)
- func (s *ConfigsService) GetItem(ctx context.Context, category, item string) (ConfigItems, error)
- func (s *ConfigsService) List(ctx context.Context) ([]string, error)
- func (s *ConfigsService) LoadFromFlash(ctx context.Context, opts ConfigOptions) error
- func (s *ConfigsService) ResetToDefault(ctx context.Context, opts ConfigOptions) error
- func (s *ConfigsService) SaveToFlash(ctx context.Context, opts ConfigOptions) error
- func (s *ConfigsService) Set(ctx context.Context, category, item, value string) error
- func (s *ConfigsService) SetBool(ctx context.Context, category, item string, value bool) error
- func (s *ConfigsService) SetInt(ctx context.Context, category, item string, value int) error
- type CreateOptions
- type DebugService
- func (d *DebugService) BASIC(ctx context.Context) ([]c64.BASICLine, error)
- func (d *DebugService) Bitmap(ctx context.Context) (*image.Paletted, error)
- func (d *DebugService) Charset(ctx context.Context) (*c64.Charset, error)
- func (d *DebugService) Screen(ctx context.Context) (*c64.Screen, error)
- func (d *DebugService) ScreenMode(ctx context.Context) (c64.ScreenMode, error)
- func (d *DebugService) Sprites(ctx context.Context) (c64.Sprites, error)
- type DeviceInfo
- type Drive
- type DriveID
- type DriveMode
- type Drives
- type DrivesService
- func (s *DrivesService) List(ctx context.Context) (*Drives, error)
- func (s *DrivesService) LoadROM(ctx context.Context, drive DriveID, file string) error
- func (s *DrivesService) LoadROMBytes(ctx context.Context, drive DriveID, data []byte) error
- func (s *DrivesService) Mount(ctx context.Context, drive DriveID, image string, opts MountOptions) error
- func (s *DrivesService) MountBytes(ctx context.Context, drive DriveID, data []byte, opts MountOptions) error
- func (s *DrivesService) ResetDrive(ctx context.Context, drive DriveID) error
- func (s *DrivesService) SetMode(ctx context.Context, drive DriveID, mode DriveMode) error
- func (s *DrivesService) TurnOff(ctx context.Context, drive DriveID) error
- func (s *DrivesService) TurnOn(ctx context.Context, drive DriveID) error
- func (s *DrivesService) Unlink(ctx context.Context, drive DriveID) error
- func (s *DrivesService) Unmount(ctx context.Context, drive DriveID) error
- type FileInfo
- type FilesService
- func (s *FilesService) CreateD64(ctx context.Context, path string, opts CreateOptions) error
- func (s *FilesService) CreateD71(ctx context.Context, path string, opts CreateOptions) error
- func (s *FilesService) CreateD81(ctx context.Context, path string, opts CreateOptions) error
- func (s *FilesService) CreateDNP(ctx context.Context, path string, opts CreateOptions) error
- func (s *FilesService) Info(ctx context.Context, path string) (*FileInfo, error)
- type ImageType
- type KeyboardService
- type MachineService
- func (s *MachineService) Inject(ctx context.Context, p *c64.Program) error
- func (s *MachineService) MeasureBus(ctx context.Context) ([]byte, error)
- func (s *MachineService) MenuButton(ctx context.Context) error
- func (s *MachineService) Pause(ctx context.Context) error
- func (s *MachineService) Peek(ctx context.Context, address uint16) (byte, error)
- func (s *MachineService) Poke(ctx context.Context, address uint16, value byte) error
- func (s *MachineService) PowerOff(ctx context.Context) error
- func (s *MachineService) ReadDebugRegister(ctx context.Context) (byte, error)
- func (s *MachineService) ReadMemory(ctx context.Context, address uint16, length int) ([]byte, error)
- func (s *MachineService) Reboot(ctx context.Context) error
- func (s *MachineService) Reset(ctx context.Context) error
- func (s *MachineService) Resume(ctx context.Context) error
- func (s *MachineService) WriteDebugRegister(ctx context.Context, value byte) (byte, error)
- func (s *MachineService) WriteMemory(ctx context.Context, address uint16, data []byte) error
- type MemoryReader
- type MemoryReaderWriter
- type MemoryWriter
- type MountMode
- type MountOptions
- type Option
- type RawConn
- func (c *RawConn) Close() error
- func (c *RawConn) Identify(ctx context.Context) (string, error)
- func (c *RawConn) LoadAndJump(ctx context.Context, jumpAddr uint16, prg []byte) error
- func (c *RawConn) LoadAndRun(ctx context.Context, prg []byte) error
- func (c *RawConn) LoadKernal(ctx context.Context, rom []byte) error
- func (c *RawConn) MountDiskImage(ctx context.Context, d64 []byte) error
- func (c *RawConn) PowerOff(ctx context.Context) error
- func (c *RawConn) Reset(ctx context.Context) error
- func (c *RawConn) RunCartridge(ctx context.Context, crt []byte) error
- func (c *RawConn) RunDiskImage(ctx context.Context, d64 []byte) error
- func (c *RawConn) Type(ctx context.Context, text string) error
- func (c *RawConn) Wait(ctx context.Context, ticks uint16) error
- func (c *RawConn) WriteMemory(ctx context.Context, address uint16, data []byte) error
- func (c *RawConn) WriteREU(ctx context.Context, reuOffset uint32, data []byte) error
- type RawService
- type RunnersService
- func (s *RunnersService) Load(ctx context.Context, p *c64.Program) error
- func (s *RunnersService) LoadPRG(ctx context.Context, file string) error
- func (s *RunnersService) LoadPRGBytes(ctx context.Context, data []byte) error
- func (s *RunnersService) PlayMOD(ctx context.Context, file string) error
- func (s *RunnersService) PlayMODBytes(ctx context.Context, data []byte) error
- func (s *RunnersService) PlaySID(ctx context.Context, file string, song int) error
- func (s *RunnersService) PlaySIDBytes(ctx context.Context, data []byte, song int) error
- func (s *RunnersService) Run(ctx context.Context, p *c64.Program) error
- func (s *RunnersService) RunCRT(ctx context.Context, file string) error
- func (s *RunnersService) RunCRTBytes(ctx context.Context, data []byte) error
- func (s *RunnersService) RunPRG(ctx context.Context, file string) error
- func (s *RunnersService) RunPRGBytes(ctx context.Context, data []byte) error
- type SoftIEC
- type SoftIECPartition
- type StreamName
- type StreamsService
- func (s *StreamsService) AVISession(ctx context.Context, opts AVISessionOptions) (*AVISession, error)
- func (s *StreamsService) Audio(ctx context.Context, port int) (io.ReadCloser, error)
- func (s *StreamsService) Start(ctx context.Context, name StreamName, ip string) error
- func (s *StreamsService) Stop(ctx context.Context, name StreamName) error
- func (s *StreamsService) Video(ctx context.Context, port int) (io.ReadCloser, error)
- type TypeOption
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
StatusCode int // HTTP status code (or 0 for success status errors)
Errors []string // Messages returned by the device firmware
}
APIError is returned on HTTP or firmware-level failures from the device.
type AVISession ¶
type AVISession struct {
Video io.ReadCloser
Audio io.ReadCloser
// contains filtered or unexported fields
}
AVISession coordinates active video and audio streams from the device.
func (*AVISession) Close ¶
func (s *AVISession) Close() error
Close stops the streams on C64, cancels the readers, and closes both connections.
type AVISessionOptions ¶
AVISessionOptions configures an AVISession.
type Client ¶
type Client struct {
Machine *MachineService // C64 power state and DMA memory access
Runners *RunnersService // load/run programs and play music
Drives *DrivesService // floppy drives and disk mounting
Configs *ConfigsService // device settings
Streams *StreamsService // UDP video/audio/debug streams (Ultimate 64)
Files *FilesService // device filesystem and blank disk images
Debug *DebugService // decode live C64 hardware state from RAM
Raw *RawService // TCP command socket on port 64
Keyboard *KeyboardService // inject strings and keystrokes (latter is best-effort)
// contains filtered or unexported fields
}
Client is an HTTP connection to a C64 Ultimate device. Create one with New; each exported field is a service group for one area of the API.
type ConfigItem ¶
type ConfigItem struct {
Current any `json:"current"` // Current value (string or number)
Min int `json:"min,omitempty"` // Minimum value (for numeric settings)
Max int `json:"max,omitempty"` // Maximum value (for numeric settings)
Format string `json:"format,omitempty"` // Printf-style display format
Default any `json:"default,omitempty"` // Factory default value
Values []string `json:"values,omitempty"` // Allowed values (for choices/enums)
Presets []string `json:"presets,omitempty"` // Available presets
}
ConfigItem is the metadata for one device setting.
type ConfigItems ¶
type ConfigItems map[string]map[string]*ConfigItem
ConfigItems is category -> setting name -> ConfigItem metadata.
func (ConfigItems) Get ¶
func (m ConfigItems) Get(category, item string) (*ConfigItem, bool)
Get retrieves a ConfigItem by category and item name. Returns false if not found.
type ConfigMap ¶
ConfigMap is category -> setting name -> current value.
func (ConfigMap) Bool ¶
Bool parses a config value as a boolean. Recognises "Enabled"/"Disabled", "Yes"/"No", "ON"/"OFF" (case-insensitive), and numeric 1/0.
type ConfigOptions ¶
type ConfigOptions struct {
Category string // Leave empty to act on all categories
}
ConfigOptions limits flash operations to one category.
type ConfigsService ¶
type ConfigsService struct {
// contains filtered or unexported fields
}
ConfigsService reads and writes device settings.
func (*ConfigsService) Apply ¶
func (s *ConfigsService) Apply(ctx context.Context, cfg ConfigMap) error
Apply updates multiple settings at once using a ConfigMap.
func (*ConfigsService) Bool ¶
Bool reads a single setting and parses it as a boolean. Uses the same parsing rules as ConfigMap.Bool.
func (*ConfigsService) GetItem ¶
func (s *ConfigsService) GetItem(ctx context.Context, category, item string) (ConfigItems, error)
GetItem returns detailed specifications for a setting (supports '*' wildcards).
func (*ConfigsService) List ¶
func (s *ConfigsService) List(ctx context.Context) ([]string, error)
List returns the names of all setting categories.
func (*ConfigsService) LoadFromFlash ¶
func (s *ConfigsService) LoadFromFlash(ctx context.Context, opts ConfigOptions) error
LoadFromFlash restores settings from flash storage.
func (*ConfigsService) ResetToDefault ¶
func (s *ConfigsService) ResetToDefault(ctx context.Context, opts ConfigOptions) error
ResetToDefault resets settings to factory defaults. Changes are not persisted until SaveToFlash is called.
func (*ConfigsService) SaveToFlash ¶
func (s *ConfigsService) SaveToFlash(ctx context.Context, opts ConfigOptions) error
SaveToFlash saves the current settings to non-volatile flash storage.
func (*ConfigsService) Set ¶
func (s *ConfigsService) Set(ctx context.Context, category, item, value string) error
Set updates a single setting.
type CreateOptions ¶
type CreateOptions struct {
Tracks int // Track count (for D64 or DNP custom size formats)
DiskName string // Custom disk name header/label (up to 16 characters)
}
CreateOptions sets optional parameters when creating a disk image.
type DebugService ¶
type DebugService struct {
Mem MemoryReaderWriter // memory backend; defaults to Machine
}
DebugService reads C64 RAM and decodes it into structured hardware views. DebugService reads C64 RAM and decodes it into structured hardware views. Mem must be set before calling any DebugService method.
func (*DebugService) BASIC ¶
BASIC reads tokenized program memory from $0801 and decodes it to source lines.
func (*DebugService) Bitmap ¶
Bitmap decodes the current VIC bitmap screen into a 320×200 image. Returns an error if the VIC is not in bitmap mode.
func (*DebugService) Charset ¶
Charset reads the active character generator dot data (2048 bytes, 256 characters × 8 bytes). The address is determined from $D018 bits 1–3.
func (*DebugService) Screen ¶
Screen reads screen memory and returns 25 rows of decoded text. The base address comes from the VIC-II memory-setup register and CIA2 bank select. In bitmap modes the screen memory holds per-cell color data, not character codes; in that case Rows is left empty and Mode is set to the active bitmap mode.
func (*DebugService) ScreenMode ¶
func (d *DebugService) ScreenMode(ctx context.Context) (c64.ScreenMode, error)
ScreenMode returns the current VIC-II display mode.
type DeviceInfo ¶
type DeviceInfo struct {
Product string `json:"product"` // e.g. "Ultimate 64"
FirmwareVersion string `json:"firmware_version"` // e.g. "3.12"
FPGAVersion string `json:"fpga_version"` // e.g. "11F"
CoreVersion string `json:"core_version,omitempty"`
Hostname string `json:"hostname"`
UniqueID string `json:"unique_id,omitempty"`
Errors []string `json:"errors"`
}
DeviceInfo is hardware model, firmware versions, and network identity.
type Drive ¶
type Drive struct {
Enabled bool `json:"enabled"` // Whether the drive is turned on
BusID int `json:"bus_id"` // IEC bus ID (typically 8 or 9)
Type string `json:"type"` // Drive model (e.g., "1541", "1571", "1581")
ROM string `json:"rom"` // Custom ROM file name (if loaded)
ImageFile string `json:"image_file"` // Name of the mounted disk image file
ImagePath string `json:"image_path"` // Directory path of the mounted image
}
Drive is the status of one emulated floppy drive.
type DriveMode ¶
type DriveMode string
DriveMode selects which Commodore disk drive model to emulate (1541, 1571, or 1581).
type Drives ¶
type Drives struct {
A *Drive // primary drive (typically IEC device 8)
B *Drive // secondary drive (typically IEC device 9)
SoftIEC *SoftIEC // software IEC filesystem device
}
Drives holds the current status of drive slots A, B, and the SoftIEC device.
func (*Drives) UnmarshalJSON ¶
UnmarshalJSON decodes the device JSON array format into a Drives struct.
type DrivesService ¶
type DrivesService struct {
// contains filtered or unexported fields
}
DrivesService controls emulated 1541/1571/1581 drives and disk mounting.
func (*DrivesService) List ¶
func (s *DrivesService) List(ctx context.Context) (*Drives, error)
List returns the current status of all floppy drives.
func (*DrivesService) LoadROM ¶
LoadROM installs a custom drive ROM from the device filesystem. The default ROM returns after a mode change or reboot.
func (*DrivesService) LoadROMBytes ¶
LoadROMBytes uploads and installs a custom drive ROM. The default ROM returns after a mode change or reboot.
func (*DrivesService) Mount ¶
func (s *DrivesService) Mount(ctx context.Context, drive DriveID, image string, opts MountOptions) error
Mount mounts an image file from the device filesystem onto drive.
func (*DrivesService) MountBytes ¶
func (s *DrivesService) MountBytes(ctx context.Context, drive DriveID, data []byte, opts MountOptions) error
MountBytes uploads image bytes and mounts them on drive.
func (*DrivesService) ResetDrive ¶
func (s *DrivesService) ResetDrive(ctx context.Context, drive DriveID) error
ResetDrive resets drive emulation.
func (*DrivesService) SetMode ¶
SetMode switches drive emulation model and restores the default ROM.
func (*DrivesService) TurnOff ¶
func (s *DrivesService) TurnOff(ctx context.Context, drive DriveID) error
TurnOff powers off drive and removes it from the IEC bus.
func (*DrivesService) TurnOn ¶
func (s *DrivesService) TurnOn(ctx context.Context, drive DriveID) error
TurnOn powers on drive. If already on, it is reset.
type FileInfo ¶
type FileInfo struct {
Path string `json:"path"`
Filename string `json:"filename"`
Size int `json:"size"`
Extension string `json:"extension"`
}
FileInfo is metadata for one file on the device.
type FilesService ¶
type FilesService struct {
// contains filtered or unexported fields
}
FilesService reads file metadata and creates blank disk images on the device.
func (*FilesService) CreateD64 ¶
func (s *FilesService) CreateD64(ctx context.Context, path string, opts CreateOptions) error
CreateD64 creates a blank .d64 disk image (standard 35 tracks).
func (*FilesService) CreateD71 ¶
func (s *FilesService) CreateD71(ctx context.Context, path string, opts CreateOptions) error
CreateD71 creates a blank .d71 disk image (70 tracks).
func (*FilesService) CreateD81 ¶
func (s *FilesService) CreateD81(ctx context.Context, path string, opts CreateOptions) error
CreateD81 creates a blank .d81 3.5-inch disk image (80 tracks).
func (*FilesService) CreateDNP ¶
func (s *FilesService) CreateDNP(ctx context.Context, path string, opts CreateOptions) error
CreateDNP creates a blank .dnp partition-based image. Tracks is required.
type KeyboardService ¶
type KeyboardService struct {
Mem MemoryReaderWriter // memory backend; defaults to Machine
}
KeyboardService injects keystrokes into the C64.
WARNING: Keystroke injection is a best-effort software feature. Remote DMA access cannot bridge physical hardware matrix pins. Injection works reliably for BASIC and standard KERNAL software, but WILL FAIL in software that bypasses the KERNAL or uses custom keyboard scanning logic.
func (*KeyboardService) Press ¶
Press simulates holding one or more keyboard keys down.
The Ultimate REST API does not provide a built-in feature for simulating keyboard key presses. To work around this, Press attempts to simulate key presses in software using two different methods depending on the environment:
- Standard C64 environment (BASIC prompt): When the C64 KERNAL operating system is scanning the keyboard in the background, Press writes the key's character code directly into the KERNAL keyboard buffer ($0277).
- Custom software (Interrupts disabled): When background IRQ scanning is disabled, Press modifies the CIA #1 hardware chip registers ($DC00-$DC03) to simulate an active key matrix signal for 40ms before restoring the original register values.
Why this workaround may fail:
- Programs that reset CIA direction registers ($DC02/$DC03) every frame will overwrite the injected key state.
- Routines that scan matrix columns individually expect selective row responses, which a static CIA register write cannot replicate across all column scans.
func (*KeyboardService) Type ¶
func (s *KeyboardService) Type(ctx context.Context, text string, opts ...TypeOption) error
Type enqueues ASCII text into the KERNAL keyboard buffer ($0277).
Use at the BASIC READY prompt or with programs reading input via KERNAL routines (GETIN/CHRIN).
WARNING: Type does NOT work in software that reads hardware registers directly.
type MachineService ¶
type MachineService struct {
// contains filtered or unexported fields
}
MachineService controls C64 run state and reads/writes RAM over DMA.
func (*MachineService) MeasureBus ¶
func (s *MachineService) MeasureBus(ctx context.Context) ([]byte, error)
MeasureBus returns a VCD trace of cartridge bus timing.
func (*MachineService) MenuButton ¶
func (s *MachineService) MenuButton(ctx context.Context) error
MenuButton simulates a press of the cartridge menu button.
func (*MachineService) Pause ¶
func (s *MachineService) Pause(ctx context.Context) error
Pause freezes the C64. The CPU stops, but RAM is preserved.
func (*MachineService) PowerOff ¶
func (s *MachineService) PowerOff(ctx context.Context) error
PowerOff shuts down the device.
func (*MachineService) ReadDebugRegister ¶
func (s *MachineService) ReadDebugRegister(ctx context.Context) (byte, error)
ReadDebugRegister reads the Ultimate 64 debug register at $D7FF.
func (*MachineService) ReadMemory ¶
func (s *MachineService) ReadMemory(ctx context.Context, address uint16, length int) ([]byte, error)
ReadMemory reads length bytes from C64 RAM starting at address.
func (*MachineService) Reboot ¶
func (s *MachineService) Reboot(ctx context.Context) error
Reboot restarts Ultimate firmware and then resets the C64.
func (*MachineService) Reset ¶
func (s *MachineService) Reset(ctx context.Context) error
Reset performs a hardware C64 reset. Cartridge settings are kept.
func (*MachineService) Resume ¶
func (s *MachineService) Resume(ctx context.Context) error
Resume lets the C64 run again after a Pause.
func (*MachineService) WriteDebugRegister ¶
WriteDebugRegister writes value to $D7FF and returns the readback.
func (*MachineService) WriteMemory ¶
WriteMemory writes data to C64 RAM.
type MemoryReader ¶
type MemoryReader interface {
ReadMemory(ctx context.Context, address uint16, length int) ([]byte, error)
}
MemoryReader reads bytes from C64 memory.
type MemoryReaderWriter ¶
type MemoryReaderWriter interface {
MemoryReader
MemoryWriter
}
MemoryReaderWriter combines MemoryReader and MemoryWriter.
type MemoryWriter ¶
MemoryWriter writes bytes to C64 memory.
type MountMode ¶
type MountMode string
MountMode controls whether writes to a mounted image are persisted.
type MountOptions ¶
type MountOptions struct {
ImageType ImageType // Image type (d64, d71, d81, etc.)
Mode MountMode // Mount mode (readonly, readwrite, etc.)
}
MountOptions sets image format and write mode for a mount operation.
type Option ¶
type Option func(*Client)
Option configures a Client.
func WithBaseURL ¶
WithBaseURL sets the full device base URL. Used mainly in tests.
func WithHTTPClient ¶
WithHTTPClient sets a custom http.Client. Overrides WithTimeout.
func WithPassword ¶
WithPassword sets the password used to authenticate with the device.
func WithTimeout ¶
WithTimeout sets the per-request timeout. Ignored when WithHTTPClient is set.
type RawConn ¶
type RawConn struct {
// contains filtered or unexported fields
}
RawConn represents an active connection to the device's TCP port 64 command socket.
func (*RawConn) LoadAndJump ¶
LoadAndJump DMA-loads a program and jumps to a specific entry point. prg is a standard C64 PRG (starts with 2-byte load address).
func (*RawConn) LoadAndRun ¶
LoadAndRun DMA-loads a standard C64 PRG program (the first 2 bytes are the load address) and runs it automatically.
func (*RawConn) LoadKernal ¶
LoadKernal uploads a replacement KERNAL ROM image.
func (*RawConn) MountDiskImage ¶
MountDiskImage mounts a .d64 or other disk image without running it.
func (*RawConn) RunCartridge ¶
RunCartridge runs a .crt cartridge image.
func (*RawConn) RunDiskImage ¶
RunDiskImage mounts and runs a .d64 or other disk image.
func (*RawConn) Wait ¶
Wait instructs the firmware to delay execution by the specified number of FreeRTOS ticks.
func (*RawConn) WriteMemory ¶
WriteMemory DMA-writes data to C64 RAM via the SOCKET_CMD_DMAWRITE command.
type RawService ¶
type RawService struct {
// contains filtered or unexported fields
}
RawService manages connections on the device's TCP port 64.
type RunnersService ¶
type RunnersService struct {
// contains filtered or unexported fields
}
RunnersService loads and runs programs or plays music files. Methods ending in Bytes upload data from memory; others use a path on the device.
func (*RunnersService) LoadPRG ¶
func (s *RunnersService) LoadPRG(ctx context.Context, file string) error
LoadPRG loads a .PRG from the device filesystem. Resets the C64 first.
func (*RunnersService) LoadPRGBytes ¶
func (s *RunnersService) LoadPRGBytes(ctx context.Context, data []byte) error
LoadPRGBytes uploads and loads PRG bytes. Resets the C64 first.
func (*RunnersService) PlayMOD ¶
func (s *RunnersService) PlayMOD(ctx context.Context, file string) error
PlayMOD plays a .MOD file from the device filesystem.
func (*RunnersService) PlayMODBytes ¶
func (s *RunnersService) PlayMODBytes(ctx context.Context, data []byte) error
PlayMODBytes uploads and plays .MOD bytes.
func (*RunnersService) PlaySID ¶
PlaySID plays a .SID file from the device. song is the sub-tune index (zero-based).
func (*RunnersService) PlaySIDBytes ¶
PlaySIDBytes uploads and plays .SID bytes. song is the sub-tune index (zero-based).
func (*RunnersService) RunCRT ¶
func (s *RunnersService) RunCRT(ctx context.Context, file string) error
RunCRT runs a .CRT cartridge file from the device filesystem.
func (*RunnersService) RunCRTBytes ¶
func (s *RunnersService) RunCRTBytes(ctx context.Context, data []byte) error
RunCRTBytes uploads and runs .CRT cartridge bytes.
func (*RunnersService) RunPRG ¶
func (s *RunnersService) RunPRG(ctx context.Context, file string) error
RunPRG loads and runs a .PRG from the device filesystem. Resets the C64 first.
func (*RunnersService) RunPRGBytes ¶
func (s *RunnersService) RunPRGBytes(ctx context.Context, data []byte) error
RunPRGBytes uploads and runs PRG bytes. Resets the C64 first.
type SoftIEC ¶
type SoftIEC struct {
Enabled bool `json:"enabled"`
BusID int `json:"bus_id"`
Type string `json:"type"`
LastError string `json:"last_error"`
Partitions []SoftIECPartition `json:"partitions"`
}
SoftIEC is the software-based IEC storage device (filesystem browser).
type SoftIECPartition ¶
SoftIECPartition is one directory partition on the software IEC device.
type StreamName ¶
type StreamName string
StreamName selects a UDP output stream (Ultimate 64 only).
const ( StreamVideo StreamName = "video" // VIC-II framebuffer StreamAudio StreamName = "audio" // mixed audio output from the C64 (SID) StreamDebug StreamName = "debug" // internal signal trace )
type StreamsService ¶
type StreamsService struct {
// contains filtered or unexported fields
}
StreamsService controls starting the streams and gives you readers for the data.
func (*StreamsService) AVISession ¶
func (s *StreamsService) AVISession(ctx context.Context, opts AVISessionOptions) (*AVISession, error)
AVISession starts video and audio streams on the device, multiplexes them into an AVI stream, and writes the output to the provided Writer. Call Close() on the returned session to cleanly stop the streams.
func (*StreamsService) Audio ¶
func (s *StreamsService) Audio(ctx context.Context, port int) (io.ReadCloser, error)
Audio returns a reader with clean 48kHz stereo PCM. Pipe it to ffmpeg or another tool.
func (*StreamsService) Start ¶
func (s *StreamsService) Start(ctx context.Context, name StreamName, ip string) error
Start tells the device to begin sending the stream to the given IP:port.
func (*StreamsService) Stop ¶
func (s *StreamsService) Stop(ctx context.Context, name StreamName) error
Stop tells the device to stop the stream.
func (*StreamsService) Video ¶
func (s *StreamsService) Video(ctx context.Context, port int) (io.ReadCloser, error)
Video returns a reader with raw RGB24 frames (384x272). Pipe it to ffmpeg or another tool.
type TypeOption ¶
type TypeOption func(*typeConfig)
TypeOption configures Type.
func Literal ¶
func Literal() TypeOption
Literal makes Type distinguish 'a' from 'A' (lowercase vs uppercase on screen). Default folds case so both produce uppercase.
type VersionInfo ¶
VersionInfo is the REST API version string.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
codec
Package codec maps between C64 single-byte encodings: ASCII, PETSCII, and screen codes.
|
Package codec maps between C64 single-byte encodings: ASCII, PETSCII, and screen codes. |
|
examples
|
|
|
utils
Package utils implements common utilities for the examples.
|
Package utils implements common utilities for the examples. |
|
tools
|
|
|
c64ctl
module
|
