forked from iPodLinux-Community/iGameGear
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vdp.h
45 lines (38 loc) · 888 Bytes
/
vdp.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
#ifndef _VDP_H_
#define _VDP_H_
/* Display timing (NTSC) */
#define MASTER_CLOCK (3579545)
#define LINES_PER_FRAME (262)
#define FRAMES_PER_SECOND (60)
#define CYCLES_PER_LINE ((MASTER_CLOCK / FRAMES_PER_SECOND) / LINES_PER_FRAME)
/* VDP context */
typedef struct
{
uint8 vram[0x4000];
uint8 cram[0x40];
uint8 reg[0x10];
uint8 status;
uint8 latch;
uint8 pending;
uint8 buffer;
uint8 code;
uint16 addr;
int ntab;
int satb;
int line;
int left;
uint8 limit;
}t_vdp;
/* Global data */
extern t_vdp vdp;
/* Function prototypes */
void vdp_init(void);
void vdp_reset(void);
void vdp_ctrl_w(int data);
int vdp_ctrl_r(void);
uint8 vdp_vcounter_r(void);
uint8 vdp_hcounter_r(void);
void vdp_data_w(int data);
int vdp_data_r(void);
void vdp_run(void);
#endif /* _VDP_H_ */