diff options
author | Bad Diode <bd@badd10de.dev> | 2021-05-21 17:17:52 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-05-21 17:17:52 +0200 |
commit | af98fa608fb4ba98138e2b1239f173e6d74d6d86 (patch) | |
tree | 90fbdb03c81a61fef396cc22efcf3c1e2c2fdacd /src/main.c | |
parent | f59f673a721cf833bafed0705d2db01cd1f358a7 (diff) | |
download | uxngba-af98fa608fb4ba98138e2b1239f173e6d74d6d86.tar.gz uxngba-af98fa608fb4ba98138e2b1239f173e6d74d6d86.zip |
Add incomplete filesystem prototype
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -3,6 +3,7 @@ | |||
3 | #include "common.h" | 3 | #include "common.h" |
4 | #include "bitmap.h" | 4 | #include "bitmap.h" |
5 | #include "bd-font.c" | 5 | #include "bd-font.c" |
6 | #include "filesystem.c" | ||
6 | 7 | ||
7 | #include "uxn/uxn.h" | 8 | #include "uxn/uxn.h" |
8 | #include "uxn/uxn.c" | 9 | #include "uxn/uxn.c" |
@@ -266,6 +267,25 @@ int main(void) { | |||
266 | }, &ppu.fg); | 267 | }, &ppu.fg); |
267 | txt_position(0,0); | 268 | txt_position(0,0); |
268 | 269 | ||
270 | fs_init(); | ||
271 | |||
272 | // DEBUG:... | ||
273 | int file_idx; | ||
274 | if ((file_idx = fs_open_file("HELLO_FILE")) >= 0) { | ||
275 | fs_write("HEY", 3, file_idx, 0, false); | ||
276 | fs_write("THERE", 3, file_idx, 1, true); | ||
277 | txt_printf("nam: %s\n", filesystem.files[file_idx].name); | ||
278 | txt_printf("num: %d\n", filesystem.num_files); | ||
279 | txt_printf("size: %d\n", filesystem.files[file_idx].size); | ||
280 | } | ||
281 | if ((file_idx = fs_open_file("HELLO_FOLKS")) >= 0) { | ||
282 | fs_write("BY GOD", 6, file_idx, 0, false); | ||
283 | fs_write("XXX", 3, file_idx, 1, true); | ||
284 | txt_printf("nam: %s\n", filesystem.files[file_idx].name); | ||
285 | txt_printf("num: %d\n", filesystem.num_files); | ||
286 | txt_printf("size: %d\n", filesystem.files[file_idx].size); | ||
287 | } | ||
288 | |||
269 | // Main loop. | 289 | // Main loop. |
270 | int frame_counter = 0; | 290 | int frame_counter = 0; |
271 | evaluxn(&u, 0x0100); | 291 | evaluxn(&u, 0x0100); |