From 3e6bd232a43a01930109734034718ec1d04cf123 Mon Sep 17 00:00:00 2001 From: brand175 <20964160+brand175@users.noreply.github.com> Date: Wed, 14 Mar 2018 18:04:08 -0700 Subject: [PATCH 1/2] Fully Functional L and R Triggers with Experimental Analog Triggers I got the L and R Triggers to work. They are also combined with analog. If you want to disable the analogs until the next button press. You can hold the L and R Triggers at the same time and lift your finger off the one of the Triggers to deactivate only one analog at a time (You have to do this step in a certain way or it won't work). I cannot do both analogs since i have zero experience in coding and i am just learning by scanning though the code and assuming what does what and tons of testing before finalizing a update. --- GC4iOS/UI/EmulatorViewController.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/GC4iOS/UI/EmulatorViewController.mm b/GC4iOS/UI/EmulatorViewController.mm index 5be7769..2c9bf93 100644 --- a/GC4iOS/UI/EmulatorViewController.mm +++ b/GC4iOS/UI/EmulatorViewController.mm @@ -80,13 +80,16 @@ - (void)viewWillLayoutSubviews pad->substickX = (uint8_t)joyData[1].x; pad->substickY = (uint8_t)joyData[1].y; + + pad->triggerLeft = buttonState * 2; + pad->triggerRight = buttonState * 100; } // Create a new class to handle the controller later - (void)joystick:(NSInteger)joyid movedToPosition:(CGPoint)joyPosition { - joyData[joyid].x = joyPosition.x * 126 + 127; - joyData[joyid].y = joyPosition.y * 126 + 127; + joyData[joyid].x = joyPosition.x * 127 + 128; + joyData[joyid].y = joyPosition.y * 127 + 128; } - (void)buttonStateChanged:(u16)bState From c88036fa09bfc84c22871f07229c3cefaae8c32a Mon Sep 17 00:00:00 2001 From: brand175 <20964160+brand175@users.noreply.github.com> Date: Fri, 16 Mar 2018 16:26:42 -0700 Subject: [PATCH 2/2] Fixed incorrect R trigger buttonState (my mistake) The D-Pad was acting like the R trigger. I guess i didn't test all the buttons on the controller before updating ( i was excited ). --- GC4iOS/UI/EmulatorViewController.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GC4iOS/UI/EmulatorViewController.mm b/GC4iOS/UI/EmulatorViewController.mm index 2c9bf93..ec334bc 100644 --- a/GC4iOS/UI/EmulatorViewController.mm +++ b/GC4iOS/UI/EmulatorViewController.mm @@ -82,7 +82,7 @@ - (void)viewWillLayoutSubviews pad->substickY = (uint8_t)joyData[1].y; pad->triggerLeft = buttonState * 2; - pad->triggerRight = buttonState * 100; + pad->triggerRight = buttonState * 4; } // Create a new class to handle the controller later