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
+20
View File
@@ -0,0 +1,20 @@
export fn set_mouse_motion(x: u16, y: u16, state: *uxn) void = {
state.dev[0x92] = (x >> 8): u8;
state.dev[0x93] = (x): u8;
state.dev[0x94] = (y >> 8): u8;
state.dev[0x95] = (y): u8;
};
export fn set_mouse_down(button: u8, state: *uxn) void = {
const cur = state.dev[0x96];
const new = cur | button;
state.dev[0x96] = new;
};
export fn set_mouse_up(button: u8, state: *uxn) void = {
const cur = state.dev[0x96];
const invbutton = 0xff ^ button;
const new = cur & invbutton;
state.dev[0x96] = new;
};