So recently I made myself a custom SNES Joystick. I'll be posting about that later, but I noticed that it wouldn't work with the Super Gameboy, despite working with other SNES games. I also noticed that my third-party PS2 to SNES adaptor as well as my NES to SNES adaptor wouldn't work either! Something is clearly up with the Super Gameboy.
So I bought an oscilloscope.
First, here's a fairly good reference for the SNES connection scheme which will provide some background information.
Here's how the latch and clock lines look on the scope for a normal game:
And here's the corresponding data lines for one button pressed:
And because the lines overlap a bit, here's it zoomed for clarity:
Now, the above also applies for the Super Gameboy... most of the time. However, it sometimes does this with the clock and latch lines:
It appears to be holding the latch line high for a rather large period of time (\~100 us), and sending strange pulse spikes on the clock line. I can't think of any specific reason the Super Gameboy is doing this, unless it is intending to trip up unofficial controllers. And trip them up it does.
An official controller completely ignores this sequence and does nothing (note: a button is pressed here):
However, my custom joystick, and presumably other adaptors see the rising edge of the latch line and load the button data. Then the small clock pulses are sufficient for the microprocessor to recognize and shift the data out:
Even the NES controller is tripped up by this, as it contains a simple shift register which will latch on the high pulse and is sensitive enough for the clock pulses.
Unfortunately, I don't really have a solution. I'm presently using interrupts, and I can't see a way to get the microprocessor to ignore the abnormal clock pulses. Theoretically, it might be able to detect the too-long latch and switch to some other mode, but that might be difficult to detect while still remaining responsive enough for the normal sequence.
The only advice I have at this time is to use a SNES gamepad as a donor and use the exact same chip on a custom joystick if you want Super Gameboy support.