Coder Social home page Coder Social logo

Comments (15)

tylau0 avatar tylau0 commented on May 31, 2024 1

SukkoPera, I confirm that the new code works with both DDG controllers. Thanks for moving this forward indeed!

from psxnewlib.

SukkoPera avatar SukkoPera commented on May 31, 2024

Thanks for your report, I will add the two-handle version to the compatibility list.

I know there are other libraries around but they all have issues with one controller or the other. The most famous one doesn't support non-DualShock controllers, for instance. On the contrary, the one you posted doesn't seem to support Analog Sticks/Buttons as available on DualShock and DualShock 2 controllers, at a quick glance. This is one of the reasons why I set to write the one library to rule them all. As stated in the README, I am interested in supporting all the controllers out there, but I can't get my hands on them all, I need help from other people.

In this case, there are a few things you can do for the single-handle version:

  • First: IIRC you will use the PsxControllerBitBang driver: if this is the case, try setting HOLD_TIME to 0 and see if anything changes. Or, if you can, please also make a test with the PsxControllerHwSpi driver (but that will require you to use the HW SPI pins).

  • Second: Could you try if the following improves the situation?

    1. Set INTER_CMD_BYTE_DELAY to 50.
    2. Set ATTN_DELAY to 100.

    Please try the two mods both alone and together and let me know if they help.

  • If all the above fails, enable debug output by uncommenting the DUMP_COMMS #define in PsxNewLib.h, try the DumpButtonsBitBang example, let it run a few seconds and post the output here.

from psxnewlib.

SukkoPera avatar SukkoPera commented on May 31, 2024

(Just for my own reference, this issue is a follow-up from here.)

from psxnewlib.

tylau0 avatar tylau0 commented on May 31, 2024

Test setup:
The densha de Go controller is cabled to an Arduino Lenoardo according to https://github.com/tylau0/DenGo/blob/main/PSX2USB_mod3.ino, which is modified from the PSX2USB.ino example in this library.
The USB output of the Arduino is cabled to a PC.
I use the "Set up USB Controllers" on Windows 10 to test the functioning of the controller. With the one-handle one, all key presses are not detected. In contrast, with the two-handle one, the buttons are detected pressed as expected. If I change to use the PsXLibrary, the one-handle controller works.

  1. I set the HOLD_TIME to 0. It doesn't change the situation. My setup isn't set with SPI so the SPI test is skipped for the time being.

  2. It doesn't work with INTER_CMD_BYTE_DELAY set to 50.
    For ATTN_DELAY, I don't call the PsxControllerHwSpi.sh and it seems to be related to the use of SPI. Since I am not setting it up. Anyway I try the case with changing ATTN_DELAY and both, but both cases don't improve anything.

  3. Output
    Repetition of the following:
    ...
    <-- 01 42 00
    --> FF FF FF
    <-- 01 42 00
    --> FF FF FF
    <-- 01 42 00
    --> FF FF FF
    <-- 01 42 00
    --> FF FF FF
    ...

Hope this helps.

from psxnewlib.

SukkoPera avatar SukkoPera commented on May 31, 2024

Thanks a lot for your tests. I just wanted to point out that there's an ATTN_DELAY setting for the BitBanging backend too, can you please try changing that one.

The only other thing that comes to mind is trying to put external pull-ups (1k) on the CMD and DATA lines. I know it's a bit cumbersome though, would it help if I sent you one of my PsxControllerShields?

from psxnewlib.

tylau0 avatar tylau0 commented on May 31, 2024

SukkoPera, thanks for the prompt response.
Further working on the test, I find out that to get the newly loaded library running, I need to unplug and then replug the USB connection from the Arduino after loading the new library. With this I confirm that changing INTER_CMD_BYTE_DELAY to 50 or ATTN_DELAY to 100 in the places that you suggest could get the Densha de Go one-handle controller TCPP-20001. Making both changes would also make it to work too. The two-handle version SLPH-00051 and the typical dual shock controller SCPH-1200 are also working with all these new settings.

from psxnewlib.

SukkoPera avatar SukkoPera commented on May 31, 2024

Sorry for the delay, I am working on definitely too many things at once :(.

Anyway, I was going to make similar changes for #8 so I took the plunge and tried to fix both issues at once.

Could you please checkout the guncon_support branch and test if it works with both DDG controllers now?

from psxnewlib.

SukkoPera avatar SukkoPera commented on May 31, 2024

Glad to hear that! I'll make a new release soon, thanks for your help!

from psxnewlib.

SukkoPera avatar SukkoPera commented on May 31, 2024

One more thing: I can add your code among the library examples, is that ok with you?

from psxnewlib.

tylau0 avatar tylau0 commented on May 31, 2024

You're welcome.
Yes you could add my code as an library example. You may wish to use https://github.com/tylau0/DenGo/blob/main/PSX2USB_mod.ino as this one doesn't involve other optional parts other than the Densha de Go controller.

from psxnewlib.

SukkoPera avatar SukkoPera commented on May 31, 2024

All changes merged and example added to master in 632e893, thanks a lot for your help.

Going to release a new version including everything in a couple of minutes.

from psxnewlib.

putnam avatar putnam commented on May 31, 2024

Commenting on an old closed issue here, but looking for clarity: the README for this project says that you need 1k pullup resistors, but @tylau0 's blog post is not using them and it seems that they were only a (ultimately unneeded) suggestion in this issue. As someone without a ton of experience with these controllers (yet?) I'm wondering whether they're necessary here to get the DDG controllers going, and if not, why not?

from psxnewlib.

SukkoPera avatar SukkoPera commented on May 31, 2024

IMHO they are required. The original PS has them, and that's enough of a reason for me. Besides it's not much of an effort nor cost. Otherwise signal analysis would be necessary in order to make sure they they rise quickly enough compared to the original PS.

from psxnewlib.

putnam avatar putnam commented on May 31, 2024

Yeah, tonight I tested with a PS2 controller and it absolutely did not work without the pullups. I guess now the question is how exactly the Densha de Go controller was working for @tylau0 without them. Is it possible the controller has them built-in?

from psxnewlib.

SukkoPera avatar SukkoPera commented on May 31, 2024

Yes, it is possible. Not all controllers require them, other controllers will work with higher pull-ups, but relying on that means trying your luck. Even worse, if everybody starts doing whatever they like, deviating from the specs, it all just becomes a support nightmare for me. Actually it already is, thanks to the widespread false information that PS controllers can safely be used at 5V and that the ACK signal is unnecessary, sigh.

from psxnewlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.