[Android] IRdA - InputRedirection client for Android

Discussion in '3DS - Homebrew Development and Emulators' started by MarcusD, Feb 27, 2018.

  1. chirogan

    chirogan The Engineer

    Member
    2
    Feb 28, 2018
    Philippines
    Thanks mate. No hurries. Hopefully yes.
    Cheers.
     
  2. MarcusD
    OP

    MarcusD WOODMILLS!

    Member
    9
    Oct 16, 2015
    Austria
    Austro-Hungarian Monarchy
    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.
     
    Craftyawesome and chirogan like this.
  3. chirogan

    chirogan The Engineer

    Member
    2
    Feb 28, 2018
    Philippines
    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..
     
  4. MarcusD
    OP

    MarcusD WOODMILLS!

    Member
    9
    Oct 16, 2015
    Austria
    Austro-Hungarian Monarchy
    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...
     
  5. chirogan

    chirogan The Engineer

    Member
    2
    Feb 28, 2018
    Philippines
    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, Mar 11, 2018
  6. MarcusD
    OP

    MarcusD WOODMILLS!

    Member
    9
    Oct 16, 2015
    Austria
    Austro-Hungarian Monarchy
    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 MarcusD, Mar 11, 2018
    chirogan likes this.
  7. chirogan

    chirogan The Engineer

    Member
    2
    Feb 28, 2018
    Philippines
    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, Mar 11, 2018
  8. MarcusD
    OP

    MarcusD WOODMILLS!

    Member
    9
    Oct 16, 2015
    Austria
    Austro-Hungarian Monarchy
    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.
     
    chirogan likes this.
  9. chirogan

    chirogan The Engineer

    Member
    2
    Feb 28, 2018
    Philippines
    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?
     
  10. MarcusD
    OP

    MarcusD WOODMILLS!

    Member
    9
    Oct 16, 2015
    Austria
    Austro-Hungarian Monarchy
    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.
     
    chirogan likes this.
  11. chirogan

    chirogan The Engineer

    Member
    2
    Feb 28, 2018
    Philippines
    Sure buddy. Thanks. :)
     
  12. MarcusD
    OP

    MarcusD WOODMILLS!

    Member
    9
    Oct 16, 2015
    Austria
    Austro-Hungarian Monarchy
    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
     
  13. chirogan

    chirogan The Engineer

    Member
    2
    Feb 28, 2018
    Philippines
    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
     
  14. MarcusD
    OP

    MarcusD WOODMILLS!

    Member
    9
    Oct 16, 2015
    Austria
    Austro-Hungarian Monarchy
    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.
     
  15. chirogan

    chirogan The Engineer

    Member
    2
    Feb 28, 2018
    Philippines
    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. :(
     
  16. chirogan

    chirogan The Engineer

    Member
    2
    Feb 28, 2018
    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!
     
  17. MarcusD
    OP

    MarcusD WOODMILLS!

    Member
    9
    Oct 16, 2015
    Austria
    Austro-Hungarian Monarchy
    I guess I can upload it. Zip or git?
     
  18. chirogan

    chirogan The Engineer

    Member
    2
    Feb 28, 2018
    Philippines
    I guess a zip would do for me.
     
  19. MarcusD
    OP

    MarcusD WOODMILLS!

    Member
    9
    Oct 16, 2015
    Austria
    Austro-Hungarian Monarchy
    okke
     
    Last edited by MarcusD, Mar 23, 2018
    chirogan likes this.
  20. chirogan

    chirogan The Engineer

    Member
    2
    Feb 28, 2018
    Philippines
    Allrighty mate. I did. Thanks!.


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

    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.
    [​IMG]
    Or Did I overlooked something mate concerning the clamping for the cstk?
     
    Last edited by chirogan, Mar 23, 2018
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice