Views: 6,911,071 | Homepage | Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search | 04-24-24 11:54 PM |
Guest: |
0 users reading D-Pads help | 1 bot |
Main - Compatibility / Testing - D-Pads help | Hide post layouts | New reply |
thelittlejungler |
| ||
Member Normal user Level: 7 Posts: 1/10 EXP: 1435 Next: 13 Since: 09-03-18 Last post: 2052 days ago Last view: 2037 days ago |
So, im new here on the fórum and i need some help if you can provide it to me.
My issue is that i used to have an usb ps2 controller, but now it is broken (im wornking on it) and i have to use one that i had home, the problema is that i cant map the d-pad onto the input settings of melonds. I looked for that issue, but the answeres never seemed to help. PS: My d-pads worked as i tested them out of the emulator. |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 199/887 EXP: 1343093 Next: 55083 Since: 03-28-17 From: France Last post: 7 hours ago Last view: 5 hours ago |
thelittlejungler |
| ||
Member Normal user Level: 7 Posts: 2/10 EXP: 1435 Next: 13 Since: 09-03-18 Last post: 2052 days ago Last view: 2037 days ago |
Hum, I Know the dpad configs, but i dont know how to apply them on the emulator, u yried editing te config file manualy but nothing happens. |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 200/887 EXP: 1343093 Next: 55083 Since: 03-28-17 From: France Last post: 7 hours ago Last view: 5 hours ago |
what do you mean by that? in the emulator, those are the up/down/left/right key mappings ____________________ Kuribo64 |
thelittlejungler |
| ||
Member Normal user Level: 7 Posts: 3/10 EXP: 1435 Next: 13 Since: 09-03-18 Last post: 2052 days ago Last view: 2037 days ago |
yea i know, but is there some way of reconfiguring without going to the key mappings tab? because that tab doesnt recognise my dpad, thats the issue. |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 201/887 EXP: 1343093 Next: 55083 Since: 03-28-17 From: France Last post: 7 hours ago Last view: 5 hours ago |
does your joystick have multiple dpads? melonDS is set to use the first one. ____________________ Kuribo64 |
thelittlejungler |
| ||
Member Normal user Level: 7 Posts: 4/10 EXP: 1435 Next: 13 Since: 09-03-18 Last post: 2052 days ago Last view: 2037 days ago |
my joystick its na usb ps1 controller so just 1 dpad ( i think i forgot to mention it).
|
thelittlejungler |
| ||
Member Normal user Level: 7 Posts: 5/10 EXP: 1435 Next: 13 Since: 09-03-18 Last post: 2052 days ago Last view: 2037 days ago |
Joy_Right=HAxis 1
Joy_Left=IHAxis 1 Joy_Up=IHAxis 2 Joy_Down=HAxis 2 this might be useful |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 202/887 EXP: 1343093 Next: 55083 Since: 03-28-17 From: France Last post: 7 hours ago Last view: 5 hours ago |
that's not how the config works, those entries only take numbers
for reference, here is how they are encoded: Joy_xxxx=N button: N = button number from 0 dpad: N = 256 + direction, like u8 blackhat = SDL_JoystickGetHat(joy, 0);
if (blackhat) { if (blackhat & 0x1) blackhat = 0x1; else if (blackhat & 0x2) blackhat = 0x2; else if (blackhat & 0x4) blackhat = 0x4; else blackhat = 0x8; joymap[id] = 0x100 | blackhat; ... } something that'd be helpful here, would be go in the config panel and open the properties page for your joystick, y'know, where it shows the buttons and axes and all and take a screenshot of that so we can see what your dpad is recognized as ____________________ Kuribo64 |
thelittlejungler |
| ||
Member Normal user Level: 7 Posts: 6/10 EXP: 1435 Next: 13 Since: 09-03-18 Last post: 2052 days ago Last view: 2037 days ago |
i dont know how to pick images here so ima just let the link of the print here
https://drive.google.com/open?id=1q3g-KPSGBUur2kQWoHwWpib-Ux0lW_wB it is in portuguese but i think you can understand the importante things there (Eixo = Axes) as i never used python im not familiar with it. |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 203/887 EXP: 1343093 Next: 55083 Since: 03-28-17 From: France Last post: 7 hours ago Last view: 5 hours ago |
yeah that's what I thought-- the dpad is recognized as a 2-axis joystick.
seeing as that's the only one there, you can just leave directional keys unconfigured-- melonDS recognizes a 2-axis joystick automatically and lets you use that for dpad keys. ____________________ Kuribo64 |
thelittlejungler |
| ||
Member Normal user Level: 7 Posts: 7/10 EXP: 1435 Next: 13 Since: 09-03-18 Last post: 2052 days ago Last view: 2037 days ago |
the problema is that i let it unconfigured and it doesnt get recognised as an input like the other button and the axes are working i tested it on a program already but it seems that i cant get it working on the emulator u.u |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 204/887 EXP: 1343093 Next: 55083 Since: 03-28-17 From: France Last post: 7 hours ago Last view: 5 hours ago |
shiiiiiiiiiiiit
I just realized, my code is flawed in a dumb way if (Joystick)
{ SDL_JoystickUpdate(); Uint32 hat = SDL_JoystickGetHat(Joystick, 0); Sint16 axisX = SDL_JoystickGetAxis(Joystick, 0); Sint16 axisY = SDL_JoystickGetAxis(Joystick, 1); for (int i = 0; i < 12; i++) { int btnid = Config::JoyMapping[i]; if (btnid < 0) continue; bool pressed; if (btnid == 0x101) // up pressed = (hat & SDL_HAT_UP) || (axisY <= -16384); else if (btnid == 0x104) // down pressed = (hat & SDL_HAT_DOWN) || (axisY >= 16384); else if (btnid == 0x102) // right pressed = (hat & SDL_HAT_RIGHT) || (axisX >= 16384); else if (btnid == 0x108) // left pressed = (hat & SDL_HAT_LEFT) || (axisX <= -16384); else pressed = SDL_JoystickGetButton(Joystick, btnid); if (pressed) joymask &= ~(1<<i); } } blarg. joystick axis will only work if an actual dpad has been mapped anyway, you can fix it by hand-editing the config file, like Joy_Right=258 Joy_Left=264 Joy_Up=257 Joy_Down=260 let me know if that works ____________________ Kuribo64 |
thelittlejungler |
| ||
Member Normal user Level: 7 Posts: 8/10 EXP: 1435 Next: 13 Since: 09-03-18 Last post: 2052 days ago Last view: 2037 days ago |
strange, now they seem to be well encoded but when i walk left i go up and when i go right i go down, but no output when i press up and down, i tried switching the codes but nothing happened, im going to try messing with the number codes and see where i get, but hey, its a step forward already, thanks. |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 205/887 EXP: 1343093 Next: 55083 Since: 03-28-17 From: France Last post: 7 hours ago Last view: 5 hours ago |
in the joystick property dialog, see if pressing the dpad directions yields the correct result
'cause otherwise that'd be weird. maybe it's returning values that fall below the thresholds melonDS uses. (the threshold value in the code above is 16384 which is 50% of the range in one direction) ____________________ Kuribo64 |
thelittlejungler |
| ||
Member Normal user Level: 7 Posts: 9/10 EXP: 1435 Next: 13 Since: 09-03-18 Last post: 2052 days ago Last view: 2037 days ago |
i know right, it is wierd i press and they go where i want. OK, now for values, im seeing here on a program that the center of the axis is 32511 so, the double would be something like 65535 for right 0 for left ,65535 for down and 0 for up. im going to try to lower the range if i can and see what happens. |
thelittlejungler |
| ||
Member Normal user Level: 7 Posts: 10/10 EXP: 1435 Next: 13 Since: 09-03-18 Last post: 2052 days ago Last view: 2037 days ago |
i dont seem to be able to change the range. |
Ammako |
| ||
Member Normal user Level: 13 Posts: 5/34 EXP: 9854 Next: 413 Since: 07-20-17 Last post: 1577 days ago Last view: 578 days ago |
Posted by StapleButter Using a retail SFC pad with the Mayflash USB adapter here. I just wanted to say, that did it for me, thanks! |
Main - Compatibility / Testing - D-Pads help | Hide post layouts | New reply |
Page rendered in 0.045 seconds. (2048KB of memory used) MySQL - queries: 29, rows: 112/112, time: 0.015 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |