MiniDoom

src/m_swap.ml

Normalizes signed 16-bit values and byte-swaps 16- and 32-bit integers across host endianness.

Package
(global)
Reachable
Yes

Declarations

__BIG_ENDIAN__

const __BIG_ENDIAN__ = false

Defines big endian for the m swap subsystem.

View source

LONG

function LONG(x)

Reverses all four bytes of a 32-bit value and returns the signed result.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.

View source

SHORT

function SHORT(x)

Byte-swaps the low 16 bits and returns the result with signed 16-bit interpretation.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.

View source

SwapLONG

function SwapLONG(x)

Reverses all four bytes of an integer's low 32-bit representation.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.

View source

SwapSHORT

function SwapSHORT(x)

Reverses the two bytes in the low 16 bits of an integer.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.

View source