aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2025-04-20 10:16:42 +0200
committerNicholas Rodrigues Lordello <[email protected]>2025-04-20 10:16:42 +0200
commit00330b81483399020ec542c2bc7cdd2b452b5d2b (patch)
tree09b097ae6f0d50758927969e3f0575854393c161 /doc
parent4a23ae3522503fe9497ea8736bf5e8832b959951 (diff)
Fibonacci Test Passes
We can now run the fibonacci program, including a native function import. This is a great first step, and now we need to start implementing PICO-8 library functions (basically, `emcc` library, but one that is both more stubbed and supports the `setjmp` and `longjmp` which does not appear to be the case for the included implementation in WAMR). But before, a small build system refactoring detour to make building WAMR and PICO-w easier for both SDL platforms and Vita platform. Additionally, the platform stubs that we use in the WAMR test might need to change a bit, in order to allow PICO-w SDL and Vita platforms to implement certain details differently.
Diffstat (limited to 'doc')
-rw-r--r--doc/journal.md12
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/journal.md b/doc/journal.md
index 05e8b10..697c27c 100644
--- a/doc/journal.md
+++ b/doc/journal.md
@@ -1,16 +1,20 @@
-# 14.4.2025
+# 20.04.2025
+
+After some painful debugging, I figured out that `invokeNative` implementation in WAMR relied on platform and ABI specific semantics, and that `invokeNative_general.c` implementation was not portable. Instead, there is a `_raw` variant for native functions where the arguments and returns need to be manually setup and extracted, but this is portable and doesn't rely on platform specifics - so I will use this instead. Note that I stubbed out the `invokeNative` implementation so that you get runtime errors if you try and use it.
+
+# 14.04.2025
Nothing too exciting in the way of PICO-8 development, but we did settle on a PNG parsing library (`stb`) and now support extracting PICO-8 32kB roms from `.p8.png` files. It was mostly painless and not very interesting.
-# 12.4.2025
+# 12.04.2025
Started looking into Wasm runtimes to use, in particular ones that are portable C. The leading candidate right now is WebAssembly Micro Runtime (WAMR). Note that it even has Emscripten library support, so we have way fewer imports to implement.
-# 10.4.2025
+# 10.04.2025
Beutifying the exported JavaScript file yields some great results. In particular, it wasn't minified and instead just stripped of whitespace, making it legible. I was able to wrap imported and exported functions of the Wasm blob with some basic logging, making the process of reverse engineering what each of the imported functions are supposed to do.
-# 8.4.2025
+# 8.04.2025
First thing that I tested was exporting different carts and seeing what changed in the output (including exporting multi-carts). What I discovered was: