Clean up interface
This commit is contained in:
parent
e6d046d593
commit
2da088f031
@ -2,6 +2,19 @@
|
||||
#include <memory.h>
|
||||
#include <ports.h>
|
||||
|
||||
#define VGA_COLS 80
|
||||
#define VGA_ROWS 24
|
||||
#define VGA_SIZE (VGA_COLS*VGA_ROWS)
|
||||
|
||||
#define VGA_ROW(pos) ((pos)/VGA_COLS)
|
||||
#define VGA_COL(pos) ((pos)%VGA_COLS)
|
||||
#define VGA_POS(row, col) ((row)*VGA_COLS + (col))
|
||||
|
||||
#define VGA_ADDRESS_PORT 0x3D4
|
||||
#define VGA_DATA_PORT 0x3D5
|
||||
#define VGA_REGISTER_CURSOR_POS_LOW 0xF
|
||||
#define VGA_REGISTER_CURSOR_POS_HIGH 0xE
|
||||
|
||||
void *vidmem;
|
||||
struct vga_cell{
|
||||
uint8_t c;
|
||||
|
@ -1,6 +1,4 @@
|
||||
#pragma once
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define debug(...) debug_printf(__VA_ARGS__)
|
||||
@ -20,8 +18,7 @@
|
||||
#define debug_error(...)
|
||||
#endif
|
||||
|
||||
void debug_putch(char c);
|
||||
void debug_putsn(char *s, size_t n);
|
||||
void debug_puts(char *s);
|
||||
void debug_vprintf(char *fmt, va_list args);
|
||||
void debug_printf(char *fmt, ...);
|
||||
void debug_puts(char *s);
|
||||
void debug_putsn(char *s, size_t n);
|
||||
void debug_putch(char c);
|
||||
|
@ -1,19 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#define VGA_COLS 80
|
||||
#define VGA_ROWS 24
|
||||
#define VGA_SIZE (VGA_COLS*VGA_ROWS)
|
||||
|
||||
#define VGA_ROW(pos) ((pos)/VGA_COLS)
|
||||
#define VGA_COL(pos) ((pos)%VGA_COLS)
|
||||
#define VGA_POS(row, col) ((row)*VGA_COLS + (col))
|
||||
|
||||
#define VGA_MEMORY P2V(0xB8000)
|
||||
|
||||
void vga_init();
|
||||
void vga_write(char c);
|
||||
|
||||
#define VGA_ADDRESS_PORT 0x3D4
|
||||
#define VGA_DATA_PORT 0x3D5
|
||||
#define VGA_REGISTER_CURSOR_POS_LOW 0xF
|
||||
#define VGA_REGISTER_CURSOR_POS_HIGH 0xE
|
||||
|
Loading…
x
Reference in New Issue
Block a user