<feed xmlns='http://www.w3.org/2005/Atom'>
<title>picow/src/wasmrt.h, branch main</title>
<subtitle>Launcher for the PICO-8 Wasm Runtime</subtitle>
<id>http://src.lordello.net/picow/atom/src/wasmrt.h?h=main</id>
<link rel='self' href='http://src.lordello.net/picow/atom/src/wasmrt.h?h=main'/>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/'/>
<updated>2026-10-30T12:16:18Z</updated>
<entry>
<title>Fix Build for PS Vita Port</title>
<updated>2026-10-30T12:16:18Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-30T12:16:18Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=a64aa9dfa8abd7934f7969eaa2ee1086d4189eeb'/>
<id>urn:sha1:a64aa9dfa8abd7934f7969eaa2ee1086d4189eeb</id>
<content type='text'>
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).
</content>
</entry>
<entry>
<title>Support the Shutdown Option</title>
<updated>2026-10-28T23:45:24Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-28T23:45:24Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=ec6ed6404cdc29fc204eb93fdeb5025deb42f49d'/>
<id>urn:sha1:ec6ed6404cdc29fc204eb93fdeb5025deb42f49d</id>
<content type='text'>
It looks like the `SHUTDOWN` menu option shows up when the `-run`
CLI argument is passed, so pass it. There is a catch though, in
that PICO-8 does not properly report shutdown requests in those
cases, so read Wasm memory directly to detect the shutdown request.
</content>
</entry>
<entry>
<title>Implement Remaining Syscalls</title>
<updated>2026-10-28T21:44:04Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-28T21:44:04Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=5db0d1702e9ba8b64d71967bbd651cb38b649cd7'/>
<id>urn:sha1:5db0d1702e9ba8b64d71967bbd651cb38b649cd7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix Relative Mouse Motion</title>
<updated>2026-10-28T14:28:33Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-28T14:28:33Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=756750924357cae5ea9df48af3f55e17a2fd90e2'/>
<id>urn:sha1:756750924357cae5ea9df48af3f55e17a2fd90e2</id>
<content type='text'>
We do some fixes, namely fixing relative mouse motion which worked
very differently compared to mouse motion outside of pointer lock.
This appears to be something built in to PICO-8 itself (as evident by
keeping track of `STAT(32-33,38-39)` under pointer lock: PICO-8 scales
relative mouse motion by a factor of `.25` before adding to the
absolute mouse position.

Additionally, we support running PICO-w on systems with no audio
playback.
</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>Various Small Bug Fixes</title>
<updated>2026-10-23T21:03:39Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-23T20:07:14Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=1c4eada99c6f98eae40c676d261c8d4fc1de6079'/>
<id>urn:sha1:1c4eada99c6f98eae40c676d261c8d4fc1de6079</id>
<content type='text'>
</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>Implement Many Host Functions</title>
<updated>2026-10-19T07:58:25Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-19T07:58:25Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=b7d0c353c7ff265f4904fd710c96395078e1dbe9'/>
<id>urn:sha1:b7d0c353c7ff265f4904fd710c96395078e1dbe9</id>
<content type='text'>
Implemented many of the missing host functions, but some things are
still unimplemented:

1. Audio, because I have _no_ idea how that works.
2. Syscalls, they look hairy and will look into them separately.
3. ASM constants, we need to go over the array in the the exported
   JS module and understand how each one maps to our host.

The other functions are _mostly_ straightforward to implement, and
I did so with some caveats (for example, only supporting the single
format the PICO-8 uses for `strftime`) which is good enough for us.

Next, I need to refactor how we load carts: in particular, all
carts need to come from the `_cartdat` mechanism, so the "embedded"
carts instead of loading them ad-hoc. This requires us to refactor
how we do the multicart loading to pre-load the entire `.p8.dir`
when a cart is selected (instead of just keeping their names and
lazy-loading them in).
</content>
</entry>
<entry>
<title>Stubbed ALL Imports</title>
<updated>2026-10-17T23:02:12Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-17T23:02:12Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=c2336f885c2b26ac613124e06225291ee59a7c15'/>
<id>urn:sha1:c2336f885c2b26ac613124e06225291ee59a7c15</id>
<content type='text'>
Now the cart fails to boot (we trap on unimplemented stubs), but
a lot of small functionv have been setup.

Now the marathon begins for trying to understand what each of the
stubs do...
</content>
</entry>
<entry>
<title>Add Trap Handling</title>
<updated>2026-10-17T10:48:53Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-17T10:48:53Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=1aa6444759c2e564f5b99c0cd65f7c2bb134758a'/>
<id>urn:sha1:1aa6444759c2e564f5b99c0cd65f7c2bb134758a</id>
<content type='text'>
We implemented trap handing with setjmp/longjmp. This _should_ be
very widely supported, but it was _one_ nicety of WAMR: it did
not rely on this mechanism and would instead return errors on
runtime calls in case of a trap.

The implementation is fairly straightforward: we set a global
`jmp_buf` when installing a handler and longjmp in case of a
trap. Note that the handler also keeps the trap code, because
the C standard only requires `if (setjmp(buf))` to be supported,
i.e. "the entire controlling expression of `if`", meaning even
if it does return the code passed to `longjmp`, we can't really
do anything with it.

Added a `Esc` key handler in the PICO-8 stub to check traps
work, and they do :).
</content>
</entry>
</feed>
