-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgpu.h
More file actions
48 lines (35 loc) · 1.05 KB
/
gpu.h
File metadata and controls
48 lines (35 loc) · 1.05 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
#ifndef GPU_H
#define GPU_H
#include <stdbool.h>
#define GPU_BG GET_BIT(gpu.gpu_ctrl, 0)
#define GPU_SPR GET_BIT(gpu.gpu_ctrl, 1)
#define GPU_SP_SZ GET_BIT(gpu.gpu_ctrl, 2)
#define GPU_BG_MAP GET_BIT(gpu.gpu_ctrl, 3)
#define GPU_BG_SET GET_BIT(gpu.gpu_ctrl, 4)
#define GPU_WDOW GET_BIT(gpu.gpu_ctrl, 5)
#define GPU_WDOW_MAP GET_BIT(gpu.gpu_ctrl, 6)
#define GPU_DISP GET_BIT(gpu.gpu_ctrl, 7)
void init_gpu(void);
void renderscan(void);
void dump_vram(void);
void showTileSet(void);
void showBGMap(void);
typedef struct {
unsigned char oam[0xA0];
unsigned char vram[0x2000];
unsigned char gpu_ctrl, gpu_stat;
unsigned char scrollX, scrollY;
unsigned char mode;
unsigned char line, lineYC;
unsigned char DMA, DMA_ptr;
unsigned short mode_clock;
bool do_DMA;
unsigned char bg_pal, ob_pal0, ob_pal1;
unsigned char wdow_y, wdow_x;
unsigned char tileset[384][8][8];
} gpu_type;
extern gpu_type gpu;
void setup(bool, bool);
void cleanup(void);
void gpu_step(void);
#endif