Mercurial > remote-gamepad-server
diff ds.h @ 4:73c20831be0a
Replace DS input with 3DS, for now disable axis input.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 22 Feb 2015 18:09:53 +0100 |
parents | f362b20de51e |
children | eafcd170dc6d |
line wrap: on
line diff
--- a/ds.h +++ b/ds.h @@ -5,18 +5,37 @@ /* Describe Device */ -typedef struct ds_s{ - uint8_t A:1; /* Pressed or held buttons */ - uint8_t B:1; - uint8_t X:1; - uint8_t Y:1; - uint8_t L:1; - uint8_t R:1; - uint8_t Start:1; - uint8_t Select:1; - uint8_t aX; - uint8_t aY; -} __attribute__((packed)) ds_t; +typedef union { + uint32_t hex; + struct { + uint32_t a:1; /* Pressed or held buttons */ + uint32_t b:1; + uint32_t select:1; + uint32_t start:1; + uint32_t right:1; + uint32_t left:1; + uint32_t up:1; + uint32_t down:1; + uint32_t r:1; + uint32_t l:1; + uint32_t x:1; + uint32_t y:1; + uint32_t padding1:2; + uint32_t zl:1; + uint32_t zr:1; + uint32_t padding2:4; + uint32_t touch:1; + uint32_t padding3:3; + uint32_t c_right:1; + uint32_t c_left:1; + uint32_t c_up:1; + uint32_t c_down:1; + uint32_t circle_right:1; + uint32_t circle_left:1; + uint32_t circle_up:1; + uint32_t circle_down:1; + } __attribute__((packed)); +} ds_t; /*