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; };