From f4e7a6b4b94a99ca98021c34b34274b8f5a4f41a Mon Sep 17 00:00:00 2001 From: Sean Maas Date: Thu, 18 Feb 2021 16:51:53 -0500 Subject: [PATCH] Map left and right C buttons to the touch screen --- src/nds/nds_controller.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nds/nds_controller.c b/src/nds/nds_controller.c index dc24753b..b7aecbfb 100644 --- a/src/nds/nds_controller.c +++ b/src/nds/nds_controller.c @@ -53,4 +53,10 @@ void osContGetReadData(OSContPad *pad) { if (keys & KEY_RIGHT) { pad->stick_x = 80; } + + if (keys & KEY_TOUCH) { + touchPosition pos; + touchRead(&pos); + pad->button |= (pos.px < 128) ? L_CBUTTONS : R_CBUTTONS; + } }