From 85a224d8383c06cac609fb99e5729f78a232d286 Mon Sep 17 00:00:00 2001 From: cg Date: Mon, 15 May 2000 02:10:27 +0000 Subject: [PATCH] fix a speed bug that nobody noticed --- sys/dev/sound/isa/ess.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/isa/ess.c b/sys/dev/sound/isa/ess.c index 60727644cd84..879c0299c17c 100644 --- a/sys/dev/sound/isa/ess.c +++ b/sys/dev/sound/isa/ess.c @@ -495,11 +495,12 @@ ess_calcspeed9(int *spd) /* rate = source / (256 - divisor) */ /* divisor = 256 - (source / rate) */ speed = *spd; - t0 = 256 - (793800 / speed); - s0 = 793800 / (256 - t0); + t0 = 128 - (793800 / speed); + s0 = 793800 / (128 - t0); - t1 = 0x80 | (256 - (768000 / speed)); - s1 = 768000 / (256 - t1); + t1 = 128 - (768000 / speed); + s1 = 768000 / (128 - t1); + t1 |= 0x80; use0 = (ABS(speed - s0) < ABS(speed - s1))? 1 : 0;