Skip to content

Commit

Permalink
Added Sonic Mania support
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtleMan64 authored Jul 22, 2018
1 parent 05ffecb commit b9650d4
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions JoystickDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,43 @@ public void setControllerDataHeroes(int buttons, float newX, float newY, float c
}
}

public void setControllerDataMania(int buttons, int stick)
{
A = buttons & 16;
B = buttons & 32;
Y = buttons & 128;
X = buttons & 64;
S = stick & 32; //Enter key sets both 16 and 32 bit
R = 0;
L = 0;

joyX = 0;
joyY = 0;

int up = stick & 1;
int down = stick & 2;
int left = stick & 4;
int right = stick & 8;

if (right != 0)
{
joyX = 127;
}
else if (left != 0)
{
joyX = -128;
}

if (up != 0)
{
joyY = 127;
}
else if (down != 0)
{
joyY = -128;
}
}

protected override void OnPaint(PaintEventArgs e)
{
if (A != 0)
Expand Down

0 comments on commit b9650d4

Please sign in to comment.