shell: horline working now

And we give a high-level error when the pixel buffer fills up.
This commit is contained in:
Kartik K. Agaram 2021-04-15 23:09:13 -07:00
parent 6392f1fde9
commit df9c71eff0
1 changed files with 9 additions and 1 deletions

View File

@ -52,8 +52,10 @@ fn initialize-screen _screen: (addr screen), width: int, height: int {
tmp <- multiply width
populate data-addr, tmp
}
# pixels
# allocate space for 16 pixels per 16x8 character. So one column of pixels
# per character.
var pixels-ah/ecx: (addr handle stream pixel) <- get screen, pixels
tmp <- shift-left 4
populate-stream pixels-ah, tmp
# screen->cursor-x = 0
dest <- get screen, cursor-x
@ -105,6 +107,12 @@ fn pixel screen: (addr screen), x: int, y: int, color: int {
var screen/eax: (addr screen) <- copy screen
var dest-stream-ah/eax: (addr handle stream pixel) <- get screen, pixels
var dest-stream/eax: (addr stream pixel) <- lookup *dest-stream-ah
{
var full?/eax: boolean <- stream-full? dest-stream
compare full?, 0/false
break-if-=
abort "tried to draw too many pixels on the fake screen; adjust initialize-screen"
}
write-to-stream dest-stream, src
}