what's actually vexing me right now is this bit from the gate-level reverse engineer of the DMG SoC, which implements the joypad interrupt (INT_JP). (the official docs say that the joypad interrupt is triggered when any button is pressed.) the PXX_IN wires come straight from the SoC's input pins, so the OR gate on the left is active when any button is pressed. BUT then there are four flipflops fed from the OR gate, connected up like a 4-bit counter...
0 Boosts
0 Likes
... but only the 1st and 4th bit of the counter go to the AND gate that triggers the interrupt. the effect, if i'm reading it right, is that to trigger the joypad interrupt, a button must be pressed *now* but also *3 clocks ago*. this *looks* like an anti-bounce measure, but it leads to a weird edge case: for those middle two cycles—which aren't connected to the AND gate—the joypad reg might show a button press, BUT a corresponding interrupt might not get triggered?