You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
841 B
C
55 lines
841 B
C
#include "conio.h"
|
|
#include <string.h>
|
|
#include <redbus.h>
|
|
#include <console.h>
|
|
|
|
#define redbus 0x0300
|
|
int conid = 0x01;
|
|
|
|
Console* con = (Console*)redbus;
|
|
char * strinv(char str[]) {
|
|
int i;
|
|
for(i = 0; i < strlen(str); i++){
|
|
str[i] = inv(str[i]);
|
|
}
|
|
return str;
|
|
}
|
|
|
|
void conprint(char * str, int x, int y){
|
|
rb_map_device(conid);
|
|
con->line = y;
|
|
memcpy(con->display + x, str, strlen(str));
|
|
}
|
|
|
|
void set_conid(int id){
|
|
conid = id;
|
|
}
|
|
|
|
int get_conid(){
|
|
return conid;
|
|
}
|
|
|
|
struct cursor_pos {
|
|
int x;
|
|
int y;
|
|
};
|
|
|
|
void set_cursor_pos(int x, int y) {
|
|
con->cursor_x = x;
|
|
con->cursor_y = y;
|
|
}
|
|
|
|
struct cursor_pos get_cursor_pos() {
|
|
struct cursor_pos cursor;
|
|
cursor.x = con->cursor_x;
|
|
cursor.y = con->cursor_y;
|
|
return cursor;
|
|
}
|
|
|
|
void set_cursor_mode(int mode) {
|
|
con->cursor_mode = mode;
|
|
}
|
|
|
|
int get_cursor_mode() {
|
|
return con->cursor_mode;
|
|
} |