MiniDoom

src/m_cheat.ml

Matches scrambled cheat-key sequences and captures optional numeric parameters from player input.

Package
(global)
Reachable
Yes

Declarations

_cht_bytes_from_list

function _cht_bytes_from_list(lst)

Packs integer list entries into a byte buffer, truncating each value to the low eight bits.

ParameterTypeDefaultDescription
lstdynamic—Lst value supplied to `_cht_bytes_from_list`.

View source

_cht_ensure_table

function _cht_ensure_table()

Lazily builds the 256-entry scrambled-key lookup table once and reuses it for subsequent cheat checks.

View source

_cht_key_byte

inline function _cht_key_byte(key)

Normalizes an input key to its low byte and converts uppercase ASCII letters to lowercase.

ParameterTypeDefaultDescription
keydynamic—Input key code to process.

View source

_cht_scramble

inline function _cht_scramble(a)

Applies Doom's reversible cheat-key bit permutation to one byte.

ParameterTypeDefaultDescription
adynamic—First input operand.

View source

_cht_seq_get

inline function _cht_seq_get(seq, idx)

Returns cht seq get information from utility state.

ParameterTypeDefaultDescription
seqdynamic—Seq value supplied to `_cht_seq_get`.
idxdynamic—Zero-based element or table index.

View source

_cht_seq_len

inline function _cht_seq_len(seq)

Locates the encoded terminator and returns the number of fixed cheat-sequence bytes before parameters begin.

ParameterTypeDefaultDescription
seqdynamic—Seq value supplied to `_cht_seq_len`.

View source

_cht_seq_set

inline function _cht_seq_set(seq, idx, v)

Replaces a cheat definition's encoded byte sequence and resets its matching and parameter cursors.

ParameterTypeDefaultDescription
seqdynamic—Seq value supplied to `_cht_seq_set`.
idxdynamic—Zero-based element or table index.
vdynamic—Value consumed by the operation.

View source

_cht_write_buffer

function _cht_write_buffer(buffer, outList)

Copies a captured cheat parameter into either a byte buffer or legacy string-reference array and terminates it.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that supplies or receives data.
outListdynamic—Out list value supplied to `_cht_write_buffer`.

View source

cheat_xlate_table

cheat_xlate_table

Stores the cheat xlate table collection used by the m cheat subsystem.

View source

cheatseq_t struct

cht_CheckCheat

function cht_CheckCheat(cht, key)

Feeds one key through a scrambled cheat sequence, advances or resets its cursor, and reports a completed match.

ParameterTypeDefaultDescription
chtdynamic—Cht value supplied to `cht_CheckCheat`.
keydynamic—Input key code to process.

View source

cht_GetParam

function cht_GetParam(cht, buffer)

Returns cht Get Param information from utility state.

ParameterTypeDefaultDescription
chtdynamic—Cht value supplied to `cht_GetParam`.
bufferdynamic—Buffer that supplies or receives data.

View source

firsttime

firsttime

Tracks the mutable firsttime value used by the m cheat subsystem.

View source