Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dylwhich committed Nov 6, 2023
1 parent e2865ba commit 9d921bc
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions emulator/src/extensions/touch/ext_touch.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,22 +258,22 @@ static int32_t touchKey(uint32_t key, bool down)
{
// Map from state to touchpad rotation. Button bits are in URLD order
const int32_t phiMap[] = {
0, // 0b0000 ____ (0 radius)
0, // 0b0000 ____ (0 radius)
270, // 0b0001 ___D
180, // 0b0010 __L_
225, // 0b0011 __LD
0, // 0b0100 _R__
0, // 0b0100 _R__
315, // 0b0101 _R_D
0, // 0b0110 _RL_ (0 radius)
0, // 0b0110 _RL_ (0 radius)
270, // 0b0111 _RLD
90, // 0b1000 U___
0, // 0b1001 U__D (0 radius)
90, // 0b1000 U___
0, // 0b1001 U__D (0 radius)
135, // 0b1010 U_L_
180, // 0b1011 U_LD
45, // 0b1100 UR__
0, // 0b1101 UR_D
90, // 0b1110 URL_
0, // 0b1111 URLD (0 radius)
45, // 0b1100 UR__
0, // 0b1101 UR_D
90, // 0b1110 URL_
0, // 0b1111 URLD (0 radius)
};

if (key < '1' || key > '4')
Expand All @@ -293,7 +293,7 @@ static int32_t touchKey(uint32_t key, bool down)
emuTouch.keyState &= ~(1 << keyNum);
}

int32_t radius = 1024;
int32_t radius = 1024;
int32_t intensity = emuTouch.lastTouchIntensity;
// Check for the canceled-out positions where
switch (emuTouch.keyState)
Expand All @@ -302,12 +302,12 @@ static int32_t touchKey(uint32_t key, bool down)
case 6: // LR pressed
case 9: // UD pressed
case 15: // All pressed
radius = 0;
intensity = 0;
break;
radius = 0;
intensity = 0;
break;

default:
break;
break;
}

emulatorSetTouchJoystick(phiMap[emuTouch.keyState], radius, intensity);
Expand Down

0 comments on commit 9d921bc

Please sign in to comment.