mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-27 19:51:48 +01:00
various menu bugfixes
This commit is contained in:
parent
64676a0b45
commit
9204498c96
@ -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++;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -32,9 +32,6 @@
|
||||
#include <asndlib.h>
|
||||
#include <oggplayer.h>
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/* 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<<config.input[player].port)))
|
||||
{
|
||||
/* try next port */
|
||||
config.input[player].port ++;
|
||||
/* use gamecube pad */
|
||||
config.input[player].device ++;
|
||||
config.input[player].port = config.input[player].device ? 0 : (player%4);
|
||||
}
|
||||
|
||||
if (config.input[player].port >= 4)
|
||||
{
|
||||
config.input[player].port = 0;
|
||||
#ifdef HW_RVL
|
||||
/* no gamecube pad found, try wiimote+nunchuks */
|
||||
config.input[player].device = 1;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#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 */
|
||||
|
@ -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;
|
||||
|
@ -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<<chan)))
|
||||
{
|
||||
sprintf(msg, "PAD #%d is not connected !", chan+1);
|
||||
WaitPrompt(msg);
|
||||
|
||||
/* remove any pending keys */
|
||||
while (m_input.keys) VIDEO_WaitVSync();
|
||||
return;
|
||||
max_keys = 0;
|
||||
}
|
||||
|
||||
/* disable inputs update callback */
|
||||
VIDEO_SetPostRetraceCallback(NULL);
|
||||
VIDEO_Flush();
|
||||
|
||||
/* Configure each keys */
|
||||
for (i=0; i<max_keys; i++)
|
||||
{
|
||||
@ -142,6 +139,7 @@ static void pad_config(int chan, int max_keys)
|
||||
|
||||
/* update key mapping */
|
||||
if (key !=0xff) config.pad_keymap[chan][i] = key;
|
||||
else break;
|
||||
}
|
||||
|
||||
/* remove any pending keys */
|
||||
@ -169,13 +167,6 @@ static void pad_update(s8 chan, u8 i)
|
||||
set_softreset();
|
||||
}
|
||||
|
||||
/* Menu */
|
||||
else if (p & PAD_TRIGGER_Z)
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Retrieve current key mapping */
|
||||
u16 pad_keymap[MAX_KEYS];
|
||||
memcpy(pad_keymap, config.pad_keymap[chan], MAX_KEYS * sizeof(u16));
|
||||
@ -323,6 +314,10 @@ static void wpad_config(u8 chan, u8 exp, u8 max_keys)
|
||||
char msg[30];
|
||||
u32 key,p = 255;
|
||||
|
||||
/* disable inputs update callback */
|
||||
VIDEO_SetPostRetraceCallback(NULL);
|
||||
VIDEO_Flush();
|
||||
|
||||
/* Check if device is connected */
|
||||
WPAD_Probe(chan, &p);
|
||||
if (((exp > 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<max_keys; i++)
|
||||
{
|
||||
@ -415,6 +403,7 @@ static void wpad_config(u8 chan, u8 exp, u8 max_keys)
|
||||
|
||||
/* update key mapping */
|
||||
if (key != 0xff) config.wpad_keymap[exp + (chan * 3)][i] = key;
|
||||
else break;
|
||||
}
|
||||
|
||||
/* remove any pending buttons */
|
||||
@ -447,13 +436,6 @@ static void wpad_update(s8 chan, u8 i, u32 exp)
|
||||
set_softreset();
|
||||
}
|
||||
|
||||
/* Menu Request */
|
||||
else if ((p & WPAD_BUTTON_HOME) || (p & WPAD_CLASSIC_BUTTON_HOME))
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Retrieve current key mapping */
|
||||
u32 *wpad_keymap = config.wpad_keymap[exp + (3 * chan)];
|
||||
|
||||
@ -728,6 +710,21 @@ void gx_input_UpdateEmu(void)
|
||||
WPAD_ScanPads();
|
||||
#endif
|
||||
|
||||
/* Menu Request */
|
||||
if (PAD_ButtonsHeld(0) & PAD_TRIGGER_Z)
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HW_RVL
|
||||
if ((WPAD_ButtonsHeld(0) & WPAD_BUTTON_HOME) || (WPAD_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_HOME))
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i=0; i<MAX_DEVICES; i++)
|
||||
{
|
||||
/* clear key status */
|
||||
@ -743,6 +740,7 @@ void gx_input_UpdateEmu(void)
|
||||
else if (config.input[player].device > 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);
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.8 KiB |
Loading…
Reference in New Issue
Block a user