gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > IPC->touchX & IPC->touchY

#156424 - Roland - Fri May 09, 2008 4:45 pm

Hello everyone,
It's me again :), I was peering into NDS lib code and I've found that the touchReadXY() function is implemented like this:
Code:

touchPosition touchReadXY() {
   touchPosition touchPos;

   touchPos.x = IPC->touchX;
   touchPos.y = IPC->touchY;

   touchPos.px = IPC->touchXpx;
   touchPos.py = IPC->touchYpx;

   return touchPos;

}

While it's clear what are .px and .py (and even the non filled members .z1 and .z2) I don't have a clear idea about .x and .y. Searching the forum I've found that those members are touch screen coordinates, each one 16 bit long... but nothing else. Since their values are very strange, can I ask you what they mean?

Thanx a lot again :).

#156425 - NeX - Fri May 09, 2008 5:20 pm

I think it is likely that this is the raw data passed back from the touch screen and it is therefore uncalibrated. PX and PY have been calibrated, transformed, whatever, and so resemble where you are touching whereas X and Y are fairly useless to most people.
_________________
Strummer or Drummer?.
Or maybe you would rather play with sand? Sandscape is for you in that case.