aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2026-10-29 19:24:31 +0100
committerNicholas Rodrigues Lordello <[email protected]>2026-10-29 19:24:31 +0100
commit4bfe4900b80c17702d9e2c02b1740c790537d5bd (patch)
tree97c8acc9dd04fce8a8241c3488baff8a96fa88cf /src
parent93a202d1fa6cd05b494bbf7175d79c6da075f333 (diff)
Add PS Vita Port
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.
Diffstat (limited to 'src')
-rw-r--r--src/fs.c2
-rw-r--r--src/input.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/fs.c b/src/fs.c
index 77b34ee..9af58a9 100644
--- a/src/fs.c
+++ b/src/fs.c
@@ -660,10 +660,12 @@ bool pw_fs_seek(struct pw_fs *fs, pw_fd fd, int64_t offset,
// This is a little weird - but the final position needs to fit in
// a signed 64-bit value (even if we use unsigned `size_t` values
// internally). In practice, this should not matter.
+#if SIZE_MAX > INT64_MAX
if (pos > INT64_MAX) {
fs->err = PW_EOVERFLOW;
return SDL_SetError("seek overflows PICO-8 maximum position");
}
+#endif
s->pos = pos;
if (newpos) {
diff --git a/src/input.c b/src/input.c
index f85c63c..8eaf6d0 100644
--- a/src/input.c
+++ b/src/input.c
@@ -256,12 +256,12 @@ static int8_t scancode_to_p8scii(SDL_Scancode sc, SDL_Keymod mod) {
#define PW_SCANCODE_MOD_SHIFT 9
static bool handle_key(struct pw_input *input, SDL_KeyboardEvent *event) {
- if (event->scancode < 0 || event->scancode > PW_SCANCODE_MASK) {
+ uint32_t sc = (uint32_t)event->scancode;
+ if (sc > PW_SCANCODE_MASK) {
// Ignore unsupported scancodes.
return true;
}
- uint32_t sc = (uint32_t)event->scancode;
if (event->down) {
sc |= PW_SCANCODE_PRESSED;
}