Code: Select all
void textScreen::scroll(){
u8int colorAttrib = (colorBG << 4) | (colorFG & 0x0F); // FG color + BG color attribute
u32int endPos; // Position it ends up at after clearing the other lines
for(u32int i = 0; i < (xSize * (ySize-1))*2; i++){ // *2 for color attribute
// Shift everything up a row, accounting for the x align, x size, y align, and y size.
bufferAddr[i+xAlign+(xAlign*yAlign)] = bufferAddr[i+xSize+xAlign+(xAlign*yAlign)];
endPos = i;
}
for(u32int i = endPos; i < xSize; i++){
// Clear the last line
bufferAddr[i+xAlign+(xAlign*yAlign)] = 0x20; // Space
i++;
bufferAddr[i+xAlign+(xAlign*yAlign)] = colorAttrib; // Color
}
csrX = xAlign;
csrY = (yAlign + ySize) - 1;
}
One more odd thing is that when I include the function, even never calling it anywhere, it adds 4kb to the size of the kernel. Considering that it isn't even that large of a function, I don't see why this is happening. Any help would be appreciated.