Commit 8111abc
authored
Fix for Classic Controller clones without data mode support (#69)
* Classic: Remove initialization for high res buffer val
This doesn't need a value because it's set in the function. If it's not set in the function we can't know what it is *anyways*, and a default value serves only to confuse.
* Classic: Re-attempt connect if HR write fails
Some Classic clone controllers apparently NACK the register write for "high res" mode which wasn't known when they were first reverse engineered. The result is that the specificInit returns 'false' indicating a communication error and the controller fails to indicate that it's connected (#68).
This commit should hopefully fix that issue by attempting to distinguish between controllers that NACK the register write for "high res" mode because they don't support it, and controllers that NACK the register write because they're no longer connected to the bus. This is done with a simple read of the control data. If we receive data the controller is still present. If not, the mode is unsupported.
Note that this can't distinguish between unsupported data and momentary (sub ms) loss of connection. That's just something we're going to have to live with for the time being...
* Classic: Change HR requests to use controls func.
Better than setting the pointer "manually" here. There should be no change in functionality.
Previously I must have used the generic requestData function because I was trying to read from bytes 7/8 instead of reading the entire control group but some of the clones didn't like that. The proper control data request function is more idiomatic and clearer about what's going on.1 parent f0629b0 commit 8111abc
1 file changed
+28
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | 162 | | |
164 | 163 | | |
165 | 164 | | |
166 | 165 | | |
167 | | - | |
| 166 | + | |
168 | 167 | | |
169 | | - | |
| 168 | + | |
170 | 169 | | |
171 | 170 | | |
172 | 171 | | |
| |||
186 | 185 | | |
187 | 186 | | |
188 | 187 | | |
189 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
190 | 212 | | |
191 | 213 | | |
192 | | - | |
| 214 | + | |
193 | 215 | | |
194 | 216 | | |
195 | 217 | | |
196 | 218 | | |
197 | | - | |
| 219 | + | |
198 | 220 | | |
199 | 221 | | |
200 | 222 | | |
| |||
0 commit comments