Adding the Nintendo Switch GameCube Controller Wired Fight Pad Pro into the Snes9x GX emulator

cereal_killer

Well-Known Member
OP
Member
Joined
Jan 2, 2018
Messages
223
Trophies
0
Age
34
XP
590
Country
United States
I have a code to integrate the Nintendo Switch GameCube Controller Wired Fight Pad Pro into the Snes9x GX emulator. Can someone add it to the Snes9x Gx .dol file so that the controller can be used with Snes9x Gx?

#define GC_VID 0x0E6F
#define GC_PID 0x0185

void handle_gc_controller_input(InputData *input)
{
// Read input from the GameCube controller
// ...

// Map input to SNES controller buttons
// ...

// Update the emulator's input state
// ...
}

while (running)
{
// Check for input from the Wii remote
// ...

// Check for input from the GameCube controller
if (connected_gc_controller)
{
handle_gc_controller_input(&input);
}

// Update the emulator's state
// ...
}

void handle_gc_controller_input(InputData *input)
{
// Read input from the GameCube controller
// ...

// Map input to SNES controller buttons
if (gc_input.dpad_up)
{
input->snes_buttons |= SNES_BUTTON_UP;
}
if (gc_input.dpad_down)
{
input->snes_buttons |= SNES_BUTTON_DOWN;
}
if (gc_input.dpad_left)
{
input->snes_buttons |= SNES_BUTTON_LEFT;
}
if (gc_input.dpad_right)
{
input->snes_buttons |= SNES_BUTTON_RIGHT;
}
if (gc_input.a)
{
input->snes_buttons |= SNES_BUTTON_A;
}
if (gc_input.b)
{
input->snes_buttons |= SNES_BUTTON_B;
}
// Map remaining buttons...

// Update the emulator's input state
// ...
}

if (gc_input.dpad_up)
{
input->snes_buttons |= SNES_BUTTON_UP;
}
if (gc_input.dpad_down)
{
input->snes_buttons |= SNES_BUTTON_DOWN;
}
if (gc_input.dpad_left)
{
input->snes_buttons |= SNES_BUTTON_LEFT;
}
if (gc_input.dpad_right)
{
input->snes_buttons |= SNES_BUTTON_RIGHT;
}
if (gc_input.a)
{
input->snes_buttons |= SNES_BUTTON_A;
}
if (gc_input.b)
{
input->snes_buttons |= SNES_BUTTON_B;
}
if (gc_input.x)
{
input->snes_buttons |= SNES_BUTTON_X;
}
if (gc_input.y)
{
input->snes_buttons |= SNES_BUTTON_Y;
}
if (gc_input.z)
{
input->snes_buttons |= SNES_BUTTON_L;
}
if (gc_input.l)
{
input->snes_buttons |= SNES_BUTTON_ZL;
}
if (gc_input.r)
{
input->s
 
General chit-chat
Help Users
  • No one is chatting at the moment.
    tankioo @ tankioo: ok