8#define WASM_IMPORT(MOD, NAME) __attribute__((import_module(MOD), import_name(NAME)))
12WASM_IMPORT(
"graphics",
"clear_screen")
13void _ffb_clear_screen(int32_t c);
15WASM_IMPORT(
"graphics",
"set_color")
16void _ffb_set_color(int32_t c, int32_t r, int32_t g, int32_t b);
18WASM_IMPORT(
"graphics",
"draw_point")
19void _ffb_draw_point(int32_t x, int32_t y, int32_t c);
21WASM_IMPORT(
"graphics",
"draw_line")
22void _ffb_draw_line(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t color, int32_t stroke_width);
24WASM_IMPORT(
"graphics",
"draw_rect")
25void _ffb_draw_rect(int32_t x, int32_t y, int32_t w, int32_t h, int32_t fc, int32_t sc, int32_t sw);
27WASM_IMPORT(
"graphics",
"draw_rounded_rect")
28void _ffb_draw_rounded_rect(int32_t x, int32_t y, int32_t w, int32_t h, int32_t cw, int32_t ch, int32_t fc, int32_t sc, int32_t sw);
30WASM_IMPORT(
"graphics",
"draw_circle")
31void _ffb_draw_circle(int32_t x, int32_t y, int32_t d, int32_t fc, int32_t sc, int32_t sw);
33WASM_IMPORT(
"graphics",
"draw_ellipse")
34void _ffb_draw_ellipse(int32_t x, int32_t y, int32_t w, int32_t h, int32_t fc, int32_t sc, int32_t sw);
36WASM_IMPORT(
"graphics",
"draw_triangle")
37void _ffb_draw_triangle(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t x3, int32_t y3, int32_t fc, int32_t sc, int32_t sw);
39WASM_IMPORT(
"graphics",
"draw_arc")
40void _ffb_draw_arc(int32_t x, int32_t y, int32_t d,
float ast,
float asw, int32_t fc, int32_t sc, int32_t sw);
42WASM_IMPORT(
"graphics",
"draw_sector")
43void _ffb_draw_sector(int32_t x, int32_t y, int32_t d,
float ast,
float asw, int32_t fc, int32_t sc, int32_t sw);
45WASM_IMPORT(
"graphics",
"draw_text")
46void _ffb_draw_text(uintptr_t textPtr, int32_t textLen, uintptr_t fontPtr, int32_t fontLen, int32_t x, int32_t y, int32_t color);
48WASM_IMPORT(
"graphics",
"draw_qr")
49void _ffb_draw_qr(uintptr_t ptr, int32_t len, int32_t x, int32_t y, int32_t black, int32_t white);
51WASM_IMPORT(
"graphics",
"draw_image")
52void _ffb_draw_image(uintptr_t ptr, int32_t len, int32_t x, int32_t y);
54WASM_IMPORT(
"graphics",
"draw_sub_image")
55void _ffb_draw_sub_image(uintptr_t ptr, uintptr_t len, int32_t x, int32_t y, int32_t subX, int32_t subY, int32_t subWidth, int32_t subHeight);
57WASM_IMPORT(
"graphics",
"draw_sub_tile")
58void _ffb_draw_sub_tile(uintptr_t ptr, uintptr_t len, int32_t x, int32_t y, int32_t w, int32_t h, int32_t subX, int32_t subY, int32_t subWidth, int32_t subHeight);
60WASM_IMPORT(
"graphics",
"draw_sub_tile")
61void _ffb_draw_nine_slice(uintptr_t ptr, uintptr_t len, int32_t x, int32_t y, int32_t w, int32_t h, int32_t subX, int32_t subY, int32_t subWidth, int32_t subHeight);
63WASM_IMPORT(
"graphics",
"set_canvas")
64void _ffb_set_canvas(uintptr_t ptr, uintptr_t len);
66WASM_IMPORT(
"graphics",
"unset_canvas")
67void _ffb_unset_canvas();
71WASM_IMPORT(
"input",
"read_pad")
72int32_t _ffb_read_pad(int32_t player);
74WASM_IMPORT(
"input",
"read_buttons")
75int32_t _ffb_read_buttons(int32_t player);
79WASM_IMPORT(
"fs",
"get_file_size")
80int32_t _ffb_get_file_size(uintptr_t pathPtr, uintptr_t pathLen);
82WASM_IMPORT(
"fs",
"load_file")
83uintptr_t _ffb_load_file(uintptr_t pathPtr, uintptr_t pathLen, uintptr_t bufPtr, uintptr_t bufLen);
85WASM_IMPORT(
"fs",
"dump_file")
86uintptr_t _ffb_dump_file(uintptr_t pathPtr, uintptr_t pathLen, uintptr_t bufPtr, uintptr_t bufLen);
88WASM_IMPORT(
"fs",
"remove_file")
89void _ffb_remove_file(uintptr_t pathPtr, uintptr_t pathLen);
93WASM_IMPORT(
"net",
"get_me")
96WASM_IMPORT(
"net",
"get_peers")
97int32_t _ffb_get_peers();
99WASM_IMPORT(
"net",
"save_stash")
100void _ffb_save_stash(int32_t peerID, uintptr_t bufPtr, uintptr_t bufLen);
102WASM_IMPORT(
"net",
"load_stash")
103int32_t _ffb_load_stash(int32_t peerID, uintptr_t bufPtr, uintptr_t bufLen);
107WASM_IMPORT(
"misc",
"add_progress")
108uintptr_t _ffb_add_progress(int32_t peerID, uintptr_t badgeID, int32_t val);
110WASM_IMPORT(
"misc",
"add_score")
111int32_t _ffb_add_score(int32_t peerID, uintptr_t badgeID, int32_t val);
115WASM_IMPORT(
"misc",
"log_debug")
116void _ffb_log_debug(uintptr_t ptr, uintptr_t len);
118WASM_IMPORT(
"misc",
"log_error")
119void _ffb_log_error(uintptr_t ptr, uintptr_t len);
121WASM_IMPORT(
"misc",
"set_seed")
122void _ffb_set_seed(uintptr_t seed);
124WASM_IMPORT(
"misc",
"get_random")
125uintptr_t _ffb_get_random();
127WASM_IMPORT(
"misc",
"get_name")
128uintptr_t _ffb_get_name(int32_t peerID, uintptr_t ptr, uintptr_t len);
130WASM_IMPORT(
"misc",
"get_settings")
131uint64_t _ffb_get_settings(int32_t peerID);
133WASM_IMPORT(
"misc",
"restart")
136WASM_IMPORT(
"misc",
"quit")
143WASM_IMPORT(
"audio",
"add_sine")
144uint32_t _ffba_add_sine(uint32_t parentID,
float freq,
float phase);
146WASM_IMPORT(
"audio",
"add_square")
147uint32_t _ffba_add_square(uint32_t parentID,
float freq,
float phase);
149WASM_IMPORT(
"audio",
"add_sawtooth")
150uint32_t _ffba_add_sawtooth(uint32_t parentID,
float freq,
float phase);
152WASM_IMPORT(
"audio",
"add_triangle")
153uint32_t _ffba_add_triangle(uint32_t parentID,
float freq,
float phase);
155WASM_IMPORT(
"audio",
"add_noise")
156uint32_t _ffba_add_noise(uint32_t parentID, int32_t seed);
158WASM_IMPORT(
"audio",
"add_empty")
159uint32_t _ffba_add_empty(uint32_t parentID);
161WASM_IMPORT(
"audio",
"add_zero")
162uint32_t _ffba_add_zero(uint32_t parentID);
164WASM_IMPORT(
"audio",
"add_file")
165uint32_t _ffba_add_file(uint32_t parentID, uintptr_t ptr, uintptr_t len);
169WASM_IMPORT(
"audio",
"add_mix")
170uint32_t _ffba_add_mix(uint32_t parentID);
172WASM_IMPORT(
"audio",
"add_all_for_one")
173uint32_t _ffba_add_all_for_one(uint32_t parentID);
175WASM_IMPORT(
"audio",
"add_gain")
176uint32_t _ffba_add_gain(uint32_t parentID,
float lvl);
178WASM_IMPORT(
"audio",
"add_loop")
179uint32_t _ffba_add_loop(uint32_t parentID);
181WASM_IMPORT(
"audio",
"add_concat")
182uint32_t _ffba_add_concat(uint32_t parentID);
184WASM_IMPORT(
"audio",
"add_pan")
185uint32_t _ffba_add_pan(uint32_t parentID,
float lvl);
187WASM_IMPORT(
"audio",
"add_mute")
188uint32_t _ffba_add_mute(uint32_t parentID);
190WASM_IMPORT(
"audio",
"add_pause")
191uint32_t _ffba_add_pause(uint32_t parentID);
193WASM_IMPORT(
"audio",
"add_track_position")
194uint32_t _ffba_add_track_position(uint32_t parentID);
196WASM_IMPORT(
"audio",
"add_low_pass")
197uint32_t _ffba_add_low_pass(uint32_t parentID,
float freq,
float q);
199WASM_IMPORT(
"audio",
"add_high_pass")
200uint32_t _ffba_add_high_pass(uint32_t parentID,
float freq,
float q);
202WASM_IMPORT(
"audio",
"add_take_left")
203uint32_t _ffba_add_take_left(uint32_t parentID);
205WASM_IMPORT(
"audio",
"add_take_right")
206uint32_t _ffba_add_take_right(uint32_t parentID);
208WASM_IMPORT(
"audio",
"add_swap")
209uint32_t _ffba_add_swap(uint32_t parentID);
211WASM_IMPORT(
"audio",
"add_clip")
212uint32_t _ffba_add_clip(uint32_t parentID,
float low,
float high);
216WASM_IMPORT(
"audio",
"mod_linear")
217void _ffba_mod_linear(uint32_t nodeID, uint32_t param,
float x_start,
float x_end, uint32_t start_at, uint32_t end_at);
219WASM_IMPORT(
"audio",
"mod_hold")
220void _ffba_mod_hold(uint32_t nodeID, uint32_t param,
float before,
float after, uint32_t time);
222WASM_IMPORT(
"audio",
"mod_adsr")
224 uint32_t nodeID, uint32_t param,
float low,
float high,
225 uint32_t attack, uint32_t decay, uint32_t sustain,
float sustain_level, uint32_t release);
227WASM_IMPORT(
"audio",
"mod_sine")
228void _ffba_mod_sine(uint32_t nodeID, uint32_t param,
float freq,
float low,
float high);
230WASM_IMPORT(
"audio",
"mod_square")
231void _ffba_mod_square(uint32_t nodeID, uint32_t param,
float low,
float high, uint32_t period);
233WASM_IMPORT(
"audio",
"mod_sawtooth")
234void _ffba_mod_sawtooth(uint32_t nodeID, uint32_t param,
float low,
float high, uint32_t period);
238WASM_IMPORT(
"audio",
"reset")
239void _ffba_reset(uint32_t nodeID);
241WASM_IMPORT(
"audio",
"reset_all")
242void _ffba_reset_all(uint32_t nodeID);
244WASM_IMPORT(
"audio",
"clear")
245void _ffba_clear(uint32_t nodeID);
247WASM_IMPORT(
"audio",
"set")
248void _ffba_set(uint32_t nodeID, uint32_t param,
float val);