-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvga.h
52 lines (40 loc) · 1.26 KB
/
vga.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef VGA_H
#define VGA_H
#include "types.h"
#define VGA_ADDRESS 0xA0000
#define VGA_MAX 0xF9FF
#define VGA_MAX_WIDTH 320
#define VGA_MAX_HEIGHT 200
/* Attribute Controller Registers */
#define VGA_AC_INDEX 0x3C0
#define VGA_AC_READ 0x3C1
#define VGA_AC_WRITE 0x3C0
/*
Miscellaneous Output
*/
#define VGA_MISC_READ 0x3CC
#define VGA_MISC_WRITE 0x3C2
/* Sequencer Registers */
#define VGA_SEQ_INDEX 0x3C4
#define VGA_SEQ_DATA 0x3C5
/* VGA Color Palette Registers */
#define VGA_DAC_READ_INDEX 0x3C7
#define VGA_DAC_WRITE_INDEX 0x3C8
#define VGA_DAC_DATA 0x3C9
/* Graphics Controller Registers */
#define VGA_GC_INDEX 0x3CE
#define VGA_GC_DATA 0x3CF
/* CRT Controller Registers */
#define VGA_CRTC_INDEX 0x3D4
#define VGA_CRTC_DATA 0x3D5
/* General Control and Status Registers */
#define VGA_INSTAT_READ 0x3DA
extern void init_vga();
extern void clear_screen();
extern void clear_color(uint8 color);
extern void putpixel(uint16 x, uint16 y, uint8 color);
extern void draw_line(uint16 x1, uint16 y1, uint16 x2, uint16 y2, uint8 color);
extern void draw_rect(uint16 x, uint16 y, uint16 width, uint16 height, uint8 color);
extern void draw_circle(uint16 x, uint16 y, uint16 radius, uint8 color);
extern void draw_diamond(uint16 x, uint16 y, uint16 radius, uint8 color);
#endif