Skip to content

Commit bee4bc4

Browse files
committed
Add support and docs for RS3 Lightguns
1 parent 1123f6c commit bee4bc4

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.14)
22

3-
project(QMamehook VERSION 2.1 LANGUAGES CXX)
3+
project(QMamehook VERSION 2.2 LANGUAGES CXX)
44

55
set(CMAKE_AUTOUIC ON)
66
set(CMAKE_AUTOMOC ON)

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ A bare-bones implementation of a MAME network output client, made primarily for
99
- Cross-platform: i.e, works natively on Linux for native emulators, and the same code runs just as well on Windows.
1010
- Modern: Built on C++ & QT5/6, and made to interface with the MAME network output *standard*, meaning implicit support e.g. for RetroArch cores that use TCP localhost:8000 for feeding force feedback events.
1111
- Small & Simple: runs in the background with a single command, no admin privileges necessary.
12-
- Designed for light guns: Made for and exclusively compatible with the serial port interface used by PC light gun systems (which currently are [OpenFIRE](https://github.com/TeamOpenFIRE/OpenFIRE-Firmware), [GUN4IR](https://forum.arcadecontrols.com/index.php/topic,161189.0.html), and the [Blamcon](https://blamcon.com/) systems).
12+
- Designed for light guns: Made for and exclusively compatible with the serial port interface used by PC light gun systems (which currently are [OpenFIRE](https://github.com/TeamOpenFIRE/OpenFIRE-Firmware), [GUN4IR](https://forum.arcadecontrols.com/index.php/topic,161189.0.html), [Blamcon](https://blamcon.com/) systems, and the RetroShooter RS3*).
1313
- Compatible with MAMEHOOKER configs: Uses the same *.ini* files verbatim, no changes needed!
14+
##### *requires manual whitelisting on Linux
1415

1516
### Why would you NOT use this over MAMEHOOKER?
1617
- It's barebones: Strictly only supports light gun peripherals over serial (COM devices).
@@ -49,6 +50,12 @@ Only programs with *network outputs support* (event packets sent over TCP @ loca
4950
Just run the `QMamehook` executable in a terminal; send an interrupt signal (or `pkill QMamehook`) to stop it.
5051

5152
Game config files are searched in `~/.config/QMamehook/ini`, and the program output will indicate whether a correct file matching the `mame_start` message is found or not.
53+
54+
> [!NOTE]
55+
> RS3 users will have to manually probe the usbserial driver to expose this device's serial port, which can be done as follows (as root/with sudo privileges):
56+
> ```
57+
> # modprobe usbserial vendor=0x0483 product=0x5750
58+
> ```
5259
### For Windows:
5360
##### Requirements: Windows 7 and up.
5461
- Download the latest release zip.

qhookermain.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,11 @@ void qhookerMain::SerialInit()
160160
}
161161
} else {
162162
QList<QSerialPortInfo> newDevices;
163-
// Filter devices based on Vendor IDs (JB = 9025, Props3D = 13939, OpenFIRE = 0xF143)
163+
// Filter devices based on Vendor IDs:
164164
for (const QSerialPortInfo &info : std::as_const(serialFoundList)) {
165-
if(info.vendorIdentifier() == 9025 || // JB
166-
info.vendorIdentifier() == 13939 || // Props3D
165+
if(info.vendorIdentifier() == 9025 || // JB
166+
info.vendorIdentifier() == 13939 || // Props3D
167+
info.vendorIdentifier() == 0x0483 || // RS3 Reaper (requires manual modprobe by user)
167168
info.vendorIdentifier() == 0xF143) // OpenFIRE
168169
newDevices.append(info);
169170
else if(!info.portName().startsWith("ttyS"))
@@ -266,16 +267,19 @@ void qhookerMain::AddNewDevices(QList<QSerialPortInfo> &newDevices)
266267
printf("Port Name: %s\n", info.portName().toLocal8Bit().constData());
267268
printf("Vendor Identifier: ");
268269
if(info.hasVendorIdentifier()) {
269-
printf("%04X", info.vendorIdentifier());
270+
printf("%04X ", info.vendorIdentifier());
270271
switch(info.vendorIdentifier()) {
271272
case 9025:
272-
printf(" (GUN4IR Lightgun)\n");
273+
printf("(GUN4IR Lightgun)\n");
273274
break;
274275
case 13939:
275-
printf(" (Blamcon Lightgun)\n");
276+
printf("(Blamcon Lightgun)\n");
277+
break;
278+
case 0x0483:
279+
printf("(RetroShooter Lightgun)");
276280
break;
277281
case 0xF143:
278-
printf(" (OpenFIRE Lightgun)\n");
282+
printf("(OpenFIRE Lightgun)\n");
279283
break;
280284
default:
281285
// unlikely to happen due to whitelisting, but just in case.

0 commit comments

Comments
 (0)