sam-falvo/kestrel — pull request #2 by sam-falvo (2013-05-09 07:01:53+00:00)
Title: Printch integration test

Since this is really the first procedure of the BIOS proper, I created a
bios.fs source file.

I fixed several bugs in cursor.fs. First, I completed the binding between
cursor and framebuffer; cursor now invokes the framebuffer's ReverseVideo
primitive to render the cursor. Second, cursor manipulation primitives, such
as mvleft, mvright, etc. now properly hide and reveal the cursor prior and
after doing their job, respectively. That way, the cursor image always appears
as though it were a hardware-rendered cursor.

In framebuffer, I fixed a bug with the Scroll and Stamp primitives. In
Scroll's case, instead of scrolling the screen, it corrupted low memory ($0000
and up to some unknown limit). Frankly, since the unit tests and integration
test code runs in this region as well, I'm rather shocked that things worked at
all until its discovery. I was missing a +, instruction in both 0p and 0q.
Not only did this cause p and q pointers to be set to zero, it would have also
introduced a stack imbalance bug if this were real Forth code. In the case of
Stamp, I forgot to set the y variable to the value of Top, causing PrintCh to
place glyphs at the correct column, but a seemingly random row.