Home

IBM 5150/5160  -  Game Card  -  Bit 12 in the Equipment Flag


Background

  In RAM, starting at address 40h, is the 'BIOS data area' (BDA).
     
  Within the BDA are two bytes, that collectively, IBM refer to as the 'Equipment Flag'.  The power-on self test (POST) populates the Equipment Flag.
     
  If the source code for the motherboard BIOS of the IBM 5150 and IBM 5160 are examined, it will be seen that bit 12 of the Equipment Flag is used to indicate whether or not a game card is fitted.  I used, "whether or not a game card is fitted" because of the associated wording that IBM have used in the source code (e.g. "NO_GAME_CARD") for bit 12.

According to the source code:
    Bit 12 = 0, means game card not present
    Bit 12 = 1, means game card present
     
  The POST of the IBM 5170 does not manipulate bit 12.


Introduction


I have an IBM game card  (the full and official name being 'IBM Game Control Adapter').

In my IBM 5150/5160, it does not matter whether or not I have my IBM game card fitted; I find that 'bit 12' is always 0.
I will mention that I have no joysticks attached to that card (because I don't own any).

I decided to investigate (e.g. perhaps my IBM game card is faulty).


Research

NOTE:  In the following, like what the POST does in its 'game card' detection code, no write to port 201h was done prior to a read of port 201h.

  For my various IBM 5150/5160 motherboards, a read of an I/O port that is not decoded (i.e. data bus will not get driven) gives varying results.  E.g. One motherboard consistently returns FF, one consistently returns FE, one consistently returns FC.
     
  The POST of an IBM 5150/5160 will only set 'bit 12' to 1 if the lower nibble of an I/O port 201h read is zero (i.e. 0000 binary).
     
  Whether or not I have my IBM game card (no joysticks attached) plugged in to my IBM 5150/5160, a read of port 201h always returns the lower nibble value of F (i.e. 1111 binary).
     
  That lower nibble corresponds to the four outputs of the 'NE588 quad timer' chip on the IBM game card.
The NE588 is used to measure the resistance values in two joysticks:
NE588 channel A = pin 13 of the card's D connector = Coordinate Y of joystick B
NE588 channel B = pin 11 of the card's D connector = Coordinate X of joystick B
NE588 channel C = pin 6 of the card's D connector = Coordinate Y of joystick A
NE588 channel D = pin 3 of the card's D connector = Coordinate X of joystick A
     
  By tying pin 3 of the card's D connector to +5V (i.e. simulating coordinate X of joystick A being in one extreme position), a read of I/O port 201h returned E (i.e. 1110 binary) in the lower nibble.
     
  By tying pins 3,6,11,13 of the card's D connector to +5V, a read of I/O port 201h returned zero (i.e. 0000 binary) in the lower nibble.  As expected, this was the only time that I saw 'bit 12' at a 1.
     
  Irrespectve of the state of 'bit 12', CheckIt version 2.1 always indicated, "Joystick(s): No Game Port".  CheckIt version 3 behaved the same.
  Irrespectve of the state of 'bit 12', InfoSpotter version 2.50 always indicated, "Game Ports: None".


Conclusion #1

In the IBM 5150/5160, the accurate description of the meaning of 'bit 12' of the equipment flag is:
    Bit 12 = 0, means no game card, or game card with no joysticks attached, or game card with one joystick attached
    Bit 12 = 1, means game card present and two joysticks (functional) are attached to it

Comment: What was IBM thinking?
How was it beneficial that the BDA be able to inform software that two joysticks were present at power-on time.
A mistake, no doubt.


Conclusion #2

Rightly so, some information gathering software don't appear to look at 'bit 12' of the equipment flag.

Whilst such software, running on an IBM 5150/5160, using their own custom code, cannot reliably detect a game card that has no joysticks attached, it is possible for that code to detect a game card with one (or two) joysticks attached.

However, as evidenced by CheckIt's and InfoSpotter's behaviour, they are misleading in the situation of a game card that has no joysticks attached.  In that situation, both CheckIt and InfoSpotter should be indicating, "Joystick(s): None".  Instead, by their indication that there are no game ports, users (like me) are led to believe that their game card is faulty.