Homebrew Help updating touchscreen faster?

Moocow9m

Member
OP
Newcomer
Joined
Dec 29, 2016
Messages
8
Trophies
0
Age
25
XP
56
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,

Moocow9m

Member
OP
Newcomer
Joined
Dec 29, 2016
Messages
8
Trophies
0
Age
25
XP
56
Country
United States
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.
 

Moocow9m

Member
OP
Newcomer
Joined
Dec 29, 2016
Messages
8
Trophies
0
Age
25
XP
56
Country
United States
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,

mironicurse

Well-Known Member
Member
Joined
Sep 28, 2015
Messages
141
Trophies
0
Age
30
XP
591
Country
Russia
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
 

Moocow9m

Member
OP
Newcomer
Joined
Dec 29, 2016
Messages
8
Trophies
0
Age
25
XP
56
Country
United States
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,

Moocow9m

Member
OP
Newcomer
Joined
Dec 29, 2016
Messages
8
Trophies
0
Age
25
XP
56
Country
United States
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

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: @NinStar, why you hurting your sisters