Daphne Control Help
-
I have a super game pi that I made that is on the adafruit website. It's sort of like a gameboy. I have installed the daphne emulator and it opens the games fine. I can't seem to get the controllers setup properly. This setup if a little weird. Here is what ii in my config file:
#Keyboard input, Joypad and Joyaxis will all obey the "nul" bind, which disables the bind completely, # rather than relying on a default. input_player1_a = "z" input_player1_b = "x" input_player1_y = "a" input_player1_x = "s" input_player1_start = "enter" input_player1_select = "escape" input_player1_l = "q" input_player1_r = "w" input_player1_left = "left" input_player1_right = "right" input_player1_up = "down" input_player1_down = "up" # input_player1_l2 = # input_player1_r2 = # input_player1_l3 = # input_player1_r3 =
I have looked at the daphne config file but I can't figure out which numbers I need to change. There are 3 columns and I know the first 2 are keyboard commands and the third is for a gamepad. I am not sure if the way my unit is set up if it's a keyboard or gamepad. Would appreciate any help. Thanks.
-
From what I can tell my joystick and buttons are mapped as keyboard inputs. Does anyone have any ideas?
-
I'm still stuck. Is there another forum that my be better suited for the daphne emulator?
-
Check out the docs here:
https://github.com/retropie/retropie-setup/wiki/DaphneDaphne has its own input binding syntax.
-
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.
-
@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.
-
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." -
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.
-
@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?
-
@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 theretrogame
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. -
@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 indapinput.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. -
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.
-
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 ------------
-
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.
-
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?
-
@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?
-
Dragon's lair
-
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.
-
@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
-
@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.
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.