mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Simplify input_state analog code remapping somewhat
This commit is contained in:
parent
368becbc42
commit
0ed69fd170
@ -659,33 +659,15 @@ int16_t input_state(unsigned port, unsigned device,
|
||||
case RETRO_DEVICE_JOYPAD:
|
||||
if (id != settings->uints.input_remap_ids[port][id])
|
||||
reset_state = true;
|
||||
|
||||
break;
|
||||
case RETRO_DEVICE_ANALOG:
|
||||
if (idx < 2 && id < 2)
|
||||
{
|
||||
if (idx == 0)
|
||||
{
|
||||
if (id == 0 && settings->uints.input_remap_ids[port][16] != 16)
|
||||
reset_state = true;
|
||||
if (id == 0 && settings->uints.input_remap_ids[port][17] != 17)
|
||||
reset_state = true;
|
||||
if (id == 1 && settings->uints.input_remap_ids[port][18] != 18)
|
||||
reset_state = true;
|
||||
if (id == 1 && settings->uints.input_remap_ids[port][19] != 19)
|
||||
reset_state = true;
|
||||
}
|
||||
if (idx == 1)
|
||||
{
|
||||
if (id == 0 && settings->uints.input_remap_ids[port][20] != 20)
|
||||
reset_state = true;
|
||||
if (id == 0 && settings->uints.input_remap_ids[port][21] != 21)
|
||||
reset_state = true;
|
||||
if (id == 1 && settings->uints.input_remap_ids[port][22] != 22)
|
||||
reset_state = true;
|
||||
if (id == 1 && settings->uints.input_remap_ids[port][23] != 23)
|
||||
reset_state = true;
|
||||
}
|
||||
unsigned offset = RARCH_FIRST_CUSTOM_BIND + (idx * 4) + (id * 2);
|
||||
if (settings->uints.input_remap_ids[port][offset] != offset)
|
||||
reset_state = true;
|
||||
if (settings->uints.input_remap_ids[port][offset+1] != (offset+1))
|
||||
reset_state = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user