pea
developer
Hi guys,
I am having an issue off 'double pressing' on the GP32 using the following source (it works perfectly ok in geepee32). This code handles the main menu for a game:
What this does is:
LOOP
wait for button down
wait for button back up
handle button press
/LOOP
In geepee32 I get this (as I am supposed to):
Press button, nothing happens
Release button, menu moves down one item
In GP32 I get this:
Press button, menu moves down one item
Release button, menu moves down one more item
So I can only ever jump two menu items at a time! Is it my new BLU+ doing funny stuff, or is it my code that is not working properly?
It seems like for every press of the D-Pad, I get a sequence like this:
0 - no press
0
0
0
1 - press here
0
1
1
1
1
1
1
0 - release here
0
0
0
0
Strange aye???
I am having an issue off 'double pressing' on the GP32 using the following source (it works perfectly ok in geepee32). This code handles the main menu for a game:
Code:
option = -1;
while (option<0){
// Draw menu with 'choice' selected
draw_menu( choice );
button = gp_getButton();
while(!button){ button = gp_getButton(); }
while(gp_getButton()){}
if (button & BUTTON_DOWN){
choice++;
}else if (button & BUTTON_UP){
choice--;
}else if (button & BUTTON_A){
option=choice;
}
choice = min( max( choice, 0 ), 4 );
}
return option;
What this does is:
LOOP
wait for button down
wait for button back up
handle button press
/LOOP
In geepee32 I get this (as I am supposed to):
Press button, nothing happens
Release button, menu moves down one item
In GP32 I get this:
Press button, menu moves down one item
Release button, menu moves down one more item
So I can only ever jump two menu items at a time! Is it my new BLU+ doing funny stuff, or is it my code that is not working properly?
It seems like for every press of the D-Pad, I get a sequence like this:
0 - no press
0
0
0
1 - press here
0
1
1
1
1
1
1
0 - release here
0
0
0
0
Strange aye???