Skip to content

Commit

Permalink
v0.99 Android compatibility new button layout
Browse files Browse the repository at this point in the history
v0.99
- changed USB Usage ID to game pad to comply with Android and Windows
simultaneously
- new button layout to fully conform with Android while maintaining
Windows compatibility
  • Loading branch information
rsn8887 committed Jul 16, 2015
1 parent 40dfacc commit 1b475c8
Show file tree
Hide file tree
Showing 24 changed files with 2,075 additions and 1,540 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# RetroAdapterMod
Mod of Paul Qureshi's Mojo RetroAdapter Firmware

Paul Qureshi RetroAdapter Firmware v2.1a Mod v0.97
Paul Qureshi RetroAdapter Firmware v2.1a Mod v0.99
--------------------------------------------------

References
Expand Down
1,413 changes: 729 additions & 684 deletions RetroAdapterV2_ArcadeMode.hex

Large diffs are not rendered by default.

1,415 changes: 730 additions & 685 deletions RetroAdapterV2_NormalMode.hex

Large diffs are not rendered by default.

85 changes: 61 additions & 24 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,55 @@
v0.99
- changed USB Usage ID to game pad to comply with Android and Windows simultaneously
- new button layout to fully conform with Android while maintaining Windows compatibility
/* Button mapping to conform with Android:
button 1: bottom button (SNES B, PSX Cross, NegCon B, NES B, NeoGeo A, Genesis A, Gamecube A, N64 A. PCE II),
button 2: right button (SNES A, PSX Circle, NegCon A, NES A, Neogeo B, Genesis B, Gamecube X, N64 Yellow Down, PCE I)

button 4: left button (SNES Y, PSX Square, NeoGeo C, Genesis C, Gamecube B, N64 B),
button 5: upper button (SNES X, PSX Triangle, NeoGeo D, Genesis X, Gamecube Y, N64 Yellow Up)

button 7: Left Shoulder (PSX L1, Genesis Y, Gamecube L, N64 L, Saturn L)
button 8: Right Shoulder (PSX R1 Genesis Z, Gamecube R, N64 R, Saturn R)

button 9: Misc 1 (PSX L2, N64 Yellow Left),
button 10: Misc 2 (PSX R2, N64 Yellow Right),

button 11: Select
button 12: Start (PC Engine Play, Genesis Mode)

button 14: Misc 3 (PSX L3, N64 Z, Gamecube Z)
button 15: Misc 4 (PSX R3)

Analog axes:
Left Joystick: x,y
Right Joystick: z,Rz

NegCon mode axes (device name changes to "Mojo Retro Adapter Mod NegCon" instead of "Mojo Retro Adapter Mod" when a NegCon is detected):
Steering (twist): x
Button I: z (0..255 in NegCon mode instead of -128..127)
Button II: "Accelerator" axis (not shown in Windows, but registered nonetheless)
Button L: "Brake" axis (not shown in Windows, but registered nonetheless)
*/

v0.98
- The adapter now reports as "Retro Adapter Mod NegCon" instead of "Retro Adapter Mod" when a PSX NegCon type controller is attached, because it then implements three additional sliders for the analog buttons.
- To make NegCon work better with Android, I changed the analog buttons to Brake (Axis_Brake in Android) Accelerator (Axis_Gas in Android), as well as Slider (Axis_Throttle in Android) for the three analog buttons. Axis_Gas does not show up in the windows control panel, but Windows does register it.

v0.97
- Right analog stick and DPAD now work correctly in Android. (Android expects second analog stick to be reported as Z/Rz axes instead of Rx/Ry. Also DPAD was reported as 4 bits instead of 8, breaking compatibility with android. This is now all fixed.)
- Just for reference, the new button config since v0.96:
button 1: bottom button (SNES B, PSX Cross, NES A, NeoGeo A, Genesis A),
button 2: left button (SNES Y, PSX Square, NES B, NeoGeo B, Genesis B),
button 3: upper button (SNES X, PSX Triangle, NeoGeo C, Genesis C, Gamecube Y, N64 Yellow Up)
button 4: right button (SNES A, PSX Circle, Neogeo D, Genesis X, Gamecube X, N64 Yellow Down)
button 5: Misc 1 (PSX L2, Genesis Y, N64 Yellow Left),
button 6: Misc 2 (PSX R2, Genesis Z, N64 Yellow Right),
button 7: Left Shoulder (PSX L1, Gamecube L, N64 L)
button 8: Right Shoulder (PSX R1 Gamecube R, N64 R)
button 9: (Select, Gamecube Z, N64 Z)
button 10: (Start, Play)
button 11: Misc 3 (PSX L3)
button 12: Misc 4 (PSX R3)
button 1: bottom button (SNES B, PSX Cross, NES A, NeoGeo A, Genesis A),
button 2: left button (SNES Y, PSX Square, NES B, NeoGeo B, Genesis B),
button 3: upper button (SNES X, PSX Triangle, NeoGeo C, Genesis C, Gamecube Y, N64 Yellow Up)
button 4: right button (SNES A, PSX Circle, Neogeo D, Genesis X, Gamecube X, N64 Yellow Down)
button 5: Misc 1 (PSX L2, Genesis Y, N64 Yellow Left),
button 6: Misc 2 (PSX R2, Genesis Z, N64 Yellow Right),
button 7: Left Shoulder (PSX L1, Gamecube L, N64 L)
button 8: Right Shoulder (PSX R1 Gamecube R, N64 R)
button 9: (Select, Gamecube Z, N64 Z)
button 10: (Start, Play)
button 11: Misc 3 (PSX L3)
button 12: Misc 4 (PSX R3)

