diff options
author | twinaphex | 2017-04-09 15:49:52 +0200 |
---|---|---|
committer | twinaphex | 2017-04-09 15:49:52 +0200 |
commit | a9bb0712e8b70bf8f3c4a0025606c70a81594ab9 (patch) | |
tree | f5e2aeaae2124cc9e562a56f6c58f152fb238376 /frontend | |
parent | d4fa7f640a5f6cc014ee74912ec0b1dd5e19abad (diff) | |
download | pcsx_rearmed-a9bb0712e8b70bf8f3c4a0025606c70a81594ab9.tar.gz pcsx_rearmed-a9bb0712e8b70bf8f3c4a0025606c70a81594ab9.tar.bz2 pcsx_rearmed-a9bb0712e8b70bf8f3c4a0025606c70a81594ab9.zip |
Turn min into macro
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/libretro.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/frontend/libretro.c b/frontend/libretro.c index ee29a9b..7fd20b1 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -39,6 +39,10 @@ #define PORTS_NUMBER 8 +#ifndef MIN +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif + #define ISHEXDEC ((buf[cursor]>='0') && (buf[cursor]<='9')) || ((buf[cursor]>='a') && (buf[cursor]<='f')) || ((buf[cursor]>='A') && (buf[cursor]<='F')) //hack to prevent retroarch freezing when reseting in the menu but not while running with the hot key @@ -1502,11 +1506,6 @@ static void update_variables(bool in_flight) } } -static int min(int a, int b) -{ - return a < b ? a : b; -} - void retro_run(void) { int i; @@ -1537,10 +1536,10 @@ void retro_run(void) if (in_type[i] == PSE_PAD_TYPE_ANALOGPAD) { - in_analog_left[i][0] = min((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X) / 255) + 128, 255); - in_analog_left[i][1] = min((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) / 255) + 128, 255); - in_analog_right[i][0] = min((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) / 255) + 128, 255); - in_analog_right[i][1] = min((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) / 255) + 128, 255); + in_analog_left[i][0] = MIN((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X) / 255) + 128, 255); + in_analog_left[i][1] = MIN((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) / 255) + 128, 255); + in_analog_right[i][0] = MIN((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) / 255) + 128, 255); + in_analog_right[i][1] = MIN((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) / 255) + 128, 255); } } |