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 > weird touchscreen coordinate on new firmware ds

#60249 - Onori - Tue Nov 08, 2005 12:14 pm

Hi,

I've made a little game that use touchscreen using latest devkitpro/libnds, and all worked fine on a normal grey old firmware ds.
now I've a new blue ds with new firmware, using passme2 etc...
and I experiment strange thing with the touchscreen, I didn't modified my code, so it must came from the ds, or maybe new firmware.
in the middle of the screen the coordinate seems ok, but when coming to the border of the screen (both top left right and bottom) the reading are incorrect.
for example, If I go to the very left of the screen I don't get '0' but something like ~5.
I use IPC->touchXpx and IPC->touchYpx for my reading.
does anyone have had the same problem on new ds ?

and before you ask, yes I've correctly calibrated my touchscreen dozen time on both ds, it work the same
I also tested my ds with an official game like meteos, and the cursor follow the stylus perfectly on the whole screen.

#60266 - tepples - Tue Nov 08, 2005 3:05 pm

I think it might have something to do with the fact that the stylus has a finite width. If its radius is 5 pixels, then you're not going to get closer to the left side of the screen than 5 pixels.

Have you tried moving a sprite under the stylus?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#60271 - Onori - Tue Nov 08, 2005 3:43 pm

Actually my program use a sprite moving under the stylus (I said like 5 pixels but it might be more, I don't have coordinate printed at screen)
on the grey ds (tested 2 of them) the sprite is exactly under the stylus when coming to the border of the screen, and on the blue ds it is like 5 or 10 pixels shift to the opposite direction.
like this:
[Images not permitted - Click here to view it]

#60281 - nman - Tue Nov 08, 2005 4:57 pm

Just calibrate the touch-screen in the options menu.

#60282 - Onori - Tue Nov 08, 2005 5:05 pm

go learn to read ...
I already say that I calibrated the touchscreen dozen time, and actually it work with official game, so it IS calibrated.

#60283 - nman - Tue Nov 08, 2005 5:29 pm

ok, sorry.

#60291 - josath - Tue Nov 08, 2005 6:30 pm

How do you know it is completely correct in official games? are there any games that read out the cursor position at the borders?

But really, there must be 500 topics that are exactly the same as this by now.

#60306 - BLKGHOST - Tue Nov 08, 2005 9:07 pm

But he's right...There is something strange with the reading. I never was able to get accurate reading from my blue DS but only with homebrew. Works fine with commercial games.

#60343 - Onori - Wed Nov 09, 2005 10:09 am

josath wrote:
How do you know it is completely correct in official games? are there any games that read out the cursor position at the borders?

just play meteos, there is a cursor that follow the stylus on the whole screen.
and on blue ds the cursor is perfectly under the stylus, whereas it is really not the case with a sprite following the stylus on a homebrew app, I also got the same problem with all other homebrew app.

#60389 - ventilo - Wed Nov 09, 2005 10:01 pm

hi, not sure if it will help but...

I had correct readings on my old gray DS until I installed a screen protector, now the readings are accurate near the center but very inaccurate near the borders (sprite under the stylus also). Maybe you installed a screen protector on your new DS ?
_________________
Firstname's Y.A.N.N..... yet another NDS noob :o)

#60441 - Mollusk - Thu Nov 10, 2005 10:36 am

for the screen protector, it has already been said quite a few times... and commercial games seem to have rather good coordinates, even with them, so that still means that the touch screen code will need some improvement... which is tough
_________________
PAlib official forum : http://www.palib.info
PAlib official tutorials: http://www.palib.info/wiki
Updates, help, code examples, tutorials, etc...