The information in this article applies to:
SUMMARYIf you are experiencing problems with Basic's game port (or joystick) routines, such as STICK or STRIG, this article provides information that may help you to diagnose whether the symptom is the result of a ROM BIOS problem. This information applies only if your computer has an Intel 80286 or 80386 microprocessor chip. MORE INFORMATION
The way in which Basic SIC handles joystick commands (which include the
STICK function, STRIG function, and STRIG statement) depends on which
kind of Intel microprocessor chip the computer uses. If the computer
has an 8086/8088 or 80186/80188 microprocessor, the joystick commands
talk directly to the hardware without going through the ROM BIOS. If
the computer has either an Intel 80286 or 80386 microprocessor, the
joystick commands are handled by going through ROM BIOS Interrupt 15h.
Because of errors in some ROM BIOS joystick functions on some computers,
STICK or STRIG may not work at all, or may not work properly.
If DX = 0, this indicates to "read switch settings." If DX = 1, this
indicates "read resistive inputs."
Depending on the value of DX when you make the call, different parameters will be returned by the interrupt. If DX = 1, then upon returning from Interrupt &H15, the registers will contain the following:
If DX = 1, then bits 4 - 7 are used to represent switches. The AX
register will contain the switch settings in bits 4 through 7. BX, CX,
and DX will be unchanged.
Code exampleThe following code example shows how to use the CALL INTERRUPT routine to directly call the ROM BIOS joystick routines.To try this example in VBDOS.EXE:
VBDOS.EXE /L Note: The INTERRUPT routine is considered an external subroutine by the compiler. The routine is located in the files QB.LIB and QB.QLB for QuickBasic for MS-DOS 4.x and in QBX.LIB and QBX.QLB in Basic PDS for MS-DOS 7.x. Programs that execute a CALL INTERRUPT statement when compiled in the QB.EXE editor require the presence of the QB.QLB or QBX.QLB Quick library. This means that QB.EXE and QBX.EXE must be invoked with the /L option, which automatically loads the correct Quick library. Compiled programs that execute CALL INTERRUPT must be linked with the file QB.LIB or QBX.LIB. More information on the use of CALL INTERRUPT can be found under the CALL statement in the language reference manual for each Basic product. For more information on how to use CALL INTERRUPT, query on the following words: CALL and INTERRUPT and application and note and QuickBasic JOYSTICK.BAS
REFERENCESFor a description of the dependency of STICK and STRIG on computers with certain Intel chips, query on the following words in the Microsoft Knowledge Base: STICK and STRIG and BIOSIt may be possible to avoid using the ROM BIOS routines altogether by directly accessing the game port using GET and PUT functions. (Basic's INP and OUT statements cannot do this because of the speed required to read the port.) It may be possible for you to write an assembly subroutine, which could be called from Basic to talk directly to the game port. Information on programming the game port can be found in the following references:
Additional query words: VBmsdos QuickBas BasicCom 1.00 4.00 4.00b 4.50 6.00 6.00b 7.00 7.10
Keywords : |
Last Reviewed: December 4, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |