summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2015-09-28 21:58:14 -0700
committeriximeow <me@iximeow.net>2015-09-28 21:58:14 -0700
commita3b999593f381a4b0da537d3160014753db4d428 (patch)
tree4a65402d8e2e06c888fa4a39ff72adfa3b507f84
parent45603a52e25812054bc15644086fe7b8d6ff097f (diff)
vga graphics for return, newln, short, and int
-rw-r--r--src/output/vga_character.c23
-rw-r--r--src/output/vga_character.h7
2 files changed, 26 insertions, 4 deletions
diff --git a/src/output/vga_character.c b/src/output/vga_character.c
index bd59a97..78b75f2 100644
--- a/src/output/vga_character.c
+++ b/src/output/vga_character.c
@@ -28,8 +28,22 @@ void vga_graphics_byte_hex(char value) {
vga_graphics_write(HEX_CHARS[low]);
}
+void vga_graphics_short_hex(short value) {
+ char low = value & 0xff;
+ char high = (value & 0xff00) >> 8;
+ vga_graphics_byte_hex(high);
+ vga_graphics_byte_hex(low);
+}
+
+void vga_graphics_int_hex(int value) {
+ short low = value & 0xffff;
+ short high = (value & 0xffff0000) >> 16;
+ vga_graphics_short_hex(high);
+ vga_graphics_short_hex(low);
+}
+
void vga_graphics_write_at_offset(char value, short offset) {
- __asm__(
+ __asm__ volatile (
"mov %0, %%al \n"
"mov %1, %%di \n"
"mov %%al, %%gs:(%%di) \n"
@@ -47,3 +61,10 @@ void vga_graphics_clear() {
}
CURSOR_LOC = 0;
}
+
+void vga_graphics_newln() {
+ CURSOR_LOC += 80 * 2;
+}
+void vga_graphics_return() {
+ CURSOR_LOC = CURSOR_LOC - (CURSOR_LOC % 160);
+}
diff --git a/src/output/vga_character.h b/src/output/vga_character.h
index 0d067f3..ca60573 100644
--- a/src/output/vga_character.h
+++ b/src/output/vga_character.h
@@ -7,10 +7,11 @@ void vga_graphics_write_with_attr(char, char);
void vga_graphics_write_str(char*);
void vga_graphics_byte_hex(char);
-//void vga_graphics_short_hex(short);
-//void vga_graphics_int_hex(int);
-//void vga_graphics_long_hex(long);
+void vga_graphics_short_hex(short);
+void vga_graphics_int_hex(int);
void vga_graphics_clear(void);
+void vga_graphics_return(void);
+void vga_graphics_newln(void);
#endif