diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-07-21 21:10:12 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-07-21 21:10:12 +0200 |
commit | 6c1633b80a30c639bc096cc4b98a1da998af38c2 (patch) | |
tree | 0f45096ba3d4cfcb92ae84274e2ce2d53d95f3f7 /src/drivers/video/vga.h | |
parent | 3e9f594c7e06017b5d919d79530c39a58de8a3c7 (diff) | |
download | abaos-6c1633b80a30c639bc096cc4b98a1da998af38c2.tar.gz abaos-6c1633b80a30c639bc096cc4b98a1da998af38c2.tar.bz2 |
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
Diffstat (limited to 'src/drivers/video/vga.h')
-rw-r--r-- | src/drivers/video/vga.h | 23 |
1 files changed, 6 insertions, 17 deletions
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; |