| Age | Commit message (Collapse) | Author |
|
|
|
|
|
I forgot to commit the makefile configuration, and also added some
other small improvements to help with the poor performance (still
only around 20 FPS).
|
|
Compile PICO-w for the PS Vita :tada:.
Fixes some minor compiler warnings that only showed up because
of the different compilation target, and makes the Makefile port
system a little more opinionated.
|
|
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.
|
|
|
|
Note that we fail to build on linking errors - we have a lot of
missing `env` functions to implement since moving away from the
stub.
Now the real fun begins...
|
|
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...
|
|
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...
|
|
We now read a `config.ini` from the SDL preference path for
options and parse CLI.
We now also disable `getopt` parsing on platforms that do not
support it, falling back to the `config.ini` system in those cases.
Additionally, carts are read from that directory as well -
allowing us to simplify the build system (as we no longer build
any `.p8.png` files in the `carts` directory).
|
|
|
|
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.
|
|
We now build STB image library directly in the `cart` module, so
we no longer need to build it as a static library.
|
|
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.
|
|
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 :)
|
|
We now have a monolithic Makefile which is, IMO, easier to grok.
Additionally, all building happens in the `target/` directory to
keep things cleaner.
The makefile also considers cross-compilation by distinguishing
between the target C compiler and a host C compiler (used for tools
needed for code generation).
Lastly, dependencies are compiled into static libraries, to keep
the process more organized (we used to just link a bunch of object
files as a final step, now we pack the dependencies into archives
and link them as a final step; so no effective difference).
|
|
We build with C99 and enable more warnings. I want to refactor the
build system a bit, as it is not conventional at the moment, and
I think a top-level single Makefile will actually be nicer. I also
want to build intermediate `.a` archives for the `libs/` to clearly
seperate them as a "vendored dependency".
|
|
We now have two separate scenes with some basic code for managing
them as well as switching to a new scene:
- Cart selection
- In-game
Additionally, we started linting with `clang-tidy`; suppress some
warning around `fprintf` and `memset` usage which are fine in our
case.
|
|
The `png` module was tiny and not worth being on its own. Instead
build the STB image code into a `lib/stbi.c`. This was prompted
because we wanted to lint with `clang-tidy` and it was pulling in
STB code because it is a single header library.
|
|
Build the `pico8` sysroot cart for testing.
|
|
I had tried to split the PICO-w stuff into a separate library
and have individual platform code, but I will instead embrace the
SDL and just build on top of it.
|
|
We now build WAMR sources directly into our binary (instead of using a
static library). Additionally, we now split the build into multiple
files to make things more manageable.
|
|
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.
|
|
We now have a "sysroot" folder with a "boot" cart, and a separate
"carts" folder containing the games.
|
|
We move some stuff to the `picow` library, and move around code in the
SDL platform. I'm pretty set on making the SDL platform the "defacto"
platform implementation.
|
|
And small build system changes.
|
|
|
|
We now support loading cart roms from .p8.png file :tada:!
|
|
We can decode PNGs from memory buffers, and soon be able to also load
the cart roms from there.
Still need to figure out if how the scanlines are organized in memory
are correct, or if I got some order backwards (I'm new to C
multi-dimentional arrays hehe...)
|
|
We now start an SDL3 front-end for PICO-w. We can load roms :)
|
|
We now keep carts (including potential test carts) in a `carts` folder
and distinguish between cart exports and system files (i.e. the PICO-8
WASM blob and the data pod).
|
|
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).
|
|
|