mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Merge pull request #6668 from JosJuice/remove-hybrid-wiimote
Remove Hybrid Wii Remote
This commit is contained in:
commit
df44aa7335
@ -290,7 +290,7 @@ bool BootCore(std::unique_ptr<BootParameters> boot)
|
|||||||
{
|
{
|
||||||
controls_section->Get(StringFromFormat("WiimoteSource%u", i), &source, -1);
|
controls_section->Get(StringFromFormat("WiimoteSource%u", i), &source, -1);
|
||||||
if (source != -1 && g_wiimote_sources[i] != (unsigned)source &&
|
if (source != -1 && g_wiimote_sources[i] != (unsigned)source &&
|
||||||
source >= WIIMOTE_SRC_NONE && source <= WIIMOTE_SRC_HYBRID)
|
source >= WIIMOTE_SRC_NONE && source <= WIIMOTE_SRC_REAL)
|
||||||
{
|
{
|
||||||
config_cache.bSetWiimoteSource[i] = true;
|
config_cache.bSetWiimoteSource[i] = true;
|
||||||
g_wiimote_sources[i] = source;
|
g_wiimote_sources[i] = source;
|
||||||
|
@ -135,17 +135,21 @@ void Pause()
|
|||||||
// An L2CAP packet is passed from the Core to the Wiimote on the HID CONTROL channel.
|
// An L2CAP packet is passed from the Core to the Wiimote on the HID CONTROL channel.
|
||||||
void ControlChannel(int number, u16 channel_id, const void* data, u32 size)
|
void ControlChannel(int number, u16 channel_id, const void* data, u32 size)
|
||||||
{
|
{
|
||||||
if (WIIMOTE_SRC_HYBRID & g_wiimote_sources[number])
|
if (g_wiimote_sources[number])
|
||||||
|
{
|
||||||
static_cast<WiimoteEmu::Wiimote*>(s_config.GetController(number))
|
static_cast<WiimoteEmu::Wiimote*>(s_config.GetController(number))
|
||||||
->ControlChannel(channel_id, data, size);
|
->ControlChannel(channel_id, data, size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// An L2CAP packet is passed from the Core to the Wiimote on the HID INTERRUPT channel.
|
// An L2CAP packet is passed from the Core to the Wiimote on the HID INTERRUPT channel.
|
||||||
void InterruptChannel(int number, u16 channel_id, const void* data, u32 size)
|
void InterruptChannel(int number, u16 channel_id, const void* data, u32 size)
|
||||||
{
|
{
|
||||||
if (WIIMOTE_SRC_HYBRID & g_wiimote_sources[number])
|
if (g_wiimote_sources[number])
|
||||||
|
{
|
||||||
static_cast<WiimoteEmu::Wiimote*>(s_config.GetController(number))
|
static_cast<WiimoteEmu::Wiimote*>(s_config.GetController(number))
|
||||||
->InterruptChannel(channel_id, data, size);
|
->InterruptChannel(channel_id, data, size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ButtonPressed(int number)
|
bool ButtonPressed(int number)
|
||||||
|
@ -43,7 +43,6 @@ enum
|
|||||||
WIIMOTE_SRC_NONE = 0,
|
WIIMOTE_SRC_NONE = 0,
|
||||||
WIIMOTE_SRC_EMU = 1,
|
WIIMOTE_SRC_EMU = 1,
|
||||||
WIIMOTE_SRC_REAL = 2,
|
WIIMOTE_SRC_REAL = 2,
|
||||||
WIIMOTE_SRC_HYBRID = 3, // emu + real
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern unsigned int g_wiimote_sources[MAX_BBMOTES];
|
extern unsigned int g_wiimote_sources[MAX_BBMOTES];
|
||||||
|
@ -722,84 +722,6 @@ void Wiimote::Update()
|
|||||||
if (rptf.ext)
|
if (rptf.ext)
|
||||||
GetExtData(data + rptf.ext);
|
GetExtData(data + rptf.ext);
|
||||||
|
|
||||||
// hybrid Wii Remote stuff (for now, it's not supported while recording)
|
|
||||||
if (WIIMOTE_SRC_HYBRID == g_wiimote_sources[m_index] && !Movie::IsRecordingInput())
|
|
||||||
{
|
|
||||||
using namespace WiimoteReal;
|
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lk(g_wiimotes_mutex);
|
|
||||||
if (g_wiimotes[m_index])
|
|
||||||
{
|
|
||||||
Report& rpt = g_wiimotes[m_index]->ProcessReadQueue();
|
|
||||||
if (!rpt.empty())
|
|
||||||
{
|
|
||||||
u8* real_data = rpt.data();
|
|
||||||
switch (real_data[1])
|
|
||||||
{
|
|
||||||
// use data reports
|
|
||||||
default:
|
|
||||||
if (real_data[1] >= RT_REPORT_CORE)
|
|
||||||
{
|
|
||||||
const ReportFeatures& real_rptf =
|
|
||||||
reporting_mode_features[real_data[1] - RT_REPORT_CORE];
|
|
||||||
|
|
||||||
// force same report type from real-Wiimote
|
|
||||||
if (&real_rptf != &rptf)
|
|
||||||
rptf_size = 0;
|
|
||||||
|
|
||||||
// core
|
|
||||||
// mix real-buttons with emu-buttons in the status struct, and in the report
|
|
||||||
if (real_rptf.core && rptf.core)
|
|
||||||
{
|
|
||||||
m_status.buttons.hex |=
|
|
||||||
reinterpret_cast<wm_buttons*>(real_data + real_rptf.core)->hex;
|
|
||||||
*reinterpret_cast<wm_buttons*>(data + rptf.core) = m_status.buttons;
|
|
||||||
}
|
|
||||||
|
|
||||||
// accel
|
|
||||||
// use real-accel data always i guess
|
|
||||||
if (real_rptf.accel && rptf.accel)
|
|
||||||
memcpy(data + rptf.accel, real_data + real_rptf.accel, sizeof(wm_accel));
|
|
||||||
|
|
||||||
// ir
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
// ext
|
|
||||||
// use real-ext data if an emu-extention isn't chosen
|
|
||||||
if (real_rptf.ext && rptf.ext && (0 == m_extension->switch_extension))
|
|
||||||
memcpy(data + rptf.ext, real_data + real_rptf.ext,
|
|
||||||
sizeof(wm_nc)); // TODO: Why NC specific?
|
|
||||||
}
|
|
||||||
else if (real_data[1] != RT_ACK_DATA || m_extension->active_extension > 0)
|
|
||||||
rptf_size = 0;
|
|
||||||
else
|
|
||||||
// use real-acks if an emu-extension isn't chosen
|
|
||||||
rptf_size = -1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
// use all status reports, after modification of the extension bit
|
|
||||||
case RT_STATUS_REPORT:
|
|
||||||
if (m_extension->active_extension)
|
|
||||||
reinterpret_cast<wm_status_report*>(real_data + 2)->extension = 1;
|
|
||||||
rptf_size = -1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
// use all read-data replies
|
|
||||||
case RT_READ_DATA_REPLY:
|
|
||||||
rptf_size = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// copy over report from real-Wiimote
|
|
||||||
if (-1 == rptf_size)
|
|
||||||
{
|
|
||||||
std::copy(rpt.begin(), rpt.end(), data);
|
|
||||||
rptf_size = (s8)(rpt.size());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Movie::CallWiiInputManip(data, rptf, m_index, m_extension->active_extension, m_ext_key);
|
Movie::CallWiiInputManip(data, rptf, m_index, m_extension->active_extension, m_ext_key);
|
||||||
}
|
}
|
||||||
if (NetPlay::IsNetPlayRunning())
|
if (NetPlay::IsNetPlayRunning())
|
||||||
|
@ -42,9 +42,6 @@ static const std::map<SerialInterface::SIDevices, int> s_gc_types = {
|
|||||||
{SerialInterface::SIDEVICE_DANCEMAT, 4}, {SerialInterface::SIDEVICE_GC_TARUKONGA, 5},
|
{SerialInterface::SIDEVICE_DANCEMAT, 4}, {SerialInterface::SIDEVICE_GC_TARUKONGA, 5},
|
||||||
{SerialInterface::SIDEVICE_GC_GBA, 6}, {SerialInterface::SIDEVICE_GC_KEYBOARD, 7}};
|
{SerialInterface::SIDEVICE_GC_GBA, 6}, {SerialInterface::SIDEVICE_GC_KEYBOARD, 7}};
|
||||||
|
|
||||||
static const std::map<int, int> s_wiimote_types = {
|
|
||||||
{WIIMOTE_SRC_NONE, 0}, {WIIMOTE_SRC_EMU, 1}, {WIIMOTE_SRC_REAL, 2}, {WIIMOTE_SRC_HYBRID, 3}};
|
|
||||||
|
|
||||||
static int ToGCMenuIndex(const SerialInterface::SIDevices sidevice)
|
static int ToGCMenuIndex(const SerialInterface::SIDevices sidevice)
|
||||||
{
|
{
|
||||||
return s_gc_types.at(sidevice);
|
return s_gc_types.at(sidevice);
|
||||||
@ -57,18 +54,6 @@ static SerialInterface::SIDevices FromGCMenuIndex(const int menudevice)
|
|||||||
return it->first;
|
return it->first;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ToWiimoteMenuIndex(const int device)
|
|
||||||
{
|
|
||||||
return s_wiimote_types.at(device);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int FromWiimoteMenuIndex(const int menudevice)
|
|
||||||
{
|
|
||||||
auto it = std::find_if(s_wiimote_types.begin(), s_wiimote_types.end(),
|
|
||||||
[=](auto pair) { return pair.second == menudevice; });
|
|
||||||
return it->first;
|
|
||||||
}
|
|
||||||
|
|
||||||
ControllersWindow::ControllersWindow(QWidget* parent) : QDialog(parent)
|
ControllersWindow::ControllersWindow(QWidget* parent) : QDialog(parent)
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("Controller Settings"));
|
setWindowTitle(tr("Controller Settings"));
|
||||||
@ -189,11 +174,8 @@ void ControllersWindow::CreateWiimoteLayout()
|
|||||||
auto* wm_box = m_wiimote_boxes[i] = new QComboBox();
|
auto* wm_box = m_wiimote_boxes[i] = new QComboBox();
|
||||||
auto* wm_button = m_wiimote_buttons[i] = new QPushButton(tr("Configure"));
|
auto* wm_button = m_wiimote_buttons[i] = new QPushButton(tr("Configure"));
|
||||||
|
|
||||||
for (const auto& item :
|
for (const auto& item : {tr("None"), tr("Emulated Wii Remote"), tr("Real Wii Remote")})
|
||||||
{tr("None"), tr("Emulated Wii Remote"), tr("Real Wii Remote"), tr("Hybrid Wii Remote")})
|
|
||||||
{
|
|
||||||
wm_box->addItem(item);
|
wm_box->addItem(item);
|
||||||
}
|
|
||||||
|
|
||||||
int wm_row = m_wiimote_layout->rowCount();
|
int wm_row = m_wiimote_layout->rowCount();
|
||||||
m_wiimote_layout->addWidget(wm_label, wm_row, 1);
|
m_wiimote_layout->addWidget(wm_label, wm_row, 1);
|
||||||
@ -458,9 +440,6 @@ void ControllersWindow::OnWiimoteConfigure()
|
|||||||
case 1: // Emulated Wii Remote
|
case 1: // Emulated Wii Remote
|
||||||
type = MappingWindow::Type::MAPPING_WIIMOTE_EMU;
|
type = MappingWindow::Type::MAPPING_WIIMOTE_EMU;
|
||||||
break;
|
break;
|
||||||
case 3: // Hybrid Wii Remote
|
|
||||||
type = MappingWindow::Type::MAPPING_WIIMOTE_HYBRID;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -482,7 +461,7 @@ void ControllersWindow::LoadSettings()
|
|||||||
for (size_t i = 0; i < m_wiimote_groups.size(); i++)
|
for (size_t i = 0; i < m_wiimote_groups.size(); i++)
|
||||||
{
|
{
|
||||||
m_gc_controller_boxes[i]->setCurrentIndex(ToGCMenuIndex(SConfig::GetInstance().m_SIDevice[i]));
|
m_gc_controller_boxes[i]->setCurrentIndex(ToGCMenuIndex(SConfig::GetInstance().m_SIDevice[i]));
|
||||||
m_wiimote_boxes[i]->setCurrentIndex(ToWiimoteMenuIndex(g_wiimote_sources[i]));
|
m_wiimote_boxes[i]->setCurrentIndex(g_wiimote_sources[i]);
|
||||||
}
|
}
|
||||||
m_wiimote_real_balance_board->setChecked(g_wiimote_sources[WIIMOTE_BALANCE_BOARD] ==
|
m_wiimote_real_balance_board->setChecked(g_wiimote_sources[WIIMOTE_BALANCE_BOARD] ==
|
||||||
WIIMOTE_SRC_REAL);
|
WIIMOTE_SRC_REAL);
|
||||||
@ -513,7 +492,7 @@ void ControllersWindow::SaveSettings()
|
|||||||
for (size_t i = 0; i < m_wiimote_groups.size(); i++)
|
for (size_t i = 0; i < m_wiimote_groups.size(); i++)
|
||||||
{
|
{
|
||||||
const int index = m_wiimote_boxes[i]->currentIndex();
|
const int index = m_wiimote_boxes[i]->currentIndex();
|
||||||
g_wiimote_sources[i] = FromWiimoteMenuIndex(index);
|
g_wiimote_sources[i] = index;
|
||||||
m_wiimote_buttons[i]->setEnabled(index != 0 && index != 2);
|
m_wiimote_buttons[i]->setEnabled(index != 0 && index != 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,7 +271,6 @@ void MappingWindow::SetMappingType(MappingWindow::Type type)
|
|||||||
AddWidget(tr("Microphone"), widget);
|
AddWidget(tr("Microphone"), widget);
|
||||||
break;
|
break;
|
||||||
case Type::MAPPING_WIIMOTE_EMU:
|
case Type::MAPPING_WIIMOTE_EMU:
|
||||||
case Type::MAPPING_WIIMOTE_HYBRID:
|
|
||||||
{
|
{
|
||||||
auto* extension = new WiimoteEmuExtension(this);
|
auto* extension = new WiimoteEmuExtension(this);
|
||||||
widget = new WiimoteEmuGeneral(this, extension);
|
widget = new WiimoteEmuGeneral(this, extension);
|
||||||
|
@ -42,7 +42,6 @@ public:
|
|||||||
MAPPING_GC_MICROPHONE,
|
MAPPING_GC_MICROPHONE,
|
||||||
// Wii
|
// Wii
|
||||||
MAPPING_WIIMOTE_EMU,
|
MAPPING_WIIMOTE_EMU,
|
||||||
MAPPING_WIIMOTE_HYBRID,
|
|
||||||
// Hotkeys
|
// Hotkeys
|
||||||
MAPPING_HOTKEYS
|
MAPPING_HOTKEYS
|
||||||
};
|
};
|
||||||
|
@ -94,8 +94,7 @@ void ControllerConfigDiag::UpdateUI()
|
|||||||
SConfig::GetInstance().bWii || Core::GetState() == Core::State::Uninitialized;
|
SConfig::GetInstance().bWii || Core::GetState() == Core::State::Uninitialized;
|
||||||
if (Core::WantsDeterminism() || !wii_game_started)
|
if (Core::WantsDeterminism() || !wii_game_started)
|
||||||
m_wiimote_sources[i]->Disable();
|
m_wiimote_sources[i]->Disable();
|
||||||
if (!wii_game_started ||
|
if (!wii_game_started || g_wiimote_sources[i] != WIIMOTE_SRC_EMU)
|
||||||
(g_wiimote_sources[i] != WIIMOTE_SRC_EMU && g_wiimote_sources[i] != WIIMOTE_SRC_HYBRID))
|
|
||||||
m_wiimote_configure_button[i]->Disable();
|
m_wiimote_configure_button[i]->Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,8 +308,8 @@ wxSizer* ControllerConfigDiag::CreatePassthroughBTConfigSizer()
|
|||||||
|
|
||||||
wxSizer* ControllerConfigDiag::CreateEmulatedBTConfigSizer()
|
wxSizer* ControllerConfigDiag::CreateEmulatedBTConfigSizer()
|
||||||
{
|
{
|
||||||
const std::array<wxString, 4> src_choices{
|
const std::array<wxString, 3> src_choices{
|
||||||
{_("None"), _("Emulated Wii Remote"), _("Real Wii Remote"), _("Hybrid Wii Remote")}};
|
{_("None"), _("Emulated Wii Remote"), _("Real Wii Remote")}};
|
||||||
|
|
||||||
const int space5 = FromDIP(5);
|
const int space5 = FromDIP(5);
|
||||||
|
|
||||||
@ -507,11 +506,7 @@ void ControllerConfigDiag::OnWiimoteSourceChanged(wxCommandEvent& event)
|
|||||||
if (index != WIIMOTE_BALANCE_BOARD)
|
if (index != WIIMOTE_BALANCE_BOARD)
|
||||||
{
|
{
|
||||||
WiimoteReal::ChangeWiimoteSource(index, event.GetInt());
|
WiimoteReal::ChangeWiimoteSource(index, event.GetInt());
|
||||||
if (g_wiimote_sources[index] != WIIMOTE_SRC_EMU &&
|
m_wiimote_configure_button[index]->Enable(g_wiimote_sources[index] == WIIMOTE_SRC_EMU);
|
||||||
g_wiimote_sources[index] != WIIMOTE_SRC_HYBRID)
|
|
||||||
m_wiimote_configure_button[index]->Disable();
|
|
||||||
else
|
|
||||||
m_wiimote_configure_button[index]->Enable();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user