Homebrew Help updating touchscreen faster?

  • Thread starter Thread starter Moocow9m
  • Start date Start date
  • Views Views 1,491
  • Replies Replies 7

Moocow9m

Member
Newcomer
Joined
Dec 29, 2016
Messages
8
Reaction score
0
Trophies
0
Age
27
XP
76
Country
United States
I am trying to be able to "color" on the touch screen by updating the touched pixels however it "jumps" positions when moving too fast. is there a way to tell when and where the screen is touched/pen moves along screen? Or a way to update touchPosition faster?

More Info EDIT:
Currently I am running the code below (which was found in ctrulib's hidScanInput) about 700 times a frame on a new thread with no ill effects to get touchPosition without checking others as to not disturb the checks on main thread. However even with this the problem is it doesn't check fast enough or the code is missing something.

Code:
touchPosition tPos;
u32 Id = hidSharedMem[42 + 4];
if(Id>7)Id=7;
  memset(&tPos, 0, sizeof(touchPosition));
  tPos = *(touchPosition*)&hidSharedMem[42 + 8 + Id*2];
return tPos;

END EDIT

Couldn't focus the camera but here is a picture of moving too fast with 3 attempts:
fXiKtr9.jpg
 
Last edited by Moocow9m,
i dont know much about programming and all that but could you make it so that it jumps between the 2 last points to make a line?
What if it wasn't a line between the points? That would be inaccurate. Thanks for suggestion though.
 
iirc, there is a function to know if the screen is being pressed. You can just draw a line if that's true.
I do not see such a function and I also need to know where the touch was. I am currently running some code that checks every 10000 nanoseconds.
 
Last edited by Moocow9m,
Displaying a line instead of dots while freehand drawing is common practice in drawing apps, such as colors on DS. Why not try both reduce the timer and draw the line? I think that'll do nicely
 
Displaying a line instead of dots while freehand drawing is common practice in drawing apps, such as colors on DS. Why not try both reduce the timer and draw the line? I think that'll do nicely
they become dots because it does not detect the next movement fast enough. I did move across the screen in a line (2nd attempt was not straight). My timer checks every 10000 nanoseconds which should be more than enough I think considering any lower freezes the 3DS.
 
Last edited by Moocow9m,
they become dots because it does not detect the next movement fast enough. I did move across the screen in a line (2nd attempt was not straight). My timer checks every 10000 nanoseconds which should be more than enough I think considering any lower freezes the 3DS.
I believe something else is not updating as fast as I execute the code. My guess is that hidSharedMem has something to do with it however I don't see where it is updated, only where it is initialized. Can anyone tell me what updates this?
 

Site & Scene News

Popular threads in this forum