~foura/uxn900

01584dc45ac5efb9e54fb6231a21bdd4fdf2e65c — james palmer 2 months ago 3a626ba
controller: use volume keys as a and b buttons.

should be able to fully play donsol now.
excited posts to follow when my n900 charges up.
1 files changed, 6 insertions(+), 3 deletions(-)

M src/dev/controller.c
M src/dev/controller.c => src/dev/controller.c +6 -3
@@ 68,15 68,18 @@ controller_init(Controller *ctrl)
static void
controller_button(Controller *ctrl, Uxn *u, Uint8 code)
{
	if(ctrl->raw.curmods & 2)
		return;

	switch(code) {
	case 0x39: ctrl->buttons |= 0x01; break; /* a (volume up) */
	case 0x3a: ctrl->buttons |= 0x02; break; /* b (volume down) */
	case 0x12: ctrl->buttons |= 0x10; break; /* up */
	case 0x21: ctrl->buttons |= 0x20; break; /* down */
	case 0x1f: ctrl->buttons |= 0x40; break; /* left */
	case 0x22: ctrl->buttons |= 0x80; break; /* right */
	}

	/* arrow keys should not trigger if fn is pressed (says u-boot) */
	if(ctrl->raw.curmods & 2)
		ctrl->buttons &= 0x0f;
}

static void