Spliting UXN devices into seperate files

This commit is contained in:
JJ Bliss
2026-04-30 15:30:26 -04:00
parent c2b83959c4
commit 09779e9134
5 changed files with 374 additions and 370 deletions
+19
View File
@@ -0,0 +1,19 @@
export fn set_controller_down(button: u8, state: *uxn) void = {
const cur = state.dev[0x82];
const new = cur | button;
state.dev[0x82] = new;
};
export fn set_controller_up(button: u8, state: *uxn) void = {
const cur = state.dev[0x82];
const invbutton = 0xff ^ button;
const new = cur & invbutton;
state.dev[0x82] = new;
};
export fn set_key_down(key: u8, state: *uxn) void = {
state.dev[0x83] = key;
};
export fn clear_key_down(state: *uxn) void = {
state.dev[0x83] = 0;
};