mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-06 23:58:04 -04:00
core, linux+libretro, multiplayer adaptor support
This commit is contained in:
parent
a833e78c98
commit
1d5885dd84
9 changed files with 104 additions and 49 deletions
|
@ -85,6 +85,19 @@ static void keys_write(FILE *fn, int dev_id, const int *binds)
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; me_ctrl_actions[i].name != NULL; i++) {
|
||||
mask = me_ctrl_actions[i].mask;
|
||||
if (mask & binds[IN_BIND_OFFS(k, IN_BINDTYPE_PLAYER34)]) {
|
||||
strncpy(act, me_ctrl_actions[i].name, 31);
|
||||
fprintf(fn, "bind %s = player3 %s" NL, name, mystrip(act));
|
||||
}
|
||||
mask = me_ctrl_actions[i].mask << 16;
|
||||
if (mask & binds[IN_BIND_OFFS(k, IN_BINDTYPE_PLAYER34)]) {
|
||||
strncpy(act, me_ctrl_actions[i].name, 31);
|
||||
fprintf(fn, "bind %s = player4 %s" NL, name, mystrip(act));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; emuctrl_actions[i].name != NULL; i++) {
|
||||
mask = emuctrl_actions[i].mask;
|
||||
if (mask & binds[IN_BIND_OFFS(k, IN_BINDTYPE_EMU)]) {
|
||||
|
@ -371,12 +384,12 @@ static int parse_bind_val(const char *val, int *type)
|
|||
int player, shift = 0;
|
||||
player = atoi(val + 6) - 1;
|
||||
|
||||
if (player > 1)
|
||||
if (player > 3)
|
||||
return -1;
|
||||
if (player == 1)
|
||||
if (player & 1)
|
||||
shift = 16;
|
||||
|
||||
*type = IN_BINDTYPE_PLAYER12;
|
||||
*type = IN_BINDTYPE_PLAYER12 + (player >> 1);
|
||||
for (i = 0; me_ctrl_actions[i].name != NULL; i++) {
|
||||
if (strncasecmp(me_ctrl_actions[i].name, val + 8, strlen(val + 8)) == 0)
|
||||
return me_ctrl_actions[i].mask << shift;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue