Removed code duplication in terminalWriteChar.
This commit is contained in:
parent
af091674a6
commit
e0c0d8cfa3
@ -43,19 +43,20 @@ proc setTerminalColour(newColour: int) =
|
||||
terminalColour = newColour
|
||||
|
||||
proc terminalWriteChar(writeChar: char) =
|
||||
if(writeChar == '\L'):
|
||||
|
||||
proc scrollCheckAndSet() =
|
||||
if(terminalRow < vgaHeight - 1): inc(terminalRow)
|
||||
else: # If we are at the bottom of the screen then scroll the screen.
|
||||
terminalScroll()
|
||||
terminalColumn = 0
|
||||
|
||||
if(writeChar == '\L'):
|
||||
scrollCheckAndSet()
|
||||
return
|
||||
terminalWriteAtPoint(writeChar, terminalColour, terminalColumn, terminalRow)
|
||||
inc(terminalColumn)
|
||||
if(terminalColumn == vgaWidth):
|
||||
terminalColumn = 0
|
||||
if(terminalRow < vgaHeight - 1): inc(terminalRow)
|
||||
else: # If we are at the bottom of the screen then scroll the screen.
|
||||
terminalScroll()
|
||||
scrollCheckAndSet()
|
||||
|
||||
proc terminalWrite*(data: string) =
|
||||
for character in data:
|
||||
|
Loading…
Reference in New Issue
Block a user