From e5ba9cb62c62a4a9cb9012dfd45870bc5b988def Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Thu, 1 Jun 2023 22:36:51 +0100 Subject: Add function to wait for VGA's vsync --- src/vga.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/vga.c') diff --git a/src/vga.c b/src/vga.c index a6524bd..981ad6f 100644 --- a/src/vga.c +++ b/src/vga.c @@ -24,6 +24,12 @@ void set_mode(uint8_t mode) __dpmi_int(0x10, ®s); } +void wait_vsync() +{ + while (inportb(0x3da) & 8); + while (!(inportb(0x3da) & 8)); +} + void set_palette(const uint8_t *palette) { outportb(0x3c8, 0); -- cgit v1.2.3