Crate wasm4_sys

Source
Expand description

§Safety

Many seemingly safe functions are marked unsafe. The reason for this is that the crate wasm4 uses them to achieve safe, idiomatic, and zero-overhead api. The major capability of that crate is being able to restrict ownership of various resources like framebuffer, sound, etc. To achieve that it implements WASM-4 api via methods on a struct like wasm4::sound::Resouce, ownership of which is restricted until you share it. As you may guess, calling crate::tone may interfere with assumptions about which sounds are playing in a code using wasm4::sound::Resource. Use of raw bindings usually gives little to no benefit, but is possible if you respect these assumptions described above.

Some of these functions are unsafe for other reasons too, like raw memory access.

However all of that assumes you or any dependency do not use any other bindings except for wasm4 and this crate (or uses them while respecting assumptions mentioned above, but this is discouraged).

Constants§

BLIT_1BPP
BLIT_2BPP
BLIT_FLIP_X
BLIT_FLIP_Y
BLIT_ROTATE
BUTTON_1
BUTTON_2
BUTTON_DOWN
BUTTON_LEFT
BUTTON_RIGHT
BUTTON_UP
DRAW_COLORS
FRAMEBUFFER
GAMEPAD1
GAMEPAD2
GAMEPAD3
GAMEPAD4
MOUSE_BUTTONS
MOUSE_LEFT
MOUSE_MIDDLE
MOUSE_RIGHT
MOUSE_X
MOUSE_Y
PALETTE
SCREEN_SIZE
SYSTEM_FLAGS
SYSTEM_HIDE_GAMEPAD_OVERLAY
SYSTEM_PRESERVE_FRAMEBUFFER
TONE_MODE1
TONE_MODE2
TONE_MODE3
TONE_MODE4
TONE_NOISE
TONE_PULSE1
TONE_PULSE2
TONE_TRIANGLE

Functions§

blit
blitSub
diskr
diskw
hline
line
oval
rect
text
textUtf8
textUtf16
tone
trace
traceUtf8
traceUtf16
tracef
vline