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",
"flip_x")
18WASM_IMPORT(
"graphics",
"flip_y")
21WASM_IMPORT(
"graphics",
"set_color")
22void _ffb_set_color(int32_t c, int32_t r, int32_t g, int32_t b);
24WASM_IMPORT(
"graphics",
"draw_point")
25void _ffb_draw_point(int32_t x, int32_t y, int32_t c);
27WASM_IMPORT(
"graphics",
"draw_line")
28void _ffb_draw_line(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t color, int32_t stroke_width);
30WASM_IMPORT(
"graphics",
"draw_rect")
31void _ffb_draw_rect(int32_t x, int32_t y, int32_t w, int32_t h, int32_t fc, int32_t sc, int32_t sw);
33WASM_IMPORT(
"graphics",
"draw_rounded_rect")
34void _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);
36WASM_IMPORT(
"graphics",
"draw_circle")
37void _ffb_draw_circle(int32_t x, int32_t y, int32_t d, int32_t fc, int32_t sc, int32_t sw);
39WASM_IMPORT(
"graphics",
"draw_ellipse")
40void _ffb_draw_ellipse(int32_t x, int32_t y, int32_t w, int32_t h, int32_t fc, int32_t sc, int32_t sw);
42WASM_IMPORT(
"graphics",
"draw_triangle")
43void _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);
45WASM_IMPORT(
"graphics",
"draw_arc")
46void _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);
48WASM_IMPORT(
"graphics",
"draw_sector")
49void _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);
51WASM_IMPORT(
"graphics",
"draw_text")
52void _ffb_draw_text(uintptr_t textPtr, int32_t textLen, uintptr_t fontPtr, int32_t fontLen, int32_t x, int32_t y, int32_t color);
54WASM_IMPORT(
"graphics",
"draw_qr")
55void _ffb_draw_qr(uintptr_t ptr, int32_t len, int32_t x, int32_t y, int32_t black, int32_t white);
57WASM_IMPORT(
"graphics",
"draw_image")
58void _ffb_draw_image(uintptr_t ptr, int32_t len, int32_t x, int32_t y);
60WASM_IMPORT(
"graphics",
"draw_sub_image")
61void _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);
63WASM_IMPORT(
"graphics",
"draw_sub_tile")
64void _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);
66WASM_IMPORT(
"graphics",
"draw_sub_tile")
67void _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);
69WASM_IMPORT(
"graphics",
"set_canvas")
70void _ffb_set_canvas(uintptr_t ptr, uintptr_t len);
72WASM_IMPORT(
"graphics",
"unset_canvas")
73void _ffb_unset_canvas();
77WASM_IMPORT(
"input",
"read_pad")
78int32_t _ffb_read_pad(int32_t player);
80WASM_IMPORT(
"input",
"read_buttons")
81int32_t _ffb_read_buttons(int32_t player);
85WASM_IMPORT(
"fs",
"get_file_size")
86int32_t _ffb_get_file_size(uintptr_t pathPtr, uintptr_t pathLen);
88WASM_IMPORT(
"fs",
"load_file")
89uintptr_t _ffb_load_file(uintptr_t pathPtr, uintptr_t pathLen, uintptr_t bufPtr, uintptr_t bufLen);
91WASM_IMPORT(
"fs",
"dump_file")
92uintptr_t _ffb_dump_file(uintptr_t pathPtr, uintptr_t pathLen, uintptr_t bufPtr, uintptr_t bufLen);
94WASM_IMPORT(
"fs",
"remove_file")
95void _ffb_remove_file(uintptr_t pathPtr, uintptr_t pathLen);
99WASM_IMPORT(
"net",
"get_me")
100int32_t _ffb_get_me();
102WASM_IMPORT(
"net",
"get_peers")
103int32_t _ffb_get_peers();
105WASM_IMPORT(
"net",
"save_stash")
106void _ffb_save_stash(int32_t peerID, uintptr_t bufPtr, uintptr_t bufLen);
108WASM_IMPORT(
"net",
"load_stash")
109int32_t _ffb_load_stash(int32_t peerID, uintptr_t bufPtr, uintptr_t bufLen);
113WASM_IMPORT(
"misc",
"add_progress")
114uintptr_t _ffb_add_progress(int32_t peerID, uintptr_t badgeID, int32_t val);
116WASM_IMPORT(
"misc",
"add_score")
117int32_t _ffb_add_score(int32_t peerID, uintptr_t badgeID, int32_t val);
121WASM_IMPORT(
"misc",
"add_menu_item")
122void _ffb_add_menu_item(uintptr_t index, uintptr_t ptr, uintptr_t len);
124WASM_IMPORT(
"misc",
"remove_menu_item")
125void _ffb_remove_menu_item(uintptr_t index);
127WASM_IMPORT(
"misc",
"open_menu")
128void _ffb_open_menu();
132WASM_IMPORT(
"misc",
"log_debug")
133void _ffb_log_debug(uintptr_t ptr, uintptr_t len);
135WASM_IMPORT(
"misc",
"log_error")
136void _ffb_log_error(uintptr_t ptr, uintptr_t len);
138WASM_IMPORT(
"misc",
"set_seed")
139void _ffb_set_seed(uintptr_t seed);
141WASM_IMPORT(
"misc",
"get_random")
142uintptr_t _ffb_get_random();
144WASM_IMPORT(
"misc",
"get_time")
145uint64_t _ffb_get_time();
147WASM_IMPORT(
"misc",
"get_name")
148uintptr_t _ffb_get_name(int32_t peerID, uintptr_t ptr, uintptr_t len);
150WASM_IMPORT(
"misc",
"get_settings")
151uint64_t _ffb_get_settings(int32_t peerID);
153WASM_IMPORT(
"misc",
"restart")
156WASM_IMPORT(
"misc",
"quit")
163WASM_IMPORT(
"audio",
"add_sine")
164uint32_t _ffba_add_sine(uint32_t parentID,
float freq,
float phase);
166WASM_IMPORT(
"audio",
"add_square")
167uint32_t _ffba_add_square(uint32_t parentID,
float freq,
float phase);
169WASM_IMPORT(
"audio",
"add_sawtooth")
170uint32_t _ffba_add_sawtooth(uint32_t parentID,
float freq,
float phase);
172WASM_IMPORT(
"audio",
"add_triangle")
173uint32_t _ffba_add_triangle(uint32_t parentID,
float freq,
float phase);
175WASM_IMPORT(
"audio",
"add_noise")
176uint32_t _ffba_add_noise(uint32_t parentID, int32_t seed);
178WASM_IMPORT(
"audio",
"add_empty")
179uint32_t _ffba_add_empty(uint32_t parentID);
181WASM_IMPORT(
"audio",
"add_zero")
182uint32_t _ffba_add_zero(uint32_t parentID);
184WASM_IMPORT(
"audio",
"add_file")
185uint32_t _ffba_add_file(uint32_t parentID, uintptr_t ptr, uintptr_t len);
189WASM_IMPORT(
"audio",
"add_mix")
190uint32_t _ffba_add_mix(uint32_t parentID);
192WASM_IMPORT(
"audio",
"add_all_for_one")
193uint32_t _ffba_add_all_for_one(uint32_t parentID);
195WASM_IMPORT(
"audio",
"add_gain")
196uint32_t _ffba_add_gain(uint32_t parentID,
float lvl);
198WASM_IMPORT(
"audio",
"add_loop")
199uint32_t _ffba_add_loop(uint32_t parentID);
201WASM_IMPORT(
"audio",
"add_concat")
202uint32_t _ffba_add_concat(uint32_t parentID);
204WASM_IMPORT(
"audio",
"add_pan")
205uint32_t _ffba_add_pan(uint32_t parentID,
float lvl);
207WASM_IMPORT(
"audio",
"add_mute")
208uint32_t _ffba_add_mute(uint32_t parentID);
210WASM_IMPORT(
"audio",
"add_pause")
211uint32_t _ffba_add_pause(uint32_t parentID);
213WASM_IMPORT(
"audio",
"add_track_position")
214uint32_t _ffba_add_track_position(uint32_t parentID);
216WASM_IMPORT(
"audio",
"add_low_pass")
217uint32_t _ffba_add_low_pass(uint32_t parentID,
float freq,
float q);
219WASM_IMPORT(
"audio",
"add_high_pass")
220uint32_t _ffba_add_high_pass(uint32_t parentID,
float freq,
float q);
222WASM_IMPORT(
"audio",
"add_take_left")
223uint32_t _ffba_add_take_left(uint32_t parentID);
225WASM_IMPORT(
"audio",
"add_take_right")
226uint32_t _ffba_add_take_right(uint32_t parentID);
228WASM_IMPORT(
"audio",
"add_swap")
229uint32_t _ffba_add_swap(uint32_t parentID);
231WASM_IMPORT(
"audio",
"add_clip")
232uint32_t _ffba_add_clip(uint32_t parentID,
float low,
float high);
236WASM_IMPORT(
"audio",
"mod_linear")
237void _ffba_mod_linear(uint32_t nodeID, uint32_t param,
float x_start,
float x_end, uint32_t start_at, uint32_t end_at);
239WASM_IMPORT(
"audio",
"mod_hold")
240void _ffba_mod_hold(uint32_t nodeID, uint32_t param,
float before,
float after, uint32_t time);
242WASM_IMPORT(
"audio",
"mod_adsr")
244 uint32_t nodeID, uint32_t param,
float low,
float high,
245 uint32_t attack, uint32_t decay, uint32_t sustain,
float sustain_level, uint32_t release);
247WASM_IMPORT(
"audio",
"mod_sine")
248void _ffba_mod_sine(uint32_t nodeID, uint32_t param,
float freq,
float low,
float high);
250WASM_IMPORT(
"audio",
"mod_square")
251void _ffba_mod_square(uint32_t nodeID, uint32_t param,
float low,
float high, uint32_t period);
253WASM_IMPORT(
"audio",
"mod_sawtooth")
254void _ffba_mod_sawtooth(uint32_t nodeID, uint32_t param,
float low,
float high, uint32_t period);
258WASM_IMPORT(
"audio",
"reset")
259void _ffba_reset(uint32_t nodeID);
261WASM_IMPORT(
"audio",
"reset_all")
262void _ffba_reset_all(uint32_t nodeID);
264WASM_IMPORT(
"audio",
"clear")
265void _ffba_clear(uint32_t nodeID);
267WASM_IMPORT(
"audio",
"set")
268void _ffba_set(uint32_t nodeID, uint32_t param,
float val);