harbaum / galagino

A Galaga, Pac-Man and Donkey Kong arcade emulator for the ESP32
315 stars 21 forks source link

Feature request - Use c button on nunchuck for coin/start #34

Open mothra78 opened 7 months ago

mothra78 commented 7 months ago

Thanks for this great project. I have compiled and installed on CYD and works great. It seems I have an extra "c" button on the nintendo wii nunchuck which does not seem to be used.

I would love for it to allow to start the game and avoid using the boot button on the back of the board.

I will see if I can implement this feature...

mothra78 commented 7 months ago

Made a quick an dirty implementation by updating nunchuck.h with :

return ((joyX < 127 - NUNCHUCK_MOVE_THRESHOLD) ? BUTTON_LEFT : 0) | //Move Left
       ((joyX > 127 + NUNCHUCK_MOVE_THRESHOLD) ? BUTTON_RIGHT : 0) | //Move Right
       ((joyY > 127 + NUNCHUCK_MOVE_THRESHOLD) ? BUTTON_UP : 0) | //Move Up
       ((joyY < 127 - NUNCHUCK_MOVE_THRESHOLD) ? BUTTON_DOWN : 0) | //Move Down
       (nchuk.buttonZ() ? BUTTON_FIRE : 0) | // Fire
       (nchuk.buttonZ() ? BUTTON_START : 0) | // Start
       (nchuk.buttonC() ? BUTTON_COIN : 0); // Coin

and galagino.ino with buttons_get(void) {:

ifdef NUNCHUCK_INPUT

  return getNunchuckInput();

else