Skip to content

Commit

Permalink
update to v0.7.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Fightingbox committed May 4, 2024
1 parent 7fb30b9 commit 2f75cb4
Show file tree
Hide file tree
Showing 14 changed files with 118 additions and 97 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "v([0-9]+\\.[0-9]+\\.[0-9]+).*" "\\1" CMAKE_GIT_REPO_VERSION ${GIT_REPO_VERSION})
string(REGEX REPLACE "^(.......-.*)|(.......)$" "0.0.0" CMAKE_GIT_REPO_VERSION ${CMAKE_GIT_REPO_VERSION}) # fix if all we have is the git SHA
set(GIT_REPO_VERSION v0.7.8)
set(CMAKE_GIT_REPO_VERSION 0.7.8)
set(GP2040_BOARDCONFIG FightingBox-Mini)
configure_file("headers/version.h.in" "headers/version.h")
message("GIT_REPO_VERSION is ${GIT_REPO_VERSION}")
message("CMAKE_GIT_REPO_VERSION is ${CMAKE_GIT_REPO_VERSION}")
Expand Down
101 changes: 10 additions & 91 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,101 +1,20 @@
<p align="center">
<a href="https://gp2040-ce.info">
<img alt="GP2040-CE" src="https://raw.githubusercontent.com/OpenStickCommunity/Site/main/docs/assets/images/gp2040-ce-logo.png" />
</a>
</p>

<p align="center">
Multi-Platform Gamepad Firmware for RP2040
</p>
## FightingBox-Mini

<p align="center">
<img src="https://img.shields.io/github/license/OpenStickCommunity/GP2040-CE" />
<img src="https://img.shields.io/github/actions/workflow/status/OpenStickCommunity/GP2040-CE/cmake.yml" />
<br />
<img src="https://img.shields.io/badge/inputlag.science-0.86%20ms-blue" />
<img src="https://img.shields.io/badge/MiSTer%20latency-0.765%20ms-blue" />
</p>
FightingBox-Mini gamepad is based on the GP2040-CE which compatible with PC, PS3 and PS4, Nintendo Switch, Steam Deck, MiSTer and Android.

<p>
GP2040-CE (Community Edition) is a gamepad firmware for the Raspberry Pi Pico and other boards based on the RP2040 microcontrollers that combines multi-platform compatibility, low latency and a rich feature set to provide endless customization possibilities without sacrificing performance.
</p>
![FightingBox-Mini](hardware/4.jpg)

<p>
GP2040-CE is compatible with PC, PS3 and PS4, Nintendo Switch, Steam Deck, MiSTer and Android.
</p>
![FightingBox-Mini](hardware/sch.jpg)
![FightingBox-Mini](hardware/FightingBox-Mini-pcb-t.jpg)
![FightingBox-Mini](hardware/2.png)
![FightingBox-Mini](hardware/3.png)

## Links

