summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-07-03 00:16:14 +0200
committerThomas White <taw@physics.org>2019-07-03 00:16:14 +0200
commit924586b603f8e639b3b1ac6d53f150a4b0a91a0a (patch)
treeed1b3254599ad0f917d82e7724bf88cc0059f768
parent5ec2adf7c2235fd42742da8fd2ecc26a87541067 (diff)
Fix integer conversion for 8-bit values
-rw-r--r--src/scanout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scanout.c b/src/scanout.c
index ce7bfc9..a744a34 100644
--- a/src/scanout.c
+++ b/src/scanout.c
@@ -39,9 +39,9 @@ static void set_val(int *dmx, int base_addr, int attr_offset, float value, int s
dmx[pos] = (val & 0xff00) >> 8;
dmx[pos+1] = val & 0xff;
} else {
- int val = value * 255;
+ int val = value * 256;
if ( val >= 255 ) val = 255;
- dmx[pos] = value * 256;
+ dmx[pos] = val & 0xff;
}
}