diff --git a/source/gx/fileio/file_dvd.c b/source/gx/fileio/file_dvd.c index 7965995..df7c04c 100644 --- a/source/gx/fileio/file_dvd.c +++ b/source/gx/fileio/file_dvd.c @@ -265,7 +265,7 @@ int DVD_ParseDirectory () while (getentry (filecount)) { - if (!strcmp(filelist[filecount].filename,".") && (filecount < MAXFILES)) + if (strcmp(filelist[filecount].filename,".") && (filecount < MAXFILES)) filecount++; } diff --git a/source/gx/gui/filesel.c b/source/gx/gui/filesel.c index 3cda2d1..3790da2 100644 --- a/source/gx/gui/filesel.c +++ b/source/gx/gui/filesel.c @@ -238,17 +238,16 @@ int FileSelector(unsigned char *buffer) if (bg_filesel[8].texture) bg_filesel[8].state |= IMAGE_VISIBLE; } } - + strcpy(action_select.comment,"Load ROM File"); + } + else + { /* update helper */ if (!strcmp(filelist[selection].filename,"..")) strcpy(action_select.comment,"Previous Directory"); else strcpy(action_select.comment,"Open Directory"); } - else - { - strcpy(action_select.comment,"Load ROM File"); - } /* Draw menu*/ GUI_DrawMenu(m); diff --git a/source/gx/gui/menu.c b/source/gx/gui/menu.c index 6a90dd1..d272e4a 100644 --- a/source/gx/gui/menu.c +++ b/source/gx/gui/menu.c @@ -32,9 +32,6 @@ #include #include -/* Global datas */ -t_input_menu m_input; - #ifdef HW_RVL gx_texture *w_pointer; #endif @@ -889,7 +886,7 @@ void GUI_FadeOut() { gxDrawRectangle(0, 0, 640, 480, alpha, (GXColor)BLACK); gxSetScreen(); - alpha ++; + alpha +=2; } } @@ -1961,7 +1958,12 @@ static void ctrlmenu_raz(void) if (input.dev[5] != NO_DEVICE) { m->buttons[6].shift[1] = 1; - if (input.dev[6] != NO_DEVICE) m->buttons[7].shift[1] = 1; + if (input.dev[6] != NO_DEVICE) + { + m->buttons[7].shift[1] = 1; + if (input.dev[7] != NO_DEVICE) m->buttons[8].shift[1] = 1; + else m->buttons[8].shift[1] = 0; + } else m->buttons[7].shift[1] = 0; } else m->buttons[6].shift[1] = 0; @@ -2280,6 +2282,7 @@ static void ctrlmenu(void) m->buttons[11].shift[2] = 11 - m->selected; m->buttons[12].shift[2] = 12 - m->selected; GUI_DrawMenuFX(m, 20, 0); + m->selected = 10; /* update title */ if (j_cart && (player > 1)) @@ -2289,53 +2292,36 @@ static void ctrlmenu(void) break; case 10: /* specific option */ - *special ^= 1; - if (config.input[player].device == 1) + if (special == &config.input[player].padtype) { - /* force 3-Buttons pad */ - config.input[player].padtype = DEVICE_3BUTTON; + if (config.input[player].device == 1) break; + config.input[player].padtype ^= 1; + io_reset(); + } + else + { + *special ^= 1; } - io_reset(); /* update menu items */ memcpy(&m->items[10],&items[*special],sizeof(gui_item)); break; case 11: /* input controller selection */ - +#ifdef HW_RVL /* no input device */ - if (config.input[player].device < 0) - { - /* use gamecube pad */ - config.input[player].device = 0; - config.input[player].port = 0; - } - else + if (config.input[player].device > 0) { /* use next port */ config.input[player].port ++; } - - /* autodetect connected gamepads */ - if (config.input[player].device == 0) + else { - while ((config.input[player].port<4) && !(PAD_ScanPads() & (1<= 4) - { - config.input[player].port = 0; -#ifdef HW_RVL - /* no gamecube pad found, try wiimote+nunchuks */ - config.input[player].device = 1; -#endif - } + /* use gamecube pad */ + config.input[player].device ++; + config.input[player].port = config.input[player].device ? 0 : (player%4); } -#ifdef HW_RVL /* autodetect connected wiimotes (without nunchuk) */ if (config.input[player].device == 1) { @@ -2417,8 +2403,8 @@ static void ctrlmenu(void) if (config.input[player].port >= 4) { /* no classic controller found, use default gamecube pad */ - config.input[player].port = 0; config.input[player].device = 0; + config.input[player].port = player%4; } } @@ -2428,6 +2414,11 @@ static void ctrlmenu(void) config.input[player].padtype = DEVICE_3BUTTON; memcpy(&m->items[10],&items[*special],sizeof(gui_item)); } + +#else + /* use gamecube pad */ + config.input[player].device = 0; + config.input[player].port = player%4; #endif /* update menu items */ diff --git a/source/gx/gui/menu.h b/source/gx/gui/menu.h index be7531e..07ba441 100644 --- a/source/gx/gui/menu.h +++ b/source/gx/gui/menu.h @@ -171,15 +171,6 @@ extern const u32 button_over_pcm_size; /* Generic GUI structures */ /*****************************************************************************/ -/* Menu Inputs */ -typedef struct -{ - u16 keys; -#ifdef HW_RVL - struct ir_t ir; -#endif -} t_input_menu; - /* Item descriptor*/ typedef struct { @@ -242,10 +233,19 @@ typedef struct bool screenshot; /* use gamescreen as background */ } gui_menu; +/* Menu Inputs */ +struct t_input_menu +{ + u32 connected; + u16 keys; +#ifdef HW_RVL + struct ir_t ir; +#endif +} m_input; + /* Global data */ extern u8 SILENT; -extern t_input_menu m_input; #ifdef HW_RVL extern gx_texture *w_pointer; diff --git a/source/gx/gx_input.c b/source/gx/gx_input.c index 7e78e38..49fcb16 100644 --- a/source/gx/gx_input.c +++ b/source/gx/gx_input.c @@ -89,21 +89,18 @@ static void pad_config(int chan, int max_keys) u16 p,key; char msg[30]; + /* disable inputs update callback */ + VIDEO_SetPostRetraceCallback(NULL); + VIDEO_Flush(); + /* Check if PAD is connected */ if (!(PAD_ScanPads() & (1< WPAD_EXP_NONE) && (p != exp)) || (p == 255)) @@ -331,16 +326,9 @@ static void wpad_config(u8 chan, u8 exp, u8 max_keys) if (exp == WPAD_EXP_NUNCHUK) sprintf(msg, "NUNCHUK #%d is not connected !", chan+1); if (exp == WPAD_EXP_CLASSIC) sprintf(msg, "CLASSIC #%d is not connected !", chan+1); WaitPrompt(msg); - - /* remove any pending buttons */ - while (m_input.keys) VIDEO_WaitVSync(); - return; + max_keys = 0; } - /* disable inputs update callback */ - VIDEO_SetPostRetraceCallback(NULL); - VIDEO_Flush(); - /* loop on each mapped keys */ for (i=0; i 0) wpad_update(config.input[player].port,i, config.input[player].device - 1); #endif + player ++; } } @@ -752,7 +750,7 @@ void gx_input_UpdateEmu(void) void gx_input_UpdateMenu(u32 cnt) { /* PAD status update */ - PAD_ScanPads(); + m_input.connected = PAD_ScanPads(); /* PAD pressed keys */ s16 pp = PAD_ButtonsDown(0); diff --git a/source/gx/images/generic_openhand.png b/source/gx/images/generic_openhand.png deleted file mode 100644 index c378c1b..0000000 Binary files a/source/gx/images/generic_openhand.png and /dev/null differ