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
333
Trophies
0
Age
35
XP
1,166
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
  • No one is chatting at the moment.
  • S @ salazarcosplay:
    hunter x hunter
  • S @ salazarcosplay:
    he has not allowed anyone to continue it for him for example
  • Xdqwerty @ Xdqwerty:
    @salazarcosplay, theres a dragon ball af mod for budokai 3
  • Xdqwerty @ Xdqwerty:
    updated ship of harkinian, gonna install some hd texture pack
  • Xdqwerty @ Xdqwerty:
    I might download rayman revolution for my ps3
  • BigOnYa @ BigOnYa:
    I may try the new ram site, and download more RAM to my Switch. Not sure if ddr3 is the right ram
    for it tho. Edit- no it uses floppy Ram, just like @AncientBoi
    +1
  • Xdqwerty @ Xdqwerty:
    aeiou
  • BigOnYa @ BigOnYa:
    And sometimes Z
  • SylverReZ @ SylverReZ:
    @K3Nv2, MAGA supporters be wearing tin foil hats lol.
    +1
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, whats maga?
  • BigOnYa @ BigOnYa:
    It stands for Maniacs Against General Acceptance
    +1
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, people rejecting general consensus about stuff?
    +1
  • BigOnYa @ BigOnYa:
    Yup, nuh its really just Trump followers
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, im not american so i dont care about trump
    +1
  • Xdqwerty @ Xdqwerty:
    or us elections
  • BigOnYa @ BigOnYa:
    Me niether, us north Koreans don't care
  • Xdqwerty @ Xdqwerty:
    good night
  • BakerMan @ BakerMan:
    i don't care either, even if i'm american
  • BakerMan @ BakerMan:
    truth be told, i agree with psi, i dislike both candidates, but i'd probably vote trump simply because the economy was better during his presidency
  • AngryCinnabon @ AngryCinnabon:
    Just be careful, if trump ends up winning and using project 2025 America might really change...for the worse.
  • AngryCinnabon @ AngryCinnabon:
    I'm not american and even that sends shivers down my spine.
  • AngryCinnabon @ AngryCinnabon:
    anything that offers trump an opportunity to become an actual dictator
    is bad in my book, i could care less if it wasn't for that...
  • K3Nv2 @ K3Nv2:
    Canada: America's Russia
  • NinStar @ NinStar:
    people are so dramatic that I can't even tell if they are being serious
    NinStar @ NinStar: people are so dramatic that I can't even tell if they are being serious