GP32 Cps2emu Test8 - Small Bug Or Improvement


sezuan

Still Fresh
Joined
Mar 12, 2007
Messages
2
Hi,

when I tried cps2emu I noticed that one of my usb joypads doesn't work as expected. The start button had no effect. After some debugging I found out that the joypad (10 Buttons), is sending a pressed button 12 event. After I've changed emumain.c to poll just 10 instead of 32 buttons, everything worked as expected.

I think it's better to poll the button pressed events just for something like SDL_JoystickNumButtons. Unfortunately my C skills are very poor, so I can't fix it properly. They joypad itself works properly with mame2x and picodrive. The linux tool jscalibrator reports the correct number of buttons.

Maybe someone is able to fix that...

matthias
 

namco

Member
Joined
Mar 22, 2006
Messages
409
Age
40
Location
Manchester, UK
Website
www.stupendous-stuff.com
Yeah I'm getting joystick problems too.

By changing the poll from 32 to 10 do you mean here:

CODE

if (num < joy_count)
{
buttons = buttons & (BTN(P1_COIN) | BTN(P1_START) | BTN(SERV_SWITCH));
joy_update(joys[num]);
if(joy_getaxe(UP, joys[num])) buttons |= BTN(joy_map[num][JOY_UP]);
if(joy_getaxe(DOWN, joys[num])) buttons |= BTN(joy_map[num][JOY_DOWN]);
if(joy_getaxe(LEFT, joys[num])) buttons |= BTN(joy_map[num][JOY_LEFT]);
if(joy_getaxe(RIGHT, joys[num])) buttons |= BTN(joy_map[num][JOY_RIGHT]);

for (i = 0; i < 32; i++) {
if((joy_map[num][JOY_BUTTON1 + i] != -1) && joy_getbutton(i, joys[num]))
buttons |= BTN(joy_map[num][JOY_BUTTON1 + i]);
}
}



?
 

sezuan

Still Fresh
Joined
Mar 12, 2007
Messages
2
Hi,

Yes, exactly. I added some debug message to see which buttons is pressed, something like that:

CODE


for (i = 0; i < 32; i++) {
if((joy_map[num][JOY_BUTTON1 + i] != -1) && joy_getbutton(i, joys[num])) {
msg_printf("Button nr: %d pressed\n", i);
buttons |= BTN(joy_map[num][JOY_BUTTON1 + i]);
}
}




matthias
 

hsinn3r

Still Fresh
Joined
Aug 17, 2007
Messages
52
i have the same problem.. can you post/send me an executable of your hack? i do have the source but i can't build yet... and it could be some time till the emu gets updated properly, and i want to use my pad :)
thx
 

galious

Still Fresh
Joined
Aug 24, 2007
Messages
21
Location
Spain
Website
Visit site
The correct code should be:
for (i = 0; i < joy_buttons(joys[num]); i++) {
if((joy_map[num][JOY_BUTTON1 + i] != -1) && joy_getbutton(i, joys[num]))
buttons |= BTN(joy_map[num][JOY_BUTTON1 + i]);
}
 

juanvvc

Member
Joined
Jul 19, 2007
Messages
291
Location
Catalonia
Cps2 emu has a weak joypad support. I mean, the default joypad configuration matches a couple of very specific joypads and it is useless in others. Things are even worse when you have a joypad with the same brand that a pre-configured one... but different model. In this case, all the buttons are messed up!

Without a dynamic configuration of buttons (or at least reading them from a configuration file), you have to modify and compile emumain.c to match your joypad. Thanks to the GPL license it is possible, but a difficult and rather technical task.

I have a Dragonplus joypad, the one that resembles the PS3 joypad. I modified Capex to match my joypad buttons in a comfortable way (well, at least comfortable for me) AND optionally letting that the *first* USB joypad manages the *second* player (in the same way that the "--usbjoy_player1 0" switch of MAME) In this way, I can play with the Gp2x as joypad and a friend with the Dragonplus while connected to the TV (no, I do not have a cradle with USB multiplexors but a single USB port).

If any of you is interested in these modifications, just ask to me!
 

Duddyroar

Member
Joined
May 8, 2003
Messages
419
Location
Leicester, UK
Website
www.vc-reviews.com
juanvvc said:
Cps2 emu has a weak joypad support. I mean, the default joypad configuration matches a couple of very specific joypads and it is useless in others. Things are even worse when you have a joypad with the same brand that a pre-configured one... but different model. In this case, all the buttons are messed up!

Without a dynamic configuration of buttons (or at least reading them from a configuration file), you have to modify and compile emumain.c to match your joypad. Thanks to the GPL license it is possible, but a difficult and rather technical task.

I have a Dragonplus joypad, the one that resembles the PS3 joypad. I modified Capex to match my joypad buttons in a comfortable way (well, at least comfortable for me) AND optionally letting that the *first* USB joypad manages the *second* player (in the same way that the "--usbjoy_player1 0" switch of MAME) In this way, I can play with the Gp2x as joypad and a friend with the Dragonplus while connected to the TV (no, I do not have a cradle with USB multiplexors but a single USB port).

If any of you is interested in these modifications, just ask to me!
I need help with this matter!

I also noticed that the start button has no effect. I'm using a Logitech pad that resembles an old PSX pad (start, select, 4 facia buttons, 4 shouler buttons)

If anyone can tell me how to configure this emulator to run TWO pads (exactly the same make and model) then I will be forever in your debt!
 
Last edited by a moderator:
Top