1. 23
  1.  

  2. 1

    As a sidenote: I needed to compile a custom kernel anyway. You may remember that I connected the button matrix of the GameBoy straight to the Raspberry Pi GPIOs. There is a gpio_matrix_keypad that makes interfacing with this very easy: just write the correct GPIOs into the device tree, load the module, and pushing the buttons will generate keyboard input as specified. The only downside is that this driver lacks polling support and as such doesn’t support pressing multiple buttons, something that is quite important for playing games. Luckily, I found a patch for the kernel to fix this. As this patch never made it to the mainline kernel, I had to manually patch this in and recompile the kernel anyway.

    I don’t understand why this is necessary. From what I can tell, the driver waits for an IRQ and then polls all the GPIO lines. The only reason why you would need a polled driver is if your GPIO controller didn’t support interrupts at all. But the RPi should certainly be able to handle this.