Homebrew [Android] IRdA - InputRedirection client for Android

chirogan

The Engineer
Member
Joined
Feb 28, 2018
Messages
379
Trophies
0
XP
396
Country
Philippines
The apk you're using is the exact same which gets installed via `adb install` by the debugger, so that's not the problem here. I just can't understsnd how and why--
[at this moment I realized that I made changes to the program, I fixed the same issue with the CPad, but I left the CStick code as-is, and since I'm using my 2DS to test (there's no old3DS irrst support yet) I can't detect CStick code mistakes]

It'll take me a while to fix the CStick bug with one hand, but I'll try and post a (hopefully) fixed build here.
Thanks mate. No hurries. Hopefully yes.
Cheers.
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,820
Trophies
2
Location
home
XP
9,289
Country
Hungary
Thanks mate. No hurries. Hopefully yes.
Cheers.

I think I found the cause of it... There was an overflow error when the controller was at a 100% to the left, but not when on the right. This is because the range goes from -128 to 127, not -127 to 127, and when the value was 128 it underflowed to -128. I changed the CStick divisor from 0x7FFF to 0x8000, and that should fix the overflow error. I think @Craftyawesome wins a cookie for that. Originally the CPad had the same bug, except that was a logical bug where the value 1.0 was treated wrong, but here it was an actual overflow due to the value 128 underflowing to -128.

Here is an updated build: https://puu.sh/zFhuj/5e48a83c96.apk

I can't test due to my hand issues anymore, so I'll have to rely on the feedback.
 

chirogan

The Engineer
Member
Joined
Feb 28, 2018
Messages
379
Trophies
0
XP
396
Country
Philippines
I think I found the cause of it... There was an overflow error when the controller was at a 100% to the left, but not when on the right. This is because the range goes from -128 to 127, not -127 to 127, and when the value was 128 it underflowed to -128. I changed the CStick divisor from 0x7FFF to 0x8000, and that should fix the overflow error. I think @Craftyawesome wins a cookie for that. Originally the CPad had the same bug, except that was a logical bug where the value 1.0 was treated wrong, but here it was an actual overflow due to the value 128 underflowing to -128.

Here is an updated build: https://puu.sh/zFhuj/5e48a83c96.apk

I can't test due to my hand issues anymore, so I'll have to rely on the feedback.
Wow. Thats a fast build right there mate. Didnt expect it to be that fast.

Okay. I tried the recent build.. and sadly... it bugged both the sticks. XD. Both now have the same issue..
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,820
Trophies
2
Location
home
XP
9,289
Country
Hungary
Wow. Thats a fast build right there mate. Didnt expect it to be that fast.

Okay. I tried the recent build.. and sadly... it bugged both the sticks. XD. Both now have the same issue..

That should not be possible... Ugh, I think I might need to rewrite the code, and I don't think when it's going to happen. I ported the C code to Java, and I always had problems with Java and C code due to Java handling signedness differently. Ugh...
 

chirogan

The Engineer
Member
Joined
Feb 28, 2018
Messages
379
Trophies
0
XP
396
Country
Philippines
That should not be possible... Ugh, I think I might need to rewrite the code, and I don't think when it's going to happen. I ported the C code to Java, and I always had problems with Java and C code due to Java handling signedness differently. Ugh...
Im really sorry mate. I got the wrong mapping.. the circle pad works perfect. But the c-stick has the same bug mate.. my bad for not testing properly before posting in your thread

P.S. i really hope you read this soon. I will feel really bad fpr giving you a hard time for giving you wrong information
 
Last edited by chirogan,

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,820
Trophies
2
Location
home
XP
9,289
Country
Hungary
Im really sorry mate. I got the wrong mapping.. the circle pad works perfect. But the c-stick has the same bug mate.. my bad for not testing properly before posting in your thread

P.S. i really hope you read this soon. I will feel really bad fpr giving you a hard time for giving you wrong information

I don't fucking know, I must have ported the code wrong, I'll have to look at multiple projects of mine where I implemented the CStick, because I definitely fucked up something when I was porting the CStick code. I hate Java so much :angry:

And I remembered that CStick didn't work for me either, just forgot to fix it because old3DS doesn't have irrst redirection yet.

Now that I think of it Java is retarded when it comes to numbers and signedness, I'd bet that is the problem. I remember me having issues when porting my Blowfish code from C to Java...
 
Last edited by Sono,
  • Like
Reactions: chirogan

