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",
"add_menu_item")
116void _ffb_add_menu_item(uintptr_t index, uintptr_t ptr, uintptr_t len);
118WASM_IMPORT(
"misc",
"remove_menu_item")
119void _ffb_remove_menu_item(uintptr_t index);
121WASM_IMPORT(
"misc",
"open_menu")
122void _ffb_open_menu();
126WASM_IMPORT(
"misc",
"log_debug")
127void _ffb_log_debug(uintptr_t ptr, uintptr_t len);
129WASM_IMPORT(
"misc",
"log_error")
130void _ffb_log_error(uintptr_t ptr, uintptr_t len);
132WASM_IMPORT(
"misc",
"set_seed")
133void _ffb_set_seed(uintptr_t seed);
135WASM_IMPORT(
"misc",
"get_random")
136uintptr_t _ffb_get_random();
138WASM_IMPORT(
"misc",
"get_time")
139uint64_t _ffb_get_time();
141WASM_IMPORT(
"misc",
"get_name")
142uintptr_t _ffb_get_name(int32_t peerID, uintptr_t ptr, uintptr_t len);
144WASM_IMPORT(
"misc",
"get_settings")
145uint64_t _ffb_get_settings(int32_t peerID);
147WASM_IMPORT(
"misc",
"restart")
150WASM_IMPORT(
"misc",
"quit")
157WASM_IMPORT(
"audio",
"add_sine")
158uint32_t _ffba_add_sine(uint32_t parentID,
float freq,
float phase);
160WASM_IMPORT(
"audio",
"add_square")
161uint32_t _ffba_add_square(uint32_t parentID,
float freq,
float phase);
163WASM_IMPORT(
"audio",
"add_sawtooth")
164uint32_t _ffba_add_sawtooth(uint32_t parentID,
float freq,
float phase);
166WASM_IMPORT(
"audio",
"add_triangle")
167uint32_t _ffba_add_triangle(uint32_t parentID,
float freq,
float phase);
169WASM_IMPORT(
"audio",
"add_noise")
170uint32_t _ffba_add_noise(uint32_t parentID, int32_t seed);
172WASM_IMPORT(
"audio",
"add_empty")
173uint32_t _ffba_add_empty(uint32_t parentID);
175WASM_IMPORT(
"audio",
"add_zero")
176uint32_t _ffba_add_zero(uint32_t parentID);
178WASM_IMPORT(
"audio",
"add_file")
179uint32_t _ffba_add_file(uint32_t parentID, uintptr_t ptr, uintptr_t len);
183WASM_IMPORT(
"audio",
"add_mix")
184uint32_t _ffba_add_mix(uint32_t parentID);
186WASM_IMPORT(
"audio",
"add_all_for_one")
187uint32_t _ffba_add_all_for_one(uint32_t parentID);
189WASM_IMPORT(
"audio",
"add_gain")
190uint32_t _ffba_add_gain(uint32_t parentID,
float lvl);
192WASM_IMPORT(
"audio",
"add_loop")
193uint32_t _ffba_add_loop(uint32_t parentID);
195WASM_IMPORT(
"audio",
"add_concat")
196uint32_t _ffba_add_concat(uint32_t parentID);
198WASM_IMPORT(
"audio",
"add_pan")
199uint32_t _ffba_add_pan(uint32_t parentID,
float lvl);
201WASM_IMPORT(
"audio",
"add_mute")
202uint32_t _ffba_add_mute(uint32_t parentID);
204WASM_IMPORT(
"audio",
"add_pause")
205uint32_t _ffba_add_pause(uint32_t parentID);
207WASM_IMPORT(
"audio",
"add_track_position")
208uint32_t _ffba_add_track_position(uint32_t parentID);
210WASM_IMPORT(
"audio",
"add_low_pass")
211uint32_t _ffba_add_low_pass(uint32_t parentID,
float freq,
float q);
213WASM_IMPORT(
"audio",
"add_high_pass")
214uint32_t _ffba_add_high_pass(uint32_t parentID,
float freq,
float q);
216WASM_IMPORT(
"audio",
"add_take_left")
217uint32_t _ffba_add_take_left(uint32_t parentID);
219WASM_IMPORT(
"audio",
"add_take_right")
220uint32_t _ffba_add_take_right(uint32_t parentID);
222WASM_IMPORT(
"audio",
"add_swap")
223uint32_t _ffba_add_swap(uint32_t parentID);
225WASM_IMPORT(
"audio",
"add_clip")
226uint32_t _ffba_add_clip(uint32_t parentID,
float low,
float high);
230WASM_IMPORT(
"audio",
"mod_linear")
231void _ffba_mod_linear(uint32_t nodeID, uint32_t param,
float x_start,
float x_end, uint32_t start_at, uint32_t end_at);
233WASM_IMPORT(
"audio",
"mod_hold")
234void _ffba_mod_hold(uint32_t nodeID, uint32_t param,
float before,
float after, uint32_t time);
236WASM_IMPORT(
"audio",
"mod_adsr")
238 uint32_t nodeID, uint32_t param,
float low,
float high,
239 uint32_t attack, uint32_t decay, uint32_t sustain,
float sustain_level, uint32_t release);
241WASM_IMPORT(
"audio",
"mod_sine")
242void _ffba_mod_sine(uint32_t nodeID, uint32_t param,
float freq,
float low,
float high);
244WASM_IMPORT(
"audio",
"mod_square")
245void _ffba_mod_square(uint32_t nodeID, uint32_t param,
float low,
float high, uint32_t period);
247WASM_IMPORT(
"audio",
"mod_sawtooth")
248void _ffba_mod_sawtooth(uint32_t nodeID, uint32_t param,
float low,
float high, uint32_t period);
252WASM_IMPORT(
"audio",
"reset")
253void _ffba_reset(uint32_t nodeID);
255WASM_IMPORT(
"audio",
"reset_all")
256void _ffba_reset_all(uint32_t nodeID);
258WASM_IMPORT(
"audio",
"clear")
259void _ffba_clear(uint32_t nodeID);
261WASM_IMPORT(
"audio",
"set")
262void _ffba_set(uint32_t nodeID, uint32_t param,
float val);