Poke4

From Pico-8 Wiki
Jump to navigation Jump to search
poke4( addr, [...] )
Writes one or more 32-bit fixed-point PICO-8 number values to contiguous groups of four consecutive memory locations.
addr
The address of the first memory location.

...
The 32-bit values to write to memory. If these are omitted, a zero is written to the first 4 bytes.

The poke4() function writes one or more 32-bit values to contiguous groups of four consecutive bytes in the addressable memory region (0x0000-0x7fff). The values are interpreted in the Little Endian representation, which stores the lowest 8 bits of the fractional part in the first byte, and the lowest 8 bits of the integer part in the third byte.

See Memory for information about the memory layout.

Examples

poke4(0x4300, 0x0fff.c000)

b0,b1,b2,b3 = peek(0x4300, 4)  -- 0x00,0xc0,0xff,0x0f
w0,w1       = peek2(0x4300, 2) -- 0xc000,0x0fff

See also