mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-27 03:31:49 +01:00
. modified ASNDLIB handling
. added support for configurable menu key combo on gamecube controllers, also C-Stick is now always used by default as additional menu key. .[wii] forced wiimote & classical controllers HOME button( port #1 only) as default menu keys, even when not configured as input devices .[gamecube] added switchable progressive video mode when component cable is detected (hold B on startup to switch mode, default is 480p).
This commit is contained in:
parent
d042eebd83
commit
9f6c9b83aa
@ -50,22 +50,30 @@ static int config_load(void)
|
||||
FILE *fp = fopen(fname, "rb");
|
||||
if (fp)
|
||||
{
|
||||
/* read version */
|
||||
char version[16];
|
||||
fread(version, 16, 1, fp);
|
||||
/* check file size */
|
||||
fseek(fp, 0, SEEK_END);
|
||||
if (ftell(fp) != sizeof(config))
|
||||
{
|
||||
fclose(fp);
|
||||
if (strncmp(version,CONFIG_VERSION,16))
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* check version */
|
||||
char version[16];
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
fread(version, 16, 1, fp);
|
||||
if (strncmp(version,CONFIG_VERSION,16))
|
||||
{
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* read file */
|
||||
fp = fopen(fname, "rb");
|
||||
if (fp)
|
||||
{
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
fread(&config, sizeof(config), 1, fp);
|
||||
fclose(fp);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -169,6 +177,7 @@ void config_default(void)
|
||||
config.s_auto = 1;
|
||||
#else
|
||||
config.s_auto = 0;
|
||||
config.v_prog = 1;
|
||||
#endif
|
||||
config.s_default = 1;
|
||||
config.s_device = 0;
|
||||
|
@ -89,9 +89,11 @@ typedef struct
|
||||
#ifdef HW_RVL
|
||||
uint32 trap;
|
||||
float gamma;
|
||||
#else
|
||||
uint8 v_prog;
|
||||
#endif
|
||||
t_input_config input[MAX_INPUTS];
|
||||
uint16 pad_keymap[4][MAX_KEYS];
|
||||
uint16 pad_keymap[4][MAX_KEYS+1];
|
||||
#ifdef HW_RVL
|
||||
uint32 wpad_keymap[4*3][MAX_KEYS];
|
||||
#endif
|
||||
|
@ -102,7 +102,7 @@ void legal ()
|
||||
gxSetScreen();
|
||||
sleep(1);
|
||||
|
||||
while (!(m_input.keys & PAD_BUTTON_A) && (count > 0))
|
||||
while (!m_input.keys && count)
|
||||
{
|
||||
gxClearScreen((GXColor)BLACK);
|
||||
show_disclaimer(56);
|
||||
@ -120,15 +120,37 @@ void legal ()
|
||||
gxTextureClose(&button);
|
||||
gxTextureClose(&logo);
|
||||
|
||||
|
||||
#ifndef HW_RVL
|
||||
/* detect video mode switch user request */
|
||||
if (PAD_ButtonsHeld(0) & PAD_BUTTON_B)
|
||||
{
|
||||
/* switch user progressive mode configuration */
|
||||
config.v_prog ^= 1;
|
||||
|
||||
if (VIDEO_HaveComponentCable())
|
||||
{
|
||||
/* switch video mode only if component cable has been detected */
|
||||
vmode = config.v_prog ? &TVNtsc480Prog : &TVNtsc480IntDf;
|
||||
}
|
||||
|
||||
/* play sound to inform user then enter main menu */
|
||||
ASND_Pause(0);
|
||||
int voice = ASND_GetFirstUnusedVoice();
|
||||
ASND_SetVoice(voice,VOICE_MONO_16BIT,44100,0,(u8 *)intro_pcm,intro_pcm_size,200,200,NULL);
|
||||
sleep (2);
|
||||
ASND_Pause(1);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
ASND_Init();
|
||||
ASND_Pause(0);
|
||||
int voice = ASND_GetFirstUnusedVoice();
|
||||
ASND_SetVoice(voice,VOICE_MONO_16BIT,44100,0,(u8 *)button_select_pcm,button_select_pcm_size,200,200,NULL);
|
||||
GUI_FadeOut();
|
||||
ASND_Pause(1);
|
||||
ASND_End();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2431,6 +2431,7 @@ static void ctrlmenu(void)
|
||||
exp = 0;
|
||||
while ((config.input[player].port < 4) && !exp)
|
||||
{
|
||||
VIDEO_WaitVSync ();
|
||||
exp = PAD_ScanPads() & (1<<config.input[player].port);
|
||||
if (!exp) config.input[player].port ++;
|
||||
}
|
||||
@ -3644,9 +3645,17 @@ void mainmenu(void)
|
||||
}
|
||||
|
||||
/*** Remove any still held buttons ***/
|
||||
while (PAD_ButtonsHeld(0)) PAD_ScanPads();
|
||||
while (PAD_ButtonsHeld(0))
|
||||
{
|
||||
VIDEO_WaitVSync();
|
||||
PAD_ScanPads();
|
||||
}
|
||||
#ifdef HW_RVL
|
||||
while (WPAD_ButtonsHeld(0)) WPAD_ScanPads();
|
||||
while (WPAD_ButtonsHeld(0))
|
||||
{
|
||||
VIDEO_WaitVSync();
|
||||
WPAD_ScanPads();
|
||||
}
|
||||
gxTextureClose(&w_pointer);
|
||||
|
||||
/* USB Mouse support */
|
||||
|
@ -179,9 +179,9 @@ void gx_audio_Start(void)
|
||||
|
||||
/* shutdown menu audio processing */
|
||||
ASND_Pause(1);
|
||||
ASND_End();
|
||||
AUDIO_StopDMA();
|
||||
AUDIO_RegisterDMACallback(NULL);
|
||||
DSP_Halt();
|
||||
|
||||
/* when VSYNC is forced OFF or AUTO with TV mode not matching emulated video mode, emulation is synchronized with Audio Hardware */
|
||||
if (!config.vsync || (config.tv_mode == !vdp_pal))
|
||||
@ -206,7 +206,6 @@ void gx_audio_Start(void)
|
||||
void gx_audio_Stop(void)
|
||||
{
|
||||
/* restart menu audio processing */
|
||||
DSP_Unhalt();
|
||||
ASND_Init();
|
||||
ASND_Pause(0);
|
||||
|
||||
|
@ -67,6 +67,7 @@
|
||||
#define KEY_BUTTONY 5
|
||||
#define KEY_BUTTONZ 6
|
||||
#define KEY_MODE 7
|
||||
#define KEY_MENU 8
|
||||
|
||||
#ifdef HW_RVL
|
||||
|
||||
@ -103,18 +104,21 @@ static int inputs_disabled = 0;
|
||||
/***************************************************************************************/
|
||||
static void pad_config(int chan, int first_key, int last_key)
|
||||
{
|
||||
u16 p,key;
|
||||
u16 p = 0;
|
||||
char msg[64];
|
||||
|
||||
/* Disable menu inputs update */
|
||||
/* disable background PAD scanning */
|
||||
inputs_disabled = 1;
|
||||
|
||||
/* Check if PAD is connected */
|
||||
VIDEO_WaitVSync();
|
||||
if (!(PAD_ScanPads() & (1<<chan)))
|
||||
{
|
||||
/* restore inputs update callback */
|
||||
sprintf(msg, "PAD #%d is not connected !", chan+1);
|
||||
GUI_WaitPrompt("Error",msg);
|
||||
|
||||
/* re-enable background PAD scanning and exit */
|
||||
inputs_disabled = 0;
|
||||
return;
|
||||
}
|
||||
@ -122,7 +126,7 @@ static void pad_config(int chan, int first_key, int last_key)
|
||||
/* Configure each keys */
|
||||
do
|
||||
{
|
||||
/* check for unused keys */
|
||||
/* ignore unused keys */
|
||||
if (strcmp(keyname[first_key], "N.A"))
|
||||
{
|
||||
/* remove any pending keys */
|
||||
@ -132,35 +136,35 @@ static void pad_config(int chan, int first_key, int last_key)
|
||||
PAD_ScanPads();
|
||||
}
|
||||
|
||||
/* wait for user input */
|
||||
/* configurable button */
|
||||
sprintf(msg,"Press key for %s\n(D-PAD to return)",keyname[first_key]);
|
||||
GUI_MsgBoxUpdate(0,msg);
|
||||
|
||||
key = 0;
|
||||
while (!key)
|
||||
/* wait for user input */
|
||||
p = 0;
|
||||
while (!p)
|
||||
{
|
||||
/* update PAD status */
|
||||
VIDEO_WaitVSync();
|
||||
PAD_ScanPads();
|
||||
p = PAD_ButtonsDown(chan);
|
||||
|
||||
/* find pressed key */
|
||||
if (p & PAD_BUTTON_A) key = PAD_BUTTON_A;
|
||||
else if (p & PAD_BUTTON_B) key = PAD_BUTTON_B;
|
||||
else if (p & PAD_BUTTON_X) key = PAD_BUTTON_X;
|
||||
else if (p & PAD_BUTTON_Y) key = PAD_BUTTON_Y;
|
||||
else if (p & PAD_TRIGGER_R) key = PAD_TRIGGER_R;
|
||||
else if (p & PAD_TRIGGER_L) key = PAD_TRIGGER_L;
|
||||
else if (p & PAD_TRIGGER_Z) key = PAD_TRIGGER_Z;
|
||||
else if (p & PAD_BUTTON_START) key = PAD_BUTTON_START;
|
||||
else if (p) key = 0xff;
|
||||
}
|
||||
|
||||
/* exit */
|
||||
if (key == 0xff) break;
|
||||
/* find pressed key */
|
||||
if (p & PAD_BUTTON_A) p = PAD_BUTTON_A;
|
||||
else if (p & PAD_BUTTON_B) p = PAD_BUTTON_B;
|
||||
else if (p & PAD_BUTTON_X) p = PAD_BUTTON_X;
|
||||
else if (p & PAD_BUTTON_Y) p = PAD_BUTTON_Y;
|
||||
else if (p & PAD_TRIGGER_R) p = PAD_TRIGGER_R;
|
||||
else if (p & PAD_TRIGGER_L) p = PAD_TRIGGER_L;
|
||||
else if (p & PAD_TRIGGER_Z) p = PAD_TRIGGER_Z;
|
||||
else if (p & PAD_BUTTON_START) p = PAD_BUTTON_START;
|
||||
else first_key = MAX_KEYS;
|
||||
|
||||
/* update key mapping */
|
||||
config.pad_keymap[chan][first_key] = key;
|
||||
if (first_key < MAX_KEYS)
|
||||
{
|
||||
config.pad_keymap[chan][first_key] = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (first_key++ < last_key);
|
||||
@ -172,7 +176,35 @@ static void pad_config(int chan, int first_key, int last_key)
|
||||
PAD_ScanPads();
|
||||
}
|
||||
|
||||
/* enable menu inputs update */
|
||||
/* Configurable menu key */
|
||||
GUI_MsgBoxUpdate(0,"Press key(s) for MENU");
|
||||
|
||||
/* reset key combo */
|
||||
config.pad_keymap[chan][KEY_MENU] = 0;
|
||||
|
||||
/* wait for user input */
|
||||
p = 0;
|
||||
while (!p)
|
||||
{
|
||||
/* update PAD status */
|
||||
VIDEO_WaitVSync();
|
||||
PAD_ScanPads();
|
||||
p = PAD_ButtonsHeld(chan);
|
||||
}
|
||||
|
||||
/* register keys until none are pressed anymore */
|
||||
while (p)
|
||||
{
|
||||
/* update key combo */
|
||||
config.pad_keymap[chan][KEY_MENU] |= p;
|
||||
|
||||
/* update PAD status */
|
||||
VIDEO_WaitVSync();
|
||||
PAD_ScanPads();
|
||||
p = PAD_ButtonsHeld(chan);
|
||||
}
|
||||
|
||||
/* re-enable background PAD scanning and exit */
|
||||
inputs_disabled = 0;
|
||||
}
|
||||
|
||||
@ -183,16 +215,16 @@ static void pad_update(s8 chan, u8 i)
|
||||
s8 x = PAD_StickX (chan);
|
||||
s8 y = PAD_StickY (chan);
|
||||
|
||||
/* Menu Combo */
|
||||
if ((p & PAD_TRIGGER_Z) && (p & (PAD_BUTTON_UP | PAD_BUTTON_DOWN | PAD_BUTTON_LEFT | PAD_BUTTON_RIGHT)))
|
||||
/* Retrieve current key mapping */
|
||||
u16 *pad_keymap = config.pad_keymap[chan];
|
||||
|
||||
/* User configurable menu combo */
|
||||
if ((p & pad_keymap[KEY_MENU]) == pad_keymap[KEY_MENU])
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Retrieve current key mapping */
|
||||
u16 *pad_keymap = config.pad_keymap[chan];
|
||||
|
||||
/* Emulated device */
|
||||
switch (input.dev[i])
|
||||
{
|
||||
@ -203,10 +235,19 @@ static void pad_update(s8 chan, u8 i)
|
||||
if (p & pad_keymap[KEY_BUTTONY]) input.pad[i] |= INPUT_Y;
|
||||
if (p & pad_keymap[KEY_BUTTONZ]) input.pad[i] |= INPUT_Z;
|
||||
if (p & pad_keymap[KEY_MODE]) input.pad[i] |= INPUT_MODE;
|
||||
|
||||
/* default inputs are checked below */
|
||||
}
|
||||
|
||||
case DEVICE_PAD3B:
|
||||
{
|
||||
/* Default menu key (right analog stick) */
|
||||
if (PAD_SubStickX(chan) > ANALOG_SENSITIVITY)
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* D-PAD */
|
||||
if ((p & PAD_BUTTON_UP) || (y > ANALOG_SENSITIVITY)) input.pad[i] |= INPUT_UP;
|
||||
else if ((p & PAD_BUTTON_DOWN) || (y < -ANALOG_SENSITIVITY)) input.pad[i] |= INPUT_DOWN;
|
||||
@ -259,10 +300,19 @@ static void pad_update(s8 chan, u8 i)
|
||||
{
|
||||
/* Y analog position [0-255] */
|
||||
input.analog[i][1] = y ? (127 - y) : (128 - y);
|
||||
|
||||
/* default inputs are checked below */
|
||||
}
|
||||
|
||||
case DEVICE_PADDLE:
|
||||
{
|
||||
/* Default menu key (right analog stick) */
|
||||
if (PAD_SubStickX(chan) > ANALOG_SENSITIVITY)
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* X analog position [0-255] */
|
||||
input.analog[i][0] = (x + 128);
|
||||
|
||||
@ -276,6 +326,13 @@ static void pad_update(s8 chan, u8 i)
|
||||
|
||||
case DEVICE_PAD2B:
|
||||
{
|
||||
/* Default menu key (right analog stick) */
|
||||
if (PAD_SubStickX(chan) > ANALOG_SENSITIVITY)
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* D-PAD */
|
||||
if ((p & PAD_BUTTON_UP) || (y > ANALOG_SENSITIVITY)) input.pad[i] |= INPUT_UP;
|
||||
else if ((p & PAD_BUTTON_DOWN) || (y < -ANALOG_SENSITIVITY)) input.pad[i] |= INPUT_DOWN;
|
||||
@ -292,6 +349,13 @@ static void pad_update(s8 chan, u8 i)
|
||||
|
||||
case DEVICE_LIGHTGUN:
|
||||
{
|
||||
/* Default menu key (right analog stick) */
|
||||
if (PAD_SubStickX(chan) > ANALOG_SENSITIVITY)
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Gun screen position (x,y) */
|
||||
input.analog[i][0] += x / ANALOG_SENSITIVITY;
|
||||
input.analog[i][1] -= y / ANALOG_SENSITIVITY;
|
||||
@ -313,6 +377,13 @@ static void pad_update(s8 chan, u8 i)
|
||||
|
||||
case DEVICE_MOUSE:
|
||||
{
|
||||
/* Default menu key (right analog stick) */
|
||||
if (PAD_SubStickX(chan) > ANALOG_SENSITIVITY)
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Mouse relative movement (-255,255) */
|
||||
input.analog[i][0] = (x / ANALOG_SENSITIVITY) * 2;
|
||||
input.analog[i][1] = (y / ANALOG_SENSITIVITY) * 2;
|
||||
@ -334,6 +405,13 @@ static void pad_update(s8 chan, u8 i)
|
||||
|
||||
case DEVICE_PICO:
|
||||
{
|
||||
/* Default menu key (right analog stick) */
|
||||
if (PAD_SubStickX(chan) > ANALOG_SENSITIVITY)
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* D-PAD */
|
||||
if (p & PAD_BUTTON_UP) input.pad[i] |= INPUT_UP;
|
||||
else if (p & PAD_BUTTON_DOWN) input.pad[i] |= INPUT_DOWN;
|
||||
@ -359,6 +437,13 @@ static void pad_update(s8 chan, u8 i)
|
||||
|
||||
case DEVICE_TEREBI:
|
||||
{
|
||||
/* Default menu key (right analog stick) */
|
||||
if (PAD_SubStickX(chan) > ANALOG_SENSITIVITY)
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* PEN screen position (x,y) */
|
||||
input.analog[0][0] += x / ANALOG_SENSITIVITY;
|
||||
input.analog[0][1] -= y / ANALOG_SENSITIVITY;
|
||||
@ -518,108 +603,112 @@ static int wpad_StickY(WPADData *data, u8 right)
|
||||
static void wpad_config(u8 exp, int chan, int first_key, int last_key)
|
||||
{
|
||||
char msg[64];
|
||||
u32 key,p = 255;
|
||||
u32 p = 255;
|
||||
|
||||
/* Disable menu inputs update */
|
||||
/* Disable background PAD scanning */
|
||||
inputs_disabled = 1;
|
||||
|
||||
/* Check if device is connected */
|
||||
WPAD_Probe(chan, &p);
|
||||
if (((exp > WPAD_EXP_NONE) && (p != exp)) || (p == 255))
|
||||
{
|
||||
/* device not detected */
|
||||
if (exp == WPAD_EXP_NONE) sprintf(msg, "WIIMOTE #%d is not connected !", chan+1);
|
||||
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);
|
||||
GUI_WaitPrompt("Error",msg);
|
||||
|
||||
/* re-enable background PAD scanning and exit */
|
||||
inputs_disabled = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* loop on each mapped keys */
|
||||
/* Configure each keys */
|
||||
do
|
||||
{
|
||||
/* check for unused keys */
|
||||
/* ignore unused keys */
|
||||
if (strcmp(keyname[first_key], "N.A"))
|
||||
{
|
||||
/* remove any pending buttons */
|
||||
while (WPAD_ButtonsHeld(chan))
|
||||
{
|
||||
WPAD_ScanPads();
|
||||
VIDEO_WaitVSync();
|
||||
WPAD_ScanPads();
|
||||
}
|
||||
|
||||
/* wait for user input */
|
||||
/* configurable button */
|
||||
sprintf(msg,"Press key for %s\n(HOME to return)",keyname[first_key]);
|
||||
GUI_MsgBoxUpdate(0,msg);
|
||||
|
||||
/* wait for input */
|
||||
key = 0;
|
||||
while (!key)
|
||||
/* wait for user input */
|
||||
p = 0;
|
||||
while (!p)
|
||||
{
|
||||
VIDEO_WaitVSync();
|
||||
WPAD_ScanPads();
|
||||
p = WPAD_ButtonsDown(chan);
|
||||
}
|
||||
|
||||
/* detect pressed key */
|
||||
switch (exp)
|
||||
{
|
||||
/* Wiimote (TODO: add motion sensing !) */
|
||||
case WPAD_EXP_NONE:
|
||||
{
|
||||
if (p & WPAD_BUTTON_HOME) key = 0xff;
|
||||
else if (p & WPAD_BUTTON_2) key = WPAD_BUTTON_2;
|
||||
else if (p & WPAD_BUTTON_1) key = WPAD_BUTTON_1;
|
||||
else if (p & WPAD_BUTTON_B) key = WPAD_BUTTON_B;
|
||||
else if (p & WPAD_BUTTON_A) key = WPAD_BUTTON_A;
|
||||
else if (p & WPAD_BUTTON_PLUS) key = WPAD_BUTTON_PLUS;
|
||||
else if (p & WPAD_BUTTON_MINUS) key = WPAD_BUTTON_MINUS;
|
||||
if (p & WPAD_BUTTON_2) p = WPAD_BUTTON_2;
|
||||
else if (p & WPAD_BUTTON_1) p = WPAD_BUTTON_1;
|
||||
else if (p & WPAD_BUTTON_B) p = WPAD_BUTTON_B;
|
||||
else if (p & WPAD_BUTTON_A) p = WPAD_BUTTON_A;
|
||||
else if (p & WPAD_BUTTON_PLUS) p = WPAD_BUTTON_PLUS;
|
||||
else if (p & WPAD_BUTTON_MINUS) p = WPAD_BUTTON_MINUS;
|
||||
else first_key = MAX_KEYS;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Wiimote + Nunchuk (TODO: add motion sensing !) */
|
||||
case WPAD_EXP_NUNCHUK:
|
||||
{
|
||||
if (p & WPAD_BUTTON_HOME) key = 0xff;
|
||||
else if (p & WPAD_BUTTON_2) key = WPAD_BUTTON_2;
|
||||
else if (p & WPAD_BUTTON_1) key = WPAD_BUTTON_1;
|
||||
else if (p & WPAD_BUTTON_B) key = WPAD_BUTTON_B;
|
||||
else if (p & WPAD_BUTTON_A) key = WPAD_BUTTON_A;
|
||||
else if (p & WPAD_BUTTON_PLUS) key = WPAD_BUTTON_PLUS;
|
||||
else if (p & WPAD_BUTTON_MINUS) key = WPAD_BUTTON_MINUS;
|
||||
else if (p & WPAD_NUNCHUK_BUTTON_Z) key = WPAD_NUNCHUK_BUTTON_Z;
|
||||
else if (p & WPAD_NUNCHUK_BUTTON_C) key = WPAD_NUNCHUK_BUTTON_C;
|
||||
if (p & WPAD_BUTTON_2) p = WPAD_BUTTON_2;
|
||||
else if (p & WPAD_BUTTON_1) p = WPAD_BUTTON_1;
|
||||
else if (p & WPAD_BUTTON_B) p = WPAD_BUTTON_B;
|
||||
else if (p & WPAD_BUTTON_A) p = WPAD_BUTTON_A;
|
||||
else if (p & WPAD_BUTTON_PLUS) p = WPAD_BUTTON_PLUS;
|
||||
else if (p & WPAD_BUTTON_MINUS) p= WPAD_BUTTON_MINUS;
|
||||
else if (p & WPAD_NUNCHUK_BUTTON_Z) p = WPAD_NUNCHUK_BUTTON_Z;
|
||||
else if (p & WPAD_NUNCHUK_BUTTON_C) p = WPAD_NUNCHUK_BUTTON_C;
|
||||
else first_key = MAX_KEYS;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Classic Controller */
|
||||
case WPAD_EXP_CLASSIC:
|
||||
{
|
||||
if (p & WPAD_CLASSIC_BUTTON_HOME) key = 0xff;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_X) key = WPAD_CLASSIC_BUTTON_X;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_A) key = WPAD_CLASSIC_BUTTON_A;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_Y) key = WPAD_CLASSIC_BUTTON_Y;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_B) key = WPAD_CLASSIC_BUTTON_B;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_ZL) key = WPAD_CLASSIC_BUTTON_ZL;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_ZR) key = WPAD_CLASSIC_BUTTON_ZR;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_PLUS) key = WPAD_CLASSIC_BUTTON_PLUS;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_MINUS) key = WPAD_CLASSIC_BUTTON_MINUS;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_FULL_L) key = WPAD_CLASSIC_BUTTON_FULL_L;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_FULL_R) key = WPAD_CLASSIC_BUTTON_FULL_R;
|
||||
if (p & WPAD_CLASSIC_BUTTON_X) p = WPAD_CLASSIC_BUTTON_X;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_A) p = WPAD_CLASSIC_BUTTON_A;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_Y) p = WPAD_CLASSIC_BUTTON_Y;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_B) p = WPAD_CLASSIC_BUTTON_B;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_ZL) p = WPAD_CLASSIC_BUTTON_ZL;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_ZR) p = WPAD_CLASSIC_BUTTON_ZR;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_PLUS) p = WPAD_CLASSIC_BUTTON_PLUS;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_MINUS) p = WPAD_CLASSIC_BUTTON_MINUS;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_FULL_L) p = WPAD_CLASSIC_BUTTON_FULL_L;
|
||||
else if (p & WPAD_CLASSIC_BUTTON_FULL_R) p = WPAD_CLASSIC_BUTTON_FULL_R;
|
||||
else first_key = MAX_KEYS;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
key = 0xff;
|
||||
first_key = MAX_KEYS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* exit */
|
||||
if (key == 0xff) break;
|
||||
|
||||
/* update key mapping */
|
||||
config.wpad_keymap[exp + (chan * 3)][first_key] = key;
|
||||
if (first_key < MAX_KEYS)
|
||||
{
|
||||
config.wpad_keymap[exp + (chan * 3)][first_key] = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (first_key++ < last_key);
|
||||
@ -627,11 +716,11 @@ static void wpad_config(u8 exp, int chan, int first_key, int last_key)
|
||||
/* remove any pending buttons */
|
||||
while (WPAD_ButtonsHeld(chan))
|
||||
{
|
||||
WPAD_ScanPads();
|
||||
VIDEO_WaitVSync();
|
||||
WPAD_ScanPads();
|
||||
}
|
||||
|
||||
/* Enable menu inputs update */
|
||||
/* re-enable background PAD scanning and exit */
|
||||
inputs_disabled = 0;
|
||||
}
|
||||
|
||||
@ -643,13 +732,6 @@ static void wpad_update(s8 chan, u8 i, u32 exp)
|
||||
/* WPAD status */
|
||||
u32 p = data->btns_h;
|
||||
|
||||
/* Menu Key */
|
||||
if ((p & WPAD_BUTTON_HOME) || (p & WPAD_CLASSIC_BUTTON_HOME))
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Analog sticks */
|
||||
s8 x = 0;
|
||||
s8 y = 0;
|
||||
@ -1038,10 +1120,12 @@ int gx_input_FindDevices(void)
|
||||
#ifdef HW_RVL
|
||||
u32 wpad;
|
||||
#endif
|
||||
u32 pad = PAD_ScanPads();
|
||||
int found = 0;
|
||||
int player = 0;
|
||||
|
||||
VIDEO_WaitVSync();
|
||||
u32 pad = PAD_ScanPads();
|
||||
|
||||
for (i=0; i<MAX_DEVICES; i++)
|
||||
{
|
||||
/* check emulated peripheral */
|
||||
@ -1115,7 +1199,8 @@ void gx_input_SetDefault(void)
|
||||
config.pad_keymap[i][KEY_BUTTONX] = PAD_TRIGGER_L;
|
||||
config.pad_keymap[i][KEY_BUTTONY] = PAD_BUTTON_Y;
|
||||
config.pad_keymap[i][KEY_BUTTONZ] = PAD_TRIGGER_R;
|
||||
config.pad_keymap[i][KEY_MODE] = 0;
|
||||
config.pad_keymap[i][KEY_MODE] = PAD_TRIGGER_Z;
|
||||
config.pad_keymap[i][KEY_MENU] = PAD_TRIGGER_Z | PAD_BUTTON_RIGHT;
|
||||
}
|
||||
|
||||
#ifdef HW_RVL
|
||||
@ -1348,8 +1433,11 @@ void gx_input_Config(u8 chan, u8 device, u8 type)
|
||||
|
||||
default:
|
||||
{
|
||||
first_key = KEY_BUTTONA;
|
||||
last_key = KEY_BUTTONA;
|
||||
sprintf(keyname[KEY_BUTTONA],"N.A");
|
||||
GUI_WaitPrompt("Info","Activator is not configurable !");
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1374,10 +1462,20 @@ void gx_input_Config(u8 chan, u8 device, u8 type)
|
||||
|
||||
void gx_input_UpdateEmu(void)
|
||||
{
|
||||
/* Update controllers */
|
||||
/* Update GC controllers status */
|
||||
PAD_ScanPads();
|
||||
|
||||
#ifdef HW_RVL
|
||||
/* Update Wii controllers status */
|
||||
WPAD_ScanPads();
|
||||
|
||||
/* Hard-coded menu key */
|
||||
u32 p = WPAD_ButtonsHeld(0);
|
||||
if ((p & WPAD_BUTTON_HOME) || (p & WPAD_CLASSIC_BUTTON_HOME))
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
int i, player = 0;
|
||||
|
@ -1686,8 +1686,8 @@ void gx_video_Init(void)
|
||||
TV60hz_480i.viTVMode = VI_TVMODE(vmode->viTVMode >> 2, VI_INTERLACE);
|
||||
|
||||
#ifndef HW_RVL
|
||||
/* force 480p on GameCube if Component Cable is detected */
|
||||
if (VIDEO_HaveComponentCable()) vmode = &TVNtsc480Prog;
|
||||
/* force 480p on GameCube if Component Cable is detected & progressiev mode is selected */
|
||||
if (VIDEO_HaveComponentCable() && config.v_prog) vmode = &TVNtsc480Prog;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user