示例#1
0
int graphics_init (void)
{
	int i,j;

#ifdef DEBUG_GFX
	dbg("Function: graphics_init");
#endif

	current_width = PREFS_GFX_WIDTH;
	current_height = PREFS_GFX_HEIGHT;

	graphics_subinit ();


    if (!init_colors ())
		return 0;

    buttonstate[0] = buttonstate[1] = buttonstate[2] = 0;
    for (i = 0; i < 256; i++)
	uae4all_keystate[i] = 0;

#ifdef DEBUG_FRAMERATE
    uae4all_update_time();
#endif
    return 1;
}
示例#2
0
int graphics_init (void)
{
	int i,j;

	
#if defined (GP2X) || defined (PSP) || defined (GIZMONDO)
// this will hold the state of the mouse emulation toggle.  The start button
// will enable mouse emulation, which will allow the joystick to move the 
// mouse point (probably badly, but there you go).
gp2xMouseEmuOn=0;
hasGp2xButtonRemapping = 1;
gp2xButtonRemappingOn = 0;
show_volumecontrol = 0;
#endif 

#ifdef DEBUG_GFX
	dbg("Function: graphics_init");
#endif

	current_width = PREFS_GFX_WIDTH;
	current_height = PREFS_GFX_HEIGHT;

	graphics_subinit ();


    if (!init_colors ())
		return 0;

    buttonstate[0] = buttonstate[1] = buttonstate[2] = 0;
    for (i = 256; i--;)
	uae4all_keystate[i] = 0;

#ifdef DEBUG_FRAMERATE
    uae4all_update_time();
#endif
    return 1;
}
示例#3
0
static void uae4all_reset(void)
{
    int i;
#if !defined(USE_CYCLONE_CORE) && !defined(USE_FAME_CORE_ARM2)
    m68k_set_context(&micontexto);
#endif
    m68k_reset();
    for(i=1; i<8; i++)
#if defined(DEBUG_INTERRUPTS)
        M68KCONTEXT.interrupts[i]=0xFF;
#else
        M68KCONTEXT.interrupts[i]=0x18+i;
#endif
    M68KCONTEXT.interrupts[0]=0;
    m68k_irq_update(0);
    mispcflags=0;
    _68k_areg(7) = get_long (0x00f80000);
    _68k_setpc(get_long (0x00f80004));
    //_68k_sreg = 0x2700; // already done by m68k_reset()
    mispcflags=0;
#ifdef DEBUG_FRAMERATE
    uae4all_update_time();
#endif
}
示例#4
0
文件: gui.cpp 项目: kerheol/uae4all
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

}
示例#5
0
文件: gui.cpp 项目: kerheol/uae4all
int gui_init (void)
{

//Se ejecuta justo despues del MAIN

    if (prSDLScreen==NULL)
#ifdef DREAMCAST
	prSDLScreen=SDL_SetVideoMode(320,240,16,VIDEO_FLAGS);
#else

#ifdef PANDORA
	if(hwScaled)
		prSDLScreen = SDL_SetVideoMode(320, gfxHeight, 16, VIDEO_FLAGS);
	else
	{
		prSDLScreen = SDL_CreateRGBSurface(SDL_SWSURFACE,320,240,16,0,0,0,0);
		prSDLScaleScreen = SDL_SetVideoMode(640, 480, 16, VIDEO_FLAGS);
	}
#else
	prSDLScreen=SDL_SetVideoMode(320,240,16,VIDEO_FLAGS);
#endif

#endif
    SDL_ShowCursor(SDL_DISABLE);
    SDL_JoystickEventState(SDL_ENABLE);
    SDL_JoystickOpen(0);
    if (prSDLScreen!=NULL)
    {
	emulating=0;

#if !defined(DEBUG_UAE4ALL) && !defined(PROFILER_UAE4ALL) && !defined(AUTO_RUN) && !defined(AUTO_FRAMERATE)
	//uae4all_image_file[0]=0;
	//uae4all_image_file2[0]=0;
#else
	//strcpy(uae4all_image_file,"prueba.adz");
	//strcpy(uae4all_image_file2,"prueba2.adz");
#endif
	init_text(1);
	if (!uae4all_image_file0[0])
		run_mainMenu();
	quit_text();
	vkbd_init();

#ifdef GP2X
	inputmode_init();
#if !defined(PANDORA) && !defined(GCW0)
	volumecontrol_init();
#endif
#endif
printf("4\n");
#if defined (PSP) || defined (GIZMONDO)
	inputmode_init();
#endif

	uae4all_pause_music();
printf("5\n");
	emulating=1;
	getChanges();
printf("6\n");
	check_all_prefs();
printf("7\n");
	reset_frameskip();
printf("8\n");
#ifdef DEBUG_FRAMERATE
	uae4all_update_time();
#endif
#ifdef PROFILER_UAE4ALL
	uae4all_prof_init();
	uae4all_prof_add("M68K");			// 0
	uae4all_prof_add("EVENTS");			// 1
	uae4all_prof_add("HSync");			// 2
	uae4all_prof_add("Copper");			// 3
	uae4all_prof_add("Audio");			// 4
	uae4all_prof_add("CIA");			// 5
	uae4all_prof_add("Blitter");			// 6
	uae4all_prof_add("Vsync");			// 7
	uae4all_prof_add("update_fetch");		// 8
	uae4all_prof_add("linetoscr");			// 9
	uae4all_prof_add("do_long_fetch");		// 10
	uae4all_prof_add("pfield_doline");		// 11
	uae4all_prof_add("draw_sprites_ecs");		// 12
	uae4all_prof_add("flush_block");		// 13
	uae4all_prof_add("SET_INTERRUPT");		// 14
/*
	uae4all_prof_add("15");		// 15
	uae4all_prof_add("16");		// 16
	uae4all_prof_add("17");		// 17
	uae4all_prof_add("18");		// 18
	uae4all_prof_add("19");		// 19
	uae4all_prof_add("20");		// 20
	uae4all_prof_add("21");		// 21
	uae4all_prof_add("22");		// 22
*/
#endif
#ifdef DREAMCAST
	SDL_DC_EmulateKeyboard(SDL_FALSE);
#endif

	/*int test = pnd_evdev_open(pnd_evdev_nub1);
	printf("nub1 open: %d\n", test);
	test = pnd_evdev_open(pnd_evdev_nub2);
	printf("nub2 open: %d\n", test);*/

	return 0;
    }
    return -1;
}