NicoHood / Nintendo

Use Nintendo Controllers with Arduino
http://www.nicohood.de
MIT License
284 stars 57 forks source link

Works in BIOS, not ingame #30

Closed sirjeannot closed 3 years ago

sirjeannot commented 3 years ago

Hello,

first thanks for your library, it's really a saver.

Based on your lib and usbhost, I've connected a ps3 controller to the gamecube. Everything works inside the gamecube bios, but ingame (fzero) no input are registered.

Code is here : https://github.com/sirjeannot/GamecubeBT/blob/main/GamecubeBT/GamecubeBT.ino The only thing I've changed from the templates:

I was wondering if the behavior of the console with the controllers is different within the BIOS and ingame. I was wondering also if the gcwrite should be called on every loop. If yes, my only way out is to use an arduino for BT, one for the Gamecube and send keypresses on different pins.

Thanks!

NicoHood commented 3 years ago
  1. Every Game handles the controller on its own. So polling times are different
  2. Mostly you need to answer EVERY call from the console, so the loop needs to be fast
  3. USB Host is expensive

I'd recommend using 1 arduino for gamecube communication and use a serial connection with a lot of (custom) error connection to transfer the data from a 2nd arduino. For example:

Arduino with USB:

  1. Poll usb data
  2. Send Data to 2nd arduino with a start/stop mark + checksum
  3. Repeat

Arduino with gamecube connection:

  1. Discard serial buffer (read until nothing is available)
  2. Read serial data until a valid package was received
  3. Talk with the gamecube
  4. Repeat

You can use up to 2M for serial speed, you must experiment with that. You have to be fast!