v0.96
- PSX L1/R1 where swapped with PSX L2/R2 swapped in normal and arcade mode. This is now fixed.
Expand Down Expand Up @@ -43,18 +80,18 @@ v0.91
- adjusted all PSX timings to hopefully be more robust against slight changes in clock timings and delays etc.
- changed button mappings in Normal Mode and Arcade Mode for all supported controllers to be more consistent, new mappings:

button 1: bottom button (SNES B, PSX Cross, NES A, NeoGeo A, Genesis A),
button 2: left button (SNES Y, PSX Square, NES B, NeoGeo B, Genesis B),
button 3: upper button (SNES X, PSX Triangle, NeoGeo C, Genesis C)
button 4: right button (SNES A, PSX Circle, Neogeo D, Genesis X)
button 5: Misc 1 (PSX L1, Genesis Y, N64 Yellow Left),
button 6: Misc 2 (PSX R1, Genesis Z, N64 Yellow Right),
button 7: Left Shoulder (PSX L2)
button 8: Right Shoulder (PSX R2)
button 9: Select
button 10: Start
button 11: Misc 3 (PSX L3)
button 12: Misc 4 (PSX R3)
button 1: bottom button (SNES B, PSX Cross, NES A, NeoGeo A, Genesis A),
button 2: left button (SNES Y, PSX Square, NES B, NeoGeo B, Genesis B),
button 3: upper button (SNES X, PSX Triangle, NeoGeo C, Genesis C)
button 4: right button (SNES A, PSX Circle, Neogeo D, Genesis X)
button 5: Misc 1 (PSX L1, Genesis Y, N64 Yellow Left),
button 6: Misc 2 (PSX R1, Genesis Z, N64 Yellow Right),
button 7: Left Shoulder (PSX L2)
button 8: Right Shoulder (PSX R2)
button 9: Select
button 10: Start
button 11: Misc 3 (PSX L3)
button 12: Misc 4 (PSX R3)

v0.9
- added some stubs for PS2 pressure sensitive button support, but disabled them all because the pressure sensitive buttons were sluggish and seemingly useless.
Expand Down
Binary file added misc/android-cdd.pdf
Binary file not shown.
Binary file added misc/android_buttons.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions misc/android_buttons.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
HID usages must be declared within a Game pad CA (0x01 0x0005).

Button HID Usage Android Button
A 0x09 0x0001 KEYCODE_BUTTON_A (96)
B 0x09 0x0002 KEYCODE_BUTTON_B (97)
X 0x09 0x0004 KEYCODE_BUTTON_X (99)
Y 0x09 0x0005 KEYCODE_BUTTON_Y (100)
D-pad up
D-pad down 0x01 0x0039 AXIS_HAT_Y*
D-pad left
D-pad right 0x01 0x0039 AXIS_HAT_X*
Left shoulder button 0x09 0x0007 KEYCODE_BUTTON_L1 (102)
Right shoulder button 0x09 0x0008 KEYCODE_BUTTON_R1 (103)
Left stick click 0x09 0x000E KEYCODE_BUTTON_THUMBL (106)
Right stick click 0x09 0x000F KEYCODE_BUTTON_THUMBR (107)
Home 0x0c 0x0223 KEYCODE_HOME (3)
Back 0x0c 0x0224 KEYCODE_BACK (4)

* This usage must have a Logical Minimum of 0, a Logical Maximum of 7, a Physical Minimum of 0, a Physical Maximum of 315, Units in Degrees, and a Report Size of 4. The logical value is defined to be the clockwise rotation away from the vertical axis; for example, a logical value of 0 represents no rotation and the up button being pressed, while a logical value of 1 represents a rotation of 45 degrees and both the up and left keys being pressed.

