Close

Background and current status

A project log for BlueRetro

Multiplayer Bluetooth controllers adapter for retro video game consoles

jacques-gagnonJacques Gagnon 05/22/2020 at 12:400 Comments

I started this project in early 2018 when I ordered Switch Pro, Xbox One S & PS4 Bluetooth controllers on amazon. I'm still not owning neither of those systems! I had resurrected my 6-year-old fork of the Cube64 project a few months back. While I absolutely loved hacking on that project, it was clear to me it was kind of pointless. Replacing old N64 controller with old GameCube controller was not ideal (even if Nintendo re-release GC pad every SSB release). What was really needed was a universal adapter that would take any current HID devices. Why bid war on eBay with collectors to get a console specific keyboard or mouse?

I kept working on Cube64 as a test bench for the next project. It was simple enough that I could easily test various features I had in mind in the real world. At the same time that spring I took a look at what would be the chip to host that next project. I wanted a chip with a good community so I had in mind to either use a STM32 with an UART BT chip or one of the Nordic chips. After learning more about Bluetooth, I realized what I really needed was a Dual Mode Bluetooth chip (Classic BT + BLE). Most controllers are Bluetooth classic (BR/EDR) but many new devices are only BLE. This ruled out Nordic and while looking at an all-in-one Dual BT solution I came across the ESP32 which had a good community around it and a nice SDK. I still had in mind to use both Bluetooth and USB HID devices at that point. I was a bit annoy the ESP32 didn't have a USB OTG PHY since it was perfect otherwise. In the end after reflection I decided to drop the USB support and focus on Bluetooth. So ESP32 it was!

The rest of 2018 was mostly trying out the various examples for the ESP32 to know the chip better while hacking a bit on Cube64 and learning more about BT Classic. It's hard to learn BT Classic in the age of BLE!! More on that in another log ;) .

By May 2019 I had a N64/GC driver using the RMT hardware for talking to 4 controller simultaneously. Then by the end of June I had a very primitive Bluetooth stack that could talk to a WiiU Pro controller. In July I glued together both demos in what end up to be the first BlueRetro version. Then in August I decide to implement the Maple protocol for Dreamcast with GPIO Bitbang. This was really hard I almost gave up. I realized then that the ESP32 got that evil chip bug that prevents both core from reading from DPORT simultaneously. Their fix in the IDF is to stall the other CPU when access is required. This is fatal when you try to bitbang 2x 1 MHz signal simultaneously. Once I realized this, I simply staled the other core when I was about to go bitbang and this resolved the problem.

With the hardest system supported I focus on my Bluetooth stack most of fall 2019 and added support for Wii, PS3, PS4, Xbox One S and Switch Bluetooth controllers. Then I added simultaneous BT device support. Then in November I added the BLE configuration interface through Web Bluetooth. My vision is that an end user should not need to install anything beside a browser. I knew nothing about JavaScript but I managed to hack something functional. Now I could configure the buttons mapping and various other features. At that point it started to feel like a real product!

I planned to go into Hackaday prize 2020 with v1.0 ready but I'm still at v0.1. It's a lot of work and it's crazy at my real job these days so my pace reduced a lot in the last few months. After thinking a bit about waiting another year to get this out, I finally decided to go in with what I got now and continue development in the public.

Current state is:

TODO:

Discussions