mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2025-02-16 20:39:15 +01:00
Add classic for the menu, some cleanup
This commit is contained in:
parent
cc6cb80401
commit
fce0db49b7
@ -641,7 +641,7 @@ uint8 C64::poll_joystick(int port)
|
||||
if (wpad->exp.type == WPAD_EXP_CLASSIC)
|
||||
held_classic = wpad->exp.classic.btns_held;
|
||||
if (wpad_other->exp.type == WPAD_EXP_CLASSIC)
|
||||
held_classic_other = wpad->exp.classic.btns_held;
|
||||
held_classic_other = wpad_other->exp.classic.btns_held;
|
||||
|
||||
if ( (held & WPAD_BUTTON_UP) || (held_classic & CLASSIC_CTRL_BUTTON_UP) )
|
||||
j &= 0xfb; // Left
|
||||
|
@ -148,8 +148,11 @@ void C64Display::Update(void)
|
||||
SDL_Rect srcrect, dstrect;
|
||||
|
||||
if (ThePrefs.DisplayOption == 0) {
|
||||
const int x_border = (DISPLAY_X - FULL_DISPLAY_X / 2) / 2;
|
||||
const int y_border = (DISPLAY_Y - FULL_DISPLAY_Y / 2) / 2;
|
||||
|
||||
/* Center, double size */
|
||||
srcrect = (SDL_Rect){32, 14, FULL_DISPLAY_X / 2, FULL_DISPLAY_Y / 2};
|
||||
srcrect = (SDL_Rect){x_border, y_border, FULL_DISPLAY_X / 2, FULL_DISPLAY_Y / 2};
|
||||
dstrect = (SDL_Rect){0, 0, FULL_DISPLAY_X, FULL_DISPLAY_Y};
|
||||
}
|
||||
else {
|
||||
|
31
Src/menu.cpp
31
Src/menu.cpp
@ -266,26 +266,37 @@ static uint32_t wait_key_press(void)
|
||||
while (1)
|
||||
{
|
||||
#if defined(GEKKO)
|
||||
Uint32 remote_keys;
|
||||
Uint32 remote_keys, classic_keys;
|
||||
WPADData *wpad, *wpad_other;
|
||||
|
||||
WPAD_ScanPads();
|
||||
remote_keys = WPAD_ButtonsDown(WPAD_CHAN_0) | WPAD_ButtonsDown(WPAD_CHAN_1);
|
||||
|
||||
if (remote_keys & WPAD_BUTTON_DOWN)
|
||||
wpad = WPAD_Data(WPAD_CHAN_0);
|
||||
wpad_other = WPAD_Data(WPAD_CHAN_1);
|
||||
remote_keys = wpad->btns_d | wpad_other->btns_d;
|
||||
classic_keys = 0;
|
||||
|
||||
// Check classic controller as well
|
||||
if (wpad->exp.type == WPAD_EXP_CLASSIC)
|
||||
classic_keys = wpad->exp.classic.btns_held | wpad_other->exp.classic.btns_held;
|
||||
|
||||
if ( (remote_keys & WPAD_BUTTON_DOWN) || (classic_keys & CLASSIC_CTRL_BUTTON_DOWN) )
|
||||
keys |= KEY_RIGHT;
|
||||
if (remote_keys & WPAD_BUTTON_UP)
|
||||
if ( (remote_keys & WPAD_BUTTON_UP) || (classic_keys & CLASSIC_CTRL_BUTTON_UP) )
|
||||
keys |= KEY_LEFT;
|
||||
if (remote_keys & WPAD_BUTTON_LEFT)
|
||||
if ( (remote_keys & WPAD_BUTTON_LEFT) || (classic_keys & CLASSIC_CTRL_BUTTON_LEFT) )
|
||||
keys |= KEY_DOWN;
|
||||
if (remote_keys & WPAD_BUTTON_RIGHT)
|
||||
if ( (remote_keys & WPAD_BUTTON_RIGHT) || (classic_keys & CLASSIC_CTRL_BUTTON_RIGHT) )
|
||||
keys |= KEY_UP;
|
||||
if (remote_keys & WPAD_BUTTON_PLUS)
|
||||
if ( (remote_keys & WPAD_BUTTON_PLUS) || (classic_keys & CLASSIC_CTRL_BUTTON_PLUS) )
|
||||
keys |= KEY_PAGEUP;
|
||||
if (remote_keys & WPAD_BUTTON_MINUS)
|
||||
if ( (remote_keys & WPAD_BUTTON_MINUS) || (classic_keys & CLASSIC_CTRL_BUTTON_MINUS) )
|
||||
keys |= KEY_PAGEDOWN;
|
||||
if (remote_keys & (WPAD_BUTTON_A | WPAD_BUTTON_2) )
|
||||
if ( (remote_keys & (WPAD_BUTTON_A | WPAD_BUTTON_2) ) ||
|
||||
(classic_keys & (CLASSIC_CTRL_BUTTON_A | CLASSIC_CTRL_BUTTON_X)) )
|
||||
keys |= KEY_SELECT;
|
||||
if (remote_keys & (WPAD_BUTTON_1 | WPAD_BUTTON_HOME) )
|
||||
if ( (remote_keys & (WPAD_BUTTON_1 | WPAD_BUTTON_HOME) ) ||
|
||||
(classic_keys & (CLASSIC_CTRL_BUTTON_B | CLASSIC_CTRL_BUTTON_Y)) )
|
||||
keys |= KEY_ESCAPE;
|
||||
#endif
|
||||
if (SDL_PollEvent(&ev))
|
||||
|
Loading…
x
Reference in New Issue
Block a user