RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Daphne Control Help

    Scheduled Pinned Locked Moved Help and Support
    daphnedaphne configdaphne controll
    25 Posts 5 Posters 8.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      bassman6805
      last edited by

      From what I can tell my joystick and buttons are mapped as keyboard inputs. Does anyone have any ideas?

      1 Reply Last reply Reply Quote 0
      • B
        bassman6805
        last edited by

        I'm still stuck. Is there another forum that my be better suited for the daphne emulator?

        1 Reply Last reply Reply Quote 0
        • AlturisA
          Alturis
          last edited by

          Check out the docs here:
          https://github.com/retropie/retropie-setup/wiki/Daphne

          Daphne has its own input binding syntax.

          RP 4.7.1 • Pi4 4Gig • CanaKit Aluminum • 64GB microSD • 1920x1080 BarTop [2 Sanwa sticks]

          1 Reply Last reply Reply Quote 0
          • B
            bassman6805
            last edited by

            Yeah, I have tried that in my original post but my controller is not registered as typical controller. I think that's the issue but I don't how to fix it.

            AlturisA 1 Reply Last reply Reply Quote 0
            • AlturisA
              Alturis @bassman6805
              last edited by

              @bassman6805 did you run jstest /dev/input/js0 and see if the buttons and axes change when you click your controller?

              not sure what your setup is but try js1 too if there is somehow multiple joysticks.

              RP 4.7.1 • Pi4 4Gig • CanaKit Aluminum • 64GB microSD • 1920x1080 BarTop [2 Sanwa sticks]

              1 Reply Last reply Reply Quote 0
              • AlturisA
                Alturis
                last edited by

                Make sure you heed this index off by one note in the Daphne docs too:

                "The third number is the joystick button code (or 0 for "none")
                Since 0 is reserved for special meaning, joystick button 0 is identified
                as 1 here. Button 1 is identified as 2, and so on."

                RP 4.7.1 • Pi4 4Gig • CanaKit Aluminum • 64GB microSD • 1920x1080 BarTop [2 Sanwa sticks]

                1 Reply Last reply Reply Quote 1
                • B
                  bassman6805
                  last edited by

                  I tried running jtest but kept getting an error. I don't think my set up is actually recognized as a controller. All of the buttons are hardwired to the pins on the pi. When I built it I followed their setup script. It would be nice to make it a controller but I think it is somehow mapped to a keyboard. Here is what I built and the instructions.

                  https://learn.adafruit.com/super-game-pi

                  AlturisA mituM mediamogulM 3 Replies Last reply Reply Quote 0
                  • AlturisA
                    Alturis @bassman6805
                    last edited by

                    @bassman6805 Hmmm... Well if the controller is hard bound to keypresses in that setup you might want to just drop to a console and start hitting buttons and writing down what key was pressed? Then map that to the daphne key codes?

                    RP 4.7.1 • Pi4 4Gig • CanaKit Aluminum • 64GB microSD • 1920x1080 BarTop [2 Sanwa sticks]

                    1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator @bassman6805
                      last edited by mitu

                      @bassman6805 Just soldering the wires to the GPIO pins doesn't automatically add a gamepad, you'll also need a driver for Linux to understand that those inputs are to be treated as a gamepad - see https://retropie.org.uk/docs/GPIO-Modules/.
                      I see that the install script (https://learn.adafruit.com/super-game-pi/initial-setup) downloads and installs an executable, so make sure you've run this step and the retrogame executable is started on boot. Of course, it would be easier to use the built-in Linux modules mentioned in the RetroPie docs, but you need to check that the wiring is according to the driver's expectations.

                      1 Reply Last reply Reply Quote 0
                      • mediamogulM
                        mediamogul Global Moderator @bassman6805
                        last edited by

                        @bassman6805 said in Daphne Control Help:

                        I think it is somehow mapped to a keyboard.

                        If that turns out to be true, then it's actually a big plus for Daphne. Currently, standard joystick support is pretty rudimentary in Daphne. It cannot be remapped in any way and if it doesn't get assigned to js0 during your session, Daphne can't even see it. However, keyboard assignments are much more flexible here.

                        If the controls do end up being key-based, you'll need to discover which keyboard keys are being generated by running evtest on the keyboard event and then use this page to see what numbered codes those keys translate to. From there, you'd just add the numbers to their proper locations in dapinput.ini. It's admittedly a bit like decoding Little Orphan Annie's secret message, but it should work well for you if you are in fact dealing with keyboard controls.

                        RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                        1 Reply Last reply Reply Quote 0
                        • B
                          bassman6805
                          last edited by

                          Ok. I think the evtest might be what I need to do. When I tried the jtest it never showed the joy0. Just event0, event1. Which I am guessing is the keyboard controller and the usb hub I had plugged in. I will try it this evening and post my results.

                          1 Reply Last reply Reply Quote 0
                          • B
                            bassman6805
                            last edited by

                            Here are the results for the evtest. Any idea on what numbers to change on the daphne.ini? 1st, 2nd, or 3rd column?

                             Input driver version is 1.0.1
                             Input device ID: bus 0x3 vendor 0x1 product 0x1 version 0x1
                             Input device name: "retrogame"
                             Supported events:
                             Event type 0 (EV_SYN)
                             Event type 1 (EV_KEY)
                             Event code 1 (KEY_ESC)
                             Event code 16 (KEY_Q)
                             Event code 17 (KEY_W)
                             Event code 28 (KEY_ENTER)
                             Event code 30 (KEY_A)
                             Event code 31 (KEY_S)
                             Event code 44 (KEY_Z)
                             Event code 45 (KEY_X)
                             Event code 103 (KEY_UP)
                             Event code 105 (KEY_LEFT)
                             Event code 106 (KEY_RIGHT)
                             Event code 108 (KEY_DOWN)
                             Properties:
                             Testing ... (interrupt to exit)
                             Event: time 1508808873.707404, type 1 (EV_KEY), code 108 (KEY_DOWN), 
                             value 1
                             Event: time 1508808873.707404, -------------- EV_SYN ------------
                             Event: time 1508808873.984816, type 1 (EV_KEY), code 108 (KEY_DOWN), 
                             value 0
                             Event: time 1508808873.984816, -------------- EV_SYN ------------
                             Event: time 1508808878.052055, type 1 (EV_KEY), code 103 (KEY_UP), value 1
                             Event: time 1508808878.052055, -------------- EV_SYN ------------
                             Event: time 1508808878.303562, type 1 (EV_KEY), code 103 (KEY_UP), value 0
                             Event: time 1508808878.303562, -------------- EV_SYN ------------
                             Event: time 1508808880.872279, type 1 (EV_KEY), code 105 (KEY_LEFT), value 
                             1
                             Event: time 1508808880.872279, -------------- EV_SYN ------------
                             Event: time 1508808881.057428, type 1 (EV_KEY), code 105 (KEY_LEFT), value 
                             0
                             Event: time 1508808881.057428, -------------- EV_SYN ------------
                             Event: time 1508808881.748917, type 1 (EV_KEY), code 106 (KEY_RIGHT), 
                             value 1
                             Event: time 1508808881.748917, -------------- EV_SYN ------------
                             Event: time 1508808881.916709, type 1 (EV_KEY), code 106 (KEY_RIGHT), 
                             value 0
                             Event: time 1508808881.916709, -------------- EV_SYN ------------
                             Event: time 1508808883.058113, type 1 (EV_KEY), code 1 (KEY_ESC), value 1
                             Event: time 1508808883.058113, -------------- EV_SYN ------------
                             Event: time 1508808883.261601, type 1 (EV_KEY), code 1 (KEY_ESC), value 0
                             Event: time 1508808883.261601, -------------- EV_SYN ------------
                             Event: time 1508808884.043804, type 1 (EV_KEY), code 28 (KEY_ENTER), value 
                             1
                             Event: time 1508808884.043804, -------------- EV_SYN ------------
                             Event: time 1508808884.194038, type 1 (EV_KEY), code 28 (KEY_ENTER), value 
                             0
                             Event: time 1508808884.194038, -------------- EV_SYN ------------
                             Event: time 1508808886.715256, type 1 (EV_KEY), code 30 (KEY_A), value 1
                             Event: time 1508808886.715256, -------------- EV_SYN ------------
                             Event: time 1508808886.910315, type 1 (EV_KEY), code 30 (KEY_A), value 0
                             Event: time 1508808886.910315, -------------- EV_SYN ------------
                             Event: time 1508808887.382060, type 1 (EV_KEY), code 45 (KEY_X), value 1
                             Event: time 1508808887.382060, -------------- EV_SYN ------------
                             Event: time 1508808887.557515, type 1 (EV_KEY), code 45 (KEY_X), value 0
                             Event: time 1508808887.557515, -------------- EV_SYN ------------
                             Event: time 1508808889.027526, type 1 (EV_KEY), code 44 (KEY_Z), value 1
                             Event: time 1508808889.027526, -------------- EV_SYN ------------
                             Event: time 1508808889.185223, type 1 (EV_KEY), code 44 (KEY_Z), value 0
                             Event: time 1508808889.185223, -------------- EV_SYN ------------
                             Event: time 1508808889.755801, type 1 (EV_KEY), code 31 (KEY_S), value 1
                             Event: time 1508808889.755801, -------------- EV_SYN ------------
                             Event: time 1508808889.923615, type 1 (EV_KEY), code 31 (KEY_S), value 0
                             Event: time 1508808889.923615, -------------- EV_SYN ------------
                             Event: time 1508808891.277758, type 1 (EV_KEY), code 17 (KEY_W), value 1
                             Event: time 1508808891.277758, -------------- EV_SYN ------------
                             Event: time 1508808891.467049, type 1 (EV_KEY), code 17 (KEY_W), value 0
                             Event: time 1508808891.467049, -------------- EV_SYN ------------
                             Event: time 1508808892.993258, type 1 (EV_KEY), code 16 (KEY_Q), value 1
                             Event: time 1508808892.993258, -------------- EV_SYN ------------
                             Event: time 1508808893.232212, type 1 (EV_KEY), code 16 (KEY_Q), value 0
                             Event: time 1508808893.232212, -------------- EV_SYN ------------
                            
                            mediamogulM 1 Reply Last reply Reply Quote 0
                            • mediamogulM
                              mediamogul Global Moderator @bassman6805
                              last edited by mediamogul

                              @bassman6805

                              The first two columns are for keys. I've always presumed those represent players one and two respectively, so you'll want to alter the numbers in the first column for the first controller. As mentioned earlier, use this page to translate the keys into the appropriate number code. For example, I see your directional pad uses the standard up, down, left and right keys, so that that would work out to 'up' being 273, 'down' 274, 'left' 276 and 'right' 275. In dapinput.ini, that would look like:

                              KEY_UP = 273 0 0
                              KEY_DOWN = 274 0 0
                              KEY_LEFT = 276 0 0
                              KEY_RIGHT = 275 0 0
                              

                              Which might not be the best example, as that's what it's set to by default, but you get the idea. I changed the 2nd and 3rd column in this example to zeros (meaning 'none') just to emphasize the first column.

                              RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                              RiverstormR 1 Reply Last reply Reply Quote 0
                              • B
                                bassman6805
                                last edited by

                                Thanks for the help. That solved it. This unit I have is a raspberry pi A and I'm guessing it doesn't have the power to run the game because it seems to have problems keeping up with the screen. Maybe it's better suited for a Pi 3?

                                AlturisA 1 Reply Last reply Reply Quote 0
                                • AlturisA
                                  Alturis @bassman6805
                                  last edited by

                                  @bassman6805 said in Daphne Control Help:

                                  Thanks for the help. That solved it. This unit I have is a raspberry pi A and I'm guessing it doesn't have the power to run the game because it seems to have problems keeping up with the screen. Maybe it's better suited for a Pi 3?

                                  Whats the game?

                                  RP 4.7.1 • Pi4 4Gig • CanaKit Aluminum • 64GB microSD • 1920x1080 BarTop [2 Sanwa sticks]

                                  1 Reply Last reply Reply Quote 0
                                  • B
                                    bassman6805
                                    last edited by

                                    Dragon's lair

                                    mediamogulM 1 Reply Last reply Reply Quote 0
                                    • mediamogulM
                                      mediamogul Global Moderator @bassman6805
                                      last edited by

                                      @bassman6805

                                      I believe it wasn't until the Raspberry Pi 2 that MPEG-2 could be decoded in software. However, there is the option of buying a £2.40/$3.33 license for hardware MPEG-2 decoding on the Raspberry Pi 1. Someone knowing more about the back-end of Daphne would need to confirm whether or not this would affect Daphne specifically, but I used to watch my own DVD (MPEG-2) backups with Kodi on my Raspberry Pi 1 using this and it worked very well there.

                                      RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                                      1 Reply Last reply Reply Quote 0
                                      • RiverstormR
                                        Riverstorm @mediamogul
                                        last edited by

                                        @mediamogul said in Daphne Control Help:

                                        The first two columns are for keys. I've always presumed those represent players one and two respectively

                                        That's very helpful. I have looked at those numbers many times and always wondered why they had two inputs for one player but it's actually one input for two players. I would guess the joystick input is a bonus for those console users. :)

                                        The ini file has this at the top:

                                        # Daphne cutom keyboard and joystick mapping
                                        #
                                        # Each input is mapped to 2 keyboard keys and one joystick button.
                                        # A joystick's first analog stick is also automatically mapped.
                                        #
                                        # The first two numbers are SDL keyboard codes (or 0 for "none")
                                        # Find keyboard codes here:
                                        # http://www.daphne-emu.com/mediawiki/index.php/KeyList
                                        #
                                        # The third number is the joystick button code (or 0 for "none")
                                        # Since 0 is reserved for special meaning, joystick button 0 is identified
                                        # as 1 here.  Button 1 is identified as 2, and so on.
                                        # 
                                        # Find the button you want to map by running:
                                        # jstest /dev/input/js0
                                        
                                        mediamogulM 1 Reply Last reply Reply Quote 0
                                        • mediamogulM
                                          mediamogul Global Moderator @Riverstorm
                                          last edited by mediamogul

                                          @riverstorm said in Daphne Control Help:

                                          but it's actually one input for two players.

                                          That's my guess. Most of the actual Laserdisc cabinets I've seen over the years featuring two player games, make use of one joystick and rely on the players to trade off when it's their turn. It could be nice to have separate controllers mapped so that you don't have to pass one back and forth across a room. On the other hand, having two sets of controls would rely heavily on the honor system to prevent the competitors from sabotaging each other as they play.

                                          RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                                          RiverstormR 1 Reply Last reply Reply Quote 0
                                          • RiverstormR
                                            Riverstorm @mediamogul
                                            last edited by

                                            @mediamogul said in Daphne Control Help:

                                            Most of the actual Laserdisc cabinets I've seen over the years featuring two player games, make use of one joystick and rely on the players to trade off when it's their turn.

                                            I remember those days standing off to the side and moving in place for you turn. The popular games had quarters on the marquee for the next player. Or just adding a few extra for your own. Dragon's Lair having a TV on top and a crowd gathered around it watching each player memorizing the moves. We had a few crazy people that hung in our group that would lift the marquees up and out and reach inside. Some games had a credit button down inside aways.

                                            Next time I have it up I will map the secondary and try it out. I know you do some advanced work with controllers. Two keys for each action would pretty much force 2 players to 1 device (keyboard/IPAC mappings) but then again that could just as easily be 2 sets of controls to one device like an IPAC. Just catching up with what you wrote above being the honor system. :)

                                            mediamogulM 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.