mirror of
https://github.com/holub/mame
synced 2025-06-01 10:31:48 +03:00
correct rounding when applying analog sensitivity
This commit is contained in:
parent
29f358dc40
commit
bd457f6e0a
@ -298,7 +298,7 @@ struct _input_port_private
|
||||
MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define APPLY_SENSITIVITY(x,s) (((INT64)(x) * (s)) / 100)
|
||||
#define APPLY_SENSITIVITY(x,s) (((INT64)(x) * (s)) / 100.0 + 0.5)
|
||||
#define APPLY_INVERSE_SENSITIVITY(x,s) (((INT64)(x) * 100) / (s))
|
||||
|
||||
#define COMPUTE_SCALE(num,den) (((INT64)(num) << 24) / (den))
|
||||
@ -846,11 +846,11 @@ INLINE INT32 apply_analog_min_max(const analog_field_state *analog, INT32 value)
|
||||
|
||||
while (value >= adjmax)
|
||||
{
|
||||
value -= range;;
|
||||
value -= range;
|
||||
}
|
||||
while (value <= adjmin)
|
||||
{
|
||||
value += range;;
|
||||
value += range;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user