<feed xmlns='http://www.w3.org/2005/Atom'>
<title>picow/src/game.h, branch main</title>
<subtitle>Launcher for the PICO-8 Wasm Runtime</subtitle>
<id>http://src.lordello.net/picow/atom/src/game.h?h=main</id>
<link rel='self' href='http://src.lordello.net/picow/atom/src/game.h?h=main'/>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/'/>
<updated>2026-10-29T10:31:08Z</updated>
<entry>
<title>Implement Cart Shutdown</title>
<updated>2026-10-29T10:31:08Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-29T10:31:08Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=f9950fce6f7b7a3743920f0d787fb1857aa05769'/>
<id>urn:sha1:f9950fce6f7b7a3743920f0d787fb1857aa05769</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Multicart Loading with BBS</title>
<updated>2026-10-27T14:26:20Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-27T14:26:20Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=8dda4698251ac7c724005a158d9c11e90a44c7e9'/>
<id>urn:sha1:8dda4698251ac7c724005a158d9c11e90a44c7e9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Implement Audio Device and Remaining ASM Consts</title>
<updated>2026-10-26T07:42:53Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-26T07:32:08Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=4957ca8373273721017fc8106b52d5bc6b2a0180'/>
<id>urn:sha1:4957ca8373273721017fc8106b52d5bc6b2a0180</id>
<content type='text'>
We abstract over SDL's audio subsystem and implement an audio
device that fits into PICO-8's model. We fixed the implementation
for the PICO-8 window focus and key buffer and can now actually
boot into PICO-8 games with working sounds and controls!

There are a few issues that remain:

1. There is no "exit" option in the pause menu, I think it thinks
   that we are on the BBS, and maybe there is someway to fix this?
2. The clipboard textarea is not implemented at all; we should
   keep a text buffer in `pw_input` and interact with SDL's
   clipboard system
3. Multicart's don't always work; in particular Undune II tries
   to download from the BBS, I would like to shim this somehow
   to support both `LOAD("FOO.P8")` and `LOAD("#FOO")` forms
   transparently.
</content>
</entry>
<entry>
<title>Improve Gamepad Handling</title>
<updated>2026-10-24T08:48:45Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-24T08:48:45Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=02da08e9d84371c558da6347210c00e3966f2dc5'/>
<id>urn:sha1:02da08e9d84371c558da6347210c00e3966f2dc5</id>
<content type='text'>
There were a few cases where we would have stale input information
becaues the `pw_input` only receives events while the game is
running. This fixes that by:

- Reseting the player count on game start
- Clearing button states for disconnected players
- Improve handling of the POOM player 2 support in case a second
  player connects
</content>
</entry>
<entry>
<title>Implement IO Syscalls</title>
<updated>2026-10-23T15:00:13Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-23T15:00:13Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=99fa88f971f23a3422f370d6f05b277c102ee9c3'/>
<id>urn:sha1:99fa88f971f23a3422f370d6f05b277c102ee9c3</id>
<content type='text'>
Now that we implemented our file-system, we can implement IO-related
syscalls and ASM constants and get further into the boot.

For now, we just use an in-memory userdat storage, but eventually,
I want to persist this to disk.

We can now boot to the point where we try to `invoke_vii`, which,
AFAIU, is the whole setjmp/longjmp machinery that I have to figure
out.
</content>
</entry>
<entry>
<title>Refactor Multicart Loading</title>
<updated>2026-10-19T18:55:01Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-19T18:55:01Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=381e246e73f271be2821dd9208edd2aa09bfc583'/>
<id>urn:sha1:381e246e73f271be2821dd9208edd2aa09bfc583</id>
<content type='text'>
When starting to implement the ASM constants, I noticed that the
multicart support would be _WAYYYYY_ easier if all the multicarts
are just passed in as embedded cart data.

Here, we modify the cart module to introduce a new "cartdat" type
that represents a cart export (either a single cart, for the regular
case, or multiple carts for the multicart case). This simplifies
lots of code, and allows us to use the ASM constants for passing in
cart data without additional glue logic.

It mimics how the PICO-8 export works for multi-cart code as well.

Lastly, cart names now include the `.p8` extension in the name,
to match how they work with the multicart export. I'm not sure how
this will interact with splore multi-cart loading (i.e.
`LOAD("#SOMECART")`).
</content>
</entry>
<entry>
<title>Use `wasm2c` instead of WAMR</title>
<updated>2026-10-17T08:52:27Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-17T08:52:27Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=d3c95fce3f5c8b910d3dc04ed5d8c1673944baf0'/>
<id>urn:sha1:d3c95fce3f5c8b910d3dc04ed5d8c1673944baf0</id>
<content type='text'>
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...
</content>
</entry>
<entry>
<title>wire up SDL events</title>
<updated>2026-10-15T07:05:16Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-15T07:05:16Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=f97bb735065392d639462e90d9abd1bb5f738c61'/>
<id>urn:sha1:f97bb735065392d639462e90d9abd1bb5f738c61</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Added Debug Stats</title>
<updated>2026-10-13T07:56:30Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-13T07:56:30Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=b5cc8d759a09ad2754efb671dc1af12d52fc542e'/>
<id>urn:sha1:b5cc8d759a09ad2754efb671dc1af12d52fc542e</id>
<content type='text'>
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...
</content>
</entry>
<entry>
<title>Implement Partial Emscripten SDL API</title>
<updated>2026-10-11T22:13:15Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-11T22:13:15Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=c6f5cca39dad3f395e8b479f6106feb10e710695'/>
<id>urn:sha1:c6f5cca39dad3f395e8b479f6106feb10e710695</id>
<content type='text'>
Start implementing the surface-specific SDL API so that we can get
our stub PICO-8 engine to draw a mouse crosshairs to screen.

The Emscripten runtime still needs its own file, and we need to
convert everything over to `wasm2c`.
</content>
</entry>
</feed>
