@@ -207,7 +207,7 @@ static struct retro_input_descriptor descWiimote[] = {
207207 {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_R2 , " Shake Wiimote" },
208208 {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_START , " +" },
209209 {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_SELECT , " -" },
210- // {0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L3, "Sideways Toggle"},
210+ // {0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L3, "Sideways Toggle"}, // see: HOTKEY_SIDEWAYS_TOGGLE
211211 {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_R3 , " Home" },
212212 {0 , RETRO_DEVICE_ANALOG , RETRO_DEVICE_INDEX_ANALOG_LEFT , RETRO_DEVICE_ID_ANALOG_X ,
213213 " Tilt Left/Right" },
@@ -228,7 +228,7 @@ static struct retro_input_descriptor descWiimoteSideways[] = {
228228 {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_R2 , " Shake Wiimote" },
229229 {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_START , " +" },
230230 {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_SELECT , " -" },
231- // {0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L3, "Sideways Toggle"},
231+ // {0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L3, "Sideways Toggle"}, // see: HOTKEY_SIDEWAYS_TOGGLE
232232 {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_R3 , " Home" },
233233 {0 , RETRO_DEVICE_ANALOG , RETRO_DEVICE_INDEX_ANALOG_LEFT , RETRO_DEVICE_ID_ANALOG_X ,
234234 " Tilt Left/Right" },
@@ -569,7 +569,7 @@ void InitStage2()
569569 if (Libretro::Options::GetCached<int >(Libretro::Options::sysconf::ALT_GC_PORTS_ON_WII ))
570570 {
571571 static struct retro_controller_description wiimote_desc[] = {
572- {" WiiMote" , RETRO_DEVICE_WIIMOTE },
572+ {" WiiMote (upright) " , RETRO_DEVICE_WIIMOTE },
573573 {" WiiMote (sideways)" , RETRO_DEVICE_WIIMOTE_SW },
574574 {" WiiMote + Nunchuk" , RETRO_DEVICE_WIIMOTE_NC },
575575 {" WiiMote + Classic Controller" , RETRO_DEVICE_WIIMOTE_CC },
@@ -600,7 +600,7 @@ void InitStage2()
600600 else // Both Wii devices and GC controllers listed in ports 1-4, ports 5-8 are unused
601601 {
602602 static struct retro_controller_description wii_and_gc_desc[] = {
603- {" WiiMote" , RETRO_DEVICE_WIIMOTE },
603+ {" WiiMote (upright) " , RETRO_DEVICE_WIIMOTE },
604604 {" WiiMote (sideways)" , RETRO_DEVICE_WIIMOTE_SW },
605605 {" WiiMote + Nunchuk" , RETRO_DEVICE_WIIMOTE_NC },
606606 {" WiiMote + Classic Controller" , RETRO_DEVICE_WIIMOTE_CC },
@@ -1054,22 +1054,31 @@ void UpdateWiimoteMappings(const WiimoteUpdateFlags& f, unsigned port, unsigned
10541054 ->SetValue (swingAngle); // Swing/Angle
10551055 }
10561056
1057+ ControllerEmu::ControlGroup* wmHotkeys = wm->GetWiimoteGroup (WiimoteEmu::WiimoteGroup::Hotkeys);
1058+
10571059 // Sideways toggle
1058- if (f.sideways )
1060+ if (wmHotkeys && f.sideways )
10591061 {
1060- ControllerEmu::ControlGroup* wmHotkeys = wm->GetWiimoteGroup (WiimoteEmu::WiimoteGroup::Hotkeys);
10611062 std::string sidewaysToggle =
10621063 Libretro::Options::GetCached<std::string>(Libretro::Options::wiimote::HOTKEY_SIDEWAYS_TOGGLE );
10631064
10641065 wmHotkeys->SetControlExpression (0 ,
10651066 sidewaysToggle != MODIFIER_DISABLED_CONTROL ? sidewaysToggle : " " ); // Sideways Toggle (L3 default)
1067+ }
10661068
1069+ // Upright toggle
1070+ if (wmHotkeys && f.upright )
1071+ {
1072+ std::string uprightToggle =
1073+ Libretro::Options::GetCached<std::string>(Libretro::Options::wiimote::HOTKEY_UPRIGHT_TOGGLE );
1074+
1075+ wmHotkeys->SetControlExpression (1 ,
1076+ uprightToggle != MODIFIER_DISABLED_CONTROL ? uprightToggle : " " ); // Upright Toggle
1077+ }
10671078#if 0
1068- wmHotkeys->SetControlExpression(1, ""); // Upright Toggle
10691079 wmHotkeys->SetControlExpression(2, ""); // Sideways Hold
10701080 wmHotkeys->SetControlExpression(3, ""); // Upright Hold
10711081#endif
1072- }
10731082
10741083 // Rumble
10751084 if (f.rumble )
@@ -1231,6 +1240,7 @@ void refresh_all_wiimote_flags(unsigned port, unsigned device)
12311240{
12321241 WiimoteUpdateFlags f;
12331242 f.sideways = true ;
1243+ f.upright = true ;
12341244 f.irModifier = true ;
12351245 f.swingModifier = true ;
12361246 f.irMode = true ;
@@ -1623,6 +1633,7 @@ void retro_set_controller_port_device_wii(unsigned port, unsigned device)
16231633 f.irModifier = true ;
16241634 f.swingModifier = true ;
16251635 f.sideways = true ;
1636+ f.upright = true ;
16261637 // Raised at setup so the option applies on a cold boot.
16271638 f.irPassthrough = true ;
16281639 Libretro::Input::UpdateWiimoteMappings (f, port, device);
0 commit comments