You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove implementation details and code from protocol docs
Strip all C code, pseudocode, PIO programs, GPIO pin assignments,
and project-specific implementation details from protocol documentation.
Replace with prose descriptions, tables, and ASCII diagrams. Protocol
docs now serve as general protocol references independent of any
specific implementation.
-**Delta Y**: Assembled as a 10-bit value by taking the lower 4 bits of byte 1 as the upper nibble (bits 9-6) and the lower 6 bits of byte 2 as the lower portion (bits 5-0). If bit 9 is set, the value is sign-extended to 16 bits by filling the upper 6 bits with ones (two's complement).
190
+
-**Delta X**: Assembled as a 10-bit value by taking the upper 2 bits of byte 2 as the upper portion (bits 9-8) and all 8 bits of byte 3 as the lower portion (bits 7-0). Sign extension follows the same rule: if bit 9 is set, fill the upper 6 bits with ones.
**Position Calculation**: The X position is derived by multiplying the 20-bit timing counter by the XSCANTIME constant and adding the TIMEOFFSET correction. The Y position is derived by multiplying the 5-bit line pulse count by the YSCANTIME constant. For NTSC systems, the defaults are XSCANTIME=1030, TIMEOFFSET=-12835, and YSCANTIME=12707.
235
212
236
213
### Arcade Controls (Silly Control Pad)
237
214
@@ -262,8 +239,8 @@ Used for Orbatak arcade cabinet integration.
262
239
263
240
```
264
241
┌─────────┐ ┌────────┐ ┌────────┐ ┌────────┐
265
-
│ Console │────────▶│ USB │────────▶│ 3DO │────────▶│ 3DO │
266
-
│ │◀────────│ Adapter│◀────────│ Pad #1 │◀────────│ Pad #2 │
| 1 | Upper 2 bits of byte 0's high nibble are non-zero (i.e., bits 7-6 of byte 0 are not both 0) | Joypad | 2 bytes |
289
+
| 2 | Byte 0 is 0x01, followed by 0x7B and 0x08 (3-byte signature) | Flightstick | 9 bytes |
290
+
| 3 | Byte 0 is 0x49 | Mouse | 4 bytes |
291
+
| 4 | Byte 0 is 0x4D | Lightgun | 4 bytes |
292
+
| 5 | Byte 0 is 0xC0 | Arcade | 2 bytes |
293
+
294
+
Check for joypads first since they are the most common device. The joypad check exploits the physical impossibility of pressing up+down simultaneously on a d-pad: any byte where the upper two bits of the high nibble are non-zero must be a joypad. If the byte does not match a joypad, check for the flightstick's 3-byte signature before falling through to the single-byte ID matches.
332
295
333
296
### End-of-Chain Detection
334
297
@@ -361,50 +324,7 @@ Portfolio OS loads drivers by device ID:
5.**Extension latency**: Extension controllers have 1-frame delay due to passthrough buffering.
418
338
419
-
6. **Buffer size**: Allocate full 201-byte buffer even if unused. Prevents overflow with many devices connected.
339
+
6.**Buffer sizing**: The maximum PBUS field is 448 bits (56 bytes). Allocate buffers with padding beyond this maximum to prevent overflow when many devices are connected.
420
340
421
341
---
422
342
423
-
## Acknowledgments
424
-
425
-
- **[3dodev.com](https://3dodev.com)**: PBUS protocol specification and Opera hardware documentation
426
-
- **[FCare's USBTo3DO](https://github.com/FCare/USBTo3DO)**: Original USB-to-3DO adapter that pioneered USB controller conversion for the 3DO
427
-
- **[SNES23DO](https://github.com/RobertDaleSmith/snes23do)**: SNES-to-3DO adapter with extension controller parsing
0 commit comments