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.
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:
- Bluetooth support
- Generic BR/EDR HID Mouse
- Generic BR/EDR HID GamePad (HID descriptor must ~match one of the known devices below)
- PS3 with led & rumble
- WiiU Pro with led & rumble
- PS4 with led & rumble
- Xbox One S with rumble (Via reconnect only (need spoof paired device MAC))
- Switch Pro with led and experimental rumble
- Wired support
- Nintendo 64 controller with and without rumble pak
- GameCube controller
- Dreamcast controller with and without jump pack
- Adapter support
- Config via Web Bluetooth
- Buttons & axes mapping
- Axes scaling
- BLE device support (Mouse, KB, Steam Ctrl)
- Mouse adapter
- Keyboard adapter
- All the other systems wired support (PSX/PS2, NES/SNES, MD/Saturn, PCE, Atari, etc)
- Finish Wii controller & extension support.
- Better HID generic support.
- PCB design
- Bug fixing!
- Documenting the code & some cleanup/polishing.