From ab0df0a0f5695e0db4c71153cf1995a718fbcdaa Mon Sep 17 00:00:00 2001 From: Bevan Weiss Date: Sat, 22 Aug 2020 23:41:08 +1000 Subject: [PATCH] Support for Namco GCon3 gun (#8757) This gun now works (passes calibration) in Time Crisis 4. --- rpcs3/Emu/Cell/lv2/sys_usbd.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_usbd.cpp b/rpcs3/Emu/Cell/lv2/sys_usbd.cpp index 0f561e278a..040dcba139 100644 --- a/rpcs3/Emu/Cell/lv2/sys_usbd.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_usbd.cpp @@ -198,6 +198,9 @@ usb_handler_thread::usb_handler_thread() check_device(0x054C, 0x0001, 0x0041, "buzzer1"); check_device(0x054C, 0x0042, 0x0042, "buzzer2"); check_device(0x046D, 0xC220, 0xC220, "buzzer9"); + + // GCon3 Gun + check_device(0x0B9A, 0x0800, 0x0800, "guncon3"); } libusb_free_device_list(list, 1); @@ -571,7 +574,19 @@ error_code sys_usbd_get_descriptor(u32 handle, u32 device_handle, vm::ptr // This function is used for psp(cellUsbPspcm), dongles in ps3 arcade cabinets(PS3A-USJ), ps2 cam(eyetoy), generic usb camera?(sample_usb2cam) error_code sys_usbd_register_ldd(u32 handle, vm::ptr s_product, u16 slen_product) { - sys_usbd.todo("sys_usbd_register_ldd(handle=0x%x, s_product=%s, slen_product=0x%x)", handle, s_product, slen_product); + // slightly hacky way of getting Namco GCon3 gun to work. + // The register_ldd appears to be a more promiscuous mode function, where all device 'inserts' would be presented to the cellUsbd for Probing. + // Unsure how many more devices might need similar treatment (i.e. just a compare and force VID/PID add), or if it's worth adding a full promiscuous + // capability + if (strcmp(s_product.get_ptr(), "guncon3") == 0) + { + sys_usbd.warning("sys_usbd_register_ldd(handle=0x%x, s_product=%s, slen_product=0x%x) -> Redirecting to sys_usbd_register_extra_ldd", handle, s_product, slen_product); + sys_usbd_register_extra_ldd(handle, s_product, slen_product, 0x0B9A, 0x0800, 0x0800); + } + else + { + sys_usbd.todo("sys_usbd_register_ldd(handle=0x%x, s_product=%s, slen_product=0x%x)", handle, s_product, slen_product); + } return CELL_OK; }