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; } }
static void raise_displayMenu() { update_display(); int i; text_draw_background(); text_flip(); for(i=0;i<10;i++) { text_draw_background(); text_draw_window(80-64,(10-i)*24,160+64+64,220,text_str_display_title); text_flip(); } }
static void raise_loadMenu() { int i; text_draw_background(); text_flip(); for(i=0;i<10;i++) { text_draw_background(); text_draw_window(80-64,(10-i)*24,160+64+64,220,text_str_load_title); text_flip(); } }
static void unraise_controlsMenu() { int i; for(i=9;i>=0;i--) { text_draw_background(); text_draw_window(80-64,(10-i)*24,160+64+64,220,text_str_controls_title); text_flip(); } text_draw_background(); text_flip(); }
static void unraise_mainMenu() { int i; for(i=9;i>=0;i-=2) { text_draw_background(); text_draw_window(40,(10-i)*24,260,200,text_str_title); text_flip(); } text_draw_background(); text_flip(); clear_events(); }
static void raise_mainMenu() { int i; text_draw_background(); text_flip(); for(i=0;i<10;i+=2) { text_draw_background(); text_draw_window(40,(10-i)*24,260,200,text_str_title); text_flip(); } clear_events(); }
static inline void unraise_menuCPU() { int i; for(i=7;i>=0;i--) { text_draw_background(); text_draw_window(128-(8*i),32+((8-i)*24),144+(8*i),160-64-32,""); text_flip(); SDL_Delay(15); } text_draw_background(); text_flip(); }
static inline void raise_menuCPU() { int i; sound_play_beep(); text_draw_background(); text_flip(); for(i=0;i<8;i++) { text_draw_background(); text_draw_window(128-(8*i),32+((8-i)*24),144+(8*i),172-64-32,""); text_flip(); SDL_Delay(15); } }
static void draw_fileinfoMenu(int c) { int menuLine = 0; SDL_Rect r; extern SDL_Surface *text_screen; r.x=80-64; r.y=60; r.w=110+64+64; r.h=120; text_draw_background(); text_draw_window(80-64,12,160+64+64,220,text_str_fileinfo_title); menuLine = 4; write_text(3, menuLine, "File info:"); menuLine+=2; write_text(3, menuLine, "----------"); menuLine+=4; // now wrap the filename if necessary (at 32) int i = 0; char line [40]; const int LINELEN = 32; for (i = 0; i < strlen(fileInfo_fileName); i+=LINELEN) { strncpy(line, fileInfo_fileName + i, LINELEN); line[LINELEN] = '\0'; write_text(3, menuLine, line); menuLine+=2; } text_flip(); }
void text_draw_saving(int per, int max) { text_draw_background(); text_draw_window(80,64,172,36,"Saving"); text_draw_barra(84, (9*8)+1, 158, 16, per, max); write_text(14,9,"Please wait"); text_flip(); }
static void draw_dirlist(char *curdir, struct dirent **namelist, int n, int sel) { int i,j; n--; static int b=0; int bb=(b%6)/3; SDL_Rect r; extern SDL_Surface *text_screen; r.x=80-64; r.y=0; r.w=150-24+64+64; r.h=240; text_draw_background(); text_draw_window(2,2,41,25,text_str_load_title); if (sel<min_in_dir) { min_in_dir=sel; max_in_dir=sel+SHOW_MAX_FILES; } else if (sel>=max_in_dir) { max_in_dir=sel+1; min_in_dir=max_in_dir-SHOW_MAX_FILES; } if (max_in_dir>n) max_in_dir=n-min_in_dir; for (i=min_in_dir,j=3;i<max_in_dir;i++,j+=2) { write_text(3,j,text_str_load_separator); SDL_SetClipRect(text_screen,&r); if ((sel+1==i+1)&&(bb)) write_text_inv(4,j+1,namelist[i+1]->d_name); else write_text(4,j+1,namelist[i+1]->d_name); SDL_SetClipRect(text_screen,NULL); if (namelist[i+1]->d_type==DT_DIR) write_text(38,j+1,text_str_load_dir); } write_text(3,j,text_str_load_separator); write_text(5,27,"Button (A) = Insert Disk into DF0"); write_text(6,29,"(Y) = DF1, (B) = DF2, (X) = DF3"); text_flip(); b++; }
void menu_unraise(void) { int i; for(i=0;i<=64;i+=4) { Mix_VolumeMusic(96-(i<<1)); #ifndef DREAMCAST SDL_Delay(10); #endif text_draw_background(); fade16(text_screen,i); text_flip(); } }
void menu_unraise(void) { int i; for(i=0;i<=80;i+=16) { #if !defined(NO_SOUND) && defined(MENU_MUSIC) Mix_VolumeMusic(MUSIC_VOLUME-(i<<1)); #endif text_draw_background(); fade16(text_screen,i); text_flip(); SDL_Delay(10); } }
static void draw_loadMenu(int c) { int i,j; static int b=0; int bb=(b%6)/3; SDL_Rect r; extern SDL_Surface *text_screen; r.x=80-64; r.y=0; r.w=110+64+64; r.h=240; text_draw_background(); text_draw_window(80-64,12,160+64+64,220,text_str_load_title); if (text_dir_num_files_index<min_in_dir) { min_in_dir=text_dir_num_files_index; max_in_dir=text_dir_num_files_index+SHOW_MAX_FILES; } else if (text_dir_num_files_index>=max_in_dir) { max_in_dir=text_dir_num_files_index+1; min_in_dir=max_in_dir-SHOW_MAX_FILES; } if (max_in_dir>text_dir_num_files) max_in_dir=text_dir_num_files-min_in_dir; for (i=min_in_dir,j=1;i<max_in_dir;i++,j+=2) { write_text(3,j,text_str_load_separator); SDL_SetClipRect(text_screen,&r); if ((text_dir_num_files_index==i)&&(bb)) write_text_inv(4,j+1,(char *)&text_dir_files[i].d_name); else write_text(4,j+1,(char *)&text_dir_files[i].d_name); SDL_SetClipRect(text_screen,NULL); if (text_dir_files[i].d_type==4) write_text(32,j+1,text_str_load_dir); } write_text(3,j,text_str_load_separator); text_flip(); b++; }
static void draw_displayMenu(int c) { int leftMargin=3; int tabstop1 = 17; int tabstop2 = 19; int tabstop3 = 21; int tabstop4 = 23; int tabstop5 = 25; int tabstop6 = 27; int tabstop7 = 29; int tabstop8 = 31; int tabstop9 = 33; int menuLine = 3; static int b=0; int bb=(b%6)/3; SDL_Rect r; extern SDL_Surface *text_screen; r.x=80-64; r.y=0; r.w=110+64+64; r.h=240; text_draw_background(); text_draw_window(2,2,40,30,text_str_display_title); // 1 if (menuDisplay == 0 && bb) write_text_inv(3, menuLine, "Return to main menu"); else write_text(3, menuLine, "Return to main menu"); menuLine++; write_text(leftMargin,menuLine,text_str_display_separator); menuLine++; // 2 write_text(leftMargin,menuLine,"Preset Mode"); if ((menuDisplay!=1)||(bb)) write_text(tabstop3,menuLine,presetMode); else write_text_inv(tabstop3,menuLine,presetMode); menuLine++; write_text(leftMargin,menuLine,text_str_display_separator); menuLine+=2; write_text(leftMargin,menuLine,"Custom Settings"); menuLine++; write_text(leftMargin,menuLine,"---------------"); menuLine++; // 3 write_text(leftMargin,menuLine,"Displayed Lines"); sprintf(value, "%d", mainMenu_displayedLines); if ((menuDisplay!=2)||(bb)) write_text(tabstop3,menuLine,value); else write_text_inv(tabstop3,menuLine,value); // 4 menuLine+=2; write_text(leftMargin,menuLine,"Screen Width"); sprintf(value, "%d", screenWidth); if ((menuDisplay!=3)||(bb)) write_text(tabstop3,menuLine,value); else write_text_inv(tabstop3,menuLine,value); // 5 menuLine+=2; write_text(leftMargin,menuLine,"Vertical Position"); sprintf(value, "%d", moveY); if ((menuDisplay!=4)||(bb)) write_text(tabstop3,menuLine,value); else write_text_inv(tabstop3,menuLine,value); // 6 menuLine+=2; write_text(leftMargin,menuLine,"Cut Left"); sprintf(value, "%d", mainMenu_cutLeft); if ((menuDisplay!=5)||(bb)) write_text(tabstop3,menuLine,value); else write_text_inv(tabstop3,menuLine,value); // 7 menuLine+=2; write_text(leftMargin,menuLine,"Cut Right"); sprintf(value, "%d", mainMenu_cutRight); if ((menuDisplay!=6)||(bb)) write_text(tabstop3,menuLine,value); else write_text_inv(tabstop3,menuLine,value); // 8 menuLine++; write_text(leftMargin,menuLine,text_str_display_separator); menuLine++; write_text(leftMargin,menuLine,"Frameskip"); if ((mainMenu_frameskip==0)&&((menuDisplay!=7)||(bb))) write_text_inv(tabstop1,menuLine,"0"); else write_text(tabstop1,menuLine,"0"); if ((mainMenu_frameskip==1)&&((menuDisplay!=7)||(bb))) write_text_inv(tabstop3,menuLine,"1"); else write_text(tabstop3,menuLine,"1"); // 9 menuLine+=2; write_text(leftMargin,menuLine,"Refresh Rate"); if ((!mainMenu_ntsc)&&((menuDisplay!=8)||(bb))) write_text_inv(tabstop1,menuLine,"50Hz"); else write_text(tabstop1,menuLine,"50Hz"); if ((mainMenu_ntsc)&&((menuDisplay!=8)||(bb))) write_text_inv(tabstop3+1,menuLine,"60Hz"); else write_text(tabstop3+1,menuLine,"60Hz"); text_flip(); b++; }
static void draw_controlsMenu(int c) { int leftMargin=3; int tabstop1 = 17; int tabstop2 = 19; int tabstop3 = 21; int tabstop4 = 23; int tabstop5 = 25; int tabstop6 = 27; int tabstop7 = 29; int tabstop8 = 31; int tabstop9 = 33; int menuLine = 3; static int b=0; int bb=(b%6)/3; SDL_Rect r; extern SDL_Surface *text_screen; r.x=80-64; r.y=0; r.w=110+64+64; r.h=240; text_draw_background(); text_draw_window(2,2,40,30,text_str_controls_title); // 1 if (menuControls == 0 && bb) write_text_inv(3, menuLine, "Return to main menu"); else write_text(3, menuLine, "Return to main menu"); menuLine++; write_text(leftMargin,menuLine,text_str_controls_separator); menuLine++; // 2 write_text(leftMargin,menuLine,"Custom Controls"); if ((mainMenu_customControls==1)&&((menuControls!=1)||(bb))) write_text_inv(tabstop3,menuLine,"On"); else write_text(tabstop3,menuLine,"On"); if ((mainMenu_customControls==0)&&((menuControls!=1)||(bb))) write_text_inv(tabstop6,menuLine,"Off"); else write_text(tabstop6,menuLine,"Off"); menuLine++; write_text(leftMargin,menuLine,text_str_controls_separator); menuLine++; // 3 write_text(leftMargin,menuLine," DPAD"); if ((mainMenu_custom_dpad==0)&&((menuControls!=2)||(bb))) write_text_inv(tabstop1-6,menuLine,"Custom"); else write_text(tabstop1-6,menuLine,"Custom"); if ((mainMenu_custom_dpad==1)&&((menuControls!=2)||(bb))) write_text_inv(tabstop2,menuLine,"Joystick"); else write_text(tabstop2,menuLine,"Joystick"); if ((mainMenu_custom_dpad==2)&&((menuControls!=2)||(bb))) write_text_inv(tabstop6+2,menuLine,"Mouse"); else write_text(tabstop6+2,menuLine,"Mouse"); if (mainMenu_custom_dpad==0) { // 4 menuLine+=2; write_text(leftMargin,menuLine," up"); getMapping(mainMenu_custom_up); if ((menuControls!=3)||(bb)) write_text_inv(tabstop1-4,menuLine,mapping); else write_text(tabstop1-4,menuLine,mapping); // 5 menuLine+=2; write_text(leftMargin,menuLine," down"); getMapping(mainMenu_custom_down); if ((menuControls!=4)||(bb)) write_text_inv(tabstop1-4,menuLine,mapping); else write_text(tabstop1-4,menuLine,mapping); // 6 menuLine+=2; write_text(leftMargin,menuLine," left"); getMapping(mainMenu_custom_left); if ((menuControls!=5)||(bb)) write_text_inv(tabstop1-4,menuLine,mapping); else write_text(tabstop1-4,menuLine,mapping); // 7 menuLine+=2; write_text(leftMargin,menuLine," right"); getMapping(mainMenu_custom_right); if ((menuControls!=6)||(bb)) write_text_inv(tabstop1-4,menuLine,mapping); else write_text(tabstop1-4,menuLine,mapping); } // 8 menuLine+=3; write_text(leftMargin,menuLine," (A)"); getMapping(mainMenu_custom_A); if ((menuControls!=7)||(bb)) write_text_inv(tabstop1-4,menuLine,mapping); else write_text(tabstop1-4,menuLine,mapping); // 9 menuLine+=2; write_text(leftMargin,menuLine," (B)"); getMapping(mainMenu_custom_B); if ((menuControls!=8)||(bb)) write_text_inv(tabstop1-4,menuLine,mapping); else write_text(tabstop1-4,menuLine,mapping); // 10 menuLine+=2; write_text(leftMargin,menuLine," (X)"); getMapping(mainMenu_custom_X); if ((menuControls!=9)||(bb)) write_text_inv(tabstop1-4,menuLine,mapping); else write_text(tabstop1-4,menuLine,mapping); // 11 menuLine+=2; write_text(leftMargin,menuLine," (Y)"); getMapping(mainMenu_custom_Y); if ((menuControls!=10)||(bb)) write_text_inv(tabstop1-4,menuLine,mapping); else write_text(tabstop1-4,menuLine,mapping); // 12 menuLine+=3; write_text(leftMargin,menuLine," (L)"); getMapping(mainMenu_custom_L); if ((menuControls!=11)||(bb)) write_text_inv(tabstop1-4,menuLine,mapping); else write_text(tabstop1-4,menuLine,mapping); // 13 menuLine+=2; write_text(leftMargin,menuLine," (R)"); getMapping(mainMenu_custom_R); if ((menuControls!=12)||(bb)) write_text_inv(tabstop1-4,menuLine,mapping); else write_text(tabstop1-4,menuLine,mapping); text_flip(); b++; }
static inline void draw_cpuMenu(int c) { text_draw_background(); text_draw_window(40,24+32,260,200-16-64-32,text_str_title); if (c==0) { write_text_sel(6,8,252,text_str_68k); switch(menuCPU_68k) { case 0: write_text_inv(19,8,"||||||||||"); break; case 1: write_text_inv(25,8,"||||||||||||"); break; default: write_text_inv(32,8,"||||||||"); break; } write_text_inv(19,8,text_str_under); write_text_inv(25,8,text_str_normal); write_text_inv(32,8,text_str_over); } else { write_text(6,8,text_str_68k); switch(menuCPU_68k) { case 0: write_text(19,8,"|||||||||"); break; case 1: write_text(25,8,"|||||||||||"); break; default: write_text(32,8,"|||||||"); break; } write_text(19,8,text_str_under); write_text(25,8,text_str_normal); write_text(32,8,text_str_over); } if (c==1) { write_text_sel(6,10,252,text_str_z80); switch(menuCPU_z80) { case 0: write_text_inv(19,10,"||||||||||"); break; case 1: write_text_inv(25,10,"||||||||||||"); break; default: write_text_inv(32,10,"||||||||"); break; } write_text_inv(19,10,text_str_under); write_text_inv(25,10,text_str_normal); write_text_inv(32,10,text_str_over); } else { write_text(6,10,text_str_z80); switch(menuCPU_z80) { case 0: write_text(19,10,"|||||||||"); break; case 1: write_text(25,10,"|||||||||||"); break; default: write_text(32,10,"|||||||"); break; } write_text(19,10,text_str_under); write_text(25,10,text_str_normal); write_text(32,10,text_str_over); } if (c==2) { write_text_sel(6,12,252,text_str_accurate); if (neogeo_accurate) write_text_inv(25,12,"||||"); else write_text_inv(19,12,"||||||"); write_text_inv(19,12,text_str_off); write_text_inv(25,12,text_str_on); } else { write_text(6,12,text_str_accurate); if (neogeo_accurate) write_text(25,12,"||||"); else write_text(19,12,"||||||"); write_text(19,12,text_str_off); write_text(25,12,text_str_on); } write_text(6,13,text_str_separator); write_text(6,14,text_str_separator); if ((c==3)) //&&(bb)) write_text_sel(6,15,252,text_str_exit); else write_text(6,15,text_str_exit); text_flip(); }
static void draw_mainMenu(enum MainMenuEntry c) { static int frame = 0; int flash = frame / 3; int row = 4, column = 0; text_draw_background(); text_draw_window(40,28,260,192,text_str_title); if (c == MAIN_MENU_ENTRY_LOAD && flash) write_text_inv(6, row++, text_str_load); else write_text(6, row++, text_str_load); write_text(6, row++, text_str_separator); if(emulating) { if (c == MAIN_MENU_ENTRY_SAVED_STATES && flash) write_text_inv(6, row++, text_str_save); else write_text(6, row++, text_str_save); } else { row++; } write_text(6, row, text_str_separator); row++; write_text(6, row, text_str_throttle); column = 17; if ((mainMenu_throttle == 0) && (c != MAIN_MENU_ENTRY_THROTTLE || flash)) write_text_inv(column, row, text_str_0); else write_text(column, row, text_str_0); column += strlen(text_str_0) + 1; if ((mainMenu_throttle == 1) && (c != MAIN_MENU_ENTRY_THROTTLE || flash)) write_text_inv(column, row, text_str_20); else write_text(column, row, text_str_20); column += strlen(text_str_20) + 1; if ((mainMenu_throttle == 2) && (c != MAIN_MENU_ENTRY_THROTTLE || flash)) write_text_inv(column, row, text_str_40); else write_text(column, row, text_str_40); column += strlen(text_str_40) + 1; if ((mainMenu_throttle == 3) && (c != MAIN_MENU_ENTRY_THROTTLE || flash)) write_text_inv(column, row, text_str_60); else write_text(column, row, text_str_60); column += strlen(text_str_60) + 1; if ((mainMenu_throttle == 4) && (c != MAIN_MENU_ENTRY_THROTTLE || flash)) write_text_inv(column, row, text_str_80); else write_text(column, row, text_str_80); column += strlen(text_str_80) + 1; if ((mainMenu_throttle == 5) && (c != MAIN_MENU_ENTRY_THROTTLE || flash)) write_text_inv(column, row, text_str_100); else write_text(column, row, text_str_100); row += 2; write_text(6, row, text_str_frameskip); column = 17; if ((mainMenu_frameskip == 0) && (c != MAIN_MENU_ENTRY_FRAMESKIP || flash)) write_text_inv(column, row, text_str_0); else write_text(column, row, text_str_0); column += strlen(text_str_0) + 1; if ((mainMenu_frameskip == 1) && (c != MAIN_MENU_ENTRY_FRAMESKIP || flash)) write_text_inv(column, row, text_str_1); else write_text(column, row, text_str_1); column += strlen(text_str_1) + 1; if ((mainMenu_frameskip == 2) && (c != MAIN_MENU_ENTRY_FRAMESKIP || flash)) write_text_inv(column, row, text_str_2); else write_text(column, row, text_str_2); column += strlen(text_str_2) + 1; if ((mainMenu_frameskip == 3) && (c != MAIN_MENU_ENTRY_FRAMESKIP || flash)) write_text_inv(column, row, text_str_3); else write_text(column, row, text_str_3); column += strlen(text_str_3) + 1; if ((mainMenu_frameskip == 4) && (c != MAIN_MENU_ENTRY_FRAMESKIP || flash)) write_text_inv(column, row, text_str_4); else write_text(column, row, text_str_4); column += strlen(text_str_4) + 1; if ((mainMenu_frameskip == 5) && (c != MAIN_MENU_ENTRY_FRAMESKIP || flash)) write_text_inv(column, row, text_str_5); else write_text(column, row, text_str_5); column += strlen(text_str_5) + 1; if ((mainMenu_frameskip == -1) && (c != MAIN_MENU_ENTRY_FRAMESKIP || flash)) write_text_inv(column, row, text_str_auto); else write_text(column, row, text_str_auto); row += 2; write_text(6, row, text_str_vpos); column = 17; if ((mainMenu_vpos == 0) && (c != MAIN_MENU_ENTRY_SCREEN_POSITION || flash)) write_text_inv(column, row, text_str_0); else write_text(column, row, text_str_0); column += strlen(text_str_0) + 1; if ((mainMenu_vpos == 1) && (c != MAIN_MENU_ENTRY_SCREEN_POSITION || flash)) write_text_inv(column, row, text_str_8); else write_text(column, row, text_str_8); column += strlen(text_str_8) + 1; if ((mainMenu_vpos == 2) && (c != MAIN_MENU_ENTRY_SCREEN_POSITION || flash)) write_text_inv(column, row, text_str_16); else write_text(column, row, text_str_16); column += strlen(text_str_16) + 1; if ((mainMenu_vpos == 3) && (c != MAIN_MENU_ENTRY_SCREEN_POSITION || flash)) write_text_inv(column, row, text_str_24); else write_text(column, row, text_str_24); column += strlen(text_str_24) + 1; if ((mainMenu_vpos == 4) && (c != MAIN_MENU_ENTRY_SCREEN_POSITION || flash)) write_text_inv(column, row, text_str_32); else write_text(column, row, text_str_32); column += strlen(text_str_32) + 1; if ((mainMenu_vpos == 5) && (c != MAIN_MENU_ENTRY_SCREEN_POSITION || flash)) write_text_inv(column, row, text_str_40); else write_text(column, row, text_str_40); row += 2; write_text(6, row, text_str_sound); column = 17; if (!mainMenu_sound && (c != MAIN_MENU_ENTRY_SOUND || flash)) write_text_inv(column, row, text_str_off); else write_text(column, row, text_str_off); column += strlen(text_str_off) + 2; if (mainMenu_sound && (c != MAIN_MENU_ENTRY_SOUND || flash)) write_text_inv(column, row, text_str_on); else write_text(column, row, text_str_on); row += 2; write_text(6, row, text_str_autosave); column = 17; if (!mainMenu_autosave && (c != MAIN_MENU_ENTRY_SAVE_DISKS || flash)) write_text_inv(column, row, text_str_off); else write_text(column, row, text_str_off); column += strlen(text_str_off) + 2; if (mainMenu_autosave && (c != MAIN_MENU_ENTRY_SAVE_DISKS || flash)) write_text_inv(column, row, text_str_on); else write_text(column, row, text_str_on); row += 2; write_text(6, row, text_str_joystick); column = 17; if (!mainMenu_usejoy && (c != MAIN_MENU_ENTRY_USE_JOY || flash)) write_text_inv(column, row, text_str_off); else write_text(column, row, text_str_off); column += strlen(text_str_off) + 2; if (mainMenu_usejoy && (c != MAIN_MENU_ENTRY_USE_JOY || flash)) write_text_inv(column, row, text_str_on); else write_text(column, row, text_str_on); row++; write_text(6, row++, text_str_separator); if (c == MAIN_MENU_ENTRY_RESET_EMULATION && flash) if(emulating) write_text_inv(6, row, text_str_reset); else write_text_inv(6, row, text_str_start); else if(emulating) write_text(6, row, text_str_reset); else write_text(6, row, text_str_start); row += 2; if(emulating) { if (c == MAIN_MENU_ENTRY_RETURN_TO_EMULATION && flash) write_text_inv(6, row++, text_str_return); else write_text(6, row++, text_str_return); } else { row++; } write_text(6, row++, text_str_separator); if (c == MAIN_MENU_ENTRY_EXIT_UAE && flash) write_text_inv(6, row++, text_str_exit); else write_text(6, row++, text_str_exit); text_flip(); frame = (frame + 1) % 6; }
static void draw_dirlist(char *curdir, struct dirent **namelist, int n, int sel) { int i,j; n--; static int b=0; int bb=(b%6)/3; SDL_Rect r; extern SDL_Surface *text_screen; r.x=80-64; r.y=0; r.w=150-24+64+64; r.h=240; text_draw_background(); if (menu_load_type == MENU_LOAD_HD_DIR) text_draw_window(2,2,41,25," Press L-key to load HD-dir "); else if (menu_load_type == MENU_LOAD_HDF) text_draw_window(2,2,41,25," Select .HDF-file "); else if (current_drive==0) text_draw_window(2,2,41,25," Insert .ADF or .ADZ into DF0 "); else if (current_drive==1) text_draw_window(2,2,41,25," Insert .ADF or .ADZ into DF1 "); else if (current_drive==2) text_draw_window(2,2,41,25," Insert .ADF or .ADZ into DF2 "); else if (current_drive==3) text_draw_window(2,2,41,25," Insert .ADF or .ADZ into DF3 "); else text_draw_window(2,2,41,25,text_str_load_title); if (sel<min_in_dir) { min_in_dir=sel; max_in_dir=sel+SHOW_MAX_FILES; } else if (sel>=max_in_dir) { max_in_dir=sel+1; min_in_dir=max_in_dir-SHOW_MAX_FILES; } if (max_in_dir>n) max_in_dir=n-min_in_dir; for (i=min_in_dir,j=3;i<max_in_dir;i++,j+=2) { write_text(3,j,text_str_load_separator); SDL_SetClipRect(text_screen,&r); if ((sel+1==i+1)&&(bb)) write_text_inv(4,j+1,namelist[i+1]->d_name); else write_text(4,j+1,namelist[i+1]->d_name); SDL_SetClipRect(text_screen,NULL); if (namelist[i+1]->d_type==DT_DIR) write_text(38,j+1,text_str_load_dir); } write_text(3,j,text_str_load_separator); text_flip(); b++; }
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(); }
void init_text(int splash) { SDL_Event ev; int toexit=0; SDL_Surface *sur; SDL_Rect r; int i,j; if (!text_screen) { // text_screen=SDL_ConvertSurface(screen,screen->format,0); text_screen=SDL_CreateRGBSurface(screen->flags,screen->w,screen->h,screen->format->BitsPerPixel,screen->format->Rmask,screen->format->Gmask,screen->format->Bmask,screen->format->Amask); // text_screen=SDL_DisplayFormat(screen); if (!text_screen) { #ifdef STDOUTPUT puts("Unable to make a SDL_Surface (text_screen)"); #endif exit(-1); } } #ifdef DREAMCAST __sdl_dc_emulate_keyboard=1; #endif if (!splash) { menu_raise(); return; } text_image2=load_img_0(MENU_FILE_TEXT2); font_inv.Surface=text_image2; SFont_InitFontInfo(&font_inv); text_image=load_img_0(MENU_FILE_TEXT); SFont_InitFont(text_image); text_win_uleft=load_img_255(MENU_FILE_WIN_ULEFT); text_win_uright=load_img_255(MENU_FILE_WIN_URIGHT); text_win_upper=load_img_255(MENU_FILE_WIN_UPPER); text_win_left=load_img_255(MENU_FILE_WIN_LEFT); text_win_right=load_img_255(MENU_FILE_WIN_RIGHT); text_win_bright=load_img_255(MENU_FILE_WIN_BRIGHT); text_win_bleft=load_img_255(MENU_FILE_WIN_BLEFT); text_win_bottom=load_img_255(MENU_FILE_WIN_BOTTOM); text_cdrom=menu_IMG_Load(MENU_FILE_LOADING); init_background(); obten_colores(); sound_play_menu_music(); #ifndef AUTO_EVENTS sur=menu_IMG_Load(MENU_FILE_SPLASH); 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,0); //0xFFFFFFFF); while(SDL_PollEvent(&ev)) SDL_Delay(50); for (i=128;(i>-8)&&(!toexit);i-=8) { #ifdef DREAMCAST vid_waitvbl(); #else SDL_Delay(50); #endif SDL_FillRect(text_screen,NULL,0); //0xFFFFFFFF); SDL_BlitSurface(sur,NULL,text_screen,&r); fade16(text_screen,i); text_flip(); while(SDL_PollEvent(&ev)) toexit=1; } for(i=0;(i<23)&&(!toexit);i++) { while(SDL_PollEvent(&ev)) toexit=1; SDL_Delay(100); } for(i=0;(i<128)&&(!toexit);i+=16) { #ifdef DREAMCAST vid_waitvbl(); #else SDL_Delay(50); #endif SDL_FillRect(text_screen,NULL,0); //0xFFFFFFFF); SDL_BlitSurface(sur,NULL,text_screen,&r); fade16(text_screen,i); text_flip(); while(SDL_PollEvent(&ev)) toexit=1; } for(i=128;(i>-8)&&(!toexit);i-=8) { #ifdef DREAMCAST vid_waitvbl(); #else SDL_Delay(50); #endif text_draw_background(); fade16(text_screen,i); text_flip(); while(SDL_PollEvent(&ev)) toexit=1; } SDL_FreeSurface(sur); #else #ifndef DREAMCAST chdir(ROM_PREFIX); #else // fs_chdir(ROM_PREFIX); fs_chdir("/");//ROM_PREFIX); #endif #endif // menu_msg_time=SDL_GetTicks(); }
void init_text(int splash) { char fname[256]; SDL_Surface *tmp; 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); window_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); SDL_Rect dest; dest.w=32; dest.h=24; for (int y=0;y<10;y++) { //text_window_background dest.y=24*y; for(int x=0;x<10;x++) { dest.x=32*x; SDL_BlitSurface(tmp,NULL,window_screen,&dest); } } SDL_FreeSurface(tmp); } if (splash) { SDL_Surface *sur; SDL_Rect r; int i,j; obten_colores(); if (skipintro) goto skipintro; 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) { SDL_Delay(50); 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) { SDL_Delay(50); 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) { SDL_Delay(50); text_draw_background(); fade16(text_screen,i); text_flip(); } SDL_FreeSurface(sur); } else { SDL_FillRect(text_screen,NULL,0xFFFFFFFF); text_flip(); uae4all_resume_music(); } skipintro: menu_msg_time=SDL_GetTicks(); }