<feed xmlns='http://www.w3.org/2005/Atom'>
<title>picow/src/input.h, branch main</title>
<subtitle>Launcher for the PICO-8 Wasm Runtime</subtitle>
<id>http://src.lordello.net/picow/atom/src/input.h?h=main</id>
<link rel='self' href='http://src.lordello.net/picow/atom/src/input.h?h=main'/>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/'/>
<updated>2026-10-29T10:59:24Z</updated>
<entry>
<title>Minor Fixes</title>
<updated>2026-10-29T10:59:24Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-29T10:52:30Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=e51027a576a07ffb41b6e7d2bfc3aade6ae091d7'/>
<id>urn:sha1:e51027a576a07ffb41b6e7d2bfc3aade6ae091d7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add Clipboard Support</title>
<updated>2026-10-29T10:30:06Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-29T10:30:06Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=668594a0bedec468e976a38bbf9eac871e1353de'/>
<id>urn:sha1:668594a0bedec468e976a38bbf9eac871e1353de</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>Improve Mouse Position Handling</title>
<updated>2026-10-24T10:26:16Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-24T10:26:16Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=f43e306bf050b9f96be4b22382cacd96d86b5239'/>
<id>urn:sha1:f43e306bf050b9f96be4b22382cacd96d86b5239</id>
<content type='text'>
After some playing around with devkit mode, I noticed two things:

1. The mouse pointer can be outside of the range [0. 128) in case
   the window is larger than the PICO-8 screen, but it does not
   move to positions that would be outside of the window
2. Under pointer lock, relative positions continue to be reported
   even when the mouse is stuck to the edge of the window

This means our implementation was slightly wrong, as it it did
not properly handle the second case in a few ways:

- We would always round to integer relative mouse mouse motions,
  meaning we would incorrectly approximate in case we collected
  multiple frames of relative mouse motion
- We would compute the relative motion based on the mouse position,
  which is incorrect under pointer lock (as the position doesn't
  change but PICO-8 still needs relative mouse motion)
- We would reset relative mouse motion every frame, meaning that
  we would not correctly accumulate relative motion in case the
  host's refresh rate was faster than PICO-8's (which seems to
  only run its frame logic at 30 FPS).

We fix that here.
</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>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>More ASM Constants</title>
<updated>2026-10-21T05:32:59Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-21T05:32:59Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=131675bb507d96bea1b0ad20e0022d53171fad2a'/>
<id>urn:sha1:131675bb507d96bea1b0ad20e0022d53171fad2a</id>
<content type='text'>
We also implement some additional mouse functionality for pointer
locking and for reading the mouse wheel (although, that is currently
not hooked up over the ASM constants quite yet).
</content>
</entry>
<entry>
<title>Started Implementing ASM Constants</title>
<updated>2026-10-19T20:47:49Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-10-19T20:47:49Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/picow/commit/?id=312c3c345b5b72a69ba6ee1bf50697eed18c2775'/>
<id>urn:sha1:312c3c345b5b72a69ba6ee1bf50697eed18c2775</id>
<content type='text'>
</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>
</feed>
