The IEEE1275 specification suggests that the fb8-* routines can be coerced into working for framebuffers with greater bit depths. Make sure that we also support this.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- openbios-devel/forth/device/display.fs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/openbios-devel/forth/device/display.fs b/openbios-devel/forth/device/display.fs index f59ef1f..07aaed5 100644 --- a/openbios-devel/forth/device/display.fs +++ b/openbios-devel/forth/device/display.fs @@ -168,7 +168,7 @@ defer fb8-invertrect
: fb8-line2addr ( line -- addr ) window-top + - screen-width * + screen-width * depth-bytes * frame-buffer-adr + window-left + ; @@ -176,12 +176,12 @@ defer fb8-invertrect : fb8-copy-line ( from to -- ) fb8-line2addr swap fb8-line2addr swap - #columns char-width * move + #columns char-width * depth-bytes * move ;
: fb8-clear-line ( line -- ) fb8-line2addr - #columns char-width * + #columns char-width * depth-bytes * background-color fill \ 0 fill ; @@ -189,8 +189,9 @@ defer fb8-invertrect : fb8-draw-character ( char -- ) \ draw the character:
font
- line# char-height * window-top + screen-width * - column# char-width * window-left + + frame-buffer-adr + + line# char-height * window-top + screen-width * depth-bytes * + column# char-width * depth-bytes * + window-left depth-bytes * + + frame-buffer-adr + swap char-width char-height \ normal or inverse? foreground-color background-color