This repository has been archived by the owner on Mar 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
regsinternal.h
108 lines (88 loc) · 2.41 KB
/
regsinternal.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#pragma once
//Most things here are straight-copied from various libdragon files
#include <stdint.h>
#define MI_INTR_SP 0x01
#define MI_INTR_SI 0x02
#define MI_INTR_AI 0x04
#define MI_INTR_VI 0x08
#define MI_INTR_PI 0x10
#define MI_INTR_DP 0x20
#define MI_INTR_CLEAR_SP (1 << 0)
#define MI_INTR_SET_SP (1 << 1)
#define MI_INTR_CLEAR_SI (1 << 2)
#define MI_INTR_SET_SI (1 << 3)
#define MI_INTR_CLEAR_AI (1 << 4)
#define MI_INTR_SET_AI (1 << 5)
#define MI_INTR_CLEAR_VI (1 << 6)
#define MI_INTR_SET_VI (1 << 7)
#define MI_INTR_CLEAR_PI (1 << 8)
#define MI_INTR_SET_PI (1 << 9)
#define MI_INTR_CLEAR_DP (1 << 10)
#define MI_INTR_SET_DP (1 << 11)
#define PI_CLEAR_INTERRUPT 0x02
#define SI_CLEAR_INTERRUPT 0
#define SP_CLEAR_INTERRUPT 0x08
#define DP_CLEAR_INTERRUPT 0x0800
#define AI_CLEAR_INTERRUPT 0
#define SW1_INTR 0x01
#define SW2_INTR 0x02
#define RCP_INTR 0x04
#define CART_INTR 0x08
#define PRENMI_INTR 0x10
#define COUNT_INTR 0x80
typedef struct {
volatile void * address;
uint32_t length;
uint32_t control;
uint32_t status;
uint32_t dacrate;
uint32_t samplesize;
} AI_regs_t;
typedef struct {
uint32_t mode;
uint32_t version;
uint32_t intr;
uint32_t mask;
} MI_regs_t;
typedef struct {
uint32_t control;
void * framebuffer;
uint32_t width;
uint32_t v_int;
uint32_t cur_line;
uint32_t timing;
uint32_t v_sync;
uint32_t h_sync;
uint32_t h_sync2;
uint32_t h_limits;
uint32_t v_limits;
uint32_t color_burst;
uint32_t h_scale;
uint32_t v_scale;
} VI_regs_t;
typedef struct {
volatile void * ram_address;
uint32_t pi_address;
uint32_t read_length;
uint32_t write_length;
uint32_t status;
} PI_regs_t;
typedef struct {
volatile void * DRAM_addr;
volatile void * PIF_addr_read;
uint32_t reserved1;
uint32_t reserved2;
volatile void * PIF_addr_write;
uint32_t reserved3;
uint32_t status;
} SI_regs_t;
typedef struct {
volatile void * RSP_addr;
volatile void * RDAM_addr;
uint32_t rsp_read_length;
uint32_t rsp_write_length;
uint32_t status;
uint32_t rsp_dma_full;
uint32_t rsp_dma_busy;
uint32_t rsp_semaphore;
} SP_regs_t;