From b40ac8e3b54150433cd2c9b4d29f9c7edacfcea5 Mon Sep 17 00:00:00 2001 From: arminth Date: Wed, 14 Feb 2024 18:55:54 +0100 Subject: [PATCH 1/2] Reworked code for more universal nintendo-input, added functionality This commit changes the following: 1. replace Nunchuk.h with Nintendo.h 2. add Classic Controller with D-pad, a-button=FIRE, -button(select) = COIN,+button (start) = START, home-button=reset_emulation 3. enhance Nunchuk capabilities: Z-button= FIRE, C-button=COIN, Z and C together=START, Joystick DOWN+Z+C=reset_emulation I know this pretty much reverts D0023R's last pullrequest but IMHO it makes things more flexible and more better! ;) Next step I will work on is autodetection of Nintendo-controller. --- galagino/Nintendo.h | 100 ++++++++++++++++++++++++++++++++++++++++++ galagino/Nunchuck.h | 56 ----------------------- galagino/config.h | 13 +++--- galagino/emulation.h | 5 ++- galagino/galagino.ino | 41 ++++++++--------- 5 files changed, 131 insertions(+), 84 deletions(-) create mode 100644 galagino/Nintendo.h delete mode 100644 galagino/Nunchuck.h diff --git a/galagino/Nintendo.h b/galagino/Nintendo.h new file mode 100644 index 0000000..c912c43 --- /dev/null +++ b/galagino/Nintendo.h @@ -0,0 +1,100 @@ +#ifndef _NINTENDO_H_ +#define _NINTENDO_H_ + +// ---------------------------- +// Standard Libraries +// ---------------------------- + +#include + +// ---------------------------- +// Additional Libraries - each one of these will need to be installed. +// ---------------------------- + +#include +// This library is for interfacing with the Nunchuck + +// Can be installed from the library manager +// https://github.com/dmadison/NintendoExtensionCtrl + +#ifdef CLASSIC_CTRL +ClassicController input; +#endif +#ifdef NUNCHUK +Nunchuk input; +#endif + +void inputSetup() { + + Wire.begin(NINTENDO_SDA, NINTENDO_SCL); + #ifdef NUNCHUK + if (!input.connect()) { + Serial.println("Nunchuk on bus #1 not detected!"); + delay(1000); + } + #endif + #ifdef CLASSIC_CTRL + if (!input.connect()) { + Serial.println("Classic Controller on bus #1 not detected!"); + delay(1000); + } + #endif + + +} + +unsigned char getNintendoInput() { + + boolean success = input.update(); // Get new data from the controller + + if (!success) { // Ruh roh + Serial.println("Nintendo Controller device disconnected!"); + return 0; + } + else + + { + #ifdef CLASSIC_CTRL + + //int joyY = input.leftJoyY(); //uncomment if Joystick should be used + //int joyX = input.leftJoyX(); //uncomment if Joystick should be used + + + return (input.dpadLeft() ? BUTTON_LEFT : 0) | //Move Left, comment out if Joystick should be used + (input.dpadRight() ? BUTTON_RIGHT : 0) | //Move Right, comment out if Joystick should be used + (input.dpadUp() ? BUTTON_UP : 0) | //Move Up,comment out if Joystick should be used + (input.dpadDown() ? BUTTON_DOWN : 0) | //Move Down,comment out if Joystick should be used + (input.buttonMinus() ? BUTTON_COIN : 0) | //Coin + (input.buttonPlus() ? BUTTON_START : 0) | //start + (input.buttonHome() ? BUTTON_HOME : 0) |//home + + // (joyX < 127 - JOYSTICK_MOVE_THRESHOLD) ? BUTTON_LEFT : 0) | //Move Left //uncomment if Joystick should be used + // ((joyX > 127 + JOYSTICK_MOVE_THRESHOLD) ? BUTTON_RIGHT : 0) | //Move Right //uncomment if Joystick should be used + // ((joyY > 127 + JOYSTICK_MOVE_THRESHOLD) ? BUTTON_UP : 0) | //Move Up //uncomment if Joystick should be used + // ((joyY < 127 - JOYSTICK_MOVE_THRESHOLD) ? BUTTON_DOWN : 0) | //Move Down //uncomment if Joystick should be used + + + (input.buttonA() ? BUTTON_FIRE : 0) ; + + #endif + #ifdef NUNCHUK + + // Read a joystick axis (0-255, X and Y) + // Roughly 127 will be the axis centered + int joyY = input.joyY(); + int joyX = input.joyX(); + + return ((joyX < 127 - JOYSTICK_MOVE_THRESHOLD) ? BUTTON_LEFT : 0) | //Move Left + ((joyX > 127 + JOYSTICK_MOVE_THRESHOLD) ? BUTTON_RIGHT : 0) | //Move Right + ((joyY > 127 + JOYSTICK_MOVE_THRESHOLD) ? BUTTON_UP : 0) | //Move Up + ((joyY < 127 - JOYSTICK_MOVE_THRESHOLD) ? BUTTON_DOWN : 0) | //Move Down + (input.buttonZ() ? BUTTON_FIRE : 0)| + (input.buttonC() ? BUTTON_COIN : 0) ; + + #endif + } + + +} + +#endif //_NINTENDO_H_ diff --git a/galagino/Nunchuck.h b/galagino/Nunchuck.h deleted file mode 100644 index ef261c3..0000000 --- a/galagino/Nunchuck.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _NUNCHUCK_H_ -#define _NUNCHUCK_H_ - -// ---------------------------- -// Standard Libraries -// ---------------------------- - -#include - -// ---------------------------- -// Additional Libraries - each one of these will need to be installed. -// ---------------------------- - -#include -// This library is for interfacing with the Nunchuck - -// Can be installed from the library manager -// https://github.com/dmadison/NintendoExtensionCtrl - -Nunchuk nchuk; - -void nunchuckSetup() { - - Wire.begin(NUNCHUCK_SDA, NUNCHUCK_SCL); - if (!nchuk.connect()) { - Serial.println("Nunchuk on bus #1 not detected!"); - delay(1000); - } - -} - -unsigned char getNunchuckInput() { - - boolean success = nchuk.update(); // Get new data from the controller - - if (!success) { // Ruh roh - Serial.println("Nunchuck disconnected!"); - return 0; - } - else { - - // Read a joystick axis (0-255, X and Y) - // Roughly 127 will be the axis centered - int joyY = nchuk.joyY(); - int joyX = nchuk.joyX(); - - 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) | - (nchuk.buttonC() ? BUTTON_EXTRA : 0) ; - } -} - -#endif //_NUNCHUCK_H_ diff --git a/galagino/config.h b/galagino/config.h index 0ecc829..3fcab3b 100644 --- a/galagino/config.h +++ b/galagino/config.h @@ -29,7 +29,7 @@ #include "dip_switches.h" -// #define CHEAP_YELLOW_DISPLAY_CONF +#define CHEAP_YELLOW_DISPLAY_CONF #ifndef CHEAP_YELLOW_DISPLAY_CONF // Config as it was before @@ -90,13 +90,14 @@ // audio config (leave both commented out for GPIO 25 for Audio) // #define SND_DIFF // set to output differential audio on GPIO25 _and_ inverted on GPIO26 #define SND_LEFT_CHANNEL // Use GPIO 26 for audio +#define NINTENDO_INPUT +#define NUNCHUK +//#define CLASSIC_CTRL -#define NUNCHUCK_INPUT +#define NINTENDO_SDA 22 +#define NINTENDO_SCL 27 -#define NUNCHUCK_SDA 22 -#define NUNCHUCK_SCL 27 - -#define NUNCHUCK_MOVE_THRESHOLD 30 // This is the dead-zone for where minor movements on the stick will not be considered valid movements +#define JOYSTICK_MOVE_THRESHOLD 30 // This is the dead-zone for where minor movements on the stick will not be considered valid movements // Pins used for buttons #define BTN_START_PIN 0 //This is the "boot" button diff --git a/galagino/emulation.h b/galagino/emulation.h index 166bf7f..53f688a 100644 --- a/galagino/emulation.h +++ b/galagino/emulation.h @@ -9,7 +9,7 @@ extern unsigned char dkong_audio_transfer_buffer[DKONG_AUDIO_QUEUE_LEN][64]; extern unsigned char dkong_audio_rptr, dkong_audio_wptr; #endif -// a total of 7 button is needed for +// a total of 8 button is needed for // most games #define BUTTON_LEFT 0x01 #define BUTTON_RIGHT 0x02 @@ -18,7 +18,8 @@ extern unsigned char dkong_audio_rptr, dkong_audio_wptr; #define BUTTON_FIRE 0x10 #define BUTTON_START 0x20 #define BUTTON_COIN 0x40 -#define BUTTON_EXTRA 0x80 +#define BUTTON_HOME 0x80 + #ifndef SINGLE_MACHINE enum { diff --git a/galagino/galagino.ino b/galagino/galagino.ino index a5c1ace..698ba66 100644 --- a/galagino/galagino.ino +++ b/galagino/galagino.ino @@ -35,8 +35,8 @@ struct sprite_S *sprite; // buffer space for one row of 28 characters unsigned short *frame_buffer; -#ifdef NUNCHUCK_INPUT -#include "Nunchuck.h" +#ifdef NINTENDO_INPUT +#include "Nintendo.h" #endif // include converted rom data @@ -806,13 +806,15 @@ void setup() { Serial.print("Free heap: "); Serial.println(ESP.getFreeHeap()); // make button pins inputs +#ifdef BTN_START_PIN pinMode(BTN_START_PIN, INPUT_PULLUP); +#endif #ifdef BTN_COIN_PIN pinMode(BTN_COIN_PIN, INPUT_PULLUP); #endif -#ifdef NUNCHUCK_INPUT - nunchuckSetup(); +#ifdef NINTENDO_INPUT + inputSetup(); #else pinMode(BTN_LEFT_PIN, INPUT_PULLUP); pinMode(BTN_RIGHT_PIN, INPUT_PULLUP); @@ -848,22 +850,12 @@ unsigned char buttons_get(void) { // galagino can be compiled without coin button. This will then // be implemented by the start button. Whenever the start button // is pressed, a virtual coin button will be sent first - unsigned char input_states = 0; -#ifdef NUNCHUCK_INPUT - input_states |= getNunchuckInput(); -#endif; - #ifndef BTN_COIN_PIN -#ifdef BTN_COIN_PIN - input_states |= (!digitalRead(BTN_COIN_PIN)) ? BUTTON_EXTRA : 0; -#else - input_states |= (!digitalRead(BTN_START_PIN)) ? BUTTON_EXTRA : 0; -#endif static unsigned long virtual_coin_timer = 0; static int virtual_coin_state = 0; switch(virtual_coin_state) { case 0: // idle state - if(input_states & BUTTON_EXTRA) { + if(!digitalRead(BTN_START_PIN)) { virtual_coin_state = 1; // virtual coin pressed virtual_coin_timer = millis(); } @@ -891,7 +883,7 @@ unsigned char buttons_get(void) { break; case 4: // virtual start has ended // check if start button is actually still pressed - if(! (input_states & BUTTON_EXTRA)) + if(digitalRead(BTN_START_PIN)) virtual_coin_state = 0; // button has been released, return to idle break; } @@ -902,7 +894,13 @@ unsigned char buttons_get(void) { // reset if coin (or start if no coin is configured) is held for // more than 1 second - if(input_states & BUTTON_EXTRA) { + if(!digitalRead( +#ifdef BTN_COIN_PIN + BTN_COIN_PIN +#else + BTN_START_PIN +#endif + )) { if(machine != MCH_MENU) { #ifdef MASTER_ATTRACT_GAME_TIMEOUT @@ -938,9 +936,12 @@ unsigned char buttons_get(void) { (((virtual_coin_state != 3) && (virtual_coin_state != 4)) ? 0 : BUTTON_START); #endif -#ifdef NUNCHUCK_INPUT - return startAndCoinState | - input_states; +#ifdef NINTENDO_INPUT + unsigned char inp = getNintendoInput(); + if (inp & BUTTON_HOME) emulation_reset(); + if ((inp & BUTTON_FIRE) && (inp & BUTTON_DOWN) && (inp &BUTTON_COIN)) emulation_reset(); + if ((inp & BUTTON_FIRE) && (inp & BUTTON_COIN)) return BUTTON_START; + else return inp; #else return startAndCoinState | (digitalRead(BTN_LEFT_PIN) ? 0 : BUTTON_LEFT) | From acc218c764e26f00361b48e06b212cd36eb9850a Mon Sep 17 00:00:00 2001 From: arminth Date: Mon, 19 Feb 2024 18:52:57 +0100 Subject: [PATCH 2/2] Add autodetection for Nintendo controllers, add DPAD and Joystick Option for classic controller 1. If you enable NINTENDO_INPUT in config.h, on bootup of the machine, the controller is detected automagically. Currently supported: Nunchuk and Classic controller (don't see any value in having guitar- or drumcontrollerbut they are in the code already with no function behind. So you might get creative! 2. Added #define CLASSIC_DPAD and CLASSIC_LJOY You can use either of them or both on the Classic controller. You have to define at least one. If not, you will receive a compiler error message when building --- galagino/Nintendo.h | 204 ++++++++++++++++++++++++++++++++++---------- galagino/config.h | 7 +- 2 files changed, 165 insertions(+), 46 deletions(-) diff --git a/galagino/Nintendo.h b/galagino/Nintendo.h index c912c43..04253de 100644 --- a/galagino/Nintendo.h +++ b/galagino/Nintendo.h @@ -17,35 +17,91 @@ // Can be installed from the library manager // https://github.com/dmadison/NintendoExtensionCtrl -#ifdef CLASSIC_CTRL -ClassicController input; -#endif -#ifdef NUNCHUK -Nunchuk input; -#endif + +bool nun=false; +bool classic=false; + + + +ExtensionPort check; //Instance to check Controllertype +ClassicController inputC; //Classic Instance +Nunchuk inputN; //Nunchuk instance void inputSetup() { - Wire.begin(NINTENDO_SDA, NINTENDO_SCL); - #ifdef NUNCHUK - if (!input.connect()) { - Serial.println("Nunchuk on bus #1 not detected!"); - delay(1000); - } - #endif - #ifdef CLASSIC_CTRL - if (!input.connect()) { - Serial.println("Classic Controller on bus #1 not detected!"); - delay(1000); - } - #endif + Wire.begin(NINTENDO_SDA, NINTENDO_SCL); //use our pins + check.begin(); + check.connect(); + while (!check.connect()) { + Serial.println("Controller not detected!"); + delay(1000);}; + + ExtensionType conType = check.getControllerType(); //check our controllertype + + switch (conType) { + case(ExtensionType::NoController): + Serial.println("No controller detected"); + break; + case(ExtensionType::UnknownController): + Serial.println("Unknown controller connected"); + break; + case(ExtensionType::Nunchuk): + Serial.println("Nunchuk connected!"); + inputN.begin(); //instantiate Nunchuk-Inputfunction + inputN.connect(); + while (!inputN.connect()) { + Serial.println("Controller not detected!"); + delay(1000);}; + nun=true; // we have a Nunchuk connected! + break; + + case(ExtensionType::ClassicController): + Serial.println("Classic Controller connected!"); + inputC.begin(); //instantiate ClassicController-Inputfunction + inputC.connect(); + while (!inputC.connect()) { + Serial.println("Controller not detected!"); + delay(1000);}; + classic=true; // we have a ClassicController connected! + break; + + case(ExtensionType::GuitarController): + Serial.println("Guitar controller connected! WTF?"); //Not yet supported + break; + + case(ExtensionType::DrumController): + Serial.println("Drum set controller connected! WTF?"); //Not yet supported + break; + + case(ExtensionType::DJTurntableController): + Serial.println("DJ turntable connected! WTF?"); //Not yet supported + break; + + case(ExtensionType::uDrawTablet): + Serial.println("uDraw Tablet connected! WTF?"); //Not yet supported + break; + + case(ExtensionType::DrawsomeTablet): + Serial.println("Drawsome Tablet connected! WTF?"); //Not yet supported + break; + + default: break; + } +}; + + + + + + -} unsigned char getNintendoInput() { - - boolean success = input.update(); // Get new data from the controller + boolean success = false; + if (classic) success = inputC.update(); // Get new data from the Classic-Controller + else if (nun) success = inputN.update(); // Get new data from the Nunchuk + if (!success) { // Ruh roh Serial.println("Nintendo Controller device disconnected!"); @@ -53,46 +109,108 @@ unsigned char getNintendoInput() { } else - { - #ifdef CLASSIC_CTRL - - //int joyY = input.leftJoyY(); //uncomment if Joystick should be used - //int joyX = input.leftJoyX(); //uncomment if Joystick should be used + + if (classic) //input definitions from Classic Controller + { +#ifdef CLASSIC_DPAD + #ifndef CLASSIC_LJOY + //int joyY = inputC.leftJoyY(); //uncomment if Joystick should be used + //int joyX = inputC.leftJoyX(); //uncomment if Joystick should be used - return (input.dpadLeft() ? BUTTON_LEFT : 0) | //Move Left, comment out if Joystick should be used - (input.dpadRight() ? BUTTON_RIGHT : 0) | //Move Right, comment out if Joystick should be used - (input.dpadUp() ? BUTTON_UP : 0) | //Move Up,comment out if Joystick should be used - (input.dpadDown() ? BUTTON_DOWN : 0) | //Move Down,comment out if Joystick should be used - (input.buttonMinus() ? BUTTON_COIN : 0) | //Coin - (input.buttonPlus() ? BUTTON_START : 0) | //start - (input.buttonHome() ? BUTTON_HOME : 0) |//home + return (inputC.dpadLeft() ? BUTTON_LEFT : 0) | //Move Left, comment out if Joystick should be used + (inputC.dpadRight() ? BUTTON_RIGHT : 0) | //Move Right, comment out if Joystick should be used + (inputC.dpadUp() ? BUTTON_UP : 0) | //Move Up,comment out if Joystick should be used + (inputC.dpadDown() ? BUTTON_DOWN : 0) | //Move Down,comment out if Joystick should be used + (inputC.buttonMinus() ? BUTTON_COIN : 0) | //Coin + (inputC.buttonPlus() ? BUTTON_START : 0) | //start + (inputC.buttonHome() ? BUTTON_HOME : 0) |//home - // (joyX < 127 - JOYSTICK_MOVE_THRESHOLD) ? BUTTON_LEFT : 0) | //Move Left //uncomment if Joystick should be used + // ((joyX < 127 - JOYSTICK_MOVE_THRESHOLD) ? BUTTON_LEFT : 0) | //Move Left //uncomment if Joystick should be used // ((joyX > 127 + JOYSTICK_MOVE_THRESHOLD) ? BUTTON_RIGHT : 0) | //Move Right //uncomment if Joystick should be used // ((joyY > 127 + JOYSTICK_MOVE_THRESHOLD) ? BUTTON_UP : 0) | //Move Up //uncomment if Joystick should be used // ((joyY < 127 - JOYSTICK_MOVE_THRESHOLD) ? BUTTON_DOWN : 0) | //Move Down //uncomment if Joystick should be used - (input.buttonA() ? BUTTON_FIRE : 0) ; + (inputC.buttonA() ? BUTTON_FIRE : 0) ; + #endif + #endif + +#ifdef CLASSIC_LJOY + #ifndef CLASSIC_DPAD + int joyY = inputC.leftJoyY(); //uncomment if Joystick should be used + int joyX = inputC.leftJoyX(); //uncomment if Joystick should be used + + + return //(inputC.dpadLeft() ? BUTTON_LEFT : 0) | //Move Left, comment out if Joystick should be used + //(inputC.dpadRight() ? BUTTON_RIGHT : 0) | //Move Right, comment out if Joystick should be used + //(inputC.dpadUp() ? BUTTON_UP : 0) | //Move Up,comment out if Joystick should be used + //(inputC.dpadDown() ? BUTTON_DOWN : 0) | //Move Down,comment out if Joystick should be used + (inputC.buttonMinus() ? BUTTON_COIN : 0) | //Coin + (inputC.buttonPlus() ? BUTTON_START : 0) | //start + (inputC.buttonHome() ? BUTTON_HOME : 0) |//home + + ((joyX < 127 - JOYSTICK_MOVE_THRESHOLD) ? BUTTON_LEFT : 0) | //Move Left //uncomment if Joystick should be used + ((joyX > 127 + JOYSTICK_MOVE_THRESHOLD) ? BUTTON_RIGHT : 0) | //Move Right //uncomment if Joystick should be used + ((joyY > 127 + JOYSTICK_MOVE_THRESHOLD) ? BUTTON_UP : 0) | //Move Up //uncomment if Joystick should be used + ((joyY < 127 - JOYSTICK_MOVE_THRESHOLD) ? BUTTON_DOWN : 0) | //Move Down //uncomment if Joystick should be used + + + (inputC.buttonA() ? BUTTON_FIRE : 0) ; + + #endif + #endif + + #ifdef CLASSIC_LJOY + #ifdef CLASSIC_DPAD + int joyY = inputC.leftJoyY(); //uncomment if Joystick should be used + int joyX = inputC.leftJoyX(); //uncomment if Joystick should be used + + + return (inputC.dpadLeft() ? BUTTON_LEFT : 0) | //Move Left, comment out if Joystick should be used + (inputC.dpadRight() ? BUTTON_RIGHT : 0) | //Move Right, comment out if Joystick should be used + (inputC.dpadUp() ? BUTTON_UP : 0) | //Move Up,comment out if Joystick should be used + (inputC.dpadDown() ? BUTTON_DOWN : 0) | //Move Down,comment out if Joystick should be used + (inputC.buttonMinus() ? BUTTON_COIN : 0) | //Coin + (inputC.buttonPlus() ? BUTTON_START : 0) | //start + (inputC.buttonHome() ? BUTTON_HOME : 0) |//home + + ((joyX < 127 - JOYSTICK_MOVE_THRESHOLD) ? BUTTON_LEFT : 0) | //Move Left //uncomment if Joystick should be used + ((joyX > 127 + JOYSTICK_MOVE_THRESHOLD) ? BUTTON_RIGHT : 0) | //Move Right //uncomment if Joystick should be used + ((joyY > 127 + JOYSTICK_MOVE_THRESHOLD) ? BUTTON_UP : 0) | //Move Up //uncomment if Joystick should be used + ((joyY < 127 - JOYSTICK_MOVE_THRESHOLD) ? BUTTON_DOWN : 0) | //Move Down //uncomment if Joystick should be used + + + (inputC.buttonA() ? BUTTON_FIRE : 0) ; #endif - #ifdef NUNCHUK + #endif + #ifndef CLASSIC_LJOY + #ifndef CLASSIC_DPAD + #error "Define at least one method of input for a Classic Controller in config.h!" + #endif + #endif + } + + + if (nun) + { // Read a joystick axis (0-255, X and Y) // Roughly 127 will be the axis centered - int joyY = input.joyY(); - int joyX = input.joyX(); + int joyY = inputN.joyY(); + int joyX = inputN.joyX(); return ((joyX < 127 - JOYSTICK_MOVE_THRESHOLD) ? BUTTON_LEFT : 0) | //Move Left ((joyX > 127 + JOYSTICK_MOVE_THRESHOLD) ? BUTTON_RIGHT : 0) | //Move Right ((joyY > 127 + JOYSTICK_MOVE_THRESHOLD) ? BUTTON_UP : 0) | //Move Up ((joyY < 127 - JOYSTICK_MOVE_THRESHOLD) ? BUTTON_DOWN : 0) | //Move Down - (input.buttonZ() ? BUTTON_FIRE : 0)| - (input.buttonC() ? BUTTON_COIN : 0) ; + (inputN.buttonZ() ? BUTTON_FIRE : 0)| + (inputN.buttonC() ? BUTTON_COIN + : 0) ; - #endif - } + }; + } diff --git a/galagino/config.h b/galagino/config.h index 3fcab3b..2d7bebb 100644 --- a/galagino/config.h +++ b/galagino/config.h @@ -90,9 +90,10 @@ // audio config (leave both commented out for GPIO 25 for Audio) // #define SND_DIFF // set to output differential audio on GPIO25 _and_ inverted on GPIO26 #define SND_LEFT_CHANNEL // Use GPIO 26 for audio -#define NINTENDO_INPUT -#define NUNCHUK -//#define CLASSIC_CTRL +#define NINTENDO_INPUT // currently supported: Nunchuk and Classic Controller +#define CLASSIC_DPAD // Use DPAD or use left Joystick or both, if so desired +#define CLASSIC_LJOY // Use left joystick + #define NINTENDO_SDA 22 #define NINTENDO_SCL 27