mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
control configurator adjustments
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@252 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
b4fe3a4a1a
commit
4549928468
2 changed files with 35 additions and 16 deletions
|
@ -617,22 +617,38 @@ static char *action_binds(int player_idx, int action_mask)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// limit..
|
||||||
|
strkeys[20] = 0;
|
||||||
|
|
||||||
return strkeys;
|
return strkeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void unbind_action(int action, int pl_idx)
|
static void unbind_action(int action, int pl_idx, int joy)
|
||||||
{
|
{
|
||||||
int i, u;
|
int i, u;
|
||||||
|
|
||||||
|
if (joy <= 0)
|
||||||
|
{
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
if (pl_idx >= 0 && (currentConfig.KeyBinds[i]&0x30000) != (pl_idx<<16)) continue;
|
if (pl_idx >= 0 && (currentConfig.KeyBinds[i]&0x30000) != (pl_idx<<16)) continue;
|
||||||
currentConfig.KeyBinds[i] &= ~action;
|
currentConfig.KeyBinds[i] &= ~action;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (joy < 0)
|
||||||
|
{
|
||||||
for (u = 0; u < 4; u++)
|
for (u = 0; u < 4; u++)
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
if (pl_idx >= 0 && (currentConfig.JoyBinds[u][i]&0x30000) != (pl_idx<<16)) continue;
|
if (pl_idx >= 0 && (currentConfig.JoyBinds[u][i]&0x30000) != (pl_idx<<16)) continue;
|
||||||
currentConfig.JoyBinds[u][i] &= ~action;
|
currentConfig.JoyBinds[u][i] &= ~action;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (joy > 0)
|
||||||
|
{
|
||||||
|
for (i = 0; i < 32; i++) {
|
||||||
|
if (pl_idx >= 0 && (currentConfig.JoyBinds[joy-1][i]&0x30000) != (pl_idx<<16)) continue;
|
||||||
|
currentConfig.JoyBinds[joy-1][i] &= ~action;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int count_bound_keys(int action, int pl_idx, int joy)
|
static int count_bound_keys(int action, int pl_idx, int joy)
|
||||||
|
@ -714,7 +730,7 @@ static void key_config_loop(const bind_action_t *opts, int opt_cnt, int player_i
|
||||||
}
|
}
|
||||||
// if we are here, we want to bind/unbind something
|
// if we are here, we want to bind/unbind something
|
||||||
if ((inp & GP2X_SELECT) && !prev_select)
|
if ((inp & GP2X_SELECT) && !prev_select)
|
||||||
unbind_action(opts[sel].mask, player_idx);
|
unbind_action(opts[sel].mask, player_idx, -1);
|
||||||
prev_select = inp & GP2X_SELECT;
|
prev_select = inp & GP2X_SELECT;
|
||||||
inp &= CONFIGURABLE_KEYS;
|
inp &= CONFIGURABLE_KEYS;
|
||||||
inp &= ~GP2X_SELECT;
|
inp &= ~GP2X_SELECT;
|
||||||
|
@ -733,12 +749,14 @@ static void key_config_loop(const bind_action_t *opts, int opt_cnt, int player_i
|
||||||
{
|
{
|
||||||
for (i = 0; i < 32; i++)
|
for (i = 0; i < 32; i++)
|
||||||
if (inp & (1 << i)) {
|
if (inp & (1 << i)) {
|
||||||
if (count_bound_keys(opts[sel].mask, player_idx, joy) >= 1) // disallow combos for usbjoy
|
int *bind = ¤tConfig.JoyBinds[joy-1][i];
|
||||||
|
if ((*bind & opts[sel].mask) && (player_idx < 0 || player_idx == ((*bind>>16)&3)))
|
||||||
currentConfig.JoyBinds[joy-1][i] &= ~opts[sel].mask;
|
currentConfig.JoyBinds[joy-1][i] &= ~opts[sel].mask;
|
||||||
else currentConfig.JoyBinds[joy-1][i] ^= opts[sel].mask;
|
else {
|
||||||
if (player_idx >= 0 && currentConfig.JoyBinds[joy-1][i] & opts[sel].mask) {
|
// override
|
||||||
currentConfig.JoyBinds[joy-1][i] &= ~(3 << 16);
|
unbind_action(opts[sel].mask, player_idx, joy);
|
||||||
currentConfig.JoyBinds[joy-1][i] |= player_idx << 16;
|
*bind = opts[sel].mask;
|
||||||
|
if (player_idx >= 0) *bind |= player_idx << 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1239,7 +1257,7 @@ static void menu_options_save(void)
|
||||||
PicoRegionOverride = currentConfig.PicoRegion;
|
PicoRegionOverride = currentConfig.PicoRegion;
|
||||||
if (!(PicoOpt & 0x20)) {
|
if (!(PicoOpt & 0x20)) {
|
||||||
// unbind XYZ MODE, just in case
|
// unbind XYZ MODE, just in case
|
||||||
unbind_action(0xf00, -1);
|
unbind_action(0xf00, -1, -1);
|
||||||
}
|
}
|
||||||
scaling_update();
|
scaling_update();
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,6 +236,7 @@ Changelog
|
||||||
* Updated serial EEPROM code to support more games. Thanks to EkeEke for
|
* Updated serial EEPROM code to support more games. Thanks to EkeEke for
|
||||||
providing info about additional EEPROM types and game mappers.
|
providing info about additional EEPROM types and game mappers.
|
||||||
* The above change fixed hang of NBA Jam.
|
* The above change fixed hang of NBA Jam.
|
||||||
|
* Minor adjustments to control configurator.
|
||||||
|
|
||||||
1.33
|
1.33
|
||||||
* Updated Cyclone core to 0.0088.
|
* Updated Cyclone core to 0.0088.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue