Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gamepad for visualboyadvance
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
mlsfit138
Guru
Guru


Joined: 20 Sep 2003
Posts: 406
Location: Washington

PostPosted: Wed May 19, 2004 11:51 pm    Post subject: gamepad for visualboyadvance Reply with quote

I want to use my gamepad for visualboyadvance. This is my first time messing with a gamepad/joystick for linux, so I feel like I'm missing something obvious. I merged joy2key, because it sounded like it might what I need, but I can't figure it out.

I use the kvisualboyadvance frontend, if that is of any relevance.
_________________
"Everytime you justify
another good in you dies"

-Converge, The Saddest Day, Petitioning the Empty Sky
Back to top
View user's profile Send private message
Venatyr
n00b
n00b


Joined: 23 Apr 2004
Posts: 18

PostPosted: Thu May 20, 2004 2:23 am    Post subject: Reply with quote

You don't need joy2key. Just make sure you enable joystick support in the kernel and anything else relevant (Like USB support for USB gamepads).

I believe there are quite a few threads about this. Do a search.

Then you can just configure the keys in the Visual Boy Advance configuration file.
Back to top
View user's profile Send private message
mlsfit138
Guru
Guru


Joined: 20 Sep 2003
Posts: 406
Location: Washington

PostPosted: Sun May 23, 2004 11:05 pm    Post subject: Reply with quote

Ok, I have my gamepad working, I tested it out with jscalibrator. It works in zsnes (except for the D-pad).

After googling for a bit, I found some directions that said that I should use a program called SDL-Test to determine the values to enter into VisualBoyAdvance.cfg. So I downloaded and ran SDL-Test, and it spit out a bunch of numbers everytime I hit a button, or moved an axis on the gamepad. So far so good.

Next I popped open the VisualBoyAdvance.cfg itself, and the instructions were some of the most confusing I've ever read:

Quote:
# All numeric values are in hexadecimal
# Use TAB or EQUAL sign to separate name from value
#
# Key configuration (all numbers are in hexadecimal!)
#
# Keys values are in the format YXXX where Y is the device number. 0 means
# keyborad and XXX is the SDL define for the desired key (read SDL_keysym.h).
#
# If Y is greater than 0, it means joystick number Y-1 and it uses the
# following format for XXX:
#
# - if XXX < 20, XXX is the axis number multiplied by 2. An even number means
# movement to the negative side (on the X axis, it means left). An odd
# number means movement to the positive side (on the X axis, it mean
# right). For the Y axis, negative means up and positive means down.
# X axis is usally axis number 0 and Y is axis number 1.
# - if 20 >= XXX > 30, then XXX is the HAT number multiplied by 4 plus the
# direction: 0 for up, 1 for down, 2 for right and 3 for left. Example:
# 0021 is HAT 0 down, 0026 is HAT 1 right.
# - if 80 >= XXX > 100, XXX is the joystick button number (XXX-080).
#
# Default key configuration is (value in parenthesis):
#
# Left Left Arrow (0114)
# Right Right Arrow (0113)
# Up Up Arrow (0111)
# Down Down Arrow (0112)
# A Z (007a)
# B X (0078)
# L A (0061)
# R S (0073)
# Start ENTER (000d)
# Select BACKSPACE (0008)
# Speed up SPACE (0020)
# Capture F12 (0125)
#
Joy0_Left=1008
Joy0_Right=1008
Joy0_Up=0111
Joy0_Down=0112
Joy0_A=007a
Joy0_B=0078
Joy0_L=0061
Joy0_R=0073
Joy0_Start=000d
Joy0_Select=0008
Joy0_Speed=0020
Joy0_Capture=0125

# Motion support keys. Same format as above
#
# Default keys are (value in parenthesis):
#
# Left Numeric Pad 4 (0104)
# Right Numeric Pad 6 (0106)
# Up Numeric Pad 8 (0108)
# Down Numeric Pad 2 (0102)
#
Motion_Left=0104
Motion_Right=0106
Motion_Up=0108
Motion_Down=0102


Note that when I press left or right on the Dpad, the number SDL-Test spits out is 1008, if I press up or down it spits out 100a; so that program gives the same value for left as it does for right, etc. Since xxx is 008, or 00a in this case, the instructions that seem to apply for my dpad start with "# - if XXX < 20, XXX is the axis number multiplied by 2" So far I understand everything, (half of eight is four, and the x axis on my dpad is axis four)

The next line loses me:
Quote:
An even number means
# movement to the negative side (on the X axis, it means left).


