Example #1
0
void gui_display (int32_t shortcut)
{
    pause_sound ();

    if (shortcut >=0 && shortcut < 4) {
	/* If we're running full-screen, we must toggle
	 * to windowed mode before opening the dialog */
	int32_t was_fullscreen;

	if (was_fullscreen = is_fullscreen ()) {
	    toggle_fullscreen (0);
	    if (is_fullscreen ()) {
		resume_sound ();
		return;
	    }
	}

	(new floppyFilePanel (shortcut))->run ();

	if (was_fullscreen)
	    toggle_fullscreen (0);
    }
    resume_sound ();
}
Example #2
0
struct virtkey* virtkbd_get_key()
{
	virtkey_t *key;
	
	if (!vkb_is_init) return NULL;
	
	pause_sound();
	
	kbd_is_active=1;
	
	key = get_key_internal();
	
	kbd_is_active=0;
	
	resume_sound();

	return key;
}
Example #3
0
static void goMenu(void)
{

   int exitmode=0;
   int autosave=mainMenu_autosave;
   if (quit_program != 0)
	    return;
#ifdef PROFILER_UAE4ALL
   uae4all_prof_show();
#endif
#ifdef DEBUG_FRAMERATE
   uae4all_show_time();
#endif
   emulating=1;
   vkbd_quit();
   init_text(0);
   pause_sound();

   menu_raise();
   exitmode=run_mainMenu();
   notice_screen_contents_lost();
   resume_sound();
   if ((!(strcmp(prefs_df[0],uae4all_image_file0))) || ((!(strcmp(prefs_df[1],uae4all_image_file1)))))
	   menu_unraise();
   quit_text();
   vkbd_init();
#ifdef DREAMCAST
   SDL_DC_EmulateKeyboard(SDL_FALSE);
#endif
    getChanges();
	vkbd_init_button2();
    if (exitmode==1 || exitmode==2)
    {
    	    extern char *savestate_filename;
    	    extern int saveMenu_n_savestate;
	    for(int i=0;i<mainMenu_drives;i++)
	    {
		if (i==0 && strcmp(changed_df[0],uae4all_image_file0)) {
		    strcpy(changed_df[0],uae4all_image_file0);
		    real_changed_df[0]=1;
		}
		else if (i==1 && strcmp(changed_df[1],uae4all_image_file1)) {
		    strcpy(changed_df[1],uae4all_image_file1);
		    real_changed_df[1]=1;
		}
		else if (i==2 && strcmp(changed_df[2],uae4all_image_file2)) {
		    strcpy(changed_df[2],uae4all_image_file2);
		    real_changed_df[2]=1;
		}
		else if (i==3 && strcmp(changed_df[3],uae4all_image_file3)) {
		    strcpy(changed_df[3],uae4all_image_file3);
		    real_changed_df[3]=1;
		}
	    }
    	    strcpy(savestate_filename,uae4all_image_file0);
	    switch(saveMenu_n_savestate)
    	    {
	    	case 1:
    			strcat(savestate_filename,"-1.asf"); break;
	    	case 2:
    			strcat(savestate_filename,"-2.asf"); break;
	    	case 3:
    			strcat(savestate_filename,"-3.asf"); break;
	    	default:
    	   		strcat(savestate_filename,".asf");
    	    }
    }
    if (exitmode==3)
    {
    	    extern char *savestate_filename;
    	    extern int saveMenu_n_savestate;
	    for(int i=0;i<mainMenu_drives;i++)
	    {
		changed_df[i][0]=0;
		if (i==0) {
		    uae4all_image_file0[0]=0;
		    if (strcmp(changed_df[0],uae4all_image_file0))
		    {
			strcpy(changed_df[0],uae4all_image_file0);
			real_changed_df[0]=1;
		    }
		}
		else if (i==1) {
		    uae4all_image_file1[0]=0;
		    if (strcmp(changed_df[1],uae4all_image_file1))
		    {
			strcpy(changed_df[1],uae4all_image_file1);
			real_changed_df[1]=1;
		    }
		}
		else if (i==2) {
		    uae4all_image_file2[0]=0;
		    if (strcmp(changed_df[2],uae4all_image_file2))
		    {
			strcpy(changed_df[2],uae4all_image_file2);
			real_changed_df[2]=1;
		    }
		}
		else if (i==3) {
		    uae4all_image_file3[0]=0;
		    if (strcmp(changed_df[3],uae4all_image_file3))
		    {
			strcpy(changed_df[3],uae4all_image_file3);
			real_changed_df[3]=1;
		    }
		}
		disk_eject(i);
	    }
    	    strcpy(savestate_filename,uae4all_image_file0);
    	    switch(saveMenu_n_savestate)
    	    {
	   	case 1:
    			strcat(savestate_filename,"-1.asf"); break;
	    	case 2:
    			strcat(savestate_filename,"-2.asf"); break;
	    	case 3:
    			strcat(savestate_filename,"-3.asf"); break;
	    	default:
    	  	 	strcat(savestate_filename,".asf");
    	    }
    }
    if (exitmode==2)
    {
	    if (autosave!=mainMenu_autosave)
	    {
	    	prefs_df[0][0]=0;
	   		prefs_df[1][0]=0;
			prefs_df[2][0]=0;
	   		prefs_df[3][0]=0;
	    }
		if(gp2xButtonRemappingOn)
			togglemouse();
		int gp2xMouseEmuOn=0;
		int gp2xButtonRemappingOn=0;
	    uae_reset ();
    }
    check_all_prefs();
    gui_purge_events();
    notice_screen_contents_lost();
#ifdef DEBUG_FRAMERATE
    uae4all_update_time();
#endif
#ifdef PROFILER_UAE4ALL
    uae4all_prof_init();
#endif

}