Close

2020-07-19 Progress update - SEGA Saturn support

A project log for BlueRetro

Multiplayer Bluetooth controllers adapter for retro video game consoles

jacques-gagnonJacques Gagnon 07/19/2020 at 16:190 Comments

As seen with the last log entry, I've been working on Genesis & Saturn support since the beginning of the month.

Finally got the last few bits working last night for the Saturn Multitap support!

In this new release v0.3 I added support for:

Still got to add the true digital mode support for the regular Saturn controller but as simple as it is on paper it's quite hard actually. The timing for the controller identification is quite brutal for our poor ESP32. 

A real controller will flip its output within 100 ns of a select line change. With the ESP32 GPIO interrupt the best I can do is 2.6 us. If I remove the 2nd core watchdog and make a very tight loop, only reading the select line and changing the output, I get between 900 ns and 1.2 us.

while (1) {
        if (GPIO.in1.val & 0x8) {
            tx_nibble(0, 0xC);
        }
        else {
            tx_nibble(0, 0xF);
        }
}

It looks like aiming for 1 us should be enough. Unfortunately the ESP32 core 1 with all the stall coming from the DPORT read on core 0 can't be reliable enough.

I think the solution is to use the ULP Coprocessor of the ESP32. I'll probably end up doing the Genesis support this way too.

For the analog controller and multitap, we work around this problem since the two nibbles for identification are the same! So even if we are in theory not fast enough to change it it's fine in those 2 cases!

For now having digital controller support via the analog controller digital mode is good enough. I think only Golden Axe: The Duel don't support that mode.

The Saturn being a 5V system and the ESP32 not being 5V tolerant, the adapter cable needs to include level shifters. I endup with quite a cable mess using breadboard ;) . I will make PCB down the line anyway.

See schematic for detail.

Discussions