WIP minor improvements to conio/screen for scrolling, still doesn't work reliably once we print more than 25 lines
This commit is contained in:
@@ -35,7 +35,7 @@ void _cputs(char *ptr)
|
||||
while ((char)*ptr != 0x0) {
|
||||
_putch((char)*ptr);
|
||||
if (*ptr == '\n') {
|
||||
_cursor_y += 1;
|
||||
if ( _cursor_y < 24 ) _cursor_y += 1;
|
||||
_cursor_x = 0;
|
||||
setCursorPosition(_cursor_x, _cursor_y);
|
||||
} else {
|
||||
|
||||
26
src/screen.c
26
src/screen.c
@@ -17,6 +17,32 @@ void blankScreen(void)
|
||||
}
|
||||
}
|
||||
|
||||
void scrollScreenUp(char start, char lines)
|
||||
{
|
||||
#ifndef __GNUC__
|
||||
#asm
|
||||
push bx;
|
||||
mov bx, sp;
|
||||
push ax;
|
||||
push cx;
|
||||
push dx;
|
||||
mov ch, [bx+4];
|
||||
mov cl, #0x00;
|
||||
mov dh, #0x18;
|
||||
mov dl, #0x4F;
|
||||
mov al, [bx+6];
|
||||
mov ah, #0x06;
|
||||
mov bx, #0x0;
|
||||
int 0x10;
|
||||
pop dx;
|
||||
pop cx;
|
||||
pop ax;
|
||||
pop bx;
|
||||
#endasm
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
void setCursorPosition(char x, char y)
|
||||
{
|
||||
#ifndef __GNUC__
|
||||
|
||||
@@ -8,5 +8,6 @@ void setCursorPosition(char x, char y);
|
||||
void backupCursor();
|
||||
void advanceCursor();
|
||||
void blankScreen();
|
||||
void scrollScreenUp(char start, char lines);
|
||||
|
||||
#endif /* _SCREEN_H_ */
|
||||
|
||||
Reference in New Issue
Block a user