From 8951fdff1aada126257e07699ea6f132cb8d2e65 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Tue, 18 Dec 2012 00:02:49 -0500 Subject: Remove various explicit delays and reduce screen tearing when drawing emulated screens. --- source/nds/gui.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index f8cd03b..99ea7b0 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -1650,7 +1650,7 @@ unsigned int frame_interval; --------------------------------------------------------*/ u32 menu(u16 *screen) { - mdelay(50); + mdelay(50); // to prevent the touch key from being applied too soon? gui_action_type gui_action; u32 i; u32 repeat; @@ -2059,7 +2059,7 @@ u32 menu(u16 *screen) reorder_latest_file(); save_game_config_file(); - mdelay(500); + // mdelay(500); // Delete this delay } } } @@ -2842,7 +2842,7 @@ u32 menu(u16 *screen) draw_string_vcenter(up_screen_addr, 0, 80, 256, COLOR_WHITE, msg[MSG_NON_LOAD_GAME]); ds2_flipScreen(UP_SCREEN, 1); - mdelay(500); + // mdelay(500); // Delete this delay } } @@ -2894,7 +2894,7 @@ u32 menu(u16 *screen) } save_emu_config_file(); - mdelay(500); + // mdelay(500); // Delete this delay } } @@ -3617,7 +3617,7 @@ u32 menu(u16 *screen) //----------------------------------------------------------------------------// // Menu Start ds2_setCPUclocklevel(0); - mdelay(200); + // mdelay(200); // Delete this delay ds2_setBacklight(3); @@ -3647,7 +3647,7 @@ u32 menu(u16 *screen) choose_menu(&main_menu); // Menu loop - mdelay(200); + // mdelay(50); // Delete this delay, shortened from 200 while(repeat) { @@ -4133,9 +4133,9 @@ u32 menu(u16 *screen) save_game_config_file(); } save_emu_config_file(); - mdelay(100); + // mdelay(100); // Delete this delay set_cpu_clock(clock_speed_number); - mdelay(200); + // mdelay(200); // Delete this delay ds2_clearScreen(DOWN_SCREEN, 0); ds2_flipScreen(DOWN_SCREEN, 1); -- cgit v1.2.3 From 65b56543ab4bab2307fe3b29a15f43caaa88dfa1 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Wed, 19 Dec 2012 01:30:30 -0500 Subject: Raise the CPU's clock speed to 396 MHz while loading ROMs. Also raise the CPU's clock speed to 396 MHz by default, instead of 360 MHz, when emulating a ROM. --- source/nds/gui.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 99ea7b0..07f59d0 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -1721,7 +1721,7 @@ u32 menu(u16 *screen) game_config.clock_speed_number = clock_speed_number; reorder_latest_file(); - //S9xAutoSaveSRAM (); + S9xAutoSaveSRAM (); save_game_config_file(); } save_emu_config_file(); @@ -1734,7 +1734,7 @@ u32 menu(u16 *screen) if(gamepak_name[0] != 0) { - //S9xAutoSaveSRAM (); + S9xAutoSaveSRAM (); save_game_config_file(); } @@ -1748,7 +1748,10 @@ u32 menu(u16 *screen) draw_string_vcenter(down_screen_addr, 36, 100, 190, COLOR_MSSG, msg[MSG_LOADING_GAME]); ds2_flipScreen(DOWN_SCREEN, 2); - if(load_gamepak(line_buffer) == -1) + ds2_setCPUclocklevel(13); + int load_result = load_gamepak(&line_buffer); + ds2_setCPUclocklevel(0); + if(load_result == -1) { first_load = 1; gamepak_name[0] = '\0'; @@ -1812,8 +1815,12 @@ u32 menu(u16 *screen) draw_message(down_screen_addr, bg_screenp, 28, 31, 227, 165, bg_screenp_color); draw_string_vcenter(down_screen_addr, 36, 100, 190, COLOR_MSSG, msg[MSG_LOADING_GAME]); ds2_flipScreen(DOWN_SCREEN, 2); - - if(load_gamepak(args[1]) == -1) + + ds2_setCPUclocklevel(13); + int load_result = load_gamepak(args[1]); + ds2_setCPUclocklevel(0); + + if(load_result == -1) { first_load = 1; gamepak_name[0] = '\0'; @@ -3495,7 +3502,7 @@ u32 menu(u16 *screen) if(gamepak_name[0] != 0) { - //S9xAutoSaveSRAM (); + S9xAutoSaveSRAM (); save_game_config_file(); } @@ -3511,7 +3518,12 @@ u32 menu(u16 *screen) *ext_pos= '/'; ext_pos = emu_config.latest_file[current_option_num -1]; - if(load_gamepak(ext_pos) == -1) { + + ds2_setCPUclocklevel(13); + int load_result = load_gamepak(ext_pos); + ds2_setCPUclocklevel(0); + + if(load_result == -1) { first_load = 1; return; } @@ -4129,7 +4141,7 @@ u32 menu(u16 *screen) game_config.clock_speed_number = clock_speed_number; reorder_latest_file(); - //S9xAutoSaveSRAM (); + S9xAutoSaveSRAM (); save_game_config_file(); } save_emu_config_file(); @@ -4308,7 +4320,7 @@ void init_game_config(void) { u32 i; - game_config.clock_speed_number = 2; //360MHz + game_config.clock_speed_number = 5; // 396 MHz by default clock_speed_number = 2; game_config.graphic = 0; -- cgit v1.2.3 From dd06ba36fff3fad1eea457026c21f49a01c78604 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Wed, 19 Dec 2012 01:37:10 -0500 Subject: Default to Graphics Mode 3, which displays the correct SNES aspect ratio at the cost of some lines at the top and bottom. --- source/nds/gui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 07f59d0..4c0a9d7 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -4321,8 +4321,8 @@ void init_game_config(void) u32 i; game_config.clock_speed_number = 5; // 396 MHz by default - clock_speed_number = 2; - game_config.graphic = 0; + clock_speed_number = 5; + game_config.graphic = 3; // By default, have a good-looking aspect ratio game_config.gamepad_config_menu = BUTTON_ID_TOUCH; memcpy(game_config.gamepad_config_map, gamepad_config_map_init, sizeof(gamepad_config_map_init)); -- cgit v1.2.3 From eee0a7ecdaa08f15ebeb7821d6e805234dc78c33 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Wed, 19 Dec 2012 03:10:55 -0500 Subject: Change the English labels so they're more descriptive. Really set the default CPU frequency to the highest. --- source/nds/gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 4c0a9d7..af04c74 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -266,7 +266,7 @@ u32 game_enable_audio = 1; /****************************************************************************** ******************************************************************************/ static u32 menu_cheat_page = 0; -static u32 clock_speed_number = 2; +static u32 clock_speed_number = 5; u32 gamepad_config_menu; /****************************************************************************** -- cgit v1.2.3 From 973cd8d5e37dba2e15de3d3fd1965d2fbfc2cdab Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Wed, 19 Dec 2012 18:38:04 -0500 Subject: EN: Link the French translation to the interface. FR: Ajout de la traduction française à l'interface. EN: * bdf_font.c: Add support for having a main font, [0], of more than 128 characters. Refactor character width checks into a new function, BDF_width16_ucs. * bdf_font.h, draw.h, gui.c: Use UTF-8 for all strings to allow more translations. Use BDF_width16_ucs where possible. FR: * bdf_font.c: Prendre en charge une police principale, [0], de plus de 128 caractères. Diriger les vérifications de la largeur d'un caractère vers une nouvelle routine, BDF_width16_ucs. * bdf_font.h, draw.h, gui.c: Utiliser le codage UTF-8 pour toutes les chaînes pour permettre d'autres traductions. Utiliser BDF_width16_ucs là où c'est possible. --- source/nds/gui.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index af04c74..b1b9ce5 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -40,10 +40,11 @@ char rom_path[MAX_PATH]; char gamepak_name[MAX_PATH]; char gcheat_filename[MAX_PATH]; -char *lang[2] = +char *lang[3] = { "English", // 0 "简体中文", // 1 + "Français", // 2 }; /****************************************************************************** @@ -1937,7 +1938,7 @@ u32 menu(u16 *screen) else color= COLOR_INACTIVE_ITEM; - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, color, COLOR_TRANS, 23, 40 + line[i]*27); + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, 23, 40 + line[i]*27); } int slot_index; @@ -1948,7 +1949,7 @@ u32 menu(u16 *screen) slot_index= get_savestate_slot(); sprintf(line_buffer, "%d", (slot_index+2) > SAVE_STATE_SLOT_NUM ? SAVE_STATE_SLOT_NUM : (slot_index+2)); - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, COLOR_INACTIVE_ITEM, COLOR_TRANS, 146, 40 + 0*27); + PRINT_STRING_BG(down_screen_addr, line_buffer, COLOR_INACTIVE_ITEM, COLOR_TRANS, 146, 40 + 0*27); if(current_option_num == 1) selected = slot_index+1; @@ -2006,7 +2007,7 @@ u32 menu(u16 *screen) else color= COLOR_INACTIVE_ITEM; - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, color, COLOR_TRANS, 23, 40 + line[i]*27); + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, 23, 40 + line[i]*27); } if(current_option_num == 2) @@ -2578,7 +2579,7 @@ u32 menu(u16 *screen) pt = strrchr(tmp_buf, ')'); strcat(line_buffer, pt); - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, color, COLOR_TRANS, 26, 40 + display_option-> line_number*27); + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, 26, 40 + display_option-> line_number*27); } void dynamic_cheat_menu_end() @@ -2801,7 +2802,7 @@ u32 menu(u16 *screen) mm = *(display_option->current_option); sprintf(line_buffer, *(display_option->display_string), str[mm]); - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, color, COLOR_TRANS, 27, + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, 27, 38 + (display_option-> line_number)*32); } @@ -2913,7 +2914,7 @@ u32 menu(u16 *screen) strcpy(line_buffer, *(display_option->display_string)); line_num= display_option-> line_number; - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, COLOR_INACTIVE_ITEM, COLOR_TRANS, 27, + PRINT_STRING_BG(down_screen_addr, line_buffer, COLOR_INACTIVE_ITEM, COLOR_TRANS, 27, 40 + (display_option->line_number)*27); num_byte = freespace; @@ -2945,7 +2946,7 @@ u32 menu(u16 *screen) strcat(line_buffer, ".0 GB"); } - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, COLOR_INACTIVE_ITEM, COLOR_TRANS, 147, + PRINT_STRING_BG(down_screen_addr, line_buffer, COLOR_INACTIVE_ITEM, COLOR_TRANS, 147, 40 + (display_option->line_number)*27); } @@ -2965,7 +2966,7 @@ u32 menu(u16 *screen) char *enable_disable_options[] = { (char*)&msg[MSG_EN_DIS_ABLE_0], (char*)&msg[MSG_EN_DIS_ABLE_1] }; - char *language_options[] = { (char*)&lang[0], (char*)&lang[1] }; + char *language_options[] = { (char*) &lang[0], (char*) &lang[1], (char*) &lang[2] }; char *keyremap_options[] = {(char*)&msg[MSG_KEY_MAP_NONE], (char*)&msg[MSG_KEY_MAP_A], (char*)&msg[MSG_KEY_MAP_B], (char*)&msg[MSG_KEY_MAP_SL], (char*)&msg[MSG_KEY_MAP_ST], (char*)&msg[MSG_KEY_MAP_RT], @@ -3124,7 +3125,7 @@ u32 menu(u16 *screen) /* 01 */ NUMERIC_SELECTION_OPTION(NULL, &msg[MSG_SUB_MENU_42], &clock_speed_number, 6, NULL, 1), /* 02 */ STRING_SELECTION_OPTION(language_set, NULL, &msg[MSG_SUB_MENU_41], language_options, - &emu_config.language, 2, NULL, ACTION_TYPE, 2), + &emu_config.language, 3 /* number of possibilities */, NULL, ACTION_TYPE, 2), /* 03 */ STRING_SELECTION_OPTION(NULL, show_card_space, &msg[MSG_SUB_MENU_43], NULL, &desert, 2, NULL, PASSIVE_TYPE | HIDEN_TYPE, 3), @@ -3582,7 +3583,7 @@ u32 menu(u16 *screen) else color= COLOR_INACTIVE_ITEM; - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, color, COLOR_TRANS, 26, 37 + line_num*32); + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, 26, 37 + line_num*32); } void game_fastforward() @@ -3758,7 +3759,7 @@ u32 menu(u16 *screen) else color= COLOR_INACTIVE_ITEM; - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, color, COLOR_TRANS, 23, 40 + i*27); + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, 23, 40 + i*27); } } } @@ -4204,6 +4205,7 @@ int load_language_msg(char *filename, u32 language) switch(language) { case ENGLISH: + default: strcpy(start, "STARTENGLISH"); strcpy(end, "ENDENGLISH"); cmplen= 12; @@ -4213,10 +4215,10 @@ int load_language_msg(char *filename, u32 language) strcpy(end, "ENDCHINESESIM"); cmplen= 15; break; - default: - strcpy(start, "STARTENGLISH"); - strcpy(end, "ENDENGLISH"); - cmplen= 12; + case FRENCH: + strcpy(start, "STARTFRENCH"); + strcpy(end, "ENDFRENCH"); + cmplen= 11; break; } //find the start flag @@ -4898,7 +4900,9 @@ void gui_init(u32 lang_id) flag = load_font(); if(0 != flag) { - err_msg(DOWN_SCREEN, "initial font library error, press any key to exit\n"); + char message[128]; + sprintf(message, "Font library initialisation error %d, press any key to exit\n", flag); + err_msg(DOWN_SCREEN, message); goto gui_init_err; } -- cgit v1.2.3 From 100c3bd9e9f9e7fc809434706ddcc2fde96143af Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Wed, 19 Dec 2012 18:49:13 -0500 Subject: Make it easier to add new translations to the menu. * source/nds/gui.c: Calculate the number of options based on the array size of language_otions. --- source/nds/gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index b1b9ce5..3201665 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -3125,7 +3125,7 @@ u32 menu(u16 *screen) /* 01 */ NUMERIC_SELECTION_OPTION(NULL, &msg[MSG_SUB_MENU_42], &clock_speed_number, 6, NULL, 1), /* 02 */ STRING_SELECTION_OPTION(language_set, NULL, &msg[MSG_SUB_MENU_41], language_options, - &emu_config.language, 3 /* number of possibilities */, NULL, ACTION_TYPE, 2), + &emu_config.language, sizeof(language_options) / sizeof(language_options[0]) /* number of possible languages */, NULL, ACTION_TYPE, 2), /* 03 */ STRING_SELECTION_OPTION(NULL, show_card_space, &msg[MSG_SUB_MENU_43], NULL, &desert, 2, NULL, PASSIVE_TYPE | HIDEN_TYPE, 3), -- cgit v1.2.3 From 80858801300a2f48ad250721a79ebc7b1b0aba92 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Thu, 20 Dec 2012 18:10:38 -0500 Subject: Remove the SNES Open Bus behaviour by default. Also simplify translation again. SNES Open Bus is a quirk of the memory subsystem that allow reads of invalid addresses to return the last byte read from memory. However, it is seldom needed by a game, and it costs 1 to 3 MIPS instructions per SNES instruction to emulate. If you need SNES Open Bus, you can remove -DNO_OPEN_BUS from the Makefile. --- source/nds/gui.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 3201665..61a3b58 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -40,6 +40,8 @@ char rom_path[MAX_PATH]; char gamepak_name[MAX_PATH]; char gcheat_filename[MAX_PATH]; +// If adding a language, make sure you update the size of the array in +// message.h too. char *lang[3] = { "English", // 0 @@ -2966,8 +2968,6 @@ u32 menu(u16 *screen) char *enable_disable_options[] = { (char*)&msg[MSG_EN_DIS_ABLE_0], (char*)&msg[MSG_EN_DIS_ABLE_1] }; - char *language_options[] = { (char*) &lang[0], (char*) &lang[1], (char*) &lang[2] }; - char *keyremap_options[] = {(char*)&msg[MSG_KEY_MAP_NONE], (char*)&msg[MSG_KEY_MAP_A], (char*)&msg[MSG_KEY_MAP_B], (char*)&msg[MSG_KEY_MAP_SL], (char*)&msg[MSG_KEY_MAP_ST], (char*)&msg[MSG_KEY_MAP_RT], (char*)&msg[MSG_KEY_MAP_LF], (char*)&msg[MSG_KEY_MAP_UP], (char*)&msg[MSG_KEY_MAP_DW], @@ -3124,8 +3124,8 @@ u32 menu(u16 *screen) //CPU speed /* 01 */ NUMERIC_SELECTION_OPTION(NULL, &msg[MSG_SUB_MENU_42], &clock_speed_number, 6, NULL, 1), - /* 02 */ STRING_SELECTION_OPTION(language_set, NULL, &msg[MSG_SUB_MENU_41], language_options, - &emu_config.language, sizeof(language_options) / sizeof(language_options[0]) /* number of possible languages */, NULL, ACTION_TYPE, 2), + /* 02 */ STRING_SELECTION_OPTION(language_set, NULL, &msg[MSG_SUB_MENU_41], lang, + &emu_config.language, sizeof(lang) / sizeof(lang[0]) /* number of possible languages */, NULL, ACTION_TYPE, 2), /* 03 */ STRING_SELECTION_OPTION(NULL, show_card_space, &msg[MSG_SUB_MENU_43], NULL, &desert, 2, NULL, PASSIVE_TYPE | HIDEN_TYPE, 3), -- cgit v1.2.3 From 8a4343ff8e4114f19f034130a4b841a6b9a98217 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Thu, 20 Dec 2012 19:34:51 -0500 Subject: Bump the version number for NDSSFC. * gui.c: #define NDSSFC_VERSION "1.08". --- source/nds/gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 61a3b58..64953be 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -54,7 +54,7 @@ char *lang[3] = ******************************************************************************/ #define SUBMENU_ROW_NUM 6 -#define NDSSFC_VERSION "1.07" +#define NDSSFC_VERSION "1.08" #define SAVE_STATE_SLOT_NUM 10 -- cgit v1.2.3 From 712c249e8c2b614555a6492b520244fe12cd1910 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Thu, 20 Dec 2012 23:52:09 -0500 Subject: Simplify the GUI code. * gui.c: Simplify row and column checks when handling touch events. * draw.c, err_msg: Use ConsoleInit instead of a custom drawstring function when an initialisation error that is NOT related to DS2 I/O occurs. This allows \r\n to work. * gui.c, initialisation: Remove the Engrish in the "initial error" messages. Make them appear in English and French. Unfortunately, the console doesn't support Chinese characters, and I don't know Chinese. --- source/nds/gui.c | 219 ++++++++++++++++++------------------------------------- 1 file changed, 71 insertions(+), 148 deletions(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 64953be..f2d9af6 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -403,13 +403,14 @@ static int sort_function(const void *dest_str_ptr, const void *src_str_ptr) char *dest_str = *((char **)dest_str_ptr); char *src_str = *((char **)src_str_ptr); + // For files and directories, . and .. sort first. if(src_str[0] == '.') return 1; if(dest_str[0] == '.') return -1; - return strcasecmp(dest_str, src_str); + return strcasecmp(dest_str, src_str); } static int my_array_partion(void *array, int left, int right) @@ -464,9 +465,9 @@ static void strupr(char *str) } } -//****************************************************************************** +// ****************************************************************************** // get file list -//****************************************************************************** +// ****************************************************************************** #define FILE_LIST_MAX 512 #define DIR_LIST_MAX 64 #define NAME_MEM_SIZE (320*64) @@ -628,7 +629,7 @@ static int load_file_list(struct FILE_LIST_INFO *filelist_infop) strcpy(current_dir_name, filelist_infop -> current_path); - //* path formate should be: "fat:/" or "fat:/dir0" or "fat:", not "fat:/dir0/" + // path formate should be: "fat:/" or "fat:/dir0" or "fat:", not "fat:/dir0/" current_dir = opendir(current_dir_name); //Open directory faiure if(current_dir == NULL) { @@ -792,31 +793,23 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) { case CURSOR_TOUCH: ds2_getrawInput(&inputdata); - if(inputdata.y <= 33) + // ___ 33 This screen has 6 possible rows. Touches + // ___ 60 above or below these are ignored. + // . . . (+27) + // ___ 192 + if(inputdata.y <= 33 || inputdata.y > 192) break; - else if(inputdata.y <= 60) - mod = 0; - else if(inputdata.y <= 87) - mod = 1; - else if(inputdata.y <= 114) - mod = 2; - else if(inputdata.y <= 141) - mod = 3; - else if(inputdata.y <= 168) - mod = 4; - else if(inputdata.y <= 192) - mod = 5; else - break; - + mod = (inputdata.y - 33) / 27; + if(selected_item_on_list - selected_item_on_screen + mod >= total_items_num) break; - + selected_item_on_list = selected_item_on_list - selected_item_on_screen + mod; - + if(selected_item_on_list + 1 <= num_files) { - //The ".." directory + //The ".." directory is the parent if(!strcasecmp(file_list[selected_item_on_list], "..")) { char *ext_pos; @@ -852,7 +845,7 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) case CURSOR_UP: redraw = 1; if(selected_item_on_screen > 0) - { + { //Not the first item on list selected_item_on_list -= 1; //Selected item on screen center @@ -2868,7 +2861,7 @@ u32 menu(u16 *screen) draw_message(down_screen_addr, bg_screenp, 28, 31, 227, 165, bg_screenp_color); draw_string_vcenter(down_screen_addr, 36, 80, 190, COLOR_MSSG, msg[MSG_EMU_VERSION0]); - sprintf(line_buffer, "%s %s", msg[MSG_EMU_VERSION1], NDSSFC_VERSION); + sprintf(line_buffer, "%s %s", msg[MSG_EMU_VERSION1], NDSSFC_VERSION); draw_string_vcenter(down_screen_addr, 36, 95, 190, COLOR_MSSG, line_buffer); ds2_flipScreen(DOWN_SCREEN, 2); @@ -3461,7 +3454,7 @@ u32 menu(u16 *screen) { draw_hscroll_over(current_option_num-1); ext_pos= strrchr(emu_config.latest_file[current_option_num-1], '/'); - draw_hscroll_init(down_screen_addr, 26, 35 + (current_option_num-1)*27, 200, + draw_hscroll_init(down_screen_addr, 26, 40 + (current_option_num-1)*27, 200, COLOR_TRANS, COLOR_INACTIVE_ITEM, ext_pos+1); } @@ -3780,26 +3773,13 @@ u32 menu(u16 *screen) /* Main menu */ if(current_menu == &main_menu) { - if(inputdata.x <= 86 && inputdata.y <= 80) - current_option_num = 0; - else if(inputdata.x <= 172 && inputdata.y <= 80) - current_option_num = 1; - else if(inputdata.x <= 256 && inputdata.y <= 80) - current_option_num = 2; - else if(inputdata.x <= 86 && inputdata.y <= 160) - current_option_num = 3; - else if(inputdata.x <= 172 && inputdata.y <= 160) - current_option_num = 4; - else if(inputdata.x <= 256 && inputdata.y <= 160) - current_option_num = 5; - else if(inputdata.x <= 86 && inputdata.y <= 192) - current_option_num = 6; - else if(inputdata.x <= 172 && inputdata.y <= 192) - current_option_num = 7; - else if(inputdata.x <= 256 && inputdata.y <= 192) - current_option_num = 8; - else - break; + // 0 86 172 256 + // _____ _____ _____ 0 + // |0VID_|1SAV_|2CHT_| 80 + // |3TLS_|4OPT_|5EXI_| 160 + // |6NEW_|7RET_|8RST_| 192 + + current_option_num = (inputdata.y / 80) * 3 + (inputdata.x / 86); current_option = current_menu->options + current_option_num; if(current_option -> option_type & HIDEN_TYPE) @@ -3818,31 +3798,22 @@ u32 menu(u16 *screen) && current_menu != (main_menu.options +6)->sub_menu && current_menu != ((main_menu.options +6)->sub_menu->options + 2)->sub_menu) { - if(inputdata.y <= 33) + if (inputdata.y <= 33 || inputdata.y > 192) break; - else if(inputdata.y <= 60) - current_option_num = 1; - else if(inputdata.y <= 87) - current_option_num = 2; - else if(inputdata.y <= 114) - current_option_num = 3; - else if(inputdata.y <= 141) - current_option_num = 4; - else if(inputdata.y <= 168) - current_option_num = 5; - else if(inputdata.y <= 192) - current_option_num = 6; - else - break; - + // ___ 33 This screen has 6 possible rows. Touches + // ___ 60 above or below these are ignored. + // . . . (+27) + // ___ 192 + current_option_num = (inputdata.y - 33) / 27; + current_option = current_menu->options + current_option_num; - + if(current_option -> option_type & HIDEN_TYPE) break; - + if(!current_option) break; - + if(current_menu->key_function) { gui_action = CURSOR_RIGHT; @@ -3885,33 +3856,16 @@ u32 menu(u16 *screen) u32 current_option_val = *(current_option->current_option); u32 old_option_val = current_option_val; - if(inputdata.x <= 25) - break; - else if(inputdata.x <= 45) - current_option_val = 0; - else if(inputdata.x <= 65) - current_option_val = 1; - else if(inputdata.x <= 86) - current_option_val = 2; - else if(inputdata.x <= 107) - current_option_val = 3; - else if(inputdata.x <= 128) - current_option_val = 4; - else if(inputdata.x <= 149) - current_option_val = 5; - else if(inputdata.x <= 170) - current_option_val = 6; - else if(inputdata.x <= 191) - current_option_val = 7; - else if(inputdata.x <= 212) - current_option_val = 8; - else if(inputdata.x <= 233) - current_option_val = 9; - else + if(inputdata.x <= 23 || inputdata.x > 233) break; - + // | | | | | | | | | | | + // 23 44 65 86 ... (+21) 233 + // This row has 10 cells for save states, each 21 + // pixels wide. + current_option_val = (inputdata.x - 23) / 21; + *(current_option->current_option) = current_option_val; - + if(current_option_val == old_option_val) { gui_action = CURSOR_SELECT; @@ -3952,33 +3906,16 @@ u32 menu(u16 *screen) u32 current_option_val = *(current_option->current_option); u32 old_option_val = current_option_val; - if(inputdata.x <= 25) - break; - else if(inputdata.x <= 45) - current_option_val = 0; - else if(inputdata.x <= 65) - current_option_val = 1; - else if(inputdata.x <= 86) - current_option_val = 2; - else if(inputdata.x <= 107) - current_option_val = 3; - else if(inputdata.x <= 128) - current_option_val = 4; - else if(inputdata.x <= 149) - current_option_val = 5; - else if(inputdata.x <= 170) - current_option_val = 6; - else if(inputdata.x <= 191) - current_option_val = 7; - else if(inputdata.x <= 212) - current_option_val = 8; - else if(inputdata.x <= 233) - current_option_val = 9; - else + if(inputdata.x <= 23 || inputdata.x > 233) break; - + // | | | | | | | | | | | + // 23 44 65 86 ... (+21) 233 + // This row has 10 cells for save states, each 21 + // pixels wide. + current_option_val = (inputdata.x - 23) / 21; + *(current_option->current_option) = current_option_val; - + if(current_option_val == old_option_val) { gui_action = CURSOR_SELECT; @@ -4004,25 +3941,16 @@ u32 menu(u16 *screen) || current_menu == (main_menu.options + 6)->sub_menu || current_menu == ((main_menu.options +6)->sub_menu->options + 2)->sub_menu) { - if(inputdata.y <= 33) + if (inputdata.y <= 33 || inputdata.y > 192) break; - else if(inputdata.y <= 60) - current_option_num = 1; - else if(inputdata.y <= 87) - current_option_num = 2; - else if(inputdata.y <= 114) - current_option_num = 3; - else if(inputdata.y <= 141) - current_option_num = 4; - else if(inputdata.y <= 168) - current_option_num = 5; - else if(inputdata.y <= 192) - current_option_num = 6; - else - break; - + // ___ 33 This screen has 6 possible rows. Touches + // ___ 60 above or below these are ignored. + // . . . (+27) The row between 33 and 60 is [1], though! + // ___ 192 + current_option_num = (inputdata.y - 33) / 27 + 1; + current_option = current_menu->options + current_option_num; - + if(current_option -> option_type & HIDEN_TYPE) break; else if(current_option->option_type & ACTION_TYPE) @@ -4150,12 +4078,9 @@ u32 menu(u16 *screen) set_cpu_clock(clock_speed_number); // mdelay(200); // Delete this delay - ds2_clearScreen(DOWN_SCREEN, 0); - ds2_flipScreen(DOWN_SCREEN, 1); - ds2_clearScreen(UP_SCREEN, 0); - ds2_flipScreen(UP_SCREEN, 1); - ds2_clearScreen(UP_SCREEN, 0); - ds2_flipScreen(UP_SCREEN, 1); + ds2_clearScreen(DUAL_SCREEN, 0); + ds2_flipScreen(DUAL_SCREEN, 1); + ds2_flipScreen(UP_SCREEN, 1); // Flip again because otherwise it flickers ds2_setBacklight(2); //save game config @@ -4855,7 +4780,7 @@ void gui_init(u32 lang_id) { int flag; - ds2_setCPUclocklevel(11); + ds2_setCPUclocklevel(13); // Crank it up. When the menu starts, -> 0. printf_clock(); //Find the "CATSFC" system directory @@ -4876,11 +4801,11 @@ void gui_init(u32 lang_id) strcpy(main_path, "fat:"); if(search_dir("CATSFC", main_path) == 0) { - printf("Dirctory find: %s\n", main_path); + printf("Found CATSFC directory\r\nDossier CATSFC trouve\r\n\r\n%s\r\n", main_path); } else { - err_msg(DOWN_SCREEN, "Can't fine CATSFC directory, press any key to exit\n"); + err_msg(DOWN_SCREEN, "/CATSFC: Directory missing\r\nPress any key to return to\r\nthe menu\r\n\r\n/CATSFC: Dossier manquant\r\nAppuyer sur une touche pour\r\nretourner au menu"); goto gui_init_err; } } @@ -4892,7 +4817,7 @@ void gui_init(u32 lang_id) flag = icon_init(lang_id); if(0 != flag) { - err_msg(DOWN_SCREEN, "some icon can't open when initial GUI, press any key to exit\n"); + err_msg(DOWN_SCREEN, "Some icons are missing\r\nLoad them onto your card\r\nPress any key to return to\r\nthe menu\r\n\r\nDes icones sont manquantes\r\nChargez-les sur votre carte\r\nAppuyer sur une touche pour\r\nretourner au menu"); goto gui_init_err; } @@ -4900,8 +4825,8 @@ void gui_init(u32 lang_id) flag = load_font(); if(0 != flag) { - char message[128]; - sprintf(message, "Font library initialisation error %d, press any key to exit\n", flag); + char message[512]; + sprintf(message, "Font library initialisation\r\nerror (%d)\r\nPress any key to return to\r\nthe menu\r\n\r\nErreur d'initalisation de la\r\npolice de caracteres (%d)\r\nAppuyer sur une touche pour\r\nretourner au menu", flag, flag); err_msg(DOWN_SCREEN, message); goto gui_init_err; } @@ -4912,13 +4837,14 @@ void gui_init(u32 lang_id) flag = load_language_msg(LANGUAGE_PACK, lang_id); if(0 != flag) { - err_msg(DOWN_SCREEN, "initial language package error, press any key to exit\n"); + char message[512]; + sprintf(message, "Language pack initialisation\r\nerror (%d)\r\nPress any key to return to\r\nthe menu\r\n\r\nErreur d'initalisation du\r\npack de langue (%d)\r\nAppuyer sur une touche pour\r\nretourner au menu", flag, flag); + err_msg(DOWN_SCREEN, message); goto gui_init_err; } initial_path_config(); - return; gui_init_err: @@ -4927,6 +4853,3 @@ gui_init_err: quit(); while(1); } - - - -- cgit v1.2.3 From 5585c035fbec86ee4bec79865357479142e94b9f Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Fri, 21 Dec 2012 00:05:07 -0500 Subject: Fix an off-by-one in the previous commit's touch handling code. --- source/nds/gui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index f2d9af6..2f9e1d2 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -3802,9 +3802,9 @@ u32 menu(u16 *screen) break; // ___ 33 This screen has 6 possible rows. Touches // ___ 60 above or below these are ignored. - // . . . (+27) + // . . . (+27) The row between 33 and 60 is [1], though! // ___ 192 - current_option_num = (inputdata.y - 33) / 27; + current_option_num = (inputdata.y - 33) / 27 + 1; current_option = current_menu->options + current_option_num; -- cgit v1.2.3 From 3972512b2a5c25236ea3ba586621dba6e5b56361 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Fri, 21 Dec 2012 01:44:57 -0500 Subject: Looks like only having 'lang' crashes the options dialog. Restore the array of pointers. --- source/nds/gui.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 2f9e1d2..bf85b67 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -49,6 +49,8 @@ char *lang[3] = "Français", // 2 }; +char *language_options[] = { (char *) &lang[0], (char *) &lang[1], (char *) &lang[2] }; + /****************************************************************************** * Macro definition ******************************************************************************/ @@ -3117,8 +3119,8 @@ u32 menu(u16 *screen) //CPU speed /* 01 */ NUMERIC_SELECTION_OPTION(NULL, &msg[MSG_SUB_MENU_42], &clock_speed_number, 6, NULL, 1), - /* 02 */ STRING_SELECTION_OPTION(language_set, NULL, &msg[MSG_SUB_MENU_41], lang, - &emu_config.language, sizeof(lang) / sizeof(lang[0]) /* number of possible languages */, NULL, ACTION_TYPE, 2), + /* 02 */ STRING_SELECTION_OPTION(language_set, NULL, &msg[MSG_SUB_MENU_41], language_options, + &emu_config.language, sizeof(language_options) / sizeof(language_options[0]) /* number of possible languages */, NULL, ACTION_TYPE, 2), /* 03 */ STRING_SELECTION_OPTION(NULL, show_card_space, &msg[MSG_SUB_MENU_43], NULL, &desert, 2, NULL, PASSIVE_TYPE | HIDEN_TYPE, 3), -- cgit v1.2.3 From a0d0c5e7a5bdc396b4c370a750273b6e3b963bb0 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Fri, 21 Dec 2012 03:50:10 -0500 Subject: Eliminate the latency of button press recognition, which was bad enough to lose keys entirely sometimes, and could otherwise delay a button press or release by 200 ms. This was the entire reason I created the fork, and I finally did it! It syncs the controls every scanline of a frame, which costs about 60,000 MIPS instructions per frame to deal with. Luckily, the processor runs at 396 MHz, which means the cost of checking the controls is 1% of the CPU's power. --- source/nds/gui.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index bf85b67..4a04efc 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -1714,6 +1714,7 @@ u32 menu(u16 *screen) void menu_exit() { + ds2_setCPUclocklevel(13); // Crank it up, leave quickly if(gamepak_name[0] != 0) { game_config.clock_speed_number = clock_speed_number; -- cgit v1.2.3 From a194b850037c03f5fb3ac1ecc9f7a99f73b84104 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Sat, 22 Dec 2012 22:16:55 -0500 Subject: Preliminary Snes9x-based cheat code support. Not tested, because the file selection interface freezes when it gets to the folder containing Mightymo's cheat files, whereas it did not do this before with the converted Mightymo cheats. (335 files -> 679, though.) --- source/nds/gui.c | 93 ++++++++++++++++++++++---------------------------------- 1 file changed, 36 insertions(+), 57 deletions(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 4a04efc..84f522f 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -23,6 +23,7 @@ #include #include +#include "port.h" #include "ds2_types.h" #include "ds2io.h" #include "ds2_malloc.h" @@ -35,6 +36,8 @@ #include "bitmap.h" #include "gcheat.h" +extern struct SCheatData Cheat; + char main_path[MAX_PATH]; char rom_path[MAX_PATH]; char gamepak_name[MAX_PATH]; @@ -69,7 +72,7 @@ char *language_options[] = { (char *) &lang[0], (char *) &lang[1], (char *) &lan EMU_CONFIG emu_config; //game configure file's header -#define GAME_CONFIG_HEADER "GSFC1.0" +#define GAME_CONFIG_HEADER "GSFC1.1" // 1.1 removed cheat names #define GAME_CONFIG_HEADER_SIZE 7 GAME_CONFIG game_config; @@ -110,7 +113,7 @@ static unsigned int savestate_index; NULL, \ &cheat_format_ptr[number], \ enable_disable_options, \ - &(game_config.cheats_flag[number].active), \ + &(Cheat.c[number].enabled), \ 2, \ NULL, \ line_number, \ @@ -1656,8 +1659,8 @@ u32 menu(u16 *screen) u32 first_load = 0; char tmp_filename[MAX_FILE]; char line_buffer[512]; - char cheat_format_str[MAX_CHEATS][41*4]; - char *cheat_format_ptr[MAX_CHEATS]; + char cheat_format_str[MAX_CHEATS_T][41*4]; + char *cheat_format_ptr[MAX_CHEATS_T]; MENU_TYPE *current_menu; MENU_OPTION_TYPE *current_option; @@ -2214,19 +2217,18 @@ u32 menu(u16 *screen) unsigned char **dynamic_cheat_pt = NULL; unsigned int dynamic_cheat_active; int dynamic_cheat_scroll_value= 0; - MSG_TABLE cheat_msg= {NULL, NULL}; void cheat_menu_init() { - for(i = 0; i < MAX_CHEATS; i++) + for(i = 0; i < MAX_CHEATS_T; i++) { - if(i >= g_cheat_num) + if(i >= Cheat.num_cheats) { sprintf(cheat_format_str[i], msg[MSG_CHEAT_MENU_NON_LOAD], i); } else { - sprintf(cheat_format_str[i], msg[MSG_CHEAT_MENU_LOADED], i, game_config.cheats_flag[i].name_shot); + sprintf(cheat_format_str[i], msg[MSG_CHEAT_MENU_LOADED], i, Cheat.c[i].name); } cheat_format_ptr[i]= cheat_format_str[i]; @@ -2237,13 +2239,11 @@ u32 menu(u16 *screen) void cheat_menu_end() { - if(!first_load) - gcheat_Managment(game_config.cheats_flag); } void dynamic_cheat_key() { - unsigned int m, n; + unsigned int m, n; switch(gui_action) { @@ -2455,11 +2455,12 @@ u32 menu(u16 *screen) unsigned int nums; nums = (CHEATS_PER_PAGE * menu_cheat_page) + current_option_num -1; - if(gui_action == CURSOR_SELECT && nums < g_cheat_num) + if(gui_action == CURSOR_SELECT && nums < Cheat.num_cheats) { unsigned int m; - nums = game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + current_option_num -1].item_num; + // nums = game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + current_option_num -1].item_num; + // REVISIT [Neb] if(dynamic_cheat_options) { @@ -2497,7 +2498,8 @@ u32 menu(u16 *screen) dynamic_cheat_options[0].action_function = NULL; dynamic_cheat_options[0].passive_function = NULL; dynamic_cheat_options[0].sub_menu = &cheats_menu; - dynamic_cheat_options[0].display_string = (char**)(dynamic_cheat_pt + game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + current_option_num -1].name_id); + // dynamic_cheat_options[0].display_string = (char**)(dynamic_cheat_pt + game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + current_option_num -1].name_id); + // REVISIT [Neb] dynamic_cheat_options[0].options = NULL; dynamic_cheat_options[0].current_option = NULL; dynamic_cheat_options[0].num_options = 0; @@ -2505,13 +2507,15 @@ u32 menu(u16 *screen) dynamic_cheat_options[0].line_number = 0; dynamic_cheat_options[0].option_type = SUBMENU_TYPE; - m = game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + current_option_num -1].item_id; + // m = game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + current_option_num -1].item_id; + // REVISIT [Neb] for(i= 0; i < nums; i++) { dynamic_cheat_options[i+1].action_function = dynamic_cheat_action; dynamic_cheat_options[i+1].passive_function = NULL; dynamic_cheat_options[i+1].sub_menu = NULL; - dynamic_cheat_options[i+1].display_string = (char**)(dynamic_cheat_pt + S9xGetCheat_nameid(m, i, g_cheat_cell_num)); + // dynamic_cheat_options[i+1].display_string = (char**)(dynamic_cheat_pt + S9xGetCheat_nameid(m, i, g_cheat_cell_num)); + // REVISIT [Neb] dynamic_cheat_options[i+1].options = NULL; dynamic_cheat_options[i+1].current_option = NULL; dynamic_cheat_options[i+1].num_options = 2; @@ -2520,10 +2524,11 @@ u32 menu(u16 *screen) dynamic_cheat_options[i+1].option_type = ACTION_TYPE; } - dynamic_cheat_active = game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + - current_option_num -1].active & 0x1; - dynamic_cheat_active |= game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + - current_option_num -1].sub_active << 16; + // dynamic_cheat_active = game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + + // current_option_num -1].active & 0x1; + // dynamic_cheat_active |= game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + + // current_option_num -1].sub_active << 16; + // REVISIT [Neb] //Initial srollable options int k; @@ -2585,7 +2590,8 @@ u32 menu(u16 *screen) unsigned int m, k; m = cheats_menu.focus_option-1; - game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + m].sub_active = dynamic_cheat_active >> 16; + // game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + m].sub_active = dynamic_cheat_active >> 16; + // REVISIT [Neb] k = SUBMENU_ROW_NUM +1; for(m= 0; m= Cheat.num_cheats) - { - sprintf(cheat_format_str[i], msg[MSG_CHEAT_MENU_NON_LOAD], i); - } - else - { - sprintf(cheat_format_str[i], msg[MSG_CHEAT_MENU_LOADED], i, Cheat.c[i].name); - } - - cheat_format_ptr[i]= cheat_format_str[i]; + sprintf(cheat_data_str[i], "%d", i); + cheat_data_ptr[i] = &cheat_data_str[i][0]; } reload_cheats_page(); @@ -2239,6 +2232,17 @@ u32 menu(u16 *screen) void cheat_menu_end() { + // Honour current cheat selections. + uint32 i; + for (i = 0; i < Cheat.num_cheats; i++) { + if (Cheat.c[i].enabled) + S9xApplyCheat(i); + else + S9xRemoveCheat(i); + } + // Save current cheat selections to the cheat binary file. + strcpy(line_buffer, (char *) S9xGetFilename (".chb")); + S9xSaveCheatFile (line_buffer); // cheat binary } void dynamic_cheat_key() @@ -2452,102 +2456,13 @@ u32 menu(u16 *screen) void cheat_option_action() { - unsigned int nums; - - nums = (CHEATS_PER_PAGE * menu_cheat_page) + current_option_num -1; - if(gui_action == CURSOR_SELECT && nums < Cheat.num_cheats) - { - unsigned int m; - - // nums = game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + current_option_num -1].item_num; - // REVISIT [Neb] - - if(dynamic_cheat_options) - { - free((void*)dynamic_cheat_options); - dynamic_cheat_options = NULL; - } - - if(dynamic_cheat_menu) - { - free((void*)dynamic_cheat_menu); - dynamic_cheat_menu = NULL; - } - - dynamic_cheat_options = (MENU_OPTION_TYPE*)malloc(sizeof(MENU_OPTION_TYPE)*(nums+1)); - if(dynamic_cheat_options == NULL) return; - - dynamic_cheat_menu = (MENU_TYPE*)malloc(sizeof(MENU_TYPE)); - if(dynamic_cheat_menu == NULL) - { - free((void*)dynamic_cheat_options); - dynamic_cheat_options = NULL; - return; - } - - //menu - dynamic_cheat_menu->init_function = NULL; - dynamic_cheat_menu->passive_function = dynamic_cheat_menu_passive; - dynamic_cheat_menu->key_function = dynamic_cheat_key; - dynamic_cheat_menu->end_function = dynamic_cheat_menu_end; - dynamic_cheat_menu->options = dynamic_cheat_options; - dynamic_cheat_menu->num_options = nums+1; - dynamic_cheat_menu->focus_option = 0; - dynamic_cheat_menu->screen_focus = 0; - //back option - dynamic_cheat_options[0].action_function = NULL; - dynamic_cheat_options[0].passive_function = NULL; - dynamic_cheat_options[0].sub_menu = &cheats_menu; - // dynamic_cheat_options[0].display_string = (char**)(dynamic_cheat_pt + game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + current_option_num -1].name_id); - // REVISIT [Neb] - dynamic_cheat_options[0].options = NULL; - dynamic_cheat_options[0].current_option = NULL; - dynamic_cheat_options[0].num_options = 0; - dynamic_cheat_options[0].help_string = NULL; - dynamic_cheat_options[0].line_number = 0; - dynamic_cheat_options[0].option_type = SUBMENU_TYPE; - - // m = game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + current_option_num -1].item_id; - // REVISIT [Neb] - for(i= 0; i < nums; i++) - { - dynamic_cheat_options[i+1].action_function = dynamic_cheat_action; - dynamic_cheat_options[i+1].passive_function = NULL; - dynamic_cheat_options[i+1].sub_menu = NULL; - // dynamic_cheat_options[i+1].display_string = (char**)(dynamic_cheat_pt + S9xGetCheat_nameid(m, i, g_cheat_cell_num)); - // REVISIT [Neb] - dynamic_cheat_options[i+1].options = NULL; - dynamic_cheat_options[i+1].current_option = NULL; - dynamic_cheat_options[i+1].num_options = 2; - dynamic_cheat_options[i+1].help_string = NULL; - dynamic_cheat_options[i+1].line_number = i+1; - dynamic_cheat_options[i+1].option_type = ACTION_TYPE; - } - - // dynamic_cheat_active = game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + - // current_option_num -1].active & 0x1; - // dynamic_cheat_active |= game_config.cheats_flag[(CHEATS_PER_PAGE * menu_cheat_page) + - // current_option_num -1].sub_active << 16; - // REVISIT [Neb] - - //Initial srollable options - int k; - - draw_hscroll_init(down_screen_addr, 50, 9, 180, COLOR_TRANS, - COLOR_ACTIVE_ITEM, *dynamic_cheat_options[0].display_string); - - if(nums>5) nums = SUBMENU_ROW_NUM; - for(k= 0; k < nums; k++) - { - draw_hscroll_init(down_screen_addr, 23, 40 + k*27, 200, - COLOR_TRANS, COLOR_INACTIVE_ITEM, *dynamic_cheat_options[k+1].display_string); - } - dynamic_cheat_scroll_value= 0; - - choose_menu(dynamic_cheat_menu); - } } +#define CHEAT_NUMBER_X 26 +#define CHEAT_DESC_X 52 +#define CHEAT_DESC_SX 163 +#define CHEAT_ACTIVE_X 225 + void cheat_option_passive() { unsigned short color; @@ -2562,27 +2477,33 @@ u32 menu(u16 *screen) //sprintf("%A") will have problem ? strcpy(tmp_buf, *(display_option->display_string)); - pt = strrchr(tmp_buf, ':'); - if(pt != NULL) - sprintf(pt+1, "%s", *((u32*)(((u32 *)display_option->options)[*(display_option->current_option)]))); + // This is the number of the cheat to display - strcpy(line_buffer, tmp_buf); - pt = strrchr(line_buffer, ')'); - *pt = '\0'; - pt = strchr(line_buffer, '('); + int i = atoi(tmp_buf); - len = BDF_cut_string(pt+1, 0, 2); - if(len > 90) - { - len = BDF_cut_string(pt+1, 90, 1); - *(pt+1+len) = '\0'; - strcat(line_buffer, "..."); - } + sprintf(line_buffer, "%d.", i + 1); + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, CHEAT_NUMBER_X, 40 + display_option-> line_number*27); - pt = strrchr(tmp_buf, ')'); - strcat(line_buffer, pt); + if (i >= Cheat.num_cheats) { + PRINT_STRING_BG(down_screen_addr, msg[MSG_CHEAT_MENU_NON_LOAD], color, COLOR_TRANS, CHEAT_DESC_X, 40 + display_option-> line_number*27); + } + else { + strcpy(line_buffer, Cheat.c[i].name); + len = BDF_cut_string(line_buffer, 0, 2); + if(len > CHEAT_DESC_SX) + { + len = BDF_cut_string(line_buffer, CHEAT_DESC_SX, 1); + line_buffer[len] = '\0'; + strcat(line_buffer, "..."); + } + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, CHEAT_DESC_X, 40 + display_option-> line_number*27); - PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, 26, 40 + display_option-> line_number*27); + if (Cheat.c[i].enabled) + strcpy(line_buffer, "+"); + else + strcpy(line_buffer, "-"); + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, CHEAT_ACTIVE_X, 40 + display_option-> line_number*27); + } } void dynamic_cheat_menu_end() @@ -3578,7 +3499,7 @@ u32 menu(u16 *screen) { for(i = 0; i < CHEATS_PER_PAGE; i++) { - cheats_options[i+1].display_string = &cheat_format_ptr[(CHEATS_PER_PAGE * menu_cheat_page) + i]; + cheats_options[i+1].display_string = &cheat_data_ptr[(CHEATS_PER_PAGE * menu_cheat_page) + i]; cheats_options[i+1].current_option = &(Cheat.c[(CHEATS_PER_PAGE * menu_cheat_page) + i].enabled); } } -- cgit v1.2.3 From e7ce8dd66c19de431fb347a0f3cd0ea867a802ce Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Mon, 24 Dec 2012 02:15:42 -0500 Subject: Bump to v. 1.09. Update the readme for cheats. Update the github link in source.txt. --- source/nds/gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 979d99c..772775b 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -59,7 +59,7 @@ char *language_options[] = { (char *) &lang[0], (char *) &lang[1], (char *) &lan ******************************************************************************/ #define SUBMENU_ROW_NUM 6 -#define NDSSFC_VERSION "1.08" +#define NDSSFC_VERSION "1.09" #define SAVE_STATE_SLOT_NUM 10 -- cgit v1.2.3 From 1fd0171c5fd17cd48f6ef4104600c6f05b4e3004 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Mon, 24 Dec 2012 04:01:50 -0500 Subject: Bump version number to 1.10 for the APU half-carry bug and optimisations. --- source/nds/gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 772775b..91e1aa3 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -59,7 +59,7 @@ char *language_options[] = { (char *) &lang[0], (char *) &lang[1], (char *) &lan ******************************************************************************/ #define SUBMENU_ROW_NUM 6 -#define NDSSFC_VERSION "1.09" +#define NDSSFC_VERSION "1.10" #define SAVE_STATE_SLOT_NUM 10 -- cgit v1.2.3 From 7f0e1fee814df6c44ced04246f511b0f91787673 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Tue, 25 Dec 2012 03:18:36 -0500 Subject: Wait for keys to be released after the yes/no dialog for deleting saved states, instead of delaying. --- source/nds/gui.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 91e1aa3..964944b 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -2170,6 +2170,7 @@ u32 menu(u16 *screen) { if(draw_yesno_dialog(DOWN_SCREEN, 115, "Yes(A)", "No(B)")) { + wait_Allkey_release(0); for(i= 0; i < SAVE_STATE_SLOT_NUM; i++) { get_savestate_filename(i, tmp_filename); @@ -2198,8 +2199,10 @@ u32 menu(u16 *screen) sprintf(line_buffer, msg[MSG_DELETTE_SINGLE_SAVESTATE_WARING], delette_savestate_num); draw_string_vcenter(down_screen_addr, 36, 75, 190, COLOR_MSSG, line_buffer); - if(draw_yesno_dialog(DOWN_SCREEN, 115, "Yes(A)", "No(B)")) + if(draw_yesno_dialog(DOWN_SCREEN, 115, "Yes(A)", "No(B)")) { + wait_Allkey_release(0); clear_savestate_slot(delette_savestate_num); +} } else { @@ -2740,6 +2743,7 @@ u32 menu(u16 *screen) if(draw_yesno_dialog(DOWN_SCREEN, 115, "Yes", "No")) { + wait_Allkey_release(0); draw_message(down_screen_addr, bg_screenp, 28, 31, 227, 165, bg_screenp_color); draw_string_vcenter(down_screen_addr, 36, 80, 190, COLOR_MSSG, msg[MSG_DEFAULT_LOADING]); ds2_flipScreen(DOWN_SCREEN, 2); @@ -2803,11 +2807,10 @@ u32 menu(u16 *screen) ds2_clearScreen(UP_SCREEN, 0); draw_string_vcenter(up_screen_addr, 0, 80, 256, COLOR_WHITE, msg[MSG_NON_LOAD_GAME]); ds2_flipScreen(UP_SCREEN, 1); - mdelay(10); //FIXME: Stranger? } save_emu_config_file(); - // mdelay(500); // Delete this delay + wait_Allkey_release(0); } } @@ -3556,6 +3559,11 @@ u32 menu(u16 *screen) } else { + /* + * It's pretty complicated. These two flips are needed because, + * otherwise, the menu freezes if S9xAutoSaveSRAM was called after + * loading from a save state. + */ ds2_flipScreen(UP_SCREEN, 1); ds2_flipScreen(UP_SCREEN, 1); } @@ -3563,7 +3571,6 @@ u32 menu(u16 *screen) choose_menu(&main_menu); // Menu loop - // mdelay(50); // Delete this delay, shortened from 200 while(repeat) { -- cgit v1.2.3 From 9c1742f6cb2043d0ed6a61ab6de3bef0aad6dc56 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Tue, 25 Dec 2012 16:00:34 -0500 Subject: Universally use update method 2 for the lower screen and 0 for the upper screen. Method 1 causes problems after about 15 minutes; despite the double-buffering, screen updates start to tear in the middle consistently. --- source/nds/gui.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 964944b..3438f62 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -1114,7 +1114,7 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) } redraw = 0; - ds2_flipScreen(DOWN_SCREEN, 2); //not switch down screen buffer + ds2_flipScreen(DOWN_SCREEN, 2); } //end if(0 != redraw) else if(0 != redraw) { unsigned int m, n; @@ -1142,7 +1142,7 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) } draw_hscroll(m+1, redraw); - ds2_flipScreen(DOWN_SCREEN, 2); //not switch down screen buffer + ds2_flipScreen(DOWN_SCREEN, 2); redraw = 0; } @@ -1162,7 +1162,7 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) { if(draw_hscroll(0, 1) <= 1) path_scroll = 0x8000; //scroll left } - ds2_flipScreen(DOWN_SCREEN, 2); //not switch down screen buffer + ds2_flipScreen(DOWN_SCREEN, 2); } mdelay(50); //about 50ms @@ -1176,7 +1176,7 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) manage_filelist_info(&filelist_info, -1); ds2_clearScreen(DOWN_SCREEN, COLOR_BLACK); - ds2_flipScreen(DOWN_SCREEN, 2); //not switch down screen buffer + ds2_flipScreen(DOWN_SCREEN, 2); return return_value; } @@ -3991,22 +3991,14 @@ u32 menu(u16 *screen) save_game_config_file(); } save_emu_config_file(); - // mdelay(100); // Delete this delay set_cpu_clock(clock_speed_number); - // mdelay(200); // Delete this delay - ds2_clearScreen(DUAL_SCREEN, 0); - ds2_flipScreen(DUAL_SCREEN, 1); + ds2_clearScreen(DOWN_SCREEN, 0); + ds2_flipScreen(DOWN_SCREEN, 1); copy_screen(up_screen_addr, (void*) screen, 0, 0, 256, 192); - ds2_flipScreen(UP_SCREEN, 1); // Flip again because otherwise it flickers + ds2_flipScreen(UP_SCREEN, 0); ds2_setBacklight(2); -//save game config -// save_game_config_file(); -// save_emu_config_file(); - - -// ds2_setCPUclocklevel(12); wait_Allkey_release(0); return return_value; @@ -4722,7 +4714,7 @@ void gui_init(u32 lang_id) } show_log(down_screen_addr); - ds2_flipScreen(DOWN_SCREEN, 1); + ds2_flipScreen(DOWN_SCREEN, 2); flag = icon_init(lang_id); if(0 != flag) @@ -4758,8 +4750,7 @@ void gui_init(u32 lang_id) return; gui_init_err: - ds2_flipScreen(DOWN_SCREEN, 1); + ds2_flipScreen(DOWN_SCREEN, 2); wait_Anykey_press(0); quit(); - while(1); } -- cgit v1.2.3 From 0f60f047f5146c76a73c8a299b4405929bf3909f Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Wed, 26 Dec 2012 15:40:35 -0500 Subject: Add the update methods for the upper and lower screen into defines. --- source/nds/gui.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'source/nds/gui.c') diff --git a/source/nds/gui.c b/source/nds/gui.c index 3438f62..9aa16bb 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -1114,7 +1114,7 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) } redraw = 0; - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); } //end if(0 != redraw) else if(0 != redraw) { unsigned int m, n; @@ -1142,7 +1142,7 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) } draw_hscroll(m+1, redraw); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); redraw = 0; } @@ -1162,7 +1162,7 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) { if(draw_hscroll(0, 1) <= 1) path_scroll = 0x8000; //scroll left } - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); } mdelay(50); //about 50ms @@ -1176,7 +1176,7 @@ s32 load_file(char **wildcards, char *result, char *default_dir_name) manage_filelist_info(&filelist_info, -1); ds2_clearScreen(DOWN_SCREEN, COLOR_BLACK); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); return return_value; } @@ -1233,7 +1233,7 @@ u32 play_screen_snapshot(void) { draw_message(down_screen_addr, screenp, 28, 31, 227, 165, color_bg); draw_string_vcenter(down_screen_addr, 36, 55, 190, COLOR_MSSG, msg[MSG_NO_SLIDE]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); if(screenp) free((void*)screenp); //construct filelist_info struct @@ -1260,7 +1260,7 @@ u32 play_screen_snapshot(void) draw_string_vcenter(down_screen_addr, 36, 115, 190, COLOR_MSSG, msg[MSG_PLAY_SLIDE4]); draw_string_vcenter(down_screen_addr, 36, 130, 190, COLOR_MSSG, msg[MSG_PLAY_SLIDE5]); draw_string_vcenter(down_screen_addr, 36, 145, 190, COLOR_MSSG, msg[MSG_PLAY_SLIDE6]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); repeat= 1; i= 0; @@ -1749,7 +1749,7 @@ u32 menu(u16 *screen) draw_message(down_screen_addr, bg_screenp, 28, 31, 227, 165, bg_screenp_color); draw_string_vcenter(down_screen_addr, 36, 100, 190, COLOR_MSSG, msg[MSG_LOADING_GAME]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); ds2_setCPUclocklevel(13); int load_result = load_gamepak(&line_buffer); @@ -1817,7 +1817,7 @@ u32 menu(u16 *screen) draw_message(down_screen_addr, bg_screenp, 28, 31, 227, 165, bg_screenp_color); draw_string_vcenter(down_screen_addr, 36, 100, 190, COLOR_MSSG, msg[MSG_LOADING_GAME]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); ds2_setCPUclocklevel(13); int load_result = load_gamepak(args[1]); @@ -2047,7 +2047,7 @@ u32 menu(u16 *screen) draw_message(down_screen_addr, NULL, 28, 31, 227, 165, 0); draw_string_vcenter(down_screen_addr, 36, 100, 190, COLOR_MSSG, msg[MSG_SAVESTATE_DOING]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); int flag = save_state(tmp_filename, (void*)screen); //clear message @@ -2063,7 +2063,7 @@ u32 menu(u16 *screen) savestate_index = slot_index; } - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); //save game config reorder_latest_file(); @@ -2100,7 +2100,7 @@ u32 menu(u16 *screen) { draw_message(down_screen_addr, bg_screenp, 28, 31, 227, 165, bg_screenp_color); draw_string_vcenter(down_screen_addr, 36, 80, 190, COLOR_MSSG, msg[MSG_SAVESTATE_FILE_BAD]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); wait_Allkey_release(0); if(gui_action == CURSOR_SELECT) @@ -2186,7 +2186,7 @@ u32 menu(u16 *screen) { draw_message(down_screen_addr, bg_screenp, 28, 31, 227, 165, bg_screenp_color); draw_string_vcenter(down_screen_addr, 36, 90, 190, COLOR_MSSG, msg[MSG_DELETTE_SAVESTATE_NOTHING]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); mdelay(500); } } @@ -2207,7 +2207,7 @@ u32 menu(u16 *screen) else { draw_string_vcenter(down_screen_addr, 36, 90, 190, COLOR_MSSG, msg[MSG_DELETTE_SAVESTATE_NOTHING]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); mdelay(500); } } @@ -2578,18 +2578,18 @@ u32 menu(u16 *screen) if(!first_load) { draw_string_vcenter(down_screen_addr, 36, 70, 190, COLOR_MSSG, msg[MSG_SAVE_SNAPSHOT]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); if(save_ss_bmp(screen)) draw_string_vcenter(down_screen_addr, 36, 90, 190, COLOR_MSSG, msg[MSG_SAVE_SNAPSHOT_COMPLETE]); else draw_string_vcenter(down_screen_addr, 36, 90, 190, COLOR_MSSG, msg[MSG_SAVE_SNAPSHOT_FAILURE]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); mdelay(500); } else { draw_string_vcenter(down_screen_addr, 36, 90, 190, COLOR_MSSG, msg[MSG_SAVESTATE_SLOT_EMPTY]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); mdelay(500); } } @@ -2746,7 +2746,7 @@ u32 menu(u16 *screen) wait_Allkey_release(0); draw_message(down_screen_addr, bg_screenp, 28, 31, 227, 165, bg_screenp_color); draw_string_vcenter(down_screen_addr, 36, 80, 190, COLOR_MSSG, msg[MSG_DEFAULT_LOADING]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); sprintf(line_buffer, "%s/%s", main_path, EMU_CONFIG_FILENAME); remove(line_buffer); @@ -2777,7 +2777,7 @@ u32 menu(u16 *screen) draw_string_vcenter(down_screen_addr, 36, 80, 190, COLOR_MSSG, msg[MSG_EMU_VERSION0]); sprintf(line_buffer, "%s %s", msg[MSG_EMU_VERSION1], NDSSFC_VERSION); draw_string_vcenter(down_screen_addr, 36, 95, 190, COLOR_MSSG, line_buffer); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); wait_Anykey_press(0); } @@ -2797,7 +2797,7 @@ u32 menu(u16 *screen) draw_message(down_screen_addr, bg_screenp, 28, 31, 227, 165, bg_screenp_color); draw_string_vcenter(down_screen_addr, 36, 75, 190, COLOR_MSSG, msg[MSG_CHANGE_LANGUAGE]); draw_string_vcenter(down_screen_addr, 36, 95, 190, COLOR_MSSG, msg[MSG_CHANGE_LANGUAGE_WAITING]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); load_language_msg(LANGUAGE_PACK, emu_config.language); gui_change_icon(emu_config.language); @@ -3405,7 +3405,7 @@ u32 menu(u16 *screen) draw_message(down_screen_addr, bg_screenp, 28, 31, 227, 165, 0); draw_string_vcenter(down_screen_addr, 36, 100, 190, COLOR_MSSG, msg[MSG_LOADING_GAME]); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); if(gamepak_name[0] != 0) { @@ -3977,7 +3977,7 @@ u32 menu(u16 *screen) break; } // end swith - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); } // end while destroy_dynamic_cheats(); if(bg_screenp != NULL) free((void*)bg_screenp); @@ -3996,7 +3996,7 @@ u32 menu(u16 *screen) ds2_clearScreen(DOWN_SCREEN, 0); ds2_flipScreen(DOWN_SCREEN, 1); copy_screen(up_screen_addr, (void*) screen, 0, 0, 256, 192); - ds2_flipScreen(UP_SCREEN, 0); + ds2_flipScreen(UP_SCREEN, UP_SCREEN_UPDATE_METHOD); ds2_setBacklight(2); wait_Allkey_release(0); @@ -4714,7 +4714,7 @@ void gui_init(u32 lang_id) } show_log(down_screen_addr); - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); flag = icon_init(lang_id); if(0 != flag) @@ -4750,7 +4750,7 @@ void gui_init(u32 lang_id) return; gui_init_err: - ds2_flipScreen(DOWN_SCREEN, 2); + ds2_flipScreen(DOWN_SCREEN, DOWN_SCREEN_UPDATE_METHOD); wait_Anykey_press(0); quit(); } -- cgit v1.2.3