diff options
author | Thomas Huth <thuth@linux.vnet.ibm.com> | 2015-02-26 13:32:41 +0100 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2015-03-12 18:25:35 +1100 |
commit | a3d4e896e57ac16ec1e5350eecb96715cdfb0559 (patch) | |
tree | 6e5eeb22bc3d59c1c6a67db1316702ee1b8f2daa /slof/fs | |
parent | 088baa0de49f9b97000609d3066b292b426cbb3c (diff) | |
download | SLOF-a3d4e896e57ac16ec1e5350eecb96715cdfb0559.zip SLOF-a3d4e896e57ac16ec1e5350eecb96715cdfb0559.tar.gz SLOF-a3d4e896e57ac16ec1e5350eecb96715cdfb0559.tar.bz2 |
Set default palette according to "16-color Text Extension" document
The "Open Firmware Recommended Practice: 16-color Text Extension"
document specifies how the first 16 colors of a palette should be
set. So let's use these colors in SLOF, too.
Also move the function for initializing the palette into the
common graphics.fs file so that we do not have to do this change
twice.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Diffstat (limited to 'slof/fs')
-rw-r--r-- | slof/fs/graphics.fs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/slof/fs/graphics.fs b/slof/fs/graphics.fs index d9407b6..7d5d930 100644 --- a/slof/fs/graphics.fs +++ b/slof/fs/graphics.fs @@ -60,3 +60,28 @@ : dimensions ( -- width height ) screen-width screen-height ; + +\ Initialize a default palette (not a standard command, but useful anyway) +: init-default-palette + \ Grayscale ramp for upper colors + 100 10 DO + i i i i color! + LOOP + \ Standard colors from "16-color Text Extension" specification + 00 00 00 0 color! + 00 00 aa 1 color! + 00 aa 00 2 color! + 00 aa aa 3 color! + aa 00 00 4 color! + aa 00 aa 5 color! + aa 55 00 6 color! + aa aa aa 7 color! + 55 55 55 8 color! + 55 55 ff 9 color! + 55 ff 55 a color! + 55 ff ff b color! + ff 55 55 c color! + ff 55 ff d color! + ff ff 55 e color! + ff ff ff f color! +; |