mirror of
https://github.com/dborth/vbagx.git
synced 2024-12-26 18:51:49 +01:00
restructure GUI, add multiplayer support, utilize new trigger input structures
This commit is contained in:
parent
45dc96a3d5
commit
f19f838274
@ -50,6 +50,8 @@ extern const u32 icon_settings_png_size;
|
||||
extern const u8 icon_home_png[];
|
||||
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 u32 icon_game_cheats_png_size;
|
||||
extern const u8 icon_game_controllers_png[];
|
||||
|
BIN
source/ngc/images/icon_game_settings.png
Normal file
BIN
source/ngc/images/icon_game_settings.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
@ -713,10 +713,9 @@ static u32 DecodeJoy(unsigned short pad)
|
||||
CursorVisible = false;
|
||||
|
||||
#ifdef HW_RVL
|
||||
WPADData * wp = WPAD_Data(pad);
|
||||
CursorX = wp->ir.x;
|
||||
CursorY = wp->ir.y;
|
||||
CursorValid = wp->ir.valid;
|
||||
CursorX = userInput[pad].wpad.ir.x;
|
||||
CursorY = userInput[pad].wpad.ir.y;
|
||||
CursorValid = userInput[pad].wpad.ir.valid;
|
||||
#else
|
||||
CursorX = CursorY = CursorValid = 0;
|
||||
#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
|
||||
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
|
||||
if(
|
||||
(gc_px > 70)
|
||||
#ifdef HW_RVL
|
||||
|| (wm_sx > 70)
|
||||
|| ((wp->btns_h & WPAD_BUTTON_A) && (wp->btns_h & WPAD_BUTTON_B))
|
||||
#endif
|
||||
userInput[0].pad.substickX > 70 ||
|
||||
userInput[0].WPAD_Stick(1,0) > 70
|
||||
)
|
||||
J |= VBA_SPEED;
|
||||
|
||||
/*** Report pressed buttons (gamepads) ***/
|
||||
// Report pressed buttons (gamepads)
|
||||
int 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
|
||||
|| ( (wp->exp.type == WPAD_EXP_NONE) && (wp->btns_h & btnmap[CTRLR_WIIMOTE][i]) ) // wiimote
|
||||
|| ( (wp->exp.type == WPAD_EXP_CLASSIC) && (wp->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_NONE) && (userInput[pad].wpad.btns_h & btnmap[CTRLR_WIIMOTE][i]) ) // wiimote
|
||||
|| ( (userInput[pad].wpad.exp.type == WPAD_EXP_CLASSIC) && (userInput[pad].wpad.btns_h & btnmap[CTRLR_CLASSIC][i]) ) // classic controller
|
||||
|| ( (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
|
||||
#endif
|
||||
)
|
||||
@ -883,36 +872,25 @@ static u32 DecodeJoy(unsigned short 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
|
||||
if ((gc_px < -70)
|
||||
#ifdef HW_RVL
|
||||
|| (wm_pb & WPAD_BUTTON_HOME)
|
||||
|| (wm_pb & WPAD_CLASSIC_BUTTON_HOME)
|
||||
|| (DownUsbKeys[KB_ESC])
|
||||
#endif
|
||||
if (
|
||||
(userInput[pad].pad.substickX < -70) ||
|
||||
(userInput[pad].wpad.btns_d & WPAD_BUTTON_HOME) ||
|
||||
(userInput[pad].wpad.btns_d & WPAD_CLASSIC_BUTTON_HOME) ||
|
||||
(DownUsbKeys[KB_ESC])
|
||||
)
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
updateRumbleFrame();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
u32 J = DecodeJoy(pad);
|
||||
// don't allow up+down or left+right
|
||||
if ((J & 48) == 48)
|
||||
J &= ~16;
|
||||
if ((J & 192) == 192)
|
||||
J &= ~128;
|
||||
updateRumbleFrame();
|
||||
return J;
|
||||
}
|
||||
|
||||
u32 J = DecodeJoy(pad);
|
||||
// don't allow up+down or left+right
|
||||
if ((J & 48) == 48)
|
||||
J &= ~16;
|
||||
if ((J & 192) == 192)
|
||||
J &= ~128;
|
||||
updateRumbleFrame();
|
||||
return J;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -30,9 +30,6 @@ enum
|
||||
MENU_EXIT = -1,
|
||||
MENU_NONE,
|
||||
MENU_SETTINGS,
|
||||
MENU_SETTINGS_MAPPINGS,
|
||||
MENU_SETTINGS_MAPPINGS_MAP,
|
||||
MENU_SETTINGS_VIDEO,
|
||||
MENU_SETTINGS_FILE,
|
||||
MENU_SETTINGS_MENU,
|
||||
MENU_SETTINGS_NETWORK,
|
||||
@ -40,7 +37,11 @@ enum
|
||||
MENU_GAME,
|
||||
MENU_GAME_SAVE,
|
||||
MENU_GAME_LOAD,
|
||||
MENU_GAME_CHEATS
|
||||
MENU_GAMESETTINGS,
|
||||
MENU_GAMESETTINGS_MAPPINGS,
|
||||
MENU_GAMESETTINGS_MAPPINGS_MAP,
|
||||
MENU_GAMESETTINGS_VIDEO,
|
||||
MENU_GAMESETTINGS_CHEATS
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -531,6 +531,7 @@ bool systemReadJoypads()
|
||||
|
||||
u32 systemReadJoypad(int which)
|
||||
{
|
||||
if(which == -1) which = 0; // default joypad
|
||||
return GetJoy(which);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user