From 3a88b69f2f88bf427b54ae5f0f76c64e7f1803d8 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Wed, 11 Jan 2012 12:21:13 +0100 Subject: Fixed problem in framebuffer code when erasing or inserting characters. When erasing characters or when inserting characters in the middle of a line, the framebuffer code did not correctly calculate the line width, since it was not taking the bit depth into account yet. Signed-off-by: Thomas Huth --- slof/fs/fbuffer.fs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'slof/fs/fbuffer.fs') diff --git a/slof/fs/fbuffer.fs b/slof/fs/fbuffer.fs index ebd6af7..b0a467c 100644 --- a/slof/fs/fbuffer.fs +++ b/slof/fs/fbuffer.fs @@ -135,11 +135,14 @@ CREATE bitmap-buffer 400 4 * allot fb8-columns2bytes swap fb8-columns2bytes tuck - over r@ tuck + rot char-height 0 ?DO 3dup rmove - -rot screen-width tuck + -rot + swap rot + -rot screen-width screen-depth * tuck + -rot + swap rot LOOP 3drop r> THEN - char-height 0 ?DO dup 2 pick fb8-erase-block screen-width + LOOP 2drop + char-height 0 ?DO + dup 2 pick fb8-erase-block screen-width screen-depth * + + LOOP + 2drop ; : fb8-delete-characters ( n -- ) @@ -150,11 +153,14 @@ CREATE bitmap-buffer 400 4 * allot fb8-columns2bytes swap fb8-columns2bytes tuck - over r@ + 2dup + r> swap >r rot char-height 0 ?DO 3dup rmove - -rot screen-width tuck + -rot + swap rot + -rot screen-width screen-depth * tuck + -rot + swap rot LOOP 3drop r> over - THEN - char-height 0 ?DO dup 2 pick fb8-erase-block screen-width + LOOP 2drop + char-height 0 ?DO + dup 2 pick fb8-erase-block screen-width screen-depth * + + LOOP + 2drop ; : fb8-reset-screen ( -- ) ( Left as no-op by design ) ; -- cgit v1.1