Reduced number of calculations performed in terminalScroll.

This commit is contained in:
neviyn 2017-10-22 02:02:19 +01:00
parent 47f18157b3
commit af091674a6

View File

@ -32,11 +32,10 @@ proc terminalInitialize*() =
proc terminalScroll() =
for y in 0..< (vgaHeight - 1):
let base1 = y * vgaWidth
let base2 = (y + 1) * vgaWidth
for x in 0..<vgaWidth:
let xval = x * 2
let index1 = y * vgaWidth + x
let index2 = (y + 1) * vgaWidth + x
vgaMem[index1] = vgaMem[index2]
vgaMem[base1 + x] = vgaMem[base2 + x]
for x in 0..<vgaWidth: # Blank the "new" bottom line
terminalWriteAtPoint(' ', terminalColour, x, vgaHeight - 1)