Author Topic: YDPG18(A)/YDPG16: Sad news: impossible to separate d-pad from analog stick  (Read 4945 times)

furan (OP)

  • *
  • Posts: 100
I disassembled the gamepad driver this morning - unfortunately the driver receives the same flags for the d-pad as it does for the stick, so there is no way to separate them. I suspect if I crack the device back open I'll find the d-pad and the stick use the same electrical traces as well.

I was really hoping to do a patch that allowed for separate key codes from the stick :(

Ashen

  • *
  • Posts: 118
They are on separate traces as far as I can tell (if I remember right). I traced everything out a while back looking for a hardware solution and I'm pretty sure I traced the analog stick datalines back to the CPU.

All the actual hardware buttons are wired to this chip:



Unfortunately, there are no identifier markings on the chip in either of my 18A's so no way to look up a datasheet or similar. I marked pin1 in the pic above. here's what I got when I traced things out.

The following pins connect together when the buttons are pressed to register a "button push" on the chip:

Right Trigger = 12+15
Left Trigger = 3+15

D Pad Up = 2+10
D Pad Down = 1+10
D Pad Left = 2+9
D Pad Right = 1+9

OK = 4+14
A = 4+15
B = 12+14
X = 3+14

Start = 11+14
Select = traces go to the CPU
Function Button = 11+15
Esc = traces go to the CPU

Its possible to rewire things differently and still replicate the same button presses through different pin combinations. Its too confusing without a datasheet to figure out though, so I gave up.

EDIT: Also, why in the name of god they did things this way I'm still trying to figure out. I think it would have been a much better design decision to just integrate some kind of built in USB interface type gamepad with drivers for it built in.

I'm actually waiting for an ICS rom that doesn't suck so that I can just cut up a usb gamepad and toss it in the case and rewire the buttons to it. Should take care of things pretty much. i'll probably even score some L2/R2 buttons out of the deal.
« Last Edit: July 15, 2012, 08:23:03 pm by Ashen »

furan (OP)

  • *
  • Posts: 100
I will double check on the analog stick. What I did was I changed the driver to send a different keycode for the 'up' button, and then in an app I got the same keycode when pressing up on the dpad or the stick, and the driver only reads the data one way - from the ir data line(weird I know).

I've been tinkering with the wifi noise problem, and found so far that the wifi module is actually usb, but being supplied 3.3v instead of 5v. It's very close to the op amp for the audio so I am thinking maybe it's sucking power from the amp? Not sure. Anyway an interesting way to go about things might be to desolder the wifi module, solder in a super tiny usb hub board, and add things like your own gamepad/storage/wifi/bluetooth..

furan (OP)

  • *
  • Posts: 100
Looks like I'm going to eat my hat. The driver reads from more than one hardware register, so it's possible the stick really is separate. I'm going to try and reverse engineer the driver to write it from scratch.

furan (OP)

  • *
  • Posts: 100
I've been disassembling the gamepad driver back to source code and it turns out I'm full of poop here. Some of the keys and the d-pad are attached using one of the IR1 I/O input (through the unlabeled chip) and the analog stick (at least) is attached via the ADRC input. So theoretically it is possible to separate them.

I have been working on a from-scratch rom compiled from the android sources for cyanogenmod and the gamepad driver is the big thing left on my list to get working.

edit: s/d-pad/analog stick.
« Last Edit: July 25, 2012, 02:47:01 am by furan »

Goesta

  • *
  • Posts: 8
Sounds great!!! Needed to register to say thanks for all this great work. The ROM sounds promising. Actually, I ordered a few resistors 7.8 Ohm, if i remember good (700 of them actually ..urrggghhh) for the brightness mod. Hope... i not break my 18A by opening, or burn it soldering ;-)

If all went well, i would have 699 left for donation ;-)
Thank you again,
Goesta

furan (OP)

  • *
  • Posts: 100
lol, thank you :)

NoeL

  • *
  • Posts: 173
Any update on the custom rom? It's sounding nice.

furan (OP)

  • *
  • Posts: 100
Still working on it :)

Deen0X

  • ***
  • Posts: 1686
hey funar, do you think this driver, if you can get it to work, will work on G18A10 and/or G18 (old)?

I think may be work on G18A10, but not in G18 (the first version). but i want to ask you about this.

and most important (at least for me), do you think you can do anything with the overlay button problem? (well, this may need another thread)

greetings!

furan (OP)

  • *
  • Posts: 100
Can't do anything for the 1st rev of the YDPG18. Can do something for (probably) YDPG16, 2nd rev YDPG18, and YDPG18A.

As far as buttons colliding with each other/not being able to press multiple at the same time, that's a hardware thing, and there's nothing short of cutting the control traces on the board and wiring it to be matrix scanned (with a shift register). Not an easy feat, totally not worth it. :)