summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-06-30 11:11:10 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-06-30 11:11:10 +0200
commitad7f1dd777eda2d6505118c4e47faba3f21e78ba (patch)
tree7ec61f6349dbec0e70bbb22cd9e83113e2b1a923 /src/drivers
parent58df0d3172ad548b85627e5bb0b92a27a6072736 (diff)
downloadabaos-ad7f1dd777eda2d6505118c4e47faba3f21e78ba.tar.gz
abaos-ad7f1dd777eda2d6505118c4e47faba3f21e78ba.tar.bz2
added a VGA wait for retrace in graphics mode
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/video/vga.c6
-rw-r--r--src/drivers/video/vga.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/drivers/video/vga.c b/src/drivers/video/vga.c
index b0b61f7..2080283 100644
--- a/src/drivers/video/vga.c
+++ b/src/drivers/video/vga.c
@@ -374,3 +374,9 @@ void vga_draw_char( vga_t *vga, const unsigned char c, const int x, const int y,
}
}
+void vga_wait_for_retrace( vga_t *vga )
+{
+ while( port8_read( &vga->attribute_controller_reset_port ) & 0x08 );
+ while( !( port8_read( &vga->attribute_controller_reset_port ) & 0x08 ) );
+}
+
diff --git a/src/drivers/video/vga.h b/src/drivers/video/vga.h
index 3b09c37..b9a5c87 100644
--- a/src/drivers/video/vga.h
+++ b/src/drivers/video/vga.h
@@ -80,5 +80,6 @@ void vga_set_pixel( vga_t *vga, const int x, const int y, const vga_color_t colo
void vga_draw_rectangle( vga_t *vga, const int x, const int y, const int w, const int h, const vga_color_t color );
void vga_clear_screen( vga_t *vga, const vga_color_t color );
void vga_draw_char( vga_t *vga, const unsigned char c, const int x, const int y, const vga_color_t background, const vga_color_t foreground );
+void vga_wait_for_retrace( vga_t *vga );
#endif // VGA_H