Home | Forums | What's new | Resources | |
Nights analog pad data format |
antime - Jun 18, 2011 |
antime | Jun 18, 2011 | |||||||||||||
Relating to the Playstation-to-Saturn pad converter topic..., here's how to read the Nights pad using SH2 direct control: The pad is what the SMPC manual calls a "3-wire handshake method peripheral". To determine if the controller is of this type, use the following algorithm:
Code:
In 3-wire mode, the TH bit acts as an attention or chip select line, TR acts as a data toggle and TL acts as an acknowledge signal. The data is sent in the R, L, D and U bits, and is valid when TR == TL. To end the transaction, set both TH and TR to 1. In code:
Code:
According to the SMPC manual, the two first data values form the peripheral's Saturn ID sequence. Furthermore, at least for some peripherals it seems the first value may be the device ID and the second value the number of data bytes following the ID sequence. While this seems to be true for the Nights pad in both modes, at least the Saturn multitap does not seem to follow this format. Here's the data sent by the Nights pad in "O" mode:
Code:
Here's the data in "+" mode:
Code:
For all button bits a zero means pressed. The analog trigger values range from 0 (min) to 0xFF (max). If the value goes above around 0x90 the digital button is registered as pressed. The digital button remains pressed until the analog value goes below around 0x56. The thumbstick axes range from 0 (left/up) to 0xFF (right/down) with 0x80 being neutral for both. |
Chilly Willy | Jun 19, 2011 | |||
Nice summary! I really want to make a Saturn->MD adapter so I can use a Saturn analog pad on the MD (with homebrew). |
mrkotfw | Mar 13, 2012 | |||
Such a large bump, but wouldn't it be better to not use SH-2 direct? |
antime | Mar 13, 2012 | |||
Yes, but this was more about documenting the transmission format (the original discussion was about making a DualShock to analog pad interface.) |