void init_kickstart() { if (uae4all_init_rom(romfile)) { #ifndef USE_GUICHAN SDL_Event ev; text_draw_background(); text_draw_window(2, 6, 42, 12, "--- ERROR ---"); write_text(6, 12, romfile); write_text(8, 14, "not found!"); write_text(8, 16, "Please check settings"); write_text(8, 18, "Press any button to continue"); text_flip(); SDL_Delay(333); while (SDL_PollEvent(&ev)) SDL_Delay(10); while (!SDL_PollEvent(&ev)) SDL_Delay(10); while (SDL_PollEvent(&ev)) if (ev.type == SDL_QUIT) exit(1); text_draw_background(); text_flip(); SDL_Delay(333); #endif kickstart_warning=1; } else { kickstart_warning=0; bReloadKickstart=1; } }
FILE *uae4all_rom_fopen(const char *name, const char *mode) { prepare_save(); if (!uae4all_rom_memory) uae4all_init_rom(name); return ((FILE *)uae4all_rom_memory); }
void default_prefs () { produce_sound = 2; prefs_gfx_framerate = 0; strcpy (prefs_df[0], ROM_PATH_PREFIX "df0.adf"); strcpy (prefs_df[1], ROM_PATH_PREFIX "df1.adf"); snprintf(romfile, 256, "%s/kickstarts/%s",launchDir,kickstarts_rom_names[kickstart]); if(strlen(extended_rom_names[kickstart]) == 0) snprintf(extfile, 256, ""); else snprintf(extfile, 256, "%s/kickstarts/%s",launchDir,extended_rom_names[kickstart]); FILE *f=fopen (romfile, "r" ); if(!f){ strcpy (romfile, "kick.rom"); } else fclose(f); snprintf(romkeyfile, 256, "%s/kickstarts/%s",launchDir,"rom.key"); f=fopen (romkeyfile, "r" ); if(!f) { strcpy (romkeyfile, "rom.key"); } else fclose(f); #ifdef ANDROIDSDL if (uae4all_init_rom(romfile)==-1) { snprintf(romfile, 256, "%s/../../com.cloanto.amigaforever.essentials/files/rom/%s",launchDir,af_kickstarts_rom_names[kickstart]); FILE *f3=fopen (romfile, "r" ); if(!f3) { strcpy (romfile, "kick.rom"); } else fclose(f3); snprintf(romkeyfile, 256, "%s/../../com.cloanto.amigaforever.essentials/files/rom/%s",launchDir,"rom.key"); FILE *f4=fopen (romkeyfile, "r" ); if(!f4) { strcpy (romkeyfile, "rom.key"); } else fclose(f4); } #endif /* 1MB */ prefs_chipmem_size = 0x00100000; prefs_bogomem_size = 0; changed_prefs.fastmem_size = 0; }
void init_text(int splash) { SDL_Surface *tmp; if (prSDLScreen==NULL) { SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK); prSDLScreen=SDL_SetVideoMode(320,240,16,VIDEO_FLAGS); SDL_ShowCursor(SDL_DISABLE); //SDL_JoystickEventState(SDL_ENABLE); //SDL_JoystickOpen(0); } #ifdef DREAMCAST __sdl_dc_emulate_keyboard=1; #endif if (!text_screen) { text_screen=SDL_CreateRGBSurface(prSDLScreen->flags,prSDLScreen->w,prSDLScreen->h,prSDLScreen->format->BitsPerPixel,prSDLScreen->format->Rmask,prSDLScreen->format->Gmask,prSDLScreen->format->Bmask,prSDLScreen->format->Amask); tmp=SDL_LoadBMP(MENU_FILE_TEXT); if (text_screen==NULL || tmp==NULL) exit(-1); text_image=SDL_DisplayFormat(tmp); SDL_FreeSurface(tmp); if (text_image==NULL) exit(-2); SDL_SetColorKey(text_image,(SDL_SRCCOLORKEY | SDL_RLEACCEL),SDL_MapRGB(text_image -> format, 0, 0, 0)); tmp=SDL_LoadBMP(MENU_FILE_BACKGROUND); if (tmp==NULL) exit(-3); text_background=SDL_DisplayFormat(tmp); SDL_FreeSurface(tmp); if (text_background==NULL) exit(-3); tmp=SDL_LoadBMP(MENU_FILE_WINDOW); if (tmp==NULL) exit(-4); text_window_background=SDL_DisplayFormat(tmp); SDL_FreeSurface(tmp); if (text_window_background==NULL) exit(-5); } if (splash) { SDL_Surface *sur; SDL_Rect r; int i,j; obten_colores(); uae4all_init_sound(); if (skipintro) goto skipintro; #if !defined(DEBUG_UAE4ALL) && !defined(PROFILER_UAE4ALL) && !defined(AUTO_RUN) && !defined(AUTO_FRAMERATE) tmp=SDL_LoadBMP(MENU_FILE_SPLASH); if (tmp==NULL) exit(-6); sur = SDL_DisplayFormat(tmp); SDL_FreeSurface(tmp); r.x=(text_screen->w - sur->w)/2; r.y=(text_screen->h - sur->h)/2; r.h=sur->w; r.w=sur->h; SDL_FillRect(text_screen,NULL,0xFFFFFFFF); for (i=128;i>-8;i-=8) { #ifdef DREAMCAST vid_waitvbl(); #else SDL_Delay(50); #endif SDL_FillRect(text_screen,NULL,0xFFFFFFFF); SDL_BlitSurface(sur,NULL,text_screen,&r); fade16(text_screen,i); text_flip(); } SDL_Delay(3000); for(i=0;i<128;i+=16) { #ifdef DREAMCAST vid_waitvbl(); #else SDL_Delay(50); #endif SDL_FillRect(text_screen,NULL,0xFFFFFFFF); SDL_BlitSurface(sur,NULL,text_screen,&r); fade16(text_screen,i); text_flip(); } for(i=128;i>-8;i-=8) { #ifdef DREAMCAST vid_waitvbl(); #else SDL_Delay(50); #endif text_draw_background(); fade16(text_screen,i); text_flip(); } SDL_FreeSurface(sur); #else #if !defined (DREAMCAST) && !defined (GP2X) chdir("example"); #else #ifdef DREAMCAST fs_chdir("/cd"); #endif #endif #endif skipintro: for(i=0;i<10;i++) { SDL_Event ev; if (!uae4all_init_rom(romfile)) break; text_draw_background(); text_draw_window(54,91,250,64,"--- ERROR ---"); write_text(11,14,"KICK.ROM not found"); write_text(8,16,"Press any button to retry"); text_flip(); SDL_Delay(333); while(SDL_PollEvent(&ev)) #ifndef DREAMCAST if (ev.type==SDL_QUIT) exit(1); else #endif SDL_Delay(10); while(!SDL_PollEvent(&ev)) SDL_Delay(10); while(SDL_PollEvent(&ev)) if (ev.type==SDL_QUIT) exit(1); text_draw_background(); text_flip(); SDL_Delay(333); } if (i>=10) exit(1); } else { SDL_FillRect(text_screen,NULL,0xFFFFFFFF); text_flip(); uae4all_resume_music(); } menu_msg_time=SDL_GetTicks(); }