4646#define SCREEN_HORIZONTAL_SIZE RES_HW_SCREEN_HORIZONTAL
4747#define SCREEN_VERTICAL_SIZE RES_HW_SCREEN_VERTICAL
4848
49- #define SCROLL_SPEED_PX 240 // This means no animations but also no tearing effect
50- #define FPS_MENU 30
49+ #define SCROLL_SPEED_PX 30
50+ #define FPS_MENU 50
5151#define ARROWS_PADDING 8
5252
5353#define MENU_ZONE_WIDTH SCREEN_HORIZONTAL_SIZE
@@ -120,6 +120,7 @@ int aspect_ratio_factor_step = 10;
120120const char *resume_options_str[] = {RESUME_OPTIONS};
121121
122122int savestate_slot = 0 ;
123+ static int quick_load_slot_chosen = 0 ;
123124
124125
125126// / -------------- FUNCTIONS DECLARATION --------------
@@ -426,7 +427,7 @@ void init_menu_system_values(){
426427
427428void menu_screen_refresh (int menuItem, int prevItem, int scroll, uint8_t menu_confirmation, uint8_t menu_action){
428429 // / --------- Vars ---------
429- int print_arrows = 1 ;
430+ int print_arrows = (scroll== 0 )? 1 : 0 ;
430431
431432 // / --------- Clear HW screen ----------
432433 if (SDL_BlitSurface (backup_hw_screen, NULL , draw_screen, NULL )){
@@ -519,7 +520,12 @@ void menu_screen_refresh(int menuItem, int prevItem, int scroll, uint8_t menu_co
519520
520521 case MENU_TYPE_LOAD:
521522 // / ---- Write slot -----
522- sprintf (text_tmp, " FROM SLOT < %d >" , savestate_slot+1 );
523+ if (quick_load_slot_chosen){
524+ sprintf (text_tmp, " FROM AUTO SAVE" );
525+ }
526+ else {
527+ sprintf (text_tmp, " FROM SLOT < %d >" , savestate_slot+1 );
528+ }
523529 text_surface = TTF_RenderText_Blended (menu_info_font, text_tmp, text_color);
524530 text_pos.x = (draw_screen->w - MENU_ZONE_WIDTH)/2 + (MENU_ZONE_WIDTH - text_surface->w )/2 ;
525531 text_pos.y = draw_screen->h - MENU_ZONE_HEIGHT/2 - text_surface->h /2 ;
@@ -535,17 +541,22 @@ void menu_screen_refresh(int menuItem, int prevItem, int scroll, uint8_t menu_co
535541 text_surface = TTF_RenderText_Blended (menu_info_font, text_tmp, text_color);
536542 }
537543 else {
538- // / ---- Write current Save state ----
539- strcpy (fname, FCEU_MakeFName (FCEUMKF_STATE,savestate_slot,NULL ).c_str ());
540- if (file_exists (fname))
541- {
542- printf (" Found Load slot: %s\n " , basename (fname));
543- char *bname = basename (fname);
544- if (strlen (bname) > limit_filename_size){bname[limit_filename_size]=0 ;} // limiting size
545- text_surface = TTF_RenderText_Blended (menu_small_info_font,bname, text_color);
544+ if (quick_load_slot_chosen){
545+ text_surface = TTF_RenderText_Blended (menu_info_font, " " , text_color);
546546 }
547547 else {
548- text_surface = TTF_RenderText_Blended (menu_info_font, " Free" , text_color);
548+ // / ---- Write current Save state ----
549+ strcpy (fname, FCEU_MakeFName (FCEUMKF_STATE,savestate_slot,NULL ).c_str ());
550+ if (file_exists (fname))
551+ {
552+ printf (" Found Load slot: %s\n " , basename (fname));
553+ char *bname = basename (fname);
554+ if (strlen (bname) > limit_filename_size){bname[limit_filename_size]=0 ;} // limiting size
555+ text_surface = TTF_RenderText_Blended (menu_small_info_font,bname, text_color);
556+ }
557+ else {
558+ text_surface = TTF_RenderText_Blended (menu_info_font, " Free" , text_color);
559+ }
549560 }
550561 }
551562 }
@@ -737,8 +748,21 @@ void run_menu_loop()
737748 }
738749 else if (idx_menus[menuItem] == MENU_TYPE_LOAD){
739750 MENU_DEBUG_PRINTF (" Load Slot DOWN\n " );
740- // idx_load_slot = (!idx_load_slot)?(MAX_SAVE_SLOTS-1):(idx_load_slot-1);
741- savestate_slot = (!savestate_slot)?(MAX_SAVE_SLOTS-1 ):(savestate_slot-1 );
751+
752+ /* * Choose quick save file or standard saveslot for loading */
753+ if (!quick_load_slot_chosen &&
754+ savestate_slot == 0 &&
755+ access (quick_save_file, F_OK ) != -1 ){
756+ quick_load_slot_chosen = 1 ;
757+ }
758+ else if (quick_load_slot_chosen){
759+ quick_load_slot_chosen = 0 ;
760+ savestate_slot = MAX_SAVE_SLOTS-1 ;
761+ }
762+ else {
763+ savestate_slot = (!savestate_slot)?(MAX_SAVE_SLOTS-1 ):(savestate_slot-1 );
764+ }
765+
742766 // / ------ Refresh screen ------
743767 screen_refresh = 1 ;
744768 }
@@ -791,8 +815,21 @@ void run_menu_loop()
791815 }
792816 else if (idx_menus[menuItem] == MENU_TYPE_LOAD){
793817 MENU_DEBUG_PRINTF (" Load Slot UP\n " );
794- // idx_load_slot = (idx_load_slot+1)%MAX_SAVE_SLOTS;
795- savestate_slot = (savestate_slot+1 )%MAX_SAVE_SLOTS;
818+
819+ /* * Choose quick save file or standard saveslot for loading */
820+ if (!quick_load_slot_chosen &&
821+ savestate_slot == MAX_SAVE_SLOTS-1 &&
822+ access (quick_save_file, F_OK ) != -1 ){
823+ quick_load_slot_chosen = 1 ;
824+ }
825+ else if (quick_load_slot_chosen){
826+ quick_load_slot_chosen = 0 ;
827+ savestate_slot = 0 ;
828+ }
829+ else {
830+ savestate_slot = (savestate_slot+1 )%MAX_SAVE_SLOTS;
831+ }
832+
796833 // / ------ Refresh screen ------
797834 screen_refresh = 1 ;
798835 }
@@ -840,12 +877,23 @@ void run_menu_loop()
840877 menu_screen_refresh (menuItem, prevItem, scroll, menu_confirmation, 1 );
841878
842879 // / ------ Load game ------
843- FCEUI_SelectState (savestate_slot, 0 );
844- FCEUI_LoadState (NULL );
880+ if (quick_load_slot_chosen){
881+ FCEUI_LoadState (quick_save_file);
882+ }
883+ else {
884+ FCEUI_SelectState (savestate_slot, 0 );
885+ FCEUI_LoadState (NULL );
886+ }
845887
846888 // / ----- Hud Msg -----
847- sprintf (shell_cmd, " %s %d \" LOADED FROM SLOT %d\" " ,
848- SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP, savestate_slot+1 );
889+ if (quick_load_slot_chosen){
890+ sprintf (shell_cmd, " %s %d \" LOADED FROM AUTO SAVE\" " ,
891+ SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP);
892+ }
893+ else {
894+ sprintf (shell_cmd, " %s %d \" LOADED FROM SLOT %d\" " ,
895+ SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP, savestate_slot+1 );
896+ }
849897 fp = popen (shell_cmd, " r" );
850898 if (fp == NULL ) {
851899 MENU_ERROR_PRINTF (" Failed to run command %s\n " , shell_cmd);
@@ -1131,64 +1179,3 @@ int launch_resume_menu_loop()
11311179
11321180 return option_idx;
11331181}
1134-
1135-
1136-
1137-
1138-
1139-
1140-
1141-
1142-
1143-
1144-
1145-
1146-
1147-
1148-
1149-
1150-
1151-
1152-
1153-
1154-
1155-
1156-
1157-
1158-
1159-
1160-
1161-
1162-
1163-
1164-
1165-
1166-
1167-
1168-
1169-
1170-
1171-
1172-
1173-
1174-
1175-
1176-
1177-
1178-
1179-
1180-
1181-
1182-
1183-
1184-
1185-
1186-
1187-
1188-
1189-
1190-
1191-
1192-
1193-
1194-
0 commit comments