@@ -75,6 +75,8 @@ static struct retro_input_descriptor descGC[] = {
7575 {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_L3 , " L-Analog" },
7676 {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_R3 , " R-Analog" },
7777 {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_R , " Z" },
78+ {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_L , " Triforce - Test" },
79+ {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_SELECT , " Triforce - Coin" },
7880 {0 , RETRO_DEVICE_JOYPAD , 0 , RETRO_DEVICE_ID_JOYPAD_START , " Start" },
7981 {0 , RETRO_DEVICE_ANALOG , RETRO_DEVICE_INDEX_ANALOG_LEFT , RETRO_DEVICE_ID_ANALOG_X ,
8082 " Control Stick X" },
@@ -727,7 +729,10 @@ void retro_set_controller_port_device_gc(unsigned port, unsigned device)
727729 if (device == RETRO_DEVICE_GC_ON_WII ) // Disconnect Wii device if we're using GC controller as device type to avoid conflict
728730 WiimoteCommon::OnSourceChanged (port, WiimoteSource::None);
729731
730- Config::SetBaseOrCurrent (Config::GetInfoForSIDevice (port > 3 ? port - 4 : port), SerialInterface::SIDEVICE_GC_CONTROLLER );
732+ Core::System& system = Core::System::GetInstance ();
733+
734+ Config::SetBaseOrCurrent (Config::GetInfoForSIDevice (port > 3 ? port - 4 : port),
735+ system.IsTriforce () ? SerialInterface::SIDEVICE_AM_BASEBOARD : SerialInterface::SIDEVICE_GC_CONTROLLER );
731736 si.ChangeDevice (Config::Get (Config::GetInfoForSIDevice (port > 3 ? port - 4 : port)), port > 3 ? port - 4 : port);
732737
733738 GCPad* gcPad = (GCPad*)Pad::GetConfig ()->GetController (port > 3 ? port - 4 : port);
@@ -743,6 +748,7 @@ void retro_set_controller_port_device_gc(unsigned port, unsigned device)
743748 ControllerEmu::ControlGroup* gcTriggers = gcPad->GetGroup (PadGroup::Triggers);
744749 ControllerEmu::ControlGroup* gcRumble = gcPad->GetGroup (PadGroup::Rumble);
745750 ControllerEmu::ControlGroup* gcOptions = gcPad->GetGroup (PadGroup::Options);
751+ ControllerEmu::ControlGroup* gcTriforce = gcPad->GetGroup (PadGroup::Triforce);
746752#if 0
747753 ControllerEmu::ControlGroup* gcMic = gcPad->GetGroup(PadGroup::Mic);
748754#endif
@@ -772,6 +778,10 @@ void retro_set_controller_port_device_gc(unsigned port, unsigned device)
772778 " `" + devAnalog + " :Trigger0+`|L3" ); // L-trigger Soft Press
773779 gcTriggers->SetControlExpression (3 ,
774780 " `" + devAnalog + " :Trigger1+`|R3" ); // R-trigger Soft Press
781+ gcTriforce->SetControlExpression (0 , " L" ); // Test
782+ gcTriforce->SetControlExpression (1 , " `" + devAnalog + " :Trigger0+`&`" + devAnalog + " :Trigger1+`" ); // Service
783+ gcTriforce->SetControlExpression (2 , " Select" ); // Coin
784+
775785 bool enableRumble = Libretro::Options::GetCached<bool >(Libretro::Options::sysconf::ENABLE_RUMBLE );
776786 if (enableRumble)
777787 gcRumble->SetControlExpression (0 , " Rumble" );
0 commit comments