[PR #85] [CLOSED] Add PS3 mode: DualShock 3 personality with gyro and haptics #191

Closed
opened 2026-10-22 05:07:21 +00:00 by roman · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/safijari/openpuck/pull/85
Author: @Copilot
Created: 6/25/2026
Status: ❌ Closed

Base: main ← Head: copilot/add-ps3-mode-gyro-haptics


📝 Commits (3)

  • 3b64b79 Add MODE_PS3: DualShock 3 personality with gyro and haptics
  • 88d7743 Improve comments in mode_ps3.cpp (MAC, IMU scale, 257u factor)
  • 97fe35b Merge branch 'main' into copilot/add-ps3-mode-gyro-haptics

📊 Changes

5 files changed (+390 additions, -10 deletions)

View changed files

📝 OpenPuck/OpenPuck.ino (+10 -8)
📝 OpenPuck/config.h (+5 -2)
📝 OpenPuck/controllers.cpp (+3 -0)
➕ OpenPuck/mode_ps3.cpp (+346 -0)
➕ OpenPuck/mode_ps3.h (+26 -0)

📄 Description

Adds MODE_PS3 (mode 9) so the puck enumerates as a DualShock 3 (054C:0289) and operates on a PS3 console.

New files: mode_ps3.h / mode_ps3.cpp

  • USB identity: VID 054C PID 0289 (DS3 with vibration), bcdDevice 0100, Sony strings
  • 48-byte input report (ID 0x01): matches real DS3 wire layout — reserved bytes, 19 digital buttons, analog sticks, 12 analog button pressures, status byte, 8-byte IMU
  • IMU: SC2 int16 ax/ay/az → DS3 big-endian uint16 (center 512); gz (yaw) → DS3 single gyro axis via >>6 shift (fills 0–1023; tunable)
  • Haptics: PS3 OUTPUT 0x01 bytes 2 (right-motor on/off) and 4 (left-motor power) forwarded to hapticSteamRumble
  • PS3 handshake: GET_FEATURE 0xF2 (device MAC), 0xF5 (USB-connected status), SET_FEATURE 0xF4 (enable) accepted silently
  • maxSlots() = 1: PS3 expects one gamepad per USB port
  • Clean enumeration: modeIsCleanPS returns true — no wake-mouse or WebUSB, matching MODE_PS5_GAME/MODE_DS4_GAME

config.h

  • MODE_PS3 = 9, MODE_MAX = 9
  • modeIsCleanPS() and etypeForMode() updated; PS3 shares ET_DS4 (same PlayStation button layout and back-paddle config)

controllers.cpp / OpenPuck.ino

  • MODE_PS3 wired into controllerFor()
  • MODE_SUFFIX extended with '3', MODE_NAME with "PS3(dualshock3+gyro)", usbReenumerate bounds updated to MODE_MAX

Switch into PS3 mode via CDC x9 or the WebUSB panel (mode 9).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/safijari/openpuck/pull/85 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 6/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `copilot/add-ps3-mode-gyro-haptics` --- ### 📝 Commits (3) - [`3b64b79`](https://github.com/safijari/openpuck/commit/3b64b7952d531cc2137afe42617d8f5d4e40aefd) Add MODE_PS3: DualShock 3 personality with gyro and haptics - [`88d7743`](https://github.com/safijari/openpuck/commit/88d7743a03683233efd68930d93cb1aee2274727) Improve comments in mode_ps3.cpp (MAC, IMU scale, 257u factor) - [`97fe35b`](https://github.com/safijari/openpuck/commit/97fe35b27af50b9f8178c54c0d69bf0c07cf011f) Merge branch 'main' into copilot/add-ps3-mode-gyro-haptics ### 📊 Changes **5 files changed** (+390 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `OpenPuck/OpenPuck.ino` (+10 -8) 📝 `OpenPuck/config.h` (+5 -2) 📝 `OpenPuck/controllers.cpp` (+3 -0) ➕ `OpenPuck/mode_ps3.cpp` (+346 -0) ➕ `OpenPuck/mode_ps3.h` (+26 -0) </details> ### 📄 Description Adds `MODE_PS3` (mode 9) so the puck enumerates as a DualShock 3 (`054C:0289`) and operates on a PS3 console. ## New files: `mode_ps3.h` / `mode_ps3.cpp` - **USB identity**: VID `054C` PID `0289` (DS3 with vibration), bcdDevice `0100`, Sony strings - **48-byte input report (ID `0x01`)**: matches real DS3 wire layout — reserved bytes, 19 digital buttons, analog sticks, 12 analog button pressures, status byte, 8-byte IMU - **IMU**: SC2 int16 ax/ay/az → DS3 big-endian uint16 (center 512); gz (yaw) → DS3 single gyro axis via `>>6` shift (fills 0–1023; tunable) - **Haptics**: PS3 `OUTPUT 0x01` bytes 2 (right-motor on/off) and 4 (left-motor power) forwarded to `hapticSteamRumble` - **PS3 handshake**: `GET_FEATURE 0xF2` (device MAC), `0xF5` (USB-connected status), `SET_FEATURE 0xF4` (enable) accepted silently - **`maxSlots() = 1`**: PS3 expects one gamepad per USB port - **Clean enumeration**: `modeIsCleanPS` returns true — no wake-mouse or WebUSB, matching `MODE_PS5_GAME`/`MODE_DS4_GAME` ## `config.h` - `MODE_PS3 = 9`, `MODE_MAX = 9` - `modeIsCleanPS()` and `etypeForMode()` updated; PS3 shares `ET_DS4` (same PlayStation button layout and back-paddle config) ## `controllers.cpp` / `OpenPuck.ino` - `MODE_PS3` wired into `controllerFor()` - `MODE_SUFFIX` extended with `'3'`, `MODE_NAME` with `"PS3(dualshock3+gyro)"`, `usbReenumerate` bounds updated to `MODE_MAX` Switch into PS3 mode via CDC `x9` or the WebUSB panel (mode 9). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
roman 2026-10-22 05:07:21 +00:00
Sign in to join this conversation.
No labels
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
safijari/openpuck#191
No description provided.