Analog Controls HID Usage Android Button
Left Trigger 0x02 0x00C5 AXIS_LTRIGGER
Right Trigger 0x02 0x00C4 AXIS_RTRIGGER
Left Joystick 0x01 0x0030 AXIS_X
0x01 0x0031 AXIS_Y
Right Joystick 0x01 0x0032 AXIS_Z
0x01 0x0035 AXIS_RZ
Binary file added misc/x360ce.zip
Binary file not shown.
Binary file added misc/x360ce_x64.zip
Binary file not shown.
43 changes: 29 additions & 14 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Paul Qureshi RetroAdapter Firmware v2.1a Mod v0.97
Paul Qureshi RetroAdapter Firmware v2.1a Mod v0.99
--------------------------------------------------

References
Expand Down Expand Up @@ -60,19 +60,34 @@ pin 9 - button 2
- Normal mode:
This is for regular use and functions identical to the original RetroAdapter. However, it is improved for operation under Android OS. Under Android, the original RetroAdapter was not reporting directions up and left for NES and some other controller types. Note: The Android fixes are also incorporated into the Arcade mode version.

The button config for Normal Mode since v0.96:
button 1: bottom button (SNES B, PSX Cross, NES A, NeoGeo A, Genesis A, Gamecube A, N64 A),
button 2: left button (SNES Y, PSX Square, NES B, NeoGeo B, Genesis B, Gamecube B, N64 A),
button 3: upper button (SNES X, PSX Triangle, NeoGeo C, Genesis C, Gamecube Y, N64 Yellow Up)
button 4: right button (SNES A, PSX Circle, Neogeo D, Genesis X, Gamecube X, N64 Yellow Down)
button 5: Misc 1 (PSX L2, Genesis Y, N64 Yellow Left),
button 6: Misc 2 (PSX R2, Genesis Z, N64 Yellow Right),
button 7: Left Shoulder (SNES L, PSX L1, Gamecube L, N64 L)
button 8: Right Shoulder (SNES R, PSX R1, Gamecube R, N64 R)
button 9: Select (Gamecube Z, N64 Z)
button 10: Start (Play)
button 11: Misc 3 (PSX L3)
button 12: Misc 4 (PSX R3)
The button config for Normal Mode since v0.99 to conform with android:
button 1: bottom button (SNES B, PSX Cross, NegCon B, NES B, NeoGeo A, Genesis A, Gamecube A, N64 A. PCE II),
button 2: right button (SNES A, PSX Circle, NegCon A, NES A, Neogeo B, Genesis B, Gamecube X, N64 Yellow Down, PCE I)

button 4: left button (SNES Y, PSX Square, NeoGeo C, Genesis C, Gamecube B, N64 B),
button 5: upper button (SNES X, PSX Triangle, NeoGeo D, Genesis X, Gamecube Y, N64 Yellow Up)

button 7: Left Shoulder (PSX L1, Genesis Y, Gamecube L, N64 L, Saturn L)
button 8: Right Shoulder (PSX R1 Genesis Z, Gamecube R, N64 R, Saturn R)

button 9: Misc 1 (PSX L2, N64 Yellow Left),
button 10: Misc 2 (PSX R2, N64 Yellow Right),

button 11: Select
button 12: Start (PC Engine Play, Genesis Mode)

button 14: Misc 3 (PSX L3, N64 Z, Gamecube Z)
button 15: Misc 4 (PSX R3)

Analog:
Left Joystick: x,y
Right Joystick: z,Rz

NegCon mode (identifies as "Mojo Retro Adapter NegCon" instead of "Mojo Retro Adapter" when NegCon is detected):
Steering: x
Button I: z (0..255 in NegCon mode instead of -128..127)
Button II: "Accelerator" axis
Button L: "Brake axis"

How to install
--------------
Expand Down
4 changes: 2 additions & 2 deletions src_NormalAndArcadeMode/3do.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ void Read3DO(report_t *reportBuffer)
temp = TDOReadByte();
if (temp & (1<<1)) reportBuffer->b1 |= (1<<6);
if (temp & (1<<2)) reportBuffer->b1 |= (1<<7);
if (temp & (1<<3)) reportBuffer->b2 |= (1<<1);
if (temp & (1<<4)) reportBuffer->b2 |= (1<<0);
if (temp & (1<<3)) reportBuffer->b2 |= (1<<0);
if (temp & (1<<4)) reportBuffer->b2 |= (1<<1);
if (temp & (1<<5)) reportBuffer->b1 |= (1<<2);
if (temp & (1<<6)) reportBuffer->b1 |= (1<<1);
if (temp & (1<<7)) reportBuffer->b1 |= (1<<0);
Expand Down
Loading

0 comments on commit 1b475c8

Please sign in to comment.