-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvga.h
47 lines (39 loc) · 964 Bytes
/
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
/*
* vga.h
*
* Created on: Jan 3, 2019
* Author: pedward
*/
#ifndef VGA_H_
#define VGA_H_
#include "image.h"
#include "adapter.h"
#define VGA_PAL_MASK 0x3c6
#define VGA_PAL_REG 0x3c8
#define VGA_PAL_DATA 0x3c9
class vga : public adapter
{
protected:
static const adapter::video_mode video_modes[];
Mode _savedvmode;
protected:
void write_crtc(unsigned int port, unsigned char reg, unsigned char val);
bool x16mode(void);
void setpalentries(palette::pal_t *pal, int palette_entries);
void setpalentry(unsigned char index, unsigned char r, unsigned char g, unsigned char b);
public:
vga(void);
~vga(void);
bool setup(void);
bool setpalette(palette::pal_type pal);
bool setpalette(palette::pal_t *pal, int palette_entries);
bool graphmode(Mode mode);
adapter::Mode getmode(void);
bool textmode(void);
void setmode(Mode mode);
void cls(void);
void update(void);
void vsync(void);
void translate(ptr_t src);
};
#endif /* VGA_H_ */