Commit 5695727e authored by Donald Haase's avatar Donald Haase
Browse files

Correct inverted button matching logic in moving from cond->state. Add emergency exit.

parent fddbb412
...@@ -160,6 +160,8 @@ static void vo_txr_load(void *src) { ...@@ -160,6 +160,8 @@ static void vo_txr_load(void *src) {
sq_cpy(vid_tex[tx_cur], src, count); sq_cpy(vid_tex[tx_cur], src, count);
sq_wait();
#else #else
int i, n; int i, n;
......
...@@ -151,6 +151,10 @@ int main(int argc, char **argv) { ...@@ -151,6 +151,10 @@ int main(int argc, char **argv) {
checkvcd = 0; isvcd = 0; checkvcd = 0; isvcd = 0;
/* dh - Make it easier to just quit out */
cont_btn_callback(0, CONT_START | CONT_A | CONT_B | CONT_X | CONT_Y,
(cont_btn_callback_t)arch_exit);
/* Do basic setup */ /* Do basic setup */
pvr_init_defaults(); pvr_init_defaults();
......
...@@ -201,7 +201,7 @@ static void set_eq_menu() /* Set our 32-band graphic equalizer */ ...@@ -201,7 +201,7 @@ static void set_eq_menu() /* Set our 32-band graphic equalizer */
state = (cont_state_t *)maple_dev_status(mcont); state = (cont_state_t *)maple_dev_status(mcont);
if (!state) return; if (!state) return;
if (!(state->buttons & CONT_DPAD_UP)) if ((state->buttons & CONT_DPAD_UP))
{ {
if ((framecnt - up_moved) > 3) if ((framecnt - up_moved) > 3)
{ {
...@@ -211,7 +211,7 @@ static void set_eq_menu() /* Set our 32-band graphic equalizer */ ...@@ -211,7 +211,7 @@ static void set_eq_menu() /* Set our 32-band graphic equalizer */
up_moved = framecnt; up_moved = framecnt;
} }
} }
if (!(state->buttons & CONT_DPAD_DOWN)) if ((state->buttons & CONT_DPAD_DOWN))
{ {
if ((framecnt - down_moved) > 3) if ((framecnt - down_moved) > 3)
{ {
...@@ -221,7 +221,7 @@ static void set_eq_menu() /* Set our 32-band graphic equalizer */ ...@@ -221,7 +221,7 @@ static void set_eq_menu() /* Set our 32-band graphic equalizer */
down_moved = framecnt; down_moved = framecnt;
} }
} }
if (!(state->buttons & CONT_DPAD_LEFT)) if ((state->buttons & CONT_DPAD_LEFT))
{ {
if ((framecnt - left_moved) > 10) if ((framecnt - left_moved) > 10)
{ {
...@@ -229,7 +229,7 @@ static void set_eq_menu() /* Set our 32-band graphic equalizer */ ...@@ -229,7 +229,7 @@ static void set_eq_menu() /* Set our 32-band graphic equalizer */
left_moved = framecnt; left_moved = framecnt;
} }
} }
if (!(state->buttons & CONT_DPAD_RIGHT)) if ((state->buttons & CONT_DPAD_RIGHT))
{ {
if ((framecnt - right_moved) > 10) if ((framecnt - right_moved) > 10)
{ {
...@@ -237,14 +237,14 @@ static void set_eq_menu() /* Set our 32-band graphic equalizer */ ...@@ -237,14 +237,14 @@ static void set_eq_menu() /* Set our 32-band graphic equalizer */
right_moved = framecnt; right_moved = framecnt;
} }
} }
if (!(state->buttons & CONT_A)) if ((state->buttons & CONT_A))
{ {
if((framecnt - a_pressed) > 10) if((framecnt - a_pressed) > 10)
{ {
in_menu = 0; in_menu = 0;
} }
} }
if (!(state->buttons & CONT_X)) if ((state->buttons & CONT_X))
{ {
for (i=0; i<32; i++) for (i=0; i<32; i++)
{ {
...@@ -327,7 +327,7 @@ static void settings_menu() ...@@ -327,7 +327,7 @@ static void settings_menu()
{ {
state = (cont_state_t *)maple_dev_status(mcont); state = (cont_state_t *)maple_dev_status(mcont);
if (!state) return; if (!state) return;
if (!(state->buttons & CONT_DPAD_UP)) { if ((state->buttons & CONT_DPAD_UP)) {
if ((framecnt - up_moved) > 10) { if ((framecnt - up_moved) > 10) {
if (menu_item > 0) { if (menu_item > 0) {
last_selection[menu_item] = selection; last_selection[menu_item] = selection;
...@@ -337,7 +337,7 @@ static void settings_menu() ...@@ -337,7 +337,7 @@ static void settings_menu()
up_moved = framecnt; up_moved = framecnt;
} }
} }
if (!(state->buttons & CONT_DPAD_DOWN)) { if ((state->buttons & CONT_DPAD_DOWN)) {
if ((framecnt - down_moved) > 10) { if ((framecnt - down_moved) > 10) {
if (menu_item < TOTAL_MENU_ITEMS-1) { if (menu_item < TOTAL_MENU_ITEMS-1) {
last_selection[menu_item] = selection; last_selection[menu_item] = selection;
...@@ -348,7 +348,7 @@ static void settings_menu() ...@@ -348,7 +348,7 @@ static void settings_menu()
} }
} }
if (!(state->buttons & CONT_DPAD_LEFT)) { if ((state->buttons & CONT_DPAD_LEFT)) {
if ((framecnt - left_moved) > 10) { if ((framecnt - left_moved) > 10) {
if (selection >= 0) { if (selection >= 0) {
selection--; selection--;
...@@ -363,7 +363,7 @@ static void settings_menu() ...@@ -363,7 +363,7 @@ static void settings_menu()
if ((menu_item==3) && (selection < 2) )pbc_switch = 1-selection; if ((menu_item==3) && (selection < 2) )pbc_switch = 1-selection;
} }
} }
if (!(state->buttons & CONT_DPAD_RIGHT)) { if ((state->buttons & CONT_DPAD_RIGHT)) {
if ((framecnt - right_moved) > 10) { if ((framecnt - right_moved) > 10) {
if (selection <= 2) { if (selection <= 2) {
selection++; selection++;
...@@ -378,7 +378,7 @@ static void settings_menu() ...@@ -378,7 +378,7 @@ static void settings_menu()
if ((menu_item==3) && (selection < 2) )pbc_switch = 1-selection; if ((menu_item==3) && (selection < 2) )pbc_switch = 1-selection;
} }
} }
if (!(state->buttons & CONT_A)){ if ((state->buttons & CONT_A)){
if((framecnt - a_pressed) > 10) { if((framecnt - a_pressed) > 10) {
in_menu = 0; in_menu = 0;
...@@ -436,7 +436,7 @@ void check_controller() { ...@@ -436,7 +436,7 @@ void check_controller() {
state = (cont_state_t *)maple_dev_status(mcont); state = (cont_state_t *)maple_dev_status(mcont);
if (!state) return; if (!state) return;
if (!(state->buttons & CONT_DPAD_UP)) { if ((state->buttons & CONT_DPAD_UP)) {
if ((framecnt - up_moved) > 10) { if ((framecnt - up_moved) > 10) {
if (selected > 0) { if (selected > 0) {
selected--; selected--;
...@@ -447,7 +447,7 @@ void check_controller() { ...@@ -447,7 +447,7 @@ void check_controller() {
up_moved = framecnt; up_moved = framecnt;
} }
} }
if (!(state->buttons & CONT_DPAD_DOWN)) { if ((state->buttons & CONT_DPAD_DOWN)) {
if ((framecnt - down_moved) > 10) { if ((framecnt - down_moved) > 10) {
if (selected < (num_entries - 1)) { if (selected < (num_entries - 1)) {
selected++; selected++;
...@@ -482,12 +482,12 @@ void check_controller() { ...@@ -482,12 +482,12 @@ void check_controller() {
} }
} }
if (!(state->buttons & CONT_Y)) { if ((state->buttons & CONT_Y)) {
if ((framecnt - y_pressed) > 10) if ((framecnt - y_pressed) > 10)
{ {
strcat(workstring,curdir); strcat(workstring,curdir);
strcat(workstring,"/"); strcat(workstring,"/");
strcat(workstring,entries[selected].fn); strcat(workstring,entries[selected].fn);
strcpy(lst_entries[lst_size].fn,workstring); strcpy(lst_entries[lst_size].fn,workstring);
lst_entries[lst_size].size = entries[selected].size; lst_entries[lst_size].size = entries[selected].size;
...@@ -501,7 +501,7 @@ void check_controller() { ...@@ -501,7 +501,7 @@ void check_controller() {
y_pressed=framecnt; y_pressed=framecnt;
} }
if (!(state->buttons & CONT_X) ) { if ((state->buttons & CONT_X) ) {
if ((framecnt - x_pressed) > 10){ if ((framecnt - x_pressed) > 10){
/* End of translucent list */ /* End of translucent list */
pvr_list_finish(); pvr_list_finish();
...@@ -526,7 +526,7 @@ void check_controller() { ...@@ -526,7 +526,7 @@ void check_controller() {
} }
} }
if (!(state->buttons & CONT_A) && !load_queued) { if ((state->buttons & CONT_A) && !load_queued) {
if ((framecnt - a_pressed) > 10) if ((framecnt - a_pressed) > 10)
{ {
/* End of translucent list */ /* End of translucent list */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment