From what I remember when I tinkered with a Gravis Gamepad a couple of years ago is there are simply switches that pull the analog joystick x & y positions to various levels, using resistors. So pressing the up button for example looks to the game port like a joystick pushed all the way up.
For auto-fire there is a 555 timer IC configured as an oscillator which simply sends pulses down the fire button input on the game port. A couple of switches control rapid fire on/off and the configuration of the buttons.
The 555 circuit draws voltage from the game port to operate.
A basic game port works by charging a capacitor through each axis and measuring the time it takes to charge or discharge. The lower the resistance, the shorter the time, and thus the smaller the position of the joystick. This was done in the past using a 558 IC (a quad version of the 555 timer), but now days it is usually handled by an I/O controller chip or other circuitry on the motherboard.
There's more involved, but this is some basic info.