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