forked from hchunhui/tiny386
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvga.h
More file actions
49 lines (38 loc) · 1.42 KB
/
vga.h
File metadata and controls
49 lines (38 loc) · 1.42 KB
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
#ifndef VGA_H
#define VGA_H
#include <stdbool.h>
typedef struct FBDevice FBDevice;
typedef void SimpleFBDrawFunc(void *opaque,
int x, int y, int w, int h);
typedef struct VGAState VGAState;
VGAState *vga_init(char *vga_ram, int vga_ram_size,
uint8_t *fb, int width, int height);
int vga_step(VGAState *vga);
void vga_refresh(VGAState *s,
SimpleFBDrawFunc *redraw_func, void *opaque, int full_update);
void vga_ioport_write(VGAState *s, uint32_t addr, uint32_t val);
uint32_t vga_ioport_read(VGAState *s, uint32_t addr);
void vbe_write(VGAState *s, uint32_t offset, uint32_t val);
uint32_t vbe_read(VGAState *s, uint32_t offset);
void vga_mem_write(VGAState *s, uint32_t addr, uint8_t val);
uint8_t vga_mem_read(VGAState *s, uint32_t addr);
void vga_mem_write16(VGAState *s, uint32_t addr, uint16_t val);
void vga_mem_write32(VGAState *s, uint32_t addr, uint32_t val);
bool vga_mem_write_string(VGAState *s, uint32_t addr, uint8_t *buf, int len);
typedef struct PCIDevice PCIDevice;
typedef struct PCIBus PCIBus;
PCIDevice *vga_pci_init(VGAState *s, PCIBus *bus,
void *o, void (*set_bar)(void *, int, uint32_t, bool));
#ifdef BUILD_ESP32
#define BPP 16
#define SCALE_3_2
#define FULL_UPDATE
#define SWAPXY
#else
#define BPP 32
//#define BPP 16
//#define SCALE_3_2
//#define FULL_UPDATE
//#define SWAPXY // depends on SCALE_3_2
#endif
#endif /* VGA_H */