diff --git a/src/conio.c b/src/conio.c index 3dc8c1c..7ebf07a 100644 --- a/src/conio.c +++ b/src/conio.c @@ -27,7 +27,7 @@ void _putch(char c) #endif } -void _cputs(char *ptr) +void _cputs(char *ptr) { if ( ptr == NULL ) { return; @@ -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 { @@ -81,10 +81,10 @@ char *_cgets(char *d) while ( scancode != 0 ) { if ( scancode == 0x0e ) { if ( d > orig ) { - backupCursor(); - setCursorPosition(_cursor_x, _cursor_y); - d -= 1; - _putch(0x0); + backupCursor(); + setCursorPosition(_cursor_x, _cursor_y); + d -= 1; + _putch(0x0); } } else if ( scancode == 0x1c ) { break; diff --git a/src/screen.c b/src/screen.c index f018150..159f11e 100644 --- a/src/screen.c +++ b/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__ diff --git a/src/screen.h b/src/screen.h index 7b169d6..4c95415 100644 --- a/src/screen.h +++ b/src/screen.h @@ -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_ */