Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
triazo
/
kernel
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
3
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0da65e79
authored
Nov 02, 2015
by
malcolm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Added more terminal manipulation functions
parent
291aa631
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
src/term.c
src/term.h
src/term.c
View file @
0da65e79
...
...
@@ -107,3 +107,18 @@ void terminal_writestring(const char* data)
terminal_putchar
(
data
[
i
]);
}
}
void
terminal_movecursor
(
size_t
x
,
size_t
y
)
{
if
(
x
>=
VGA_WIDTH
||
y
>=
VGA_HEIGHT
)
return
;
terminal_column
=
x
;
terminal_row
=
y
;
update_csr
();
}
void
terminal_adjustcursor
(
int
x
,
int
y
)
{
terminal_column
+=
x
;
terminal_row
+=
y
;
if
(
terminal_column
>
VGA_WIDTH
)
terminal_column
=
VGA_WIDTH
;
if
(
terminal_row
>
VGA_HEIGHT
)
terminal_row
=
VGA_HEIGHT
;
update_csr
();
}
src/term.h
View file @
0da65e79
...
...
@@ -36,3 +36,5 @@ void terminal_setcolor(uint8_t color);
void
terminal_putentryat
(
char
c
,
uint8_t
color
,
size_t
x
,
size_t
y
);
void
terminal_putchar
(
char
c
);
void
terminal_writestring
(
const
char
*
data
);
void
terminal_movecursor
(
size_t
x
,
size_t
y
);
void
terminal_adjustcursor
(
int
x
,
int
y
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment