1

cga use span to address screen memory

This commit is contained in:
2022-07-24 22:43:07 +02:00
parent 7e046b6f89
commit f711e41216
2 changed files with 13 additions and 8 deletions

View File

@ -16,6 +16,7 @@
#include "kernel/IOport.h"
#include "user/lib/Array.h"
#include "user/lib/Span.h"
#include "user/lib/String.h"
class CGA {
@ -34,8 +35,6 @@ public:
// virtual ~CGA() = default;
static const unsigned int CGA_START = 0xb8000U;
// Konstanten fuer die moeglichen Farben im Attribut-Byte.
typedef enum {
BLACK,
@ -78,6 +77,10 @@ public:
bse::array<cga_line_t, ROWS> cga_page;
};
static bse::span<cga_char_t, ROWS * COLUMNS> SCREEN;
static bse::span<cga_line_t, ROWS> SCREEN_ROWS;
static cga_page_t* SCREEN_PAGE; // No span because can't address anything in [0, 1]
// Setzen des Cursors in Spalte x und Zeile y.
static void setpos(unsigned int x, unsigned int y);