You'd think then that if I pressed right on the dpad, SDL-Test would spit out an odd number, it doesn't however, it only says 1008, over and over again, no matter if I hit left or right. Where am I supposed to get the correct values to enter here?
_________________
"Everytime you justify
another good in you dies"

-Converge, The Saddest Day, Petitioning the Empty Sky
Back to top
View user's profile Send private message
Houn
n00b
n00b


Joined: 17 Dec 2003
Posts: 66

PostPosted: Mon May 24, 2004 12:06 am    Post subject: Reply with quote

Dunno what's up with your gamepad, mine gives different numbers for right/left and up/down. I use a Gravis Gamepad Pro USB. Here's the relevent portion of my VisualBoyAdvance.cfg:

Code:
Joy0_Left=1000
Joy0_Right=1001
Joy0_Up=1002
Joy0_Down=1003
Joy0_A=1081
Joy0_B=1080
Joy0_L=1084
Joy0_R=1085
Joy0_Start=1089
Joy0_Select=1088
Joy0_Speed=0020
Joy0_Capture=0125


Those numbers are directly from SDL test. Dunno if that helps you with yours, but you never know ;)
Back to top
View user's profile Send private message
mlsfit138
Guru
Guru


Joined: 20 Sep 2003
Posts: 406
Location: Washington

PostPosted: Tue May 25, 2004 6:07 am    Post subject: Reply with quote

I think that the pad is simply incompatible with visualboyadvance. I'll return it tomorrow for the same model you have. It's too bad that I won't have the dual analogue (playstation style). True that don't need them right away, but who knows when I will.
_________________
"Everytime you justify
another good in you dies"

-Converge, The Saddest Day, Petitioning the Empty Sky
Back to top
View user's profile Send private message
Venatyr
n00b
n00b


Joined: 23 Apr 2004
Posts: 18

PostPosted: Wed May 26, 2004 6:06 am    Post subject: Reply with quote

What gamepad do you use?
Back to top
View user's profile Send private message
mlsfit138
Guru
Guru


Joined: 20 Sep 2003
Posts: 406
Location: Washington

PostPosted: Thu May 27, 2004 5:51 am    Post subject: Reply with quote

Venatyr wrote:
What gamepad do you use?
Well, up until a few minutes ago, i was using the logitech dual analogue USB controller. I just returned in for a gravis gamepad pro in the hopes that it would actually work for my games. Unfortunately, I'm having the exact same problem with the gravis. for some reason sdl-test still spits out the same numbers for left and right, and up and down. and zsnes won't recognize the dpad at all.

I would think that it's a driver problem, but my gamepads work just fine in jscalibrator, so I'm pretty sure my kernel is configured correctly.
_________________
"Everytime you justify
another good in you dies"

-Converge, The Saddest Day, Petitioning the Empty Sky
Back to top
View user's profile Send private message
Venatyr
n00b
n00b


Joined: 23 Apr 2004
Posts: 18

PostPosted: Thu May 27, 2004 6:04 am    Post subject: Reply with quote

I have a Logitech Wingman Cordless USB.

I get the same sort of results for sdl-test for the axis.
For Left-Right I get 1000 and for Up-Down I get 1002.
You are supposed to do this in VisualBoyAdvance:

Code:
# - if XXX < 20, XXX is the axis number multiplied by 2. An even number means
#   movement to the negative side (on the X axis, it means left). An odd
#   number means movement to the positive side (on the X axis, it mean
#   right). For the Y axis, negative means up and positive means down.


Mine looks like this:
Code:
Joy0_Left=1000
Joy0_Right=1001
Joy0_Up=1002
Joy0_Down=1003


Also, if you are having axis problems in other games, make sure you have a symbolic link pointing to the correct joystick device.

Here is what I have in /dev:

Code:
lrwxrwxrwx  1 root root 14 May 26 16:17 js0 -> /dev/input/js0


Hope this helps in some way.
Back to top
View user's profile Send private message
mlsfit138
Guru
Guru


Joined: 20 Sep 2003
Posts: 406
Location: Washington

PostPosted: Thu May 27, 2004 6:24 am    Post subject: Reply with quote

Thank you guys, you have been a big help. Somehow I resolved my problem by messing with the kernel. I was so sure it wasn't a kernel problem, but apparently I was wrong. I'll post exactly what I did tomorrow when I have more time.
_________________
"Everytime you justify
another good in you dies"

-Converge, The Saddest Day, Petitioning the Empty Sky
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum