diff --git a/Readme.txt b/Readme.txt index 5cbd80d..21fedb1 100755 --- a/Readme.txt +++ b/Readme.txt @@ -111,6 +111,10 @@ Square = Backspace Triangle = Toggle Shift CHANGELOG: +1.53 + +- fix analog stick angular zone sizes (22.5 degrees now) + 1.52 - improved joystick diagonals and deadzone diff --git a/src/gui.cpp b/src/gui.cpp index dce46d4..39f3d5e 100755 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -104,20 +104,20 @@ struct myRes int top_pos; }; static myRes quickSwitchModes[] = { - {192, 2}, - {200, 2}, - {216, 2}, - {224, 2}, - {240, 2}, - {256, 2}, - {270, 2}, - {192, 14}, - {200, 14}, - {216, 14}, - {224, 14}, - {240, 14}, - {256, 14}, - {270, 14}, + {192, 2}, + {200, 2}, + {216, 2}, + {224, 2}, + {240, 2}, + {256, 2}, + {270, 2}, + {192, 14}, + {200, 14}, + {216, 14}, + {224, 14}, + {240, 14}, + {256, 14}, + {270, 14}, }; extern int moveY; @@ -226,28 +226,28 @@ void remap_custom_controls() // assign custom 1-3 to currently used custom set static void getChanges(void) { - if (mainMenu_sound) - { + if (mainMenu_sound) + { if (mainMenu_sound == 1) changed_produce_sound=2; else changed_produce_sound=3; - sound_default_evtime(); - } - else - changed_produce_sound=0; - changed_gfx_framerate=mainMenu_frameskip; + sound_default_evtime(); + } + else + changed_produce_sound=0; + changed_gfx_framerate=mainMenu_frameskip; } int gui_init (void) { - SDL_ShowCursor(SDL_DISABLE); + SDL_ShowCursor(SDL_DISABLE); #if !(defined(ANDROIDSDL) || defined(AROS)) - SDL_JoystickEventState(SDL_ENABLE); - SDL_JoystickOpen(0); + SDL_JoystickEventState(SDL_ENABLE); + SDL_JoystickOpen(0); #endif - if (prSDLScreen!=NULL) - { + if (prSDLScreen!=NULL) + { emulating=0; uae4all_init_sound(); init_kickstart(); @@ -276,28 +276,28 @@ int gui_init (void) getChanges(); check_all_prefs(); return 0; - } - return -1; + } + return -1; } int gui_update (void) { - extern char *savestate_filename; + extern char *savestate_filename; #ifdef USE_GUICHAN - extern char *screenshot_filename; + extern char *screenshot_filename; #else char *screenshot_filename=NULL; #endif - strcpy(changed_df[0],uae4all_image_file0); - strcpy(changed_df[1],uae4all_image_file1); - strcpy(changed_df[2],uae4all_image_file2); - strcpy(changed_df[3],uae4all_image_file3); - make_savestate_filenames(savestate_filename, screenshot_filename); - real_changed_df[0]=1; - real_changed_df[1]=1; - real_changed_df[2]=1; - real_changed_df[3]=1; - return 0; + strcpy(changed_df[0],uae4all_image_file0); + strcpy(changed_df[1],uae4all_image_file1); + strcpy(changed_df[2],uae4all_image_file2); + strcpy(changed_df[3],uae4all_image_file3); + make_savestate_filenames(savestate_filename, screenshot_filename); + real_changed_df[0]=1; + real_changed_df[1]=1; + real_changed_df[2]=1; + real_changed_df[3]=1; + return 0; } static void goMenu(void) @@ -337,12 +337,12 @@ static void goMenu(void) vkbd_init(); #endif #endif - getChanges(); + getChanges(); #ifdef USE_UAE4ALL_VKBD vkbd_init_button2(); #endif - if (exitmode==1 || exitmode==2) - { + if (exitmode==1 || exitmode==2) + { extern char *savestate_filename; #ifdef USE_GUICHAN extern char *screenshot_filename; @@ -351,7 +351,7 @@ static void goMenu(void) #endif extern int saveMenu_n_savestate; for(int i=0;i0 && joyX>0) { - if (2*joyY>joyX) + if (joyY>slope*joyX) dpadUp[i] = 1; - if (2*joyX>joyY) + if (joyX>slope*joyY) dpadRight[i] = 1; } // upper left quadrant else if (joyY>0 && joyX<=0) { - if (2*joyY>(-joyX)) + if (joyY>slope*(-joyX)) dpadUp[i] = 1; - if (2*(-joyX)>joyY) + if ((-joyX)>slope*joyY) dpadLeft[i] = 1; } // lower right quadrant else if (joyY<=0 && joyX>0) { - if (2*(-joyY)>joyX) + if ((-joyY)>slope*joyX) dpadDown[i] = 1; - if (2*joyX>(-joyY)) + if (joyX>slope*(-joyY)) dpadRight[i] = 1; } // lower left quadrant else if (joyY<=0 && joyX<=0) { - if (2*(-joyY)>(-joyX)) + if ((-joyY)>slope*(-joyX)) dpadDown[i] = 1; - if (2*(-joyX)>(-joyY)) + if ((-joyX)>slope*(-joyY)) dpadLeft[i] = 1; } } @@ -806,13 +807,13 @@ void gui_handle_events (void) if (((mainMenu_quickSwitch==1) && buttonB[0] && dpadUp[0]) || ((mainMenu_quickSwitch==2) && buttonY[0] && dpadUp[0])) { if (visibleAreaWidth==320) { - visibleAreaWidth=640; - mainMenu_displayHires=1; + visibleAreaWidth=640; + mainMenu_displayHires=1; } else if (visibleAreaWidth==640) { - visibleAreaWidth=320; - mainMenu_displayHires=0; - } + visibleAreaWidth=320; + mainMenu_displayHires=0; + } getChanges(); check_all_prefs(); update_display(); @@ -821,17 +822,17 @@ void gui_handle_events (void) if (((mainMenu_quickSwitch==1) && buttonB[0] && dpadDown[0]) || ((mainMenu_quickSwitch==2) && buttonY[0] && dpadDown[0])) { if (mainMenu_displayedLines==200) - mainMenu_displayedLines=216; + mainMenu_displayedLines=216; else if (mainMenu_displayedLines==216) - mainMenu_displayedLines=240; + mainMenu_displayedLines=240; else if (mainMenu_displayedLines==240) - mainMenu_displayedLines=256; + mainMenu_displayedLines=256; else if (mainMenu_displayedLines==256) - mainMenu_displayedLines=262; + mainMenu_displayedLines=262; else if (mainMenu_displayedLines==262) - mainMenu_displayedLines=270; + mainMenu_displayedLines=270; else if (mainMenu_displayedLines==270) - mainMenu_displayedLines=200; + mainMenu_displayedLines=200; getChanges(); check_all_prefs(); update_display(); diff --git a/src/od-joy.cpp b/src/od-joy.cpp index 6d51a27..5f514d7 100755 --- a/src/od-joy.cpp +++ b/src/od-joy.cpp @@ -214,21 +214,21 @@ void read_joystick(int nr, unsigned int *dir, int *button) & delay>mainMenu_autofireRate ) ) - { - if(!buttonB[0]) - *button=1; - delay=0; - *button |= (buttonB[0] & 1) << 1; - } - else - { + { + if(!buttonB[0]) + *button=1; + delay=0; + *button |= (buttonB[0] & 1) << 1; + } + else + { #ifdef __PSP2__ *button = ((mainMenu_button1==GP2X_BUTTON_B && buttonA[0]) || (mainMenu_button1==GP2X_BUTTON_X && buttonX[0]) || (mainMenu_button1==GP2X_BUTTON_Y && buttonY[0])) & 1; #else #if !(defined(ANDROIDSDL) || defined(AROS)) - *button = ((mainMenu_button1==GP2X_BUTTON_B && buttonA[0]) || (mainMenu_button1==GP2X_BUTTON_X && buttonX[0]) || (mainMenu_button1==GP2X_BUTTON_Y && buttonY[0]) || SDL_JoystickGetButton(joy, mainMenu_button1)) & 1; + *button = ((mainMenu_button1==GP2X_BUTTON_B && buttonA[0]) || (mainMenu_button1==GP2X_BUTTON_X && buttonX[0]) || (mainMenu_button1==GP2X_BUTTON_Y && buttonY[0]) || SDL_JoystickGetButton(joy, mainMenu_button1)) & 1; #else - *button = ((mainMenu_button1==GP2X_BUTTON_B && buttonA[0]) || (mainMenu_button1==GP2X_BUTTON_X && buttonX[0]) || (mainMenu_button1==GP2X_BUTTON_Y && buttonY[0])) & 1; + *button = ((mainMenu_button1==GP2X_BUTTON_B && buttonA[0]) || (mainMenu_button1==GP2X_BUTTON_X && buttonX[0]) || (mainMenu_button1==GP2X_BUTTON_Y && buttonY[0])) & 1; #endif #endif //__PSP2__ delay++; @@ -241,8 +241,8 @@ void read_joystick(int nr, unsigned int *dir, int *button) *button |= ((buttonB[0]) & 1) << 1; #endif #endif //__PSP2__ - } } + } //Analog Mouse @@ -385,47 +385,47 @@ void read_joystick(int nr, unsigned int *dir, int *button) if(mainMenu_customControls) #endif { - for (int i=0; i 0) + if (nr_joysticks > 0) uae4all_joy0 = SDL_JoystickOpen(0); - if (nr_joysticks > 1) + if (nr_joysticks > 1) uae4all_joy1 = SDL_JoystickOpen(1); else uae4all_joy1 = NULL;