From 62a2afe0d842534f00decb9e8e4c85cdbcf36bff Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 13 Jul 2021 16:59:19 -0700 Subject: clean up some unseemly speckles Turns out they were a bug after all, and scaling the palette was just making them more obvious. The bug: I was carefully clamping to 0xf0 to avoid rounding later, but I forgot to do so for values between 0xf0 and 0xff. As a result, some values could round up past 0xff and turn black. --- img.mu | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/img.mu b/img.mu index 14d87545..73aea245 100644 --- a/img.mu +++ b/img.mu @@ -26,8 +26,7 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) var img-storage: image var img/esi: (addr image) <- address img-storage load-image img, data-disk - render-image screen, img, 0/x, 0xd0/y, 0x12c/width=300, 0xc8/height=200 - render-pgm-image screen, img, 0x140/x, 0/y, 0x12c/width=300, 0xc8/height=200 + render-image screen, img, 0/x, 0/y, 0x300/width, 0x300/height } fn load-image self: (addr image), data-disk: (addr disk) { @@ -484,7 +483,7 @@ fn dither-pgm-unordered _src: (addr image), _dest: (addr image) { nearest-color <- copy 0 } { - compare nearest-color, 0xff + compare nearest-color, 0xf0 break-if-<= nearest-color <- copy 0xf0 } -- cgit 1.4.1-2-gfad0 le/tree/config.mk?id=fb52c72e80651f76d792b70c552827f3d4f79ca8'>tree commit diff stats
path: root/config.mk
blob: 2ccc175700aa49f3d60830a7ac86918b7afe9013 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14