From 6c1633b80a30c639bc096cc4b98a1da998af38c2 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 21 Jul 2017 21:10:12 +0200 Subject: changed video mode management, moved to video driver, the VGA driver registers his specific mode data with the video driver kernel function now use virtual functions of the video driver --- src/drivers/video/vga.h | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src/drivers/video/vga.h') diff --git a/src/drivers/video/vga.h b/src/drivers/video/vga.h index 600180a..fed47a1 100644 --- a/src/drivers/video/vga.h +++ b/src/drivers/video/vga.h @@ -9,28 +9,19 @@ #include "interrupts.h" #include "port.h" -#include "driver.h" +#include "video.h" #define NOF_MODE_REGS 66 -typedef enum { - VGA_MODE_TYPE_TEXT, - VGA_MODE_TYPE_GRAPHICS -} vga_mode_type_t; - typedef struct { - vga_mode_type_t mode_type; - int x; - int y; - int color_depth; + video_mode_t base; uint8_t regs[NOF_MODE_REGS]; uint8_t *segment; size_t segment_size; } vga_mode_t; typedef struct { - driver_t base; - interrupt_t *interrupts; + video_t base; port8_t misc_port; port8_t crtc_index_port; port8_t crtc_data_port; @@ -42,7 +33,7 @@ typedef struct { port8_t attribute_controller_read_port; port8_t attribute_controller_write_port; port8_t attribute_controller_reset_port; - vga_mode_t mode; + vga_mode_t *mode; bool use_z_buffer; uint8_t *zbuffer; // stores either the address to the beginning of the segment @@ -51,7 +42,7 @@ typedef struct { } vga_t; typedef struct { - driver_vtable_t base; + video_vtable_t base; } vga_vtable_t; void vga_init( vga_t *vga, interrupt_t *interrupt, void *context ); @@ -60,9 +51,7 @@ void vga_deactivate( void *obj ); void vga_deinit( void *obj ); void vga_print_info( void *obj ); -vga_mode_t vga_make_mode( const vga_mode_type_t mode_type, const int x, const int y, const int color_depth ); -bool vga_set_mode( vga_t *vga, const vga_mode_t mode ); -bool vga_supports_mode( const vga_mode_t mode ); +bool vga_switch_mode( void *obj, const video_mode_t *mode ); typedef struct { int R; -- cgit v1.2.3-54-g00ecf