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 > ScummVM Touchscreen registers the wrong spot

#66086 - wonderworld - Sun Jan 08, 2006 3:46 am

Hi,
I have got big trouble with ScummVM. When tapping the touchscreen, SCUMM registers the tap in the wrong place.

___________

some button
___________


>> I have to click here to activate the button <<


Because of this problem the games are unplayable for me.
I can't reach every place in the inventory and i have to guess the
right spot to click all the time. Starnage thing is i haven't read anything
about that issue on any forum i have been visiting, so my last chance is,
you guys can help me.

My Hardware:

Early DS silver
M3 CF
Console Software 14
Scumm v.5

Thanks
wonder

#66092 - Critical_Impact - Sun Jan 08, 2006 5:00 am

Have u tried calibrating your ds in the options screen?

#66097 - Puppet - Sun Jan 08, 2006 5:29 am

I have a similar problem with my DS. YopYop sent me a touch screen app, and the touch screen worked perfectly with that. Hopefully the code in that app will be applied to ScummVM.

#66100 - wonderworld - Sun Jan 08, 2006 6:05 am

Hey..
In case you ment the DS-Firmware-Calibration, yes i did that.

In case you ment a calibration option inside SCUMM, no because i can't tap the "Options" button :)

Greets
wonder

#66123 - MatLeOuf - Sun Jan 08, 2006 11:16 am

