diff --git a/include/addons/i2cdisplay.h b/include/addons/i2cdisplay.h index fdc2d0c8..c87fbe9e 100644 --- a/include/addons/i2cdisplay.h +++ b/include/addons/i2cdisplay.h @@ -93,6 +93,8 @@ class I2CDisplayAddon : public GPAddon void drawTwinStickB(int startX, int startY, int buttonSize, int buttonPadding); void drawBlankA(int startX, int startY, int buttonSize, int buttonPadding); void drawBlankB(int startX, int startY, int buttonSize, int buttonPadding); + void drawVLXA(int startX, int startY, int buttonRadius, int buttonPadding); + void drawVLXB(int startX, int startY, int buttonRadius, int buttonPadding); uint8_t ucBackBuffer[1024]; OBDISP obd; std::string statusBar; diff --git a/include/enums.h b/include/enums.h index 56f3142d..45dfe286 100644 --- a/include/enums.h +++ b/include/enums.h @@ -12,6 +12,7 @@ typedef enum BUTTON_LAYOUT_DANCEPADA, BUTTON_LAYOUT_TWINSTICKA, BUTTON_LAYOUT_BLANKA, + BUTTON_LAYOUT_VLXA, } ButtonLayout; typedef enum @@ -28,7 +29,8 @@ typedef enum BUTTON_LAYOUT_KEYBOARDB, BUTTON_LAYOUT_DANCEPADB, BUTTON_LAYOUT_TWINSTICKB, - BUTTON_LAYOUT_BLANKB + BUTTON_LAYOUT_BLANKB, + BUTTON_LAYOUT_VLXB, } ButtonLayoutRight; typedef enum diff --git a/src/addons/i2cdisplay.cpp b/src/addons/i2cdisplay.cpp index e1a56b9f..c6fc3e32 100644 --- a/src/addons/i2cdisplay.cpp +++ b/src/addons/i2cdisplay.cpp @@ -79,6 +79,9 @@ void I2CDisplayAddon::process() { case BUTTON_LAYOUT_BLANKA: drawBlankA(0, 0, 0, 0); break; + case BUTTON_LAYOUT_VLXA: + drawVLXA(7, 28, 7, 2); + break; } switch (BUTTON_LAYOUT_RIGHT) @@ -122,6 +125,9 @@ void I2CDisplayAddon::process() { case BUTTON_LAYOUT_BLANKB: drawSticklessButtons(0, 0, 0, 0); break; + case BUTTON_LAYOUT_VLXB: + drawVLXB(6, 28, 7, 2); + break; } } @@ -213,6 +219,38 @@ void I2CDisplayAddon::drawArcadeStick(int startX, int startY, int buttonRadius, } } +void I2CDisplayAddon::drawVLXA(int startX, int startY, int buttonRadius, int buttonPadding) +{ + const int buttonMargin = buttonPadding + (buttonRadius * 2); + + // Stick + obdPreciseEllipse(&obd, startX + (buttonMargin / 2), startY + (buttonMargin / 2), buttonRadius * 1.25, buttonRadius * 1.25, 1, 0); + + if (pGamepad->pressedUp()) { + if (pGamepad->pressedLeft()) { + obdPreciseEllipse(&obd, startX + (buttonMargin / 5), startY + (buttonMargin / 5), buttonRadius, buttonRadius, 1, 1); + } else if (pGamepad->pressedRight()) { + obdPreciseEllipse(&obd, startX + (buttonMargin * 0.875), startY + (buttonMargin / 5), buttonRadius, buttonRadius, 1, 1); + } else { + obdPreciseEllipse(&obd, startX + (buttonMargin / 2), startY, buttonRadius, buttonRadius, 1, 1); + } + } else if (pGamepad->pressedDown()) { + if (pGamepad->pressedLeft()) { + obdPreciseEllipse(&obd, startX + (buttonMargin / 5), startY + (buttonMargin * 0.875), buttonRadius, buttonRadius, 1, 1); + } else if (pGamepad->pressedRight()) { + obdPreciseEllipse(&obd, startX + (buttonMargin * 0.875), startY + (buttonMargin * 0.875), buttonRadius, buttonRadius, 1, 1); + } else { + obdPreciseEllipse(&obd, startX + buttonMargin / 2, startY + buttonMargin, buttonRadius, buttonRadius, 1, 1); + } + } else if (pGamepad->pressedLeft()) { + obdPreciseEllipse(&obd, startX, startY + buttonMargin / 2, buttonRadius, buttonRadius, 1, 1); + } else if (pGamepad->pressedRight()) { + obdPreciseEllipse(&obd, startX + buttonMargin, startY + buttonMargin / 2, buttonRadius, buttonRadius, 1, 1); + } else { + obdPreciseEllipse(&obd, startX + buttonMargin / 2, startY + buttonMargin / 2, buttonRadius, buttonRadius, 1, 1); + } +} + void I2CDisplayAddon::drawTwinStickA(int startX, int startY, int buttonRadius, int buttonPadding) { const int buttonMargin = buttonPadding + (buttonRadius * 2); @@ -330,6 +368,24 @@ void I2CDisplayAddon::drawVewlix(int startX, int startY, int buttonRadius, int b obdPreciseEllipse(&obd, startX + (buttonMargin * 5.75) - (buttonMargin / 3), startY + buttonMargin - (buttonMargin / 4), buttonRadius, buttonRadius, 1, pGamepad->pressedL2()); } +void I2CDisplayAddon::drawVLXB(int startX, int startY, int buttonRadius, int buttonPadding) +{ + const int buttonMargin = buttonPadding + (buttonRadius * 2); + + // 9-button Hori VLX + obdPreciseEllipse(&obd, startX + (buttonMargin * 2.75), startY + (buttonMargin * 0.2), buttonRadius, buttonRadius, 1, pGamepad->pressedB3()); + obdPreciseEllipse(&obd, startX + (buttonMargin * 3.75), startY - (buttonMargin / 4), buttonRadius, buttonRadius, 1, pGamepad->pressedB4()); + obdPreciseEllipse(&obd, startX + (buttonMargin * 4.75), startY - (buttonMargin / 4), buttonRadius, buttonRadius, 1, pGamepad->pressedR1()); + obdPreciseEllipse(&obd, startX + (buttonMargin * 5.75), startY - (buttonMargin / 4), buttonRadius, buttonRadius, 1, pGamepad->pressedL1()); + + obdPreciseEllipse(&obd, startX + (buttonMargin * 2.75) - (buttonMargin / 3), startY + buttonMargin + (buttonMargin * 0.2), buttonRadius, buttonRadius, 1, pGamepad->pressedB1()); + obdPreciseEllipse(&obd, startX + (buttonMargin * 3.75) - (buttonMargin / 3), startY + buttonMargin - (buttonMargin / 4), buttonRadius, buttonRadius, 1, pGamepad->pressedB2()); + obdPreciseEllipse(&obd, startX + (buttonMargin * 4.75) - (buttonMargin / 3), startY + buttonMargin - (buttonMargin / 4), buttonRadius, buttonRadius, 1, pGamepad->pressedR2()); + obdPreciseEllipse(&obd, startX + (buttonMargin * 5.75) - (buttonMargin / 3), startY + buttonMargin - (buttonMargin / 4), buttonRadius, buttonRadius, 1, pGamepad->pressedL2()); + + obdPreciseEllipse(&obd, startX + (buttonMargin * 7.4) - (buttonMargin / 3.5), startY + buttonMargin - (buttonMargin / 1.5), buttonRadius *.8, buttonRadius * .8, 1, pGamepad->pressedS2()); +} + void I2CDisplayAddon::drawVewlix7(int startX, int startY, int buttonRadius, int buttonPadding) { const int buttonMargin = buttonPadding + (buttonRadius * 2); diff --git a/src/addons/neopicoleds.cpp b/src/addons/neopicoleds.cpp index 925ccdfb..726dda85 100644 --- a/src/addons/neopicoleds.cpp +++ b/src/addons/neopicoleds.cpp @@ -369,6 +369,9 @@ std::vector> NeoPicoLEDAddon::createLEDLayout(ButtonLayout la case BUTTON_LAYOUT_BUTTONS_ANGLED: return generatedLEDWasd(&positions); + + case BUTTON_LAYOUT_VLXA: + return generatedLEDButtons(&positions); } }