A Debian user has reported that their gamepad with >4 buttons is not supported by prboom: at least, buttons 5+ are not recognised.
Original report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=606231
Hmm, the joystick code looks fairly obvious and I think I could extend it to 32 buttons... maybe. The menu code to configure the buttons is a horrible mess. But I don't have any way of testing such a patch, so it'd be a bit of a "hit and hope" as it were.