restructure GUI, add multiplayer support, utilize new trigger input structures

This commit is contained in:
dborth 2009-04-14 05:24:01 +00:00
parent 45dc96a3d5
commit f19f838274
6 changed files with 475 additions and 425 deletions

View File

@ -50,6 +50,8 @@ extern const u32 icon_settings_png_size;
extern const u8 icon_home_png[]; extern const u8 icon_home_png[];
extern const u32 icon_home_png_size; extern const u32 icon_home_png_size;
extern const u8 icon_game_settings_png[];
extern const u32 icon_game_settings_png_size;
extern const u8 icon_game_cheats_png[]; extern const u8 icon_game_cheats_png[];
extern const u32 icon_game_cheats_png_size; extern const u32 icon_game_cheats_png_size;
extern const u8 icon_game_controllers_png[]; extern const u8 icon_game_controllers_png[];

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -713,10 +713,9 @@ static u32 DecodeJoy(unsigned short pad)
CursorVisible = false; CursorVisible = false;
#ifdef HW_RVL #ifdef HW_RVL
WPADData * wp = WPAD_Data(pad); CursorX = userInput[pad].wpad.ir.x;
CursorX = wp->ir.x; CursorY = userInput[pad].wpad.ir.y;
CursorY = wp->ir.y; CursorValid = userInput[pad].wpad.ir.valid;
CursorValid = wp->ir.valid;
#else #else
CursorX = CursorY = CursorValid = 0; CursorX = CursorY = CursorValid = 0;
#endif #endif
@ -845,33 +844,23 @@ static u32 DecodeJoy(unsigned short pad)
// the function result, J, is a combination of flags for all the VBA buttons that are down // the function result, J, is a combination of flags for all the VBA buttons that are down
u32 J = StandardMovement(pad); u32 J = StandardMovement(pad);
signed char gc_px = PAD_SubStickX(0);
u32 jp = PAD_ButtonsHeld(pad);
#ifdef HW_RVL
signed char wm_sx = WPAD_Stick (0,1,0); // CC right joystick
#endif
// Turbo feature // Turbo feature
if( if(
(gc_px > 70) userInput[0].pad.substickX > 70 ||
#ifdef HW_RVL userInput[0].WPAD_Stick(1,0) > 70
|| (wm_sx > 70)
|| ((wp->btns_h & WPAD_BUTTON_A) && (wp->btns_h & WPAD_BUTTON_B))
#endif
) )
J |= VBA_SPEED; J |= VBA_SPEED;
/*** Report pressed buttons (gamepads) ***/ // Report pressed buttons (gamepads)
int i; int i;
for (i = 0; i < MAXJP; i++) for (i = 0; i < MAXJP; i++)
{ {
if ((jp & btnmap[CTRLR_GCPAD][i]) // gamecube controller if ((userInput[pad].pad.btns_h & btnmap[CTRLR_GCPAD][i]) // gamecube controller
#ifdef HW_RVL #ifdef HW_RVL
|| ( (wp->exp.type == WPAD_EXP_NONE) && (wp->btns_h & btnmap[CTRLR_WIIMOTE][i]) ) // wiimote || ( (userInput[pad].wpad.exp.type == WPAD_EXP_NONE) && (userInput[pad].wpad.btns_h & btnmap[CTRLR_WIIMOTE][i]) ) // wiimote
|| ( (wp->exp.type == WPAD_EXP_CLASSIC) && (wp->btns_h & btnmap[CTRLR_CLASSIC][i]) ) // classic controller || ( (userInput[pad].wpad.exp.type == WPAD_EXP_CLASSIC) && (userInput[pad].wpad.btns_h & btnmap[CTRLR_CLASSIC][i]) ) // classic controller
|| ( (wp->exp.type == WPAD_EXP_NUNCHUK) && (wp->btns_h & btnmap[CTRLR_NUNCHUK][i]) ) // nunchuk + wiimote || ( (userInput[pad].wpad.exp.type == WPAD_EXP_NUNCHUK) && (userInput[pad].wpad.btns_h & btnmap[CTRLR_NUNCHUK][i]) ) // nunchuk + wiimote
|| ( (DownUsbKeys[btnmap[CTRLR_KEYBOARD][i]]) ) // keyboard || ( (DownUsbKeys[btnmap[CTRLR_KEYBOARD][i]]) ) // keyboard
#endif #endif
) )
@ -883,36 +872,25 @@ static u32 DecodeJoy(unsigned short pad)
u32 GetJoy(int pad) u32 GetJoy(int pad)
{ {
pad = 0;
s8 gc_px = PAD_SubStickX(0);
#ifdef HW_RVL
u32 wm_pb = WPAD_ButtonsDown(0); // wiimote / expansion button info
#endif
// request to go back to menu // request to go back to menu
if ((gc_px < -70) if (
#ifdef HW_RVL (userInput[pad].pad.substickX < -70) ||
|| (wm_pb & WPAD_BUTTON_HOME) (userInput[pad].wpad.btns_d & WPAD_BUTTON_HOME) ||
|| (wm_pb & WPAD_CLASSIC_BUTTON_HOME) (userInput[pad].wpad.btns_d & WPAD_CLASSIC_BUTTON_HOME) ||
|| (DownUsbKeys[KB_ESC]) (DownUsbKeys[KB_ESC])
#endif
) )
{ {
ConfigRequested = 1; ConfigRequested = 1;
updateRumbleFrame(); updateRumbleFrame();
return 0; return 0;
} }
else
{ u32 J = DecodeJoy(pad);
u32 J = DecodeJoy(pad); // don't allow up+down or left+right
// don't allow up+down or left+right if ((J & 48) == 48)
if ((J & 48) == 48) J &= ~16;
J &= ~16; if ((J & 192) == 192)
if ((J & 192) == 192) J &= ~128;
J &= ~128; updateRumbleFrame();
updateRumbleFrame(); return J;
return J;
}
} }

File diff suppressed because it is too large Load Diff

View File

@ -30,9 +30,6 @@ enum
MENU_EXIT = -1, MENU_EXIT = -1,
MENU_NONE, MENU_NONE,
MENU_SETTINGS, MENU_SETTINGS,
MENU_SETTINGS_MAPPINGS,
MENU_SETTINGS_MAPPINGS_MAP,
MENU_SETTINGS_VIDEO,
MENU_SETTINGS_FILE, MENU_SETTINGS_FILE,
MENU_SETTINGS_MENU, MENU_SETTINGS_MENU,
MENU_SETTINGS_NETWORK, MENU_SETTINGS_NETWORK,
@ -40,7 +37,11 @@ enum
MENU_GAME, MENU_GAME,
MENU_GAME_SAVE, MENU_GAME_SAVE,
MENU_GAME_LOAD, MENU_GAME_LOAD,
MENU_GAME_CHEATS MENU_GAMESETTINGS,
MENU_GAMESETTINGS_MAPPINGS,
MENU_GAMESETTINGS_MAPPINGS_MAP,
MENU_GAMESETTINGS_VIDEO,
MENU_GAMESETTINGS_CHEATS
}; };
#endif #endif

View File

@ -531,6 +531,7 @@ bool systemReadJoypads()
u32 systemReadJoypad(int which) u32 systemReadJoypad(int which)
{ {
if(which == -1) which = 0; // default joypad
return GetJoy(which); return GetJoy(which);
} }