Game Port Problem

Dear all,
I access the game port through the memory address 0x201 . In my program ,
the code is as the following :

ThreadCtl(_NTO_TCTL_IO, 0) ;
ptr=mmap_device_io( 1 , 0x201 );
value = in8(ptr);

However , I had found a problem on reading data on three different computer
:

  1. A computer with onboard game board (set to 0x209) and a game port on a
    sound card(default to 0x201)
    In this computer , I ONLY CAN access the port through address 0x209.
  2. A computer only have one onboard game port(default to 0x201)
    In this computer , I CAN access the port through address 0x201.
  3. A computer have a game port on the sound card(default to 0x201)
    In this computer , I CAN NOT access the port through address 0x201.

I want to ask weather the game port on the sound card can be accessed on QNX
or not.
Or I had something done wrong?
Any idea about the problem?

Thanks ,
Waity Wong

“waity” <waity@hongkong.com> wrote in message
news:9r165l$80j$1@inn.qnx.com
I access the game port through the memory address 0x201 . In my program ,

the code is as the following :

ThreadCtl(_NTO_TCTL_IO, 0) ;
ptr=mmap_device_io( 1 , 0x201 );
value = in8(ptr);

You should check that the mmap didn’t fail - just for sanity and good coding
practice.

However , I had found a problem on reading data on three different
computer
:

  1. A computer with onboard game board (set to 0x209) and a game port on a
    sound card(default to 0x201)
    In this computer , I ONLY CAN access the port through address 0x209.
  2. A computer only have one onboard game port(default to 0x201)
    In this computer , I CAN access the port through address 0x201.
  3. A computer have a game port on the sound card(default to 0x201)
    In this computer , I CAN NOT access the port through address 0x201.

I want to ask weather the game port on the sound card can be accessed on
QNX
or not.
Or I had something done wrong?
Any idea about the problem?

While I can’t answer questions on gameport programming, if you have the
proper physical address and size, you can map it into a process and
write/read in/out to it without a problem (regardless of the fact it’s a
gameport). I think perhaps there are some specifics to programming the game
port you are missing (ie. are you sure the register space for the port is
only 8bits wide?).

-Adam