cloudpilot
    Preparing search index...

    Interface Emulator

    interface Emulator {
        powerOffChangeEvent: Event<boolean>;
        isUiInitializedChangeEvent: Event<boolean>;
        audioInitializedEvent: Event<void>;
        timesliceEvent: Event<void>;
        hotsyncNameChangeEvent: Event<string>;
        gameModeChangeEvent: Event<boolean>;
        loadRom(rom: Uint8Array, deviceId?: DeviceId): this;
        loadSession(session: Uint8Array): this;
        insertCompressedCardImage(cardImage: Uint8Array): this;
        insertCardImage(cardImage: Uint8Array): this;
        ejectCard(): this;
        isCardMounted(): boolean;
        setCanvas(canvas: HTMLCanvasElement): this;
        bindInput(keyboardTarget?: EventTarget): this;
        releaseInput(): this;
        installDatabase(file: Uint8Array): this;
        installAndLaunchDatabase(file: Uint8Array): this;
        installFromZipfile(file: Uint8Array): this;
        installFromZipfileAndLaunch(file: Uint8Array, launchFile: string): this;
        launchByName(name: string): this;
        launchDatabase(database: Uint8Array): this;
        reset(): this;
        resetNoExtensions(): this;
        resetHard(): this;
        isRunning(): boolean;
        isPowerOff(): boolean;
        isUiInitialized(): boolean;
        resume(): this;
        pause(): this;
        buttonDown(button: Button): this;
        buttonUp(button: Button): this;
        setSpeed(speed: number): this;
        getSpeed(): number;
        setVolume(volume: number): this;
        getVolume(): number;
        initializeAudio(): Promise<boolean>;
        isAudioInitialized(): boolean;
        setGameMode(gameModeActive: boolean): this;
        isGameMode(): boolean;
        setGameModeHotkeyEnabled(enableGamemodeHotkey: boolean): this;
        isGameModeHotkeyEnabled(): boolean;
        setGameModeIndicatorEnabled(gameModeIndicatorEnabled: boolean): this;
        isGameModeIndicatorEnabled(): boolean;
        setOrientation(orientation: DeviceOrientation): this;
        getOrientation(): DeviceOrientation;
        setHotsyncName(hotsyncName: undefined | string): this;
        getHotsyncName(): undefined | string;
        setRunHidden(toggle: boolean): this;
        getRunHidden(): boolean;
        getStatistics(): EmulationStatistics;
        getSerialPortIR(): SerialPort;
        getSerialPortSerial(): SerialPort;
    }
    Index

    Properties

    powerOffChangeEvent: Event<boolean>

    Fires when the device turns on or off.

    isUiInitializedChangeEvent: Event<boolean>

    Fires when PalmOS resets or passed UI initialization during boot.

    audioInitializedEvent: Event<void>

    Fires when audio is initializd successfully.

    timesliceEvent: Event<void>

    Fires after each emulated timeslice (typicall 60 times per second)

    hotsyncNameChangeEvent: Event<string>

    Fires when the hotsync name changes. This does not happen immediatelly when setHotsyncName is called, but only when the OS is notified of the new name.

    gameModeChangeEvent: Event<boolean>

    Fires if game mode is enabled or disabled.

    Methods

    • Load a ROM and put the emulator in paused state.

      Parameters

      • rom: Uint8Array

        Device ROM

      • OptionaldeviceId: DeviceId

        Optional: device ID, autodetected if not specified

      Returns this

    • Load a Cloudpilot session and put the emulator in paused state.

      Parameters

      • session: Uint8Array

        Session image

      Returns this

    • Attach and mount a gzip compressed card image.

      Parameters

      • cardImage: Uint8Array

        Gzip compressed image data

      Returns this

    • Attach and mount a plain card image.

      Parameters

      • cardImage: Uint8Array

        Image data

      Returns this

    • Configure the canvas element used for displaying the emulator.

      Parameters

      • canvas: HTMLCanvasElement

        Canvas for displaying the emulator

      Returns this

    • Receive input events from the specified sources. If this method is called multiple times the previous sources will be unbound.

      Parameters

      • OptionalkeyboardTarget: EventTarget

        Optional: target for keyboard events, default: window

      Returns this

    • Install a prc or pdb database to the device.

      Parameters

      • file: Uint8Array

        The database data.

      Returns this

    • Install a prc database to the device and attempt to launch it.

      Parameters

      • file: Uint8Array

        The database data.

      Returns this

    • Extract all databases from a zip archive and install them.

      Parameters

      • file: Uint8Array

        The zip archive data.

      Returns this

    • Extract all databases from a zip archive and install them, then attampt to launch the specified file.

      Parameters

      • file: Uint8Array

        The zip archive data.

      • launchFile: string

        The file name of the database that Cloudpilot will try to launch.

      Returns this

    • Attemot to launch the database with the specified name.

      Parameters

      • name: string

        Database name

      Returns this

    • Attempt to extract the name from a database and launch it.

      Parameters

      • database: Uint8Array

        Database data (only the first 32 bytes are required)

      Returns this

    • Reset w/o system extensions (equivalent to holding "down" while pushing the reset button).

      Returns this

    • Hard reset (equivalent to holding "power" while pushing the reset button).

      Returns this

    • Has the emulated device passed UI initialization (during boot)? This is required before software can be installed.

      Returns boolean

    • Adjust speed of the emulated device.

      Parameters

      • speed: number

        Speed factor

      Returns this

    • Set audio volume.

      Parameters

      • volume: number

        Volume (1 = 100%, 0 = silent)

      Returns this

    • Initialize audio. This must be called from an event handler that was triggered by a user interaction, i.e. a click or a key press.

      Returns Promise<boolean>

    • Enable or disable game mode (direct key mapping to hardware buttons).

      Parameters

      • gameModeActive: boolean

        Desired state

      Returns this

    • Enable or disable shift-ctrl for toggling game mode (enabled by default).

      Parameters

      • enableGamemodeHotkey: boolean

        Desired state

      Returns this

    • Enable or disable game mode indicator (overlays hard buttons if game mode is active)? Enabled by default.

      Parameters

      • gameModeIndicatorEnabled: boolean

        Desired state

      Returns this

    • Set hotsync name.

      Parameters

      • hotsyncName: undefined | string

        Desired hotsync name

      Returns this

    • Keep running if the emulator tab is not visible?

      Parameters

      • toggle: boolean

        Desired state

      Returns this