11#include "screen.h"
22#include "../cpu/ports.h"
3+ #include "../libc/mem.h"
34
45/* Declaration of private functions */
56int get_cursor_offset ();
@@ -64,7 +65,7 @@ void kprint_backspace() {
6465 * Sets the video cursor to the returned offset
6566 */
6667int print_char (char c , int col , int row , char attr ) {
67- unsigned char * vidmem = (unsigned char * ) VIDEO_ADDRESS ;
68+ u8 * vidmem = (u8 * ) VIDEO_ADDRESS ;
6869 if (!attr ) attr = WHITE_ON_BLACK ;
6970
7071 /* Error control: print a red 'E' if the coords aren't right */
@@ -94,12 +95,12 @@ int print_char(char c, int col, int row, char attr) {
9495 if (offset >= MAX_ROWS * MAX_COLS * 2 ) {
9596 int i ;
9697 for (i = 1 ; i < MAX_ROWS ; i ++ )
97- memory_copy (get_offset (0 , i ) + VIDEO_ADDRESS ,
98- get_offset (0 , i - 1 ) + VIDEO_ADDRESS ,
98+ memory_copy (( u8 * )( get_offset (0 , i ) + VIDEO_ADDRESS ) ,
99+ ( u8 * )( get_offset (0 , i - 1 ) + VIDEO_ADDRESS ) ,
99100 MAX_COLS * 2 );
100101
101102 /* Blank last line */
102- char * last_line = get_offset (0 , MAX_ROWS - 1 ) + VIDEO_ADDRESS ;
103+ char * last_line = ( char * ) ( get_offset (0 , MAX_ROWS - 1 ) + ( u8 * ) VIDEO_ADDRESS ) ;
103104 for (i = 0 ; i < MAX_COLS * 2 ; i ++ ) last_line [i ] = 0 ;
104105
105106 offset -= 2 * MAX_COLS ;
@@ -125,15 +126,15 @@ void set_cursor_offset(int offset) {
125126 /* Similar to get_cursor_offset, but instead of reading we write data */
126127 offset /= 2 ;
127128 port_byte_out (REG_SCREEN_CTRL , 14 );
128- port_byte_out (REG_SCREEN_DATA , (unsigned char )(offset >> 8 ));
129+ port_byte_out (REG_SCREEN_DATA , (u8 )(offset >> 8 ));
129130 port_byte_out (REG_SCREEN_CTRL , 15 );
130- port_byte_out (REG_SCREEN_DATA , (unsigned char )(offset & 0xff ));
131+ port_byte_out (REG_SCREEN_DATA , (u8 )(offset & 0xff ));
131132}
132133
133134void clear_screen () {
134135 int screen_size = MAX_COLS * MAX_ROWS ;
135136 int i ;
136- char * screen = VIDEO_ADDRESS ;
137+ u8 * screen = ( u8 * ) VIDEO_ADDRESS ;
137138
138139 for (i = 0 ; i < screen_size ; i ++ ) {
139140 screen [i * 2 ] = ' ' ;
0 commit comments