diff --git a/rpcs3/Emu/Cell/Modules/cellPad.cpp b/rpcs3/Emu/Cell/Modules/cellPad.cpp index 577602053a..c2cfba1248 100644 --- a/rpcs3/Emu/Cell/Modules/cellPad.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPad.cpp @@ -152,6 +152,9 @@ void cellPad_NotifyStateChange(usz index, u64 /*state*/, bool locked) case CELL_PAD_PCLASS_TYPE_SKATEBOARD: product = input::get_product_info(input::product_type::ride_skateboard); break; + case CELL_PAD_FAKE_TYPE_GUNCON3: + product = input::get_product_info(input::product_type::guncon_3); + break; case CELL_PAD_PCLASS_TYPE_STANDARD: default: product = input::get_product_info(input::product_type::playstation_3_controller); diff --git a/rpcs3/Emu/Io/pad_config.h b/rpcs3/Emu/Io/pad_config.h index a4a03dee2e..a1e6a14b5a 100644 --- a/rpcs3/Emu/Io/pad_config.h +++ b/rpcs3/Emu/Io/pad_config.h @@ -104,7 +104,7 @@ struct cfg_pad final : cfg::node cfg::uint<0, 100> analog_lerp_factor{ this, "Analog Button Lerp Factor", 100 }; cfg::uint<0, 100> trigger_lerp_factor{ this, "Trigger Lerp Factor", 100 }; - cfg::uint device_class_type{ this, "Device Class Type", 0 }; + cfg::uint device_class_type{ this, "Device Class Type", 0 }; cfg::uint<0, 65535> vendor_id{ this, "Vendor ID", 0 }; cfg::uint<0, 65535> product_id{ this, "Product ID", 0 }; }; diff --git a/rpcs3/Emu/Io/pad_types.h b/rpcs3/Emu/Io/pad_types.h index ce4f1306e2..de818179b5 100644 --- a/rpcs3/Emu/Io/pad_types.h +++ b/rpcs3/Emu/Io/pad_types.h @@ -134,6 +134,11 @@ enum CELL_PAD_PCLASS_TYPE_DANCEMAT = 0x04, CELL_PAD_PCLASS_TYPE_NAVIGATION = 0x05, CELL_PAD_PCLASS_TYPE_SKATEBOARD = 0x8001, + + // these are used together with pad->is_fake_pad to capture input events for usbd/gem/move without conflicting with cellPad + CELL_PAD_FAKE_TYPE_GUNCON3 = 0xa000, + + CELL_PAD_PCLASS_TYPE_MAX // last item }; // Profile of a Standard Type Controller diff --git a/rpcs3/Input/pad_thread.cpp b/rpcs3/Input/pad_thread.cpp index e093b739f5..135200a07d 100644 --- a/rpcs3/Input/pad_thread.cpp +++ b/rpcs3/Input/pad_thread.cpp @@ -170,7 +170,6 @@ void pad_thread::Init() cur_pad_handler->Init(); m_pads[i] = std::make_shared(handler_type, CELL_PAD_STATUS_DISCONNECTED, pad_settings[i].device_capability, pad_settings[i].device_type); - m_pads[i]->is_fake_pad = (g_cfg.io.move == move_handler::fake && i >= (CELL_PAD_MAX_PORT_NUM - CELL_GEM_MAX_NUM)); if (pad_settings[i].is_ldd_pad) { @@ -188,6 +187,9 @@ void pad_thread::Init() input_log.notice("Pad %d: device='%s', handler=%s, VID=0x%x, PID=0x%x, class_type=0x%x, class_profile=0x%x", i, cfg->device.to_string(), m_pads[i]->m_pad_handler, m_pads[i]->m_vendor_id, m_pads[i]->m_product_id, m_pads[i]->m_class_type, m_pads[i]->m_class_profile); } + + m_pads[i]->is_fake_pad = (g_cfg.io.move == move_handler::fake && i >= (static_cast(CELL_PAD_MAX_PORT_NUM) - static_cast(CELL_GEM_MAX_NUM))) || m_pads[i]->m_class_type == CELL_PAD_FAKE_TYPE_GUNCON3; + connect_usb_controller(i, input::get_product_by_vid_pid(m_pads[i]->m_vendor_id, m_pads[i]->m_product_id)); } } diff --git a/rpcs3/Input/product_info.h b/rpcs3/Input/product_info.h index eac07bf183..48470307a3 100644 --- a/rpcs3/Input/product_info.h +++ b/rpcs3/Input/product_info.h @@ -17,12 +17,14 @@ namespace input harmonix_rockband_drum_kit_2, rock_revolution_drum_kit, ps_move_navigation, - ride_skateboard + ride_skateboard, + guncon_3, }; enum vendor_id { sony_corp = 0x054C, // Sony Corp. + namco = 0x0B9A, // Namco sony_cea = 0x12BA, // Sony Computer Entertainment America konami_de = 0x1CCF, // Konami Digital Entertainment }; @@ -40,6 +42,7 @@ namespace input ps_move_navigation = 0x042F, // PlayStation Move navigation controller dance_dance_revolution_mat = 0x1010, // Dance Dance Revolution Dance Mat Controller ride_skateboard = 0x0400, // Tony Hawk RIDE Skateboard Controller + guncon_3 = 0x0800, // GunCon 3 Controller }; struct product_info @@ -233,6 +236,16 @@ namespace input .capabilites = CELL_PAD_CAPABILITY_PS3_CONFORMITY | CELL_PAD_CAPABILITY_PRESS_MODE | CELL_PAD_CAPABILITY_SENSOR_MODE }; } + case product_type::guncon_3: + { + return product_info{ + .type = type, + .vendor_id = vendor_id::namco, + .product_id = product_id::guncon_3, + .pclass_profile = 0x0, + .capabilites = 0x0 + }; + } case product_type::playstation_3_controller: default: // GCC doesn't like it when there is no return value if if all enum values are covered { @@ -305,6 +318,13 @@ namespace input get_product_info(product_type::ride_skateboard) }; } + case CELL_PAD_FAKE_TYPE_GUNCON3: + { + return + { + get_product_info(product_type::guncon_3) + }; + } } } }; diff --git a/rpcs3/rpcs3qt/pad_settings_dialog.cpp b/rpcs3/rpcs3qt/pad_settings_dialog.cpp index 144bba11c5..e7e760cc72 100644 --- a/rpcs3/rpcs3qt/pad_settings_dialog.cpp +++ b/rpcs3/rpcs3qt/pad_settings_dialog.cpp @@ -181,6 +181,7 @@ pad_settings_dialog::pad_settings_dialog(std::shared_ptr gui_setti ui->chooseClass->addItem(tr("Dance Mat"), u32{CELL_PAD_PCLASS_TYPE_DANCEMAT}); ui->chooseClass->addItem(tr("PS Move Navigation"), u32{CELL_PAD_PCLASS_TYPE_NAVIGATION}); ui->chooseClass->addItem(tr("Skateboard"), u32{CELL_PAD_PCLASS_TYPE_SKATEBOARD}); + ui->chooseClass->addItem(tr("GunCon 3"), u32{CELL_PAD_FAKE_TYPE_GUNCON3}); connect(ui->chooseClass, QOverload::of(&QComboBox::currentIndexChanged), this, [this](int index) { @@ -1682,6 +1683,11 @@ void pad_settings_dialog::HandleDeviceClassChange(u32 class_id) const ui->chooseProduct->addItem(tr("RIDE Skateboard", "Tony Hawk RIDE Skateboard Controller"), static_cast(product.type)); break; } + case input::product_type::guncon_3: + { + ui->chooseProduct->addItem(tr("GunCon 3", "GunCon 3 Controller"), static_cast(product.type)); + break; + } } } }