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
- GAMEPA
D1 - GAMEPA
D2 - GAMEPA
D3 - GAMEPA
D4 - 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_
PULS E1 - TONE_
PULS E2 - TONE_
TRIANGLE