MiniQuake2

src/miniquake2/platform/dedicated_console.ml

Provides miniquake2 platform dedicated console facilities for this project.

Package
miniquake2.platform.dedicated_console
Reachable
Yes

Imports

Declarations

acceptEvent

function acceptEvent(state, encoded)

Decode one bridge event. The original Windows Quake console consumes the character on key release; redirected stdin uses the same key-up encoding. The return value is [completedLine-or-void, echoText].

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.
encodeddynamic—encoded value consumed by this operation.

View source

close

function close(state)

Release only a console allocated by the shared bridge.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.

View source

CONSOLE_CAPACITY

const CONSOLE_CAPACITY = 256

Defines the console capacity constant used by the miniquake2 platform dedicated console module.

View source

create

function create()

Create an isolated console decoder. Native allocation remains explicit so unit tests can exercise the byte-for-byte input policy without host I/O.

View source

miniquake2.platform.dedicated_console.DedicatedConsoleState struct

EVENT_KEY_DOWN

const EVENT_KEY_DOWN = 65536

Defines the event key down constant used by the miniquake2 platform dedicated console module.

View source

EVENT_PRESENT

const EVENT_PRESENT = 2147483648

Defines the event present constant used by the miniquake2 platform dedicated console module.

View source

open

function open(state)

Attach to the process console, allocating one only when the executable does not already own a usable standard-output handle.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.

View source

poll

function poll(state)

Drain all currently pending native events without blocking the 10 Hz server frame. More than one complete redirected-input line may be available.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.

View source

write

function write(state, text)

Write operator output through the console-safe bridge.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.
textdynamic—Text consumed by the operation.

View source