Hi!
Have you looked at my last thread (http://forum.gbadev.org/viewtopic.php?t=7980)? I've got exactly the same problem as you, and duencil posted a hack that makes the screen much more precise. Unfortunately, you need to recompile the software, but I don't despair to see this hack included in the next release of libnds, if you can't compile things, I can send you the modified app (along with the unmodified one) for you to test and see if your problem gets solved.

YopYop also sent me his TouchTest program but, unfortunately, it didn't solve anything for me...

#66144 - wonderworld - Sun Jan 08, 2006 2:36 pm

yes, that would be cool.
I don't have the tools to compile by myself.

Just upload it to http://www.rapidshare.de or some other free file hoster.
Thanks a lot.

wonder

#66153 - MatLeOuf - Sun Jan 08, 2006 3:38 pm

No problem. Here is the modified software, along with the source code : http://rapidshare.de/files/10649024/TouchTest4.rar.html
And don't hesitate to give feedback ;)

#66191 - wonderworld - Sun Jan 08, 2006 10:50 pm

hey yes, this touchscreen test seems to work fine for me.
the ball i was moving was a little too big to tell that it's really 100% accurate, but it's definately much better then the tochscreen in SCUMM.

How does it happen that some DS units just work fine and others like mine have got big problems?

Is there a way to compile a new SCUMM with that updated library?

Greets
wonder

#66201 - duencil - Mon Jan 09, 2006 12:06 am

wonderworld wrote:
Is there a way to compile a new SCUMM with that updated library?


Just 2 lines in the measurement code need to be added and the source recompiled. I left instructions in the thread MatLeOuf linked to above. I tried recompiling ScummVM for DS for you, but it seems to depend on an older version of libnds than the one I use. But I'm sure agentq will make the change if you ask on the ScummVM thread (http://forum.gbadev.org/viewtopic.php?t=7232) or PM him.

#66206 - agentq - Mon Jan 09, 2006 12:41 am

ScummVM uses some very old code to read the touchscreen from before libnds had touchscreen reading code. This was tweaked to give the correct values on my DS. This may be what is causing problems for some people. Other people have reported the touch screen being perfectly accurate in ScummVM.

I switched over to the libnds touchscreen code this morning, and it is noticably less accurate on my DS. When I made the hack posted on this board to read the registers twice, it doesn't improve the touch screen accuracy at all. Running the touchtest program on my DS also doesn't produce very good results. Especially with the single shot mode, the ball's position frequently has no relation to where I touched.

So perhaps this isn't the solution. Or perhaps it only improves it on some hardware revision, other then mine (I have an original silver DS bought on release day).

#66259 - NoMis - Mon Jan 09, 2006 10:09 am

Version 0.4 worked very fine and accurate and it mostly took the clicks right. But since I updated to 0.5 it seems very inaccurate on my DS.
It's very noticeable in the menus where I often need like 5 clicks until I can select a savegame :(

Other than that the new version is just great. Sound is now very nice and the other improvements are also very good. Keep up the good work.

NoMis

#66272 - Critical_Impact - Mon Jan 09, 2006 12:04 pm

Mine works most of the time but sometimes it clicks on the other side of the screen.

#66429 - Puppet - Tue Jan 10, 2006 7:04 pm

agentq wrote:
ScummVM uses some very old code to read the touchscreen from before libnds had touchscreen reading code. This was tweaked to give the correct values on my DS. This may be what is causing problems for some people. Other people have reported the touch screen being perfectly accurate in ScummVM.

I switched over to the libnds touchscreen code this morning, and it is noticably less accurate on my DS. When I made the hack posted on this board to read the registers twice, it doesn't improve the touch screen accuracy at all. Running the touchtest program on my DS also doesn't produce very good results. Especially with the single shot mode, the ball's position frequently has no relation to where I touched.

So perhaps this isn't the solution. Or perhaps it only improves it on some hardware revision, other then mine (I have an original silver DS bought on release day).


Would it be possible to switch between the two touchscreen codes? Maybe you could hold down a button when it's starting up or something to switch over to the alternative code.... would something like this be possible?

#66436 - duencil - Tue Jan 10, 2006 8:41 pm

agentq wrote:
I switched over to the libnds touchscreen code this morning, and it is noticably less accurate on my DS. When I made the hack posted on this board to read the registers twice, it doesn't improve the touch screen accuracy at all. Running the touchtest program on my DS also doesn't produce very good results. Especially with the single shot mode, the ball's position frequently has no relation to where I touched.


I see from looking at your arm7 code that what you've you've tweaked is the conversion from touchscreen coordinates to pixel coordinates, presumable with values that obtain better results on your machine. You should be able to preserve that behaviour with your custom code - my suggestion was just referring to modifying the previous raw reading of touchscreen coodinates. I found that adding a touchRead(TSC_MEASURE_X|1) before
Code:
x = touchRead(TSC_MEASURE_X);
and a touchRead(TSC_MEASURE_Y|1) before
Code:
y = touchRead(TSC_MEASURE_Y);
reduces interference in the measurements. You may not notice any improvement - many units seem immune to the interference anyway, but if adding these lines doesn't affect you adversely, it will probably help others.

#66538 - wonderworld - Wed Jan 11, 2006 7:14 pm

any chance that someone who is able to, could patch that
code into the current version of SCUMM and offer it for download here?

I would do it by myself, but i really have got no idea how to do it...
I would report of course if it fixed my problems....

I really want to meet the ALIEN MINDBENDERS again.


Cheers
wonder

#66550 - wonderworld - Wed Jan 11, 2006 10:17 pm

ok, i tried to compile it bymyself.
had to adjust a lot of paths and stuff but now i am stuck....


e:/desktop/scummvmds0-5src/scummvm/backends/ds/arm9/source/dsmain.h:17: error: 'vector' does not name a type

#66556 - tepples - Wed Jan 11, 2006 10:52 pm

agentq wrote:
I switched over to the libnds touchscreen code this morning, and it is noticably less accurate on my DS.

What happens when you wait before each read?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#66571 - duencil - Thu Jan 12, 2006 12:44 am

wonderworld wrote:
ok, i tried to compile it bymyself.
had to adjust a lot of paths and stuff but now i am stuck....


e:/desktop/scummvmds0-5src/scummvm/backends/ds/arm9/source/dsmain.h:17: error: 'vector' does not name a type

vector was replaced by GLvector in later revisions of libnds

tepples wrote:
agentq wrote:
I switched over to the libnds touchscreen code this morning, and it is noticably less accurate on my DS.

What happens when you wait before each read?

The touchRead() function does perform several waits itself. Also I did experiment with
Code:
touchRead(TSC_MEASURE_X);
x = touchRead(TSC_MEASURE_X);

instead of
Code:
touchRead(TSC_MEASURE_X|1);
x=touchRead(TSC_MEASURE_X);
but that didn't help at all, which would suggest that its not just a timing issue or a simple case of reading the registers twice.

#67132 - wonderworld - Sun Jan 15, 2006 8:06 pm

Ok, wasn't able to compile the patched version because i have got no idea about DS programming. Is there anything else i could try to make it work?
I am really desperately waiting for a working SCUMM since October.

Tnx
wonder

#69471 - wonderworld - Tue Jan 31, 2006 12:00 am

Ok,
tried out something new today (WIN2DS).
Exactly the same problem. Touchscreen is not aligned to the screen right.

So the error must be in some lib both programs are using!?

Greets wonder

#69475 - wonderworld - Tue Jan 31, 2006 12:32 am

Here, I made a pic of myself tapping key "1"...

http://img210.imageshack.us/my.php?image=img03141om.jpg

#72861 - VanillaIcee - Wed Feb 22, 2006 5:10 am

Hey agentq, have you officially switched over to the libnds code? Is it possible to get a copy of this new code. Although since you are probably rewriting dsmain for the next version I can wait.