Spliting UXN devices into seperate files
This commit is contained in:
@@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user