aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2026-10-29Prebuild System FilesNicholas Rodrigues Lordello
In order to make it easier to build `picow` on systems _without_ PICO-8 support (which what this project targets...), we added a system for producing a `system.tar.gz` tarball that contains the generated system source required for building PICO-w (namely, the `pico8.wasm` transpiled to C, and the `sysroot` with the embedded data files needed by the application). I also moved away from `a b c: ...` style recipes, as they run multiple times in parallelized builds. I made it compatible with older `make`s, and it will hopefully generally work.
2026-10-23Various Small Bug FixesNicholas Rodrigues Lordello
2026-10-22Introduce Virtual File-SystemNicholas Rodrigues Lordello
PICO-8 carts write to a file-system when running carts, even ones that don't do anything. From what I can tell, it records cart changes to an `IndexDB` file-system in the Emscripten bundle, so things like `CSTORE(...)` persist for a given cart. It uses the same system calls for also: - Reading the `data.pod` file, which contains some data for boot - Writing logs to `stdout`, which we mimic by producing `SDL_Log`s Persistance will be handled later, by reading and writing to a UStar file (since they are simple, and allow us to keep all cart-specific save data in one file). None of this is hooked up to the `env.c` Emscripten glue code port.
2026-10-17Use `wasm2c` instead of WAMRNicholas Rodrigues Lordello
Instead of interpreting Wasm, compile it ahead of time to C and run that instead: - it is much faster (no interpreter overhead) - it is easier to implement host functions, they are just C calls This works well for us since we only ever load a single Wasm blob (the PICO-8 runtime that `picow` is built with). There was some fun figuring out how big-endian stuff works (WRT memory layout), but otherwise it was pretty straight forward. Note that traps are still not working, I need to figure that out still...
2026-10-13Added Debug StatsNicholas Rodrigues Lordello
We now print debug stats (ATM, just FPS) overlaying the actual game. We use the PICO-8 font to keep things consistent; I probable should choose a better color though...
2026-10-10Fixed Minor Portability IssuesNicholas Rodrigues Lordello
2026-09-30WASM Main LoopNicholas Rodrigues Lordello
Getting the full PICO-8 bindings working right off the bat is way too daunting: instead create a small stub so that we can wire up the WASM code to do the main PICO-8 WASM setup: 1. Build the environment (stubbed out for now, but in theory this would allocate space to store environment variable strings). 2. Call the `_main` function which sets a "main loop" callback; making sure to allocate memory for `argv`. And then the main loop: call the main loop callback function with the Emscripten `dynCall` builtin and then the PICO-8 specific audio mixing function; this was determined experimentally by attaching a debugger to a running exported PICO-8 cartridge.
2026-09-28Introduce Cart ModuleNicholas Rodrigues Lordello
In an effort to split up `picow.c` into smaller modules, add a `cart` module that includes logic for listing and loading cart files. We also added multi-cart support (by creating special `.p8.dir` directories for each individual parent cart that specifies which carts can be loaded in-game). Small fixes to the Makefile.
2026-09-17Generate Sysroot in Build DirectoryNicholas Rodrigues Lordello
This is a mouthful! We now generate `sysroot.c` **and** its corresponding header file `sysroot.h`. We also made a few modifications to the Makefile to better support out builds: - We now output to `build/` - this plays nicer with tooling as that is the typical directory created by CMake, and helps with things like `compile_commands.json` being automagically picked up by `clangd`. - We now have a recipe for building a `compile_commands.json` file, so that `clangd` can provide LSP support out-of-the box. It works by creating a small wrapper `ccj` compiler that adds the required `-MJ <path>` option to clang. This is an adhoc solution to avoid pulling in additional build dependencies to the project, and works well enough :)
2026-06-27Initialize WASM ModuleNicholas Rodrigues Lordello
We now load the PICO-8 WebAssembly module and, unsuccessfully, try to instantiate it on game selection. The failure is expected, as we have not completely implemented the host functions that we need to in order to make everything work.
2026-06-22Generate Unknown CartNicholas Rodrigues Lordello
Add an `unknown.p8` cart that is part of the sysroot and displayed when `picow` is unable to load carts (either because it cannot read the cart directory, or it contains a malformed cart).
2026-06-21Remove Boot CartNicholas Rodrigues Lordello
Instead of a boot cart (which would just be really complicated to properly implement), just implement a basic game selector in SDL directly. We can just implement a very basic cart selection interface that cycles through all carts in the cart directory (supporting `.p8`, `.p8.png` and `.p8.rom` formats).
2025-06-14Embed Sysroot Into BinaryNicholas Rodrigues Lordello
We now embed the PICO-w sysroot files (the WASM blob, data pod and boot rom) into the final `picow` binary in order to simplify distribution. This commit adds a new `generate-sysroot` tool to achieve it.
2025-04-15Minor FixesNicholas Rodrigues Lordello
- `argv` size specifier - WASM -> Wasm
2025-04-14PNG Cart SupportNicholas Rodrigues Lordello
We now support loading cart roms from .p8.png file :tada:!
2025-04-12Extra PICO-8 Data PodNicholas Rodrigues Lordello
Add a tool for extracting the PICO-8 data.pod file that is exported with the cart. This includes (on inspecting the binary) the boot sequence cart among some other things. It is written as a quick and dirty C program (since we will have to practice our C anyway).