1. Hello Guest! Did you know that we're also on Discord? You can join us here: https://discord.gg/vxqdaG4.
    Dismiss Notice

Project diva homemade controllers

Discussion in 'Tutorial Area - By users for users!' started by nofutur, Jul 20, 2016.

  1. kakurenbo

    kakurenbo Welcome to DIVA!

    Joined:
    Sep 5, 2020
    Messages:
    7
    Likes Received:
    3
    Trophy Points:
    40
    yeah they didn't, hori ones are really crappy. the parts are not interchangeable with sanwa ones at all
     
  2. correllroy

    correllroy Big Debut

    Joined:
    Sep 29, 2016
    Messages:
    23
    Likes Received:
    7
    Trophy Points:
    115
    Gender:
    Male
    Nah, the mechanical switches and cheaper parts is what pushed me to buy DIVALLER. I helped switch the buttons and switches with a friends MEGA39s controller.
     
  3. gbafamily

    gbafamily Welcome to DIVA!

    Joined:
    Sep 10, 2020
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    45
    #303 gbafamily, Sep 11, 2020
    Last edited: Sep 11, 2020
    I am experimenting using a portable HDMI monitor with 10 point cap
    touch as an arcade controller connected to a Nintendo Switch. The
    monitor is flat on the back so it lays flat on a table. The cable
    connectors are on the side. I do have some concerns about damaging the
    monitor by endless finger tapping. Hooking up four buttons is probably
    a better solution. Using the screen for slides should be OK.

    The monitor is connected to Raspberry Pi running a Python3 program.
    No fancy graphics at the moment. The program responds to touch events
    (buttons and slider) by sending Nintendo Switch controller HID reports
    out its UART. A small USB gadget connected to the UART puts the HID
    reports out its USB port. The USB gadget could have been implemented
    with a Pro Micro and LUFA software but it is an Adafruit Trinket M0.
    Note the Switch is not hacked. The Trinket M0 pretends to be a Switch
    compatible USB gamepad.

    The slider has 32 touch areas which are encoded in AR mode. Thanks to
    @Doctopus for documenting this. The slider seems to be working but the
    code is still unstable. I am learning Python as well so this is going
    slow.

    Has anyone captured the USB traffic between Hori arcade controllers
    and a PS4 and/or Switch? I wonder if there are special messages
    packets that are not supported by gamepads. For example, can the
    console control the LED strip?
     
  4. steelpuxnastik

    steelpuxnastik ShinSanwaSwitch is near completement

    Joined:
    Aug 2, 2019
    Messages:
    64
    Likes Received:
    25
    Trophy Points:
    115
    Gender:
    Male
    Occupation:
    just living
    Location:
    Mykolaiv, Ukraine
    Home Page:
    https://www.instagram.com/jandevalua/
    #304 steelpuxnastik, Sep 11, 2020
    Last edited: Sep 11, 2020
    No, in case of home consoles there is no special messages at all and console cannot control the LED strip. It can do only PDAFT on PC only in case of when you connect official slider to your PC via RS232. @Doctopus posted info about UART protocol of official slider, but I do not know really does anyone actually repeated it in his realization of slider?

    As I understand for consoles you need emulate only gamepad input for it, for PS4 - Dualshock 4. for Switch - something from switch. I do not know. Hori (I think) can do that because it use some more advanced universal chip, that use xinput, directinput and someotherinput depending on how you turn it on, like in some not so expensive chinese gamepad, that can be used with Switch, PS4 and xbox, I think there is the same. So may be in case of Pro Micro there is needed to write 2 cases of code for PS4 (if it possible at all, I do not know) and Switch (same), make some jumper to use first or second case and may be then something can work. I definitely saw the possibility of emulation Xinput on Pro Micro, but haven't seen others. And may be if I'm somewhere wrong I hope you can correct me.
     
  5. gbafamily

    gbafamily Welcome to DIVA!

    Joined:
    Sep 10, 2020
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    45
    Thanks @steelpuxnastik for confirming the USB arcade controllers are using the
    gamepad protocol with no extra messages.

    There is an Arduino XInput (XBox 360) library that supports 32u4 (Pro
    Micro/Leonardo) and Teensy LC/3 boards. Then use a Brook or MayFlash controller
    adapter to connect to PS4. I read FTPS4 does not support AR mode so that might
    be a complication. For the moment I will stick with Switch.

    Someone has figured out how to emulate joycons and pro controller using the Pi
    Bluetooth LE. Wireless will introduce some lag but it eliminates the need for
    the Trinket M0 and all soldering!

    https://github.com/mart1nro/joycontrol
     
  6. gbafamily

    gbafamily Welcome to DIVA!

    Joined:
    Sep 10, 2020
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    45
    As long as my board identifies itself as a gamepad, the Switch does not use
    dedicated mode (AR). The Mega39 controller must identify itself with different
    USB product ID or some other USB descriptor that tells the Switch to interpret
    the axes (RX,RY,LX,LY) as the 32 bit slider bits. This is probably true of the
    PS4 controller. I read it has a switch for normal vs. dedicated mode. The
    Switch Mega39 controller is always in dedicated or special mode so there is no
    switch. Any dumps (lsusb) of USB descriptors from Hori arcade controllers?
     
  7. erikchan002

    erikchan002 Welcome to DIVA!

    Joined:
    Mar 7, 2020
    Messages:
    6
    Likes Received:
    4
    Trophy Points:
    40
    You have to turn on the dedicated mode manually in the controls settings
     
  8. correllroy

    correllroy Big Debut

    Joined:
    Sep 29, 2016
    Messages:
    23
    Likes Received:
    7
    Trophy Points:
    115
    Gender:
    Male
    [​IMG]
    You have to enable the Arcade Controller Settings for HORI Arcade controller in Customization>Game Config>Arcade Config>Arcade Controller Settings. As for PS4 Dedicated controller as well (Except in PS4 Extend Control settings, have to disable the Touch Pad and Motion Control OFF and have only Arcade Controller setting ON), the DS4 (PS4) Touch simulate as 16 bit of touch slide which makes unstable to use as a PCB for a Arcade controller.
     
  9. gbafamily

    gbafamily Welcome to DIVA!

    Joined:
    Sep 10, 2020
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    45
    Thanks, but I have arcade Controller enabled. This mode works fine with a Pro
    Controller using the sticks for slides. I am thinking there is something
    additional to tell the Switch whether the controller is in sticks mode (regular
    gamepad) vs. AR for Hori arcade controller. One possiblity is the arcade
    controller sends a different USB product ID so the Switch knows whether to use
    sticks or AR mode.

    The reason I think the Switch is in sticks mode is the slider bits
    corresponding to the RY and LY axes appear to be ignored by the Switch. Oh
    well, back to debugging.
     
  10. erikchan002

    erikchan002 Welcome to DIVA!

    Joined:
    Mar 7, 2020
    Messages:
    6
    Likes Received:
    4
    Trophy Points:
    40
    #310 erikchan002, Sep 12, 2020
    Last edited: Sep 12, 2020
    After turning on the mode the stick no longer works correctly for sliders for me. The most obvious thing during gameplay is that pushing the stick in whatever direction randomly COOL the sliders, even the opposite direction.

    My guess is that it only appears to not change for you because the fluctuating less significant bits for all axes happens to indicate moving from slider sensors to sensors.
    There isn't any additional thing in the USB descriptor, it works with any controller including the joycons, pro controller, or just pretended hori fight sticks.

    It's also very obvious in the menus:
    When you move the right stick the menu item only goes up because the more significant bits of RY are activated (unless you're holding it perfectly horizontal, RX doesn't matter in the menus because the bits indicate the middle of the slider) causing a tap of the slider on the left to be registered.
    When you move the left stick the menu item only goes down because the less significant bits of LX are activated (unless you're holding perfectly vertical, LY doesn't matter in the menus because the bits indicate the middle of the slider) causing a tap of the slider on the right to be registered.
     
  11. gbafamily

    gbafamily Welcome to DIVA!

    Joined:
    Sep 10, 2020
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    45
    Are you saying when a regular gamepad such as a Pro Controller is plugged in and using Arcade mode, the sticks no longer work for slides? This works fine for me. I do not use the joycons because they are too small for me.

    When using my touchscreen controller in AR (dedicated mode) and MegaMix in Arcade mode, the part of the slide that corresponds to LX and RX sort of work but the LY and RY do nothing. And the slides are kind of random. Swiping the
    wrong way frequently works. I think we are seeing the same behavior here. Outside of gameplay such as the song list, the slider LY and RY regions sort of work to scroll the list.

    I have since implemented sticks mode (Hori calls this normal mode) instead of AR mode for the slider. This eliminates the random slides. For 1 hand sliding, slide to the left translates to moving the left stick in the left direction. Slide to the right translates to moving the right stick in the right direction. For 2 hand sliding, the direction of the left hand maps to the left stick. The direction of the right hand maps to the right stick. I may add a switch to select between sticks/normal mode vs. AR/dedicated mode like the PS4 arcade controller. Although AR mode is not very useful so far on the Switch.

    The following is a quote from the Hori PS4 Arcade controller web page. This is an automatic Google translation. Except for @Doctopus gist on github this is the only description I have seen of normal vs. dedicated modes.

    https://hori.jp/products/p4/FTDX_con/

    I think pol8139 uses sticks mode on PS4. The PSoC code determines hands direction and also sends the slider 32-bits over i2c to the Pro Micro. I got lost in the Pro Micro/LUFA code but I think it sends L/R movement on the L and R sticks.
     
  12. erikchan002

    erikchan002 Welcome to DIVA!

    Joined:
    Mar 7, 2020
    Messages:
    6
    Likes Received:
    4
    Trophy Points:
    40
    When dedicated controller mode is turned on, the sticks "work" for slides just not correctly.


    "Sort of work" is not an informative description. Does any single bit activation on LY or RX do anything in the song list? Because it should not in the dedicated mode.


    I have my controller right in front of me using the dedicated mode: atmega32u4, LUFA, emulated HORI fight sticks, plugs straight into the Switch.


    Probably because when pol8139 made the controller dedicated mode isn't a thing yet. He also doesn't use anything like a Brook adapter for PS4 so he has to find a way to circumvent the 3rd-party controller time limit by using GIMX and a DS4.
     
  13. steelpuxnastik

    steelpuxnastik ShinSanwaSwitch is near completement

    Joined:
    Aug 2, 2019
    Messages:
    64
    Likes Received:
    25
    Trophy Points:
    115
    Gender:
    Male
    Occupation:
    just living
    Location:
    Mykolaiv, Ukraine
    Home Page:
    https://www.instagram.com/jandevalua/
    Yes, it is. PSoC code determines hands direction and also sends the slider 32-bits over i2c to the Pro Micro, and Pro Micro sends it as L/R sticks movement to recipient.
     
  14. gbafamily

    gbafamily Welcome to DIVA!

    Joined:
    Sep 10, 2020
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    45
    Thanks, @erikchan002 and @steelpuxnastik
    Dedicated/AR mode for me will have to wait for another time. Normal/sticks mode is working fine so far.

    PS4 controller authentication does add another complication (GIMX, Brook, etc) that is not present for the Switch. I have no plans to work on a PS4 version.

    I will upload code to github when it is ready. For now it has a system block diagram. I will post some photos later.

    https://github.com/touchgadget/toucharcade
     
  15. gbafamily

    gbafamily Welcome to DIVA!

    Joined:
    Sep 10, 2020
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    45
    After another look at my code I found the bug that breaks AR mode. I turned dedicated controller mode back on and verified the bug is dead. I hear the chimes/harp sound when sliding outside game play. For example, in the Tutorial. I used
    the Tutorial to verify the 1 and 2 handed slides work as expected. I will be posting more details in the github repo mentioned in the previous message. Thanks for all the help!
     
  16. Doctopus

    Doctopus I bought MEGA69 and I regret

    Joined:
    Dec 22, 2017
    Messages:
    194
    Likes Received:
    76
    Trophy Points:
    220
    Location:
    Planet Earth
    #316 Doctopus, Sep 14, 2020
    Last edited: Sep 14, 2020
    RPi4 without Gadget/FunctionFS? Disappointed D: (jk

    Auth isn't that hard once you got HID stack set up. Not to mention that there is a very nasty trick if you are using PC or RPi. See https://github.com/dogtopus/e3pp :P (Can't believe nobody found out this and what it does for almost a year)
     
    gbafamily likes this.
  17. gbafamily

    gbafamily Welcome to DIVA!

    Joined:
    Sep 10, 2020
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    45
    All very interesting but mostly over my head. I will leave controller auth to companies like Brook. The video about glitching power is fascinating.

    I was thinking to try this using a Teensy 4.1 instead of a Pi because the Teensy has USB host and device ports. The perfect USB converter and it runs at 600 MHz. But I would have to write a Teensyduino USB host touchscreen driver which will happen about the same time I write a Linux USB gadget driver (never!).
     
  18. jonsilvestro

    jonsilvestro Welcome to DIVA!

    Joined:
    Aug 19, 2020
    Messages:
    9
    Likes Received:
    7
    Trophy Points:
    30
    Gender:
    Male
    thought I would share the process I went through building my own arcade controller (without ever using a real one lol) and also ask a couple questions. Mainly I bought Chinese buttons and im pretty sure they came with a 200g spring but im not sure so for now i've just completely taken the spring out but idk if thats ideal so does anyone have any suggestions for making it as arcade accurate as possible?
     
    steelpuxnastik likes this.
  19. jonsilvestro

    jonsilvestro Welcome to DIVA!

    Joined:
    Aug 19, 2020
    Messages:
    9
    Likes Received:
    7
    Trophy Points:
    30
    Gender:
    Male
  20. steelpuxnastik

    steelpuxnastik ShinSanwaSwitch is near completement

    Joined:
    Aug 2, 2019
    Messages:
    64
    Likes Received:
    25
    Trophy Points:
    115
    Gender:
    Male
    Occupation:
    just living
    Location:
    Mykolaiv, Ukraine
    Home Page:
    https://www.instagram.com/jandevalua/
    #320 steelpuxnastik, Sep 15, 2020
    Last edited: Sep 15, 2020
    Boooomb :)))

    In chinese buttons, unfortunately, cannot be 200g springs, there are much more G, I know it, because I bought later original Sanwa 200g springs and had opportunity to compare. But if you use your button with [​IMG] this kind of switch you need to use some kind of formula: a + b = c, where "a" is count of g of spring, "b" - count of g of switch, and "c" - sum of g. And in most cases with this combination you get a lot more than "arcade pressing force standard?", but with optical switches you can get that (look here https://www.projectdiva.net/community/threads/questions-about-sanwa-obsa-lhsxf-ln.2325/ may be you can make donation and I'll make that faster :D )
     

Share This Page

  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