[OpenBIOS] [PATCH v2 1/2] display.fs: fix off-by-one errors in color palette initialisation
Mark Cave-Ayland
mark.cave-ayland at ilande.co.uk
Fri Apr 21 08:48:56 CEST 2017
Loops in Forth are described using a limit and start value. Fix the limit so
palette entry 255 is actually set.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
forth/device/display.fs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/forth/device/display.fs b/forth/device/display.fs
index fff44e0..f7fa2a7 100644
--- a/forth/device/display.fs
+++ b/forth/device/display.fs
@@ -386,7 +386,7 @@ defer fb8-invertrect
to foreground-color to background-color
\ setup palette
- 10101 ['] color-palette cell+ ff 0 do
+ 10101 ['] color-palette cell+ 100 0 do
dup 2 pick i * swap ! cell+
loop 2drop
@@ -394,7 +394,7 @@ defer fb8-invertrect
ffffcc ['] color-palette cell+ fe cells + !
\ load palette onto the hardware
- ['] color-palette cell+ ff 0 do
+ ['] color-palette cell+ 100 0 do
dup @ ff0000 and d# 16 rshift
1 pick @ ff00 and d# 8 rshift
2 pick @ ff and
--
1.7.10.4
More information about the OpenBIOS
mailing list