diff -Nurp p2/src/haptic/linux/SDL_syshaptic.c p3/src/haptic/linux/SDL_syshaptic.c --- p2/src/haptic/linux/SDL_syshaptic.c 2014-10-17 09:57:50.000000000 +0200 +++ p3/src/haptic/linux/SDL_syshaptic.c 2014-10-17 18:42:40.000000000 +0200 @@ -729,7 +729,6 @@ SDL_SYS_ToDirection(Uint16 *dest, SDL_Ha static int SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) { - Uint32 tmp; SDL_HapticConstant *constant; SDL_HapticPeriodic *periodic; SDL_HapticCondition *condition; @@ -807,9 +806,8 @@ SDL_SYS_ToFFEffect(struct ff_effect *des dest->u.periodic.period = CLAMP(periodic->period); dest->u.periodic.magnitude = periodic->magnitude; dest->u.periodic.offset = periodic->offset; - /* Phase is calculated based of offset from period and then clamped. */ - tmp = ((periodic->phase % 36000) * dest->u.periodic.period) / 36000; - dest->u.periodic.phase = CLAMP(tmp); + /* Linux phase is defined in interval "[0x0000, 0x10000[", corresponds with "[0deg, 360deg[" phase shift. */ + dest->u.periodic.phase = ((Uint32)periodic->phase * 0x10000U) / 36000; /* Envelope */ dest->u.periodic.envelope.attack_length =