[Downloads](https://gp2040-ce.info/downloads) | [Installation](https://gp2040-ce.info/installation) | [Wiring](https://gp2040-ce.info/controller-build/wiring) | [Usage](https://gp2040-ce.info/usage) | [FAQ](https://gp2040-ce.info/faq/faq-general) | [GitHub](https://github.com/OpenStickCommunity/GP2040-CE)

Full documentation can be found at [https://gp2040-ce.info](https://gp2040-ce.info)

## Features

- Select from 13 input modes including X-Input, Nintendo Switch, Playstation 4/5, Xbox One, D-Input, and Keyboard
- Overclocked polling rate for an average of 0.76ms of input latency in Xinput and on average 1.72 for Playstation 4/5.
- Multiple SOCD cleaning modes - Up Priority (a.k.a. Stickless), Neutral, and Second Input Priority.
- Left and Right stick emulation via D-pad inputs as well as dedicated toggle switches.
- Dual direction via D-pad + LS/RS.
- Reversed input via a button.
- [Turbo and Turbo LED](https://gp2040-ce.info/add-ons/turbo) with selectable speed
- Per-button RGB LED support.
- PWM Player indicator LED support (XInput only).
- Multiple LED profiles support.
- Support for 128x64 monochrome I2C displays - SSD1306, SH1106, and SH1107 compatible.
- Custom startup splash screen and easy image upload via web configuration.
- Support for passive buzzer speaker (3v or 5v).
- [Built-in, embedded web configuration](https://gp2040-ce.info/web-configurator) - No download required!

Visit the [GP2040-CE Usage](https://gp2040-ce.info/usage) page for more details.

## Performance

Input latency is tested using the methodology outlined at [WydD's inputlag.science website](https://inputlag.science/controller/methodology), using the default 1000 Hz (1 ms) polling rate in the firmware. You can read more about the setup we use to conduct latency testing [HERE](https://github.com/OpenStickCommunity/Site/blob/main/latency_testing/README.md) if you are interested in testing for yourself or would just like to know more about the devices used to do the testing.

| Version | Mode | Poll Rate | Min | Max | Avg | Stdev | % on time | %1f skip | %2f skip |
| ------- | ------------ | --------- | ------- | ------- | ------- | ------- | --------- | -------- | -------- |
| v0.7.7 | Xinput | 1 ms | 0.45 ms | 1.28 ms | 0.76 ms | 0.24 ms | 98.48% | 1.52% | 0% |
| v0.7.7 | Switch | 1 ms | 0.41 ms | 1.22 ms | 0.72 ms | 0.24 ms | 98.54% | 1.46% | 0% |
| v0.7.7 | Dinput (PS3) | 1 ms | 0.44 ms | 1.27 ms | 0.75 ms | 0.24 ms | 98.49% | 1.51% | 0% |
| v0.7.7 | PS4 | 1 ms | 0.55 ms | 2.17 ms | 0.86 ms | 0.24 ms | 98.30% | 1.70% | 0% |
| v0.7.7 | PS4 Hack | 1 ms | 0.55 ms | 1.38 ms | 0.86 ms | 0.24 ms | 98.32% | 1.68% | 0% |

Full results can be found in the [GP2040-CE v0.7.7 Firmware Latency Test Results](https://github.com/OpenStickCommunity/Site/raw/main/latency_testing/GP2040-CE_Firmware_Latency_Test_Results_v0.7.7.xlsx) .xlsx Sheet.

Results from v0.7.6 can be found [HERE](https://github.com/OpenStickCommunity/Site/raw/main/latency_testing/GP2040-CE_Firmware_Latency_Test_Results_v0.7.6.xlsx). Previous results from v0.7.5 and earlier can be found in the [GP2040-CE v0.7.5 (and before) Firmware Latency Test Results](https://github.com/OpenStickCommunity/Site/raw/main/latency_testing/GP2040-CE_Firmware_Latency_Test_Results_v0.7.5_and_before.xlsx) .xlsx Sheet.

## Support

If you would like to discuss features, issues or anything else related to GP2040-CE please [create an issue](https://github.com/OpenStickCommunity/GP2040-CE/issues/new) or join the [OpenStick GP2040-CE Discord](https://discord.gg/k2pxhke7q8) support channel.

## Contributing

Want to help improve GP2040-CE? There are a bunch of ways to contribute!

### Community Participation

Have an idea for a cool new feature, or just want to discuss some technical details with the developers? Join the [OpenStick GP2040-CE Discord](https://discord.gg/k2pxhke7q8) server to participate in our active and ever-growing community!

### Pull Requests

Pull requests are welcome and encouraged for enhancements, bug fixes and documentation updates.
## Links

Please respect the coding style of the file(s) you are working in, and enforce the use of the `.editorconfig` file when present.
[Downloads](https://gp2040-ce.info/#/download) | [Installation](https://gp2040-ce.info/#/installation) | [Wiring](https://gp2040-ce.info/#/wiring) | [Usage](https://gp2040-ce.info/#/usage) | [FAQ](https://gp2040-ce.info/#/faq) | [GitHub](https://github.com/OpenStickCommunity/GP2040-CE)

## Acknowledgements
Full documentation can be found at <https://gp2040-ce.info>

- [FeralAI](https://github.com/FeralAI) for building [GP2040](https://github.com/FeralAI/GP2040) and laying the foundation for this community project
- Ha Thach's excellent [TinyUSB library](https://github.com/hathach/tinyusb) examples
- fluffymadness's [tinyusb-xinput](https://github.com/fluffymadness/tinyusb-xinput) sample
- Kevin Boone's [blog post on using RP2040 flash memory as emulated EEPROM](https://kevinboone.me/picoflash.html)
- [bitbank2](https://github.com/bitbank2) for the [OneBitDisplay](https://github.com/bitbank2/OneBitDisplay) and [BitBang_I2C](https://github.com/bitbank2/BitBang_I2C) libraries, which were ported for use with the Pico SDK
- [arntsonl](https://github.com/arntsonl) for the amazing cleanup and feature additions that brought us to v0.5.0
- [alirin222](https://github.com/alirin222) for the awesome turbo code ([@alirin222](https://twitter.com/alirin222) on Twitter)
- [deeebug](https://github.com/deeebug) for improvements to the web-UI and fixing the PS3 home button issue
- [TheTrain](https://github.com/TheTrainGoes/GP2040-Projects) and [Fortinbra](https://github.com/Fortinbra) for helping keep our community chugging along
- [PassingLink](https://github.com/passinglink/passinglink) for the technical details and code for PS4 implementation
- [Youssef Habchi](https://youssef-habchi.com/) for allowing us to purchase a license to use Road Rage font for the project
- [tamanegitaro](https://github.com/tamanegitaro/) and [alirin222](https://github.com/alirin222) for the basis of the mini/classic controller work
- [Ryzee119](https://github.com/Ryzee119) for the wonderful [ogx360_t4](https://github.com/Ryzee119/ogx360_t4/) and xid_driver library for Original Xbox support
- [Santroller](https://github.com/Santroller/Santroller) and [GIMX](https://github.com/matlo/GIMX) for technical examples of Xbox One authentication using pass-through
99 changes: 99 additions & 0 deletions configs/FightingBox-Mini/BoardConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
* SPDX-License-Identifier: MIT
* SPDX-FileCopyrightText: Copyright (c) 2024 OpenStickCommunity (gp2040-ce.info)
*/

#ifndef FM_BOARD_CONFIG_H_
#define FM_BOARD_CONFIG_H_

#include "enums.pb.h"
#include "class/hid/hid.h"
#define BOARD_CONFIG_LABEL "FightingBox Mini"

// Main pin mapping Configuration
// // GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade |
#define GPIO_PIN_29 GpioAction::BUTTON_PRESS_UP // UP | UP | UP | UP | UP | UP |
#define GPIO_PIN_27 GpioAction::BUTTON_PRESS_DOWN // DOWN | DOWN | DOWN | DOWN | DOWN | DOWN |
#define GPIO_PIN_26 GpioAction::BUTTON_PRESS_RIGHT // RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT |
#define GPIO_PIN_28 GpioAction::BUTTON_PRESS_LEFT // LEFT | LEFT | LEFT | LEFT | LEFT | LEFT |
#define GPIO_PIN_05 GpioAction::BUTTON_PRESS_B1 // B1 | A | B | Cross | 2 | K1 |
#define GPIO_PIN_06 GpioAction::BUTTON_PRESS_B2 // B2 | B | A | Circle | 3 | K2 |
#define GPIO_PIN_07 GpioAction::BUTTON_PRESS_R2 // R2 | RT | ZR | R2 | 8 | K3 |
#define GPIO_PIN_08 GpioAction::BUTTON_PRESS_L2 // L2 | LT | ZL | L2 | 7 | K4 |
#define GPIO_PIN_01 GpioAction::BUTTON_PRESS_B3 // B3 | X | Y | Square | 1 | P1 |
#define GPIO_PIN_02 GpioAction::BUTTON_PRESS_B4 // B4 | Y | X | Triangle | 4 | P2 |
#define GPIO_PIN_03 GpioAction::BUTTON_PRESS_R1 // R1 | RB | R | R1 | 6 | P3 |
#define GPIO_PIN_04 GpioAction::BUTTON_PRESS_L1 // L1 | LB | L | L1 | 5 | P4 |
#define GPIO_PIN_10 GpioAction::BUTTON_PRESS_S1 // S1 | Back | Minus | Select | 9 | Coin |
#define GPIO_PIN_12 GpioAction::BUTTON_PRESS_S2 // S2 | Start | Plus | Start | 10 | Start |
#define GPIO_PIN_09 GpioAction::BUTTON_PRESS_L3 // L3 | LS | LS | L3 | 11 | LS |
#define GPIO_PIN_13 GpioAction::BUTTON_PRESS_R3 // R3 | RS | RS | R3 | 12 | RS |
#define GPIO_PIN_11 GpioAction::BUTTON_PRESS_A1 // A1 | Guide | Home | PS | 13 | ~ |
#define GPIO_PIN_17 GpioAction::BUTTON_PRESS_A2 // A2 | ~ | Capture | ~ | 14 | ~ |

// Setting GPIO pins to assigned by add-on
//
#define GPIO_PIN_00 GpioAction::ASSIGNED_TO_ADDON
#define GPIO_PIN_14 GpioAction::ASSIGNED_TO_ADDON
#define GPIO_PIN_15 GpioAction::ASSIGNED_TO_ADDON

// Keyboard Mapping Configuration
// // GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade |
#define KEY_DPAD_UP HID_KEY_ARROW_UP // UP | UP | UP | UP | UP | UP |
#define KEY_DPAD_DOWN HID_KEY_ARROW_DOWN // DOWN | DOWN | DOWN | DOWN | DOWN | DOWN |
#define KEY_DPAD_RIGHT HID_KEY_ARROW_RIGHT // RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT |
#define KEY_DPAD_LEFT HID_KEY_ARROW_LEFT // LEFT | LEFT | LEFT | LEFT | LEFT | LEFT |
#define KEY_BUTTON_B1 HID_KEY_SHIFT_LEFT // B1 | A | B | Cross | 2 | K1 |
#define KEY_BUTTON_B2 HID_KEY_Z // B2 | B | A | Circle | 3 | K2 |
#define KEY_BUTTON_R2 HID_KEY_X // R2 | RT | ZR | R2 | 8 | K3 |
#define KEY_BUTTON_L2 HID_KEY_V // L2 | LT | ZL | L2 | 7 | K4 |
#define KEY_BUTTON_B3 HID_KEY_CONTROL_LEFT // B3 | X | Y | Square | 1 | P1 |
#define KEY_BUTTON_B4 HID_KEY_ALT_LEFT // B4 | Y | X | Triangle | 4 | P2 |
#define KEY_BUTTON_R1 HID_KEY_SPACE // R1 | RB | R | R1 | 6 | P3 |
#define KEY_BUTTON_L1 HID_KEY_C // L1 | LB | L | L1 | 5 | P4 |
#define KEY_BUTTON_S1 HID_KEY_5 // S1 | Back | Minus | Select | 9 | Coin |
#define KEY_BUTTON_S2 HID_KEY_1 // S2 | Start | Plus | Start | 10 | Start |
#define KEY_BUTTON_L3 HID_KEY_EQUAL // L3 | LS | LS | L3 | 11 | LS |
#define KEY_BUTTON_R3 HID_KEY_MINUS // R3 | RS | RS | R3 | 12 | RS |
#define KEY_BUTTON_A1 HID_KEY_9 // A1 | Guide | Home | PS | 13 | ~ |
#define KEY_BUTTON_A2 HID_KEY_F2 // A2 | ~ | Capture | ~ | 14 | ~ |
#define KEY_BUTTON_FN -1 // Hotkey Function |

#define BOARD_LEDS_PIN 0

#define TURBO_ENABLED 1
#define GPIO_PIN_18 GpioAction::BUTTON_PRESS_TURBO

#define LED_BRIGHTNESS_MAXIMUM 50
#define LED_BRIGHTNESS_STEPS 5
#define LEDS_PER_PIXEL 1

#define LEDS_DPAD_LEFT 10
#define LEDS_DPAD_DOWN 9
#define LEDS_DPAD_RIGHT 8
#define LEDS_DPAD_UP 11
#define LEDS_BUTTON_B3 0
#define LEDS_BUTTON_B4 1
#define LEDS_BUTTON_R1 2
#define LEDS_BUTTON_L1 3
#define LEDS_BUTTON_B1 7
#define LEDS_BUTTON_B2 6
#define LEDS_BUTTON_R2 5
#define LEDS_BUTTON_L2 4

#define HAS_I2C_DISPLAY 1
#define I2C1_ENABLED 1
#define I2C1_PIN_SDA 14
#define I2C1_PIN_SCL 15
#define DISPLAY_I2C_BLOCK i2c1

#define BUTTON_LAYOUT BUTTON_LAYOUT_OPENCORE0WASDA
#define BUTTON_LAYOUT_RIGHT BUTTON_LAYOUT_OPENCORE0WASDB

#define LEDS_BASE_ANIMATION_INDEX 3
#define LEDS_THEME_INDEX 19
#define LEDS_BUTTON_COLOR_INDEX 0
#define LEDS_BRIGHTNESS 2


#endif
Binary file added hardware/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hardware/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hardware/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hardware/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hardware/FightingBox-Mini-pcb-b.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hardware/FightingBox-Mini-pcb-t.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hardware/FightingBox-Mini-v1.2-20230801.zip
Binary file not shown.
Binary file added hardware/FightingBox-Mini.pdf
Binary file not shown.
Binary file added hardware/Fightingbox-mini-3pcs.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hardware/sch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions headers/buttonlayouts.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@
{GP_ELEMENT_DIR_BUTTON, {27, 39, 37, 49, 1, 1, GAMEPAD_MASK_DOWN, GP_SHAPE_SQUARE}},\
{GP_ELEMENT_DIR_BUTTON, {27, 28, 37, 38, 1, 1, GAMEPAD_MASK_UP, GP_SHAPE_SQUARE}},\
{GP_ELEMENT_DIR_BUTTON, {38, 39, 48, 49, 1, 1, GAMEPAD_MASK_RIGHT, GP_SHAPE_SQUARE}},\
{GP_ELEMENT_BTN_BUTTON, {6, 19, 3, 3, 1, 1, GAMEPAD_MASK_S2, GP_SHAPE_ELLIPSE}},\
{GP_ELEMENT_BTN_BUTTON, {14, 19, 3, 3, 1, 1, GAMEPAD_MASK_S1, GP_SHAPE_ELLIPSE}},\
{GP_ELEMENT_BTN_BUTTON, {23, 19, 3, 3, 1, 1, GAMEPAD_MASK_A1, GP_SHAPE_ELLIPSE}},\
{GP_ELEMENT_BTN_BUTTON, {31, 19, 3, 3, 1, 1, GAMEPAD_MASK_A2, GP_SHAPE_ELLIPSE}},\
{GP_ELEMENT_BTN_BUTTON, {39, 19, 3, 3, 1, 1, GAMEPAD_MASK_L3, GP_SHAPE_ELLIPSE}},\
{GP_ELEMENT_BTN_BUTTON, {47, 19, 3, 3, 1, 1, GAMEPAD_MASK_R3, GP_SHAPE_ELLIPSE}}\
{GP_ELEMENT_BTN_BUTTON, {6, 19, 3, 3, 1, 1, GAMEPAD_MASK_R3, GP_SHAPE_ELLIPSE}},\
{GP_ELEMENT_BTN_BUTTON, {14, 19, 3, 3, 1, 1, GAMEPAD_MASK_L3, GP_SHAPE_ELLIPSE}},\
{GP_ELEMENT_BTN_BUTTON, {23, 19, 3, 3, 1, 1, GAMEPAD_MASK_A2, GP_SHAPE_ELLIPSE}},\
{GP_ELEMENT_BTN_BUTTON, {31, 19, 3, 3, 1, 1, GAMEPAD_MASK_S2, GP_SHAPE_ELLIPSE}},\
{GP_ELEMENT_BTN_BUTTON, {39, 19, 3, 3, 1, 1, GAMEPAD_MASK_S1, GP_SHAPE_ELLIPSE}},\
{GP_ELEMENT_BTN_BUTTON, {68, 19, 3, 3, 1, 1, GAMEPAD_MASK_A1, GP_SHAPE_ELLIPSE}}\
}

#define BUTTON_GROUP_OPEN_CORE_WASD_B {\
Expand Down

0 comments on commit 2f75cb4

Please sign in to comment.