Buzz settings

This commit is contained in:
Florin9doi 2020-12-27 16:51:55 +02:00 committed by Ivan
parent a7c9827ad4
commit dfee46604a
9 changed files with 58 additions and 12 deletions

View File

@ -145,7 +145,6 @@ usb_handler_thread::usb_handler_thread()
bool found_skylander = false;
bool found_ghltar = false;
bool found_buzz = false;
for (ssize_t index = 0; index < ndev; index++)
{
@ -199,14 +198,10 @@ usb_handler_thread::usb_handler_thread()
check_device(0x044F, 0xB660, 0xB660, "Thrustmaster T500 RS Gear Shift");
// Buzz controllers
if (check_device(0x054C, 0x1000, 0x1040, "buzzer0"))
found_buzz = true;
if (check_device(0x054C, 0x0001, 0x0041, "buzzer1"))
found_buzz = true;
if (check_device(0x054C, 0x0042, 0x0042, "buzzer2"))
found_buzz = true;
if (check_device(0x046D, 0xC220, 0xC220, "buzzer9"))
found_buzz = true;
check_device(0x054C, 0x1000, 0x1040, "buzzer0");
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");
@ -229,12 +224,16 @@ usb_handler_thread::usb_handler_thread()
usb_devices.push_back(std::make_shared<usb_device_ghltar>());
}
if (!found_buzz)
if (g_cfg.io.buzz == buzz_handler::one_controller || g_cfg.io.buzz == buzz_handler::two_controllers)
{
sys_usbd.notice("Adding emulated Buzz! buzzer");
sys_usbd.notice("Adding emulated Buzz! buzzer (1-4 players)");
usb_devices.push_back(std::make_shared<usb_device_buzz>(0, 3));
}
if (g_cfg.io.buzz == buzz_handler::two_controllers)
{
// The current buzz emulation piggybacks on the pad input.
// Since there can only be 7 pads connected on a PS3 the 8th player is currently not supported
sys_usbd.notice("Adding emulated Buzz! buzzer (5-7 players)");
usb_devices.push_back(std::make_shared<usb_device_buzz>(4, 6));
}

View File

@ -251,6 +251,7 @@ struct cfg_root : cfg::node
cfg::_enum<camera_handler> camera{ this, "Camera", camera_handler::null };
cfg::_enum<fake_camera_type> camera_type{ this, "Camera type", fake_camera_type::unknown };
cfg::_enum<move_handler> move{ this, "Move", move_handler::null };
cfg::_enum<buzz_handler> buzz{ this, "Buzz emulated controller", buzz_handler::null };
} io{ this };
struct node_sys : cfg::node

View File

@ -355,6 +355,22 @@ void fmt_class_string<move_handler>::format(std::string& out, u64 arg)
});
}
template <>
void fmt_class_string<buzz_handler>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto value)
{
switch (value)
{
case buzz_handler::null: return "Null";
case buzz_handler::one_controller: return "1 controller";
case buzz_handler::two_controllers: return "2 controllers";
}
return unknown;
});
}
template <>
void fmt_class_string<ppu_decoder_type>::format(std::string& out, u64 arg)
{

View File

@ -95,6 +95,13 @@ enum class move_handler
mouse,
};
enum class buzz_handler
{
null,
one_controller,
two_controllers,
};
enum class microphone_handler
{
null,

View File

@ -853,6 +853,14 @@ QString emu_settings::GetLocalizedSetting(const QString& original, emu_settings_
case move_handler::mouse: return tr("Mouse", "Move handler");
}
break;
case emu_settings_type::Buzz:
switch (static_cast<buzz_handler>(index))
{
case buzz_handler::null: return tr("Null (use real Buzzers)", "Buzz handler");
case buzz_handler::one_controller: return tr("1 controller (1-4 players)", "Buzz handler");
case buzz_handler::two_controllers: return tr("2 controllers (5-7 players)", "Buzz handler");
}
break;
case emu_settings_type::InternetStatus:
switch (static_cast<np_internet_status>(index))
{

View File

@ -114,6 +114,7 @@ enum class emu_settings_type
Camera,
CameraType,
Move,
Buzz,
// Misc
ExitRPCS3OnFinish,
@ -258,6 +259,7 @@ static const QMap<emu_settings_type, cfg_location> settings_location =
{ emu_settings_type::Camera, { "Input/Output", "Camera"}},
{ emu_settings_type::CameraType, { "Input/Output", "Camera type"}},
{ emu_settings_type::Move, { "Input/Output", "Move" }},
{ emu_settings_type::Buzz, { "Input/Output", "Buzz emulated controller" }},
// Misc
{ emu_settings_type::ExitRPCS3OnFinish, { "Miscellaneous", "Exit RPCS3 when process finishes" }},

View File

@ -849,6 +849,9 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
m_emu_settings->EnhanceComboBox(ui->moveBox, emu_settings_type::Move);
SubscribeTooltip(ui->gb_move_handler, tooltips.settings.move);
m_emu_settings->EnhanceComboBox(ui->buzzBox, emu_settings_type::Buzz);
SubscribeTooltip(ui->gb_buzz_emulated, tooltips.settings.buzz);
// _____ _ _______ _
// / ____| | | |__ __| | |
// | (___ _ _ ___| |_ ___ _ __ ___ | | __ _| |__

View File

@ -1345,7 +1345,16 @@
</widget>
</item>
<item>
<widget class="QWidget" name="inputTabSpacerWidget" native="true"/>
<widget class="QGroupBox" name="gb_buzz_emulated">
<property name="title">
<string>Buzz! emulated controller</string>
</property>
<layout class="QVBoxLayout" name="gb_buzz_emulated_layout">
<item>
<widget class="QComboBox" name="buzzBox"/>
</item>
</layout>
</widget>
</item>
</layout>
</item>

View File

@ -181,6 +181,7 @@ public:
const QString camera = tr("Camera support is not implemented, leave this on null.");
const QString camera_type = tr("Camera support is not implemented, leave this on unknown.");
const QString move = tr("PlayStation Move support.\nFake: Experimental! This maps Move controls to DS3 controller mappings.\nMouse: Emulate PSMove with Mouse handler.");
const QString buzz = tr("Buzz! support.\nSelect 1 or 2 controllers if the game requires Buzz! controllers and you don't have real controllers.\nSelect Null if the game has support for DualShock or if you have real Buzz! controllers.");
// network