chirogan

The Engineer
Member
Joined
Feb 28, 2018
Messages
379
Trophies
0
XP
396
Country
Philippines
I don't fucking know, I must have ported the code wrong, I'll have to look at multiple projects of mine where I implemented the CStick, because I definitely fucked up something when I was porting the CStick code. I hate Java so much :angry:
Sorry this was giving you a hard time.
One thing i noticed. The values that reflects on the gui screen is supposed to be the mapped value isnt it? Which means, if you pressed anybutton, and you mapped it to A, A will reflect on the gui when you press it. Then you use the values assigned to interpret which button was pressed to send the input to the 3ds isnt it? This conflict happens, when i use the c stick and x axis is supposed to be mapped as positive, it reflects as negative. Maybe the mashup of values confuse the program because it gives a value that the point of reference cannot determine. Thats why it goes to the other side where it is confused if it is going to follow the x or the y axis? I think it has something to do with the x axis being wrong in the inverting values process.. Does that makes sense?.
 
Last edited by chirogan,

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,820
Trophies
2
Location
home
XP
9,289
Country
Hungary
Sorry this was giving you a hard time.
One thing i noticed. The values that reflects on the gui screen is supposed to be the mapped value isnt it? Which means, if you pressed anybutton, and you mapped it to A, A will reflect on the gui when you press it. Then you use the values assigned to interpret which button was pressed to send the input to the 3ds isnt it? This conflict happens, when i use the c stick and x axis is supposed to be mapped as positive, it reflects as negative. Maybe the mashup of values confuse the program because it gives a value that the point of reference cannot determine. Thats why it goes to the other side where it is confused if it is going to follow the x or the y axis? I think it has something to do with the x axis being wrong in the inverting values process.. Does that makes sense?.

I don't really understand, so I'll say what I can.

The debug text is the data read from the CitroPad variables before converting it to a packet, but after the event has been processed.

Also, I don't know about DPAD, but every axis except CPad X is mirrored, because that's the way they are on the 3DS.
 
  • Like
Reactions: chirogan

chirogan

The Engineer
Member
Joined
Feb 28, 2018
Messages
379
Trophies
0
XP
396
Country
Philippines
Sorry this was giving you a hard time.
One thing i noticed. The values that relects on the gui screen is supposed to be the mapped value isnt it? Which means, if you pressed anybutton, and you mapped it to A, A will reflect on the gui when you press it. Then you use the values assigned to them isnt it? This conflict happens, when i use the c stick and x axis is supposed to br mapped as positive, it reflects as negative. Maybe thr mashup of values confuse the program because it gives a value that the point of reference cannot determine. Thats why it goes to the other side where it is confused if it is going to follow the x or the y axis?. Does that makes sense?.
I don't really understand, so I'll say what I can.

The debug text is the data read from the CitroPad variables before converting it to a packet, but after the event has been processed.

Also, I don't know about DPAD, but every axis except CPad X is mirrored, because that's the way they are on the 3DS.
Yes. Thats what i mean. Thanks for confirming. I see. Thats where im trying to pointout too. So if you mirrored except the cpadX, meaning the CstkX is mirrored too? Because i think the CpadX behaves the same way with the CstickX. I cant be sure if it is on the program but the processed variable for CstkX gives inverted value but the y is correct. Could you try making CstkX the same with the CpadX? If i make sense in what im trying to request from you?
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,820
Trophies
2
Location
home
XP
9,289
Country
Hungary
Yes. Thats what i mean. Thanks for confirming. I see. Thats where im trying to pointout too. So if you mirrored except the cpadX, meaning the CstkX is mirrored too? Because i think the CpadX behaves the same way with the CstickX. I cant be sure if it is on the program but the processed variable for CstkX gives inverted value but the y is correct. Could you try making CstkX the same with the CpadX? If i make sense in what im trying to request from you?

Sadly I can't, because the CStick is PHYSICALLY ROTATED, hence it requires an entirely different algorhythm to calculate. I'll poke around later and see what and why it's causing it.
 
  • Like
Reactions: chirogan

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,820
Trophies
2
Location
home
XP
9,289
Country
Hungary
Sure buddy. Thanks. :)

It seems like the CStick issue is fixed on my other device, I did a hard reset (even though it was a fresh start because I once accidently uninstalled it), and the CStick issue is not present. I didn't change anything in the apk, but I'll upload in case some super magical bit got flipped in the apk that made it work :P

https://puu.sh/zGFqL/658ee9d245.apk

Though I noticed ALL of the axes cut off at half instead of at 100% :/ Debugging the code made it obvious that it's Android's way of handling the axes :c Sadly the raw float value corresponds to the value displayed on the debug textbox, and the value clamping does work as expected. I'm lost at why it inverts for you :'c
 

chirogan

The Engineer
Member
Joined
Feb 28, 2018
Messages
379
Trophies
0
XP
396
Country
Philippines
It seems like the CStick issue is fixed on my other device, I did a hard reset (even though it was a fresh start because I once accidently uninstalled it), and the CStick issue is not present. I didn't change anything in the apk, but I'll upload in case some super magical bit got flipped in the apk that made it work :P

https://puu.sh/zGFqL/658ee9d245.apk

Though I noticed ALL of the axes cut off at half instead of at 100% :/ Debugging the code made it obvious that it's Android's way of handling the axes :c Sadly the raw float value corresponds to the value displayed on the debug textbox, and the value clamping does work as expected. I'm lost at why it inverts for you :'c
Thanks for the effort mate. I'll do some more tests.
Now that i think about it, i use a custom rom for my android. If it comes to the crunch, i will reflash a new stock rom and see what difference it will make since it works perfect for you. I dont have any other android device in the house to check this out since im the only android user in my house.(sucks to be me.) I will check this out tomorrow as the problem stil persist in my end.

Cheers,
Chirogan
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,820
Trophies
2
Location
home
XP
9,289
Country
Hungary
Thanks for the effort mate. I'll do some more tests.
Now that i think about it, i use a custom rom for my android. If it comes to the crunch, i will reflash a new stock rom and see what difference it will make since it works perfect for you. I dont have any other android device in the house to check this out since im the only android user in my house.(sucks to be me.) I will check this out tomorrow as the problem stil persist in my end.

Cheers,
Chirogan

Yeah, I remember having to go back to stock ROM because the custom ROM I was using at the time I created the project did NOT recognize my controller properly, and it didn't even work in menus and stuff.
 

chirogan

The Engineer
Member
Joined
Feb 28, 2018
Messages
379
Trophies
0
XP
396
Country
Philippines
Yeah, I remember having to go back to stock ROM because the custom ROM I was using at the time I created the project did NOT recognize my controller properly, and it didn't even work in menus and stuff.

Managed to do a hard reset + Stock Rom Flash for my Samsung S6 Edge. Unfortunately, Problem still exist. :(
i dont Think it is directly related to my rom since i use a Stock Rom, I just Customized it to Deodex, Debloat Apps and Install Custom Kernel for Power Management. Overall, the Rom is untouched and fully stock in other aspects.
Yet, after a series of attempts, the problem still persists in my end. :(
 

chirogan

The Engineer
Member
Joined
Feb 28, 2018
Messages
379
Trophies
0
XP
396
Country
Philippines
Hey Buddy, how are you?

are you still open with supporting this app? I'm currently checking the app. are you willing to upload the repositories of the app and make it open source? do you still have it somehow?

i cant set a debugger without the project repo and everything. Thanks!
 

Sono

cripple piss
OP
Developer
Joined
Oct 16, 2015
Messages
2,820
Trophies
2
Location
home
XP
9,289
Country
Hungary
Hey Buddy, how are you?

are you still open with supporting this app? I'm currently checking the app. are you willing to upload the repositories of the app and make it open source? do you still have it somehow?

i cant set a debugger without the project repo and everything. Thanks!

I guess I can upload it. Zip or git?
 

chirogan

The Engineer
Member
Joined
Feb 28, 2018
Messages
379
Trophies
0
XP
396
Country
Philippines
Allrighty mate. I did. Thanks!.


One last question buddy. I was reading your codes and i encountered some confusion.

The "int axis" parameter is actually the axis for the 3DS!
0 = CPad X
1 = CPad Y
2 = CStick X
3 = CStick Y
4 = DPAD X (partially unused)
5 = DPAD Y (partially unused)
You previously mentioned that you used the int parameter as containers for your axes.
The values 0 and 1 for Cpad, 2 and 3 for Cstk. In the code, the increment stops when it hits 2 leaving one of the axes assigned at 3 not obtained for use in clampaxis.
58104dad3d.png

Or Did I overlooked something mate concerning the clamping for the cstk?
 
Last edited by chirogan,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: :rofl2: +1