aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/vga_t.cc
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-04-29 08:49:41 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-04-29 08:49:41 +0200
commitfde8a1ab65d5e33d90123a3aaa9b5c15e249689f (patch)
tree14134c0c2f322cbcba0989b78bd7057f76c157c3 /src/drivers/vga_t.cc
parent067d6e340be698b0e26b7732215a1969e0e683f3 (diff)
Debug, add memory print driver
Diffstat (limited to 'src/drivers/vga_t.cc')
-rw-r--r--src/drivers/vga_t.cc65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/drivers/vga_t.cc b/src/drivers/vga_t.cc
deleted file mode 100644
index 0ff3f82..0000000
--- a/src/drivers/vga_t.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-#include "vga_t.hpp"
-
-#include "include/boucane.hpp"
-
-#define MAX_COL 80
-#define MAX_LINE 25
-
-VIDEO_STATE VS={
- (u8 *)0xB8000,
- 0,
- 0,
- BLACK,
- GRAY,
-};
-
-void vga_t_init(){
- PAGING_MAP(0xB8000);
- PAGING_MAP(0xB8000+4096);
-}
-
-void vga_t_putchar(char c){
- // Handle newline here
- if(c=='\n'){
- VS.col=0;
- VS.line+=1;
- if(VS.line>=MAX_LINE){
- VS.line=MAX_LINE-1;
- vga_t_scrollup();
- }
- return;
- }
-
- // Print char
- VS.mem[VS.col*2+MAX_COL*VS.line*2]=c;
- VS.mem[VS.col*2+MAX_COL*VS.line*2+1]=VS.fg|VS.bg<<4;
-
- // Refresh location
- VS.col+=1;
- if(VS.col>= MAX_COL){
- VS.col=0;
- VS.line+=1;
- if(VS.line>=MAX_LINE){
- VS.line=MAX_LINE-1;
- vga_t_scrollup();
- }
- }
-}
-
-void vga_t_clear(){
- for(u8 i=0;i<MAX_LINE;i++){
- vga_t_scrollup();
- }
-}
-
-void vga_t_scrollup(){
- // Move VS.line up
- for(u8 i=1;i<=MAX_LINE;i++){
- for(u8 j=0;j<=MAX_COL;j++)
- VS.mem[j*2+MAX_COL*(i-1)*2]=VS.mem[j*2+MAX_COL*i*2];
- }
- // Clear last VS.line
- for(u8 i=0;i<=MAX_COL;i++){
- VS.mem[i*2+MAX_COL*(MAX_LINE-1)*2]='\0';
- }
-}