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
317
Trophies
0
Age
35
XP
1,118
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
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: I'm NEVER horny