I just bought an old 2-axis 6-button gamepad on eBay which I plan to add support for in a game i'm writing for MS-DOS in 8086 assembly.
While I wait for it to be delivered i've been looking into low level programming of joysticks and game port based controllers. I can't find any documentation pertaining specifically to programming gamepads, only joysticks. I'm assuming they're treated the same as joysticks at the hardware level anyway, but I may be wrong.
Here's a link to an image of the gamepad just to show that it's nothing like a joystick.
https://i.ebayimg.com/images/g/9xsAAOSwBjdaOHFo/s-l1600.jpg
From what I can find, you access the game port via hardware port 201h, but I can't understand what the documentation is getting at as far as what the input bits actually represent.
This link describes the bits: http://docs.huihoo.com/help-pc/hw-game_port.html
First of all it only mentions 2 buttons. What if the controller has 6 buttons? Also, "joystick a, x coord (0 = timing active)" is the description of bit 0. Okay, but where do you actually collect the X coord? That just seems to tell you if timing is active, or inactive. Is it the length of time of the pulse that determines the X coord?
This link mentions that int 15h function 84 provides a somewhat easier method of accessing joysticks, but it only returns 4 button inputs, 2 per joystick, I think.
http://www.fysnet.net/joystick.htm
I would rather collect input directly from port 201h rather than use the BIOS service. Just to understand how it works.