I know that there is at least one register at 0x201, but I can't find
any specifics.
Thanks,
Pat
Just to clarify, I am planning on writing a Unix device driver. So I
will not have access to any DOS bios routines.
I am really just looking for a description of where to write to start the pot
timers, where to read them back, and what kind of times would be involved.
Any info would be greatly appreciated.
Thanks,
Pat
: I am really just looking for a description of where to write to start the pot
: timers, where to read them back, and what kind of times would be involved.
: Any info would be greatly appreciated.
although it is a most unlikely place, you will find what you
need in the Joystick section of the "flight of fantasy" book.
This book explain how to write a flight simulator using C++.
(I have the book at home, so can't give ISBN now,
email me if you don't find other reference and will look it up).
Edgar
That's the only port it uses, I think. There's a bios call read
the values:
INT 15,84 - Joy-Stick Support
AH = 84h
DX = 0 to read the current switch settings
= 1 to read the joystick position (resistive inputs)
on return (DX=0, read switch setting):
CF = 0 if successful
= 1 if error
AH = 80h error code if CF set on PC
= 86h error code if CF set on XT before 11/8/82
AL = switch settings in bits 7-4 (if read switch function)
on return (DX=1, read joystick position):
AX = A(X)
BX = A(Y)
CX = B(X)
DX = B(Y)
Anssi
--
Anssi Saari s10...@ee.tut.fi
Tampere University of Technology
Finland, Europe
Yes, 1 I/O port, at hex 201 only. Write to port 201 to start the timers. Read
port 201 for the status - the bits are :
7 - 4 Digital inputs (MSB = button 3 etc)
3 - 0 Outputs of the timers (3 = Y2, 2 = X2, 1 = Y1, 0 = X1)
Writing to port 201 will set the timer outputs to logic 1. They then go back to
logic 0 after a time determined by the value of pot.
>
>Just to clarify, I am planning on writing a Unix device driver. So I
>will not have access to any DOS bios routines.
>
>I am really just looking for a description of where to write to start the pot
>timers, where to read them back, and what kind of times would be involved.
Write to port 201 to start the timers. Read them back at the same port. Pots
are normally 0-150k variable resistors (0-100k sometimes), and according to the
IBM techref, the time is given by
Time = 24.2e-6s + 0.011e-6s * R/Ohms
>
>Any info would be greatly appreciated.
Hope this helps.
>
>Thanks,
>Pat
-tony
I did used the PC game port as an analog input, and I think I can help you..
To reset the timer , send 0 to port 0x201 and then implement an loop that
increment an variable while port is not high.
function bellow reads an value from horizontal pot of game port A.
int readgame(void)
{
int j,k;
k=0;
j=0;
outportb(0x201,0);
j=inportb(0x201)&1;
while (j)
{
k++;
j=inportb(0x201)&1;
}
return (k);
}
You can implement up to four analog inputs and four switch inputs with PC game
port.
I hope this reply can help you....
Good luck.. :)
/* Evandro - Computer Engineering Student */
/* Universidade de Sao Paulo - USP */
Just a word of caution, I've come across several machines which don't have
this in their BIOS. My 286 Pheonix for example reported the button's
status but didn't return the position values. Seeing as my joystick has
worked on every game I've tried it on I think it's safe to assume that
most commercial games don't use this interrupt.
Mark
I've been looking into this. Phoenix *claims* their BIOS supports it,
and IBM has supported it since the PC AT (but not the PC, PCjr, or PC XT).
Maybe your joystick resistance is too high for your particular machine.
The problem is, the behavior of the BIOS interrupt is not very reproducible
from machine to machine. A normal 0-200k joystick resistance gives very
different readings on different machines.
For the best reproducibility, write your programs in BASIC. The joystick
reading routines in BASICA, GWBASIC, QBASIC, and QuickBASIC are very
reproducible from machine to machine -- they number they give you is very
close to the resistance in kilohms, and is unaffected by CPU speed.
Microsoft did something right.
--
< Michael A. Covington, Assc Rsch Scientist, Artificial Intelligence Programs >
< The University of Georgia, Athens, GA 30606-7415 USA mcov...@ai.uga.edu >
<>< ----------------------------------------------------------------------- ><>
< For info about U.Ga. degree programs, email GRA...@UGA.CC.UGA.EDU (not me) >