Loading [MathJax]/extensions/tex2jax.js
Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
hw_regs.h
Go to the documentation of this file.
1#ifndef _DOLPHIN_HW_REGS_H_
2#define _DOLPHIN_HW_REGS_H_
3
4#include <dolphin/types.h>
5
6#ifdef __MWERKS__
7volatile u16 __VIRegs[59] AT_ADDRESS(0xCC002000);
8volatile u32 __PIRegs[12] AT_ADDRESS(0xCC003000);
9volatile u16 __MEMRegs[64] AT_ADDRESS(0xCC004000);
10volatile u16 __DSPRegs[] AT_ADDRESS(0xCC005000);
11volatile u32 __DIRegs[] AT_ADDRESS(0xCC006000);
12volatile u32 __SIRegs[0x100] AT_ADDRESS(0xCC006400);
13volatile u32 __EXIRegs[0x40] AT_ADDRESS(0xCC006800);
14volatile u32 __AIRegs[8] AT_ADDRESS(0xCC006C00);
15#else
16#define __VIRegs ((volatile u16 *)0xCC002000)
17#define __PIRegs ((volatile u32 *)0xCC003000)
18#define __MEMRegs ((volatile u16 *)0xCC004000)
19#define __DSPRegs ((volatile u16 *)0xCC005000)
20#define __DIRegs ((volatile u32 *)0xCC006000)
21#define __SIRegs ((volatile u32 *)0xCC006400)
22#define __EXIRegs ((volatile u32 *)0xCC006800)
23#define __AIRegs ((volatile u32 *)0xCC006C00)
24#endif
25
26// Offsets for __VIRegs
27
28// offsets for __VIRegs[i]
29#define VI_VERT_TIMING (0)
30#define VI_DISP_CONFIG (1)
31#define VI_HORIZ_TIMING_0L (2)
32#define VI_HORIZ_TIMING_0U (3)
33#define VI_HORIZ_TIMING_1L (4)
34#define VI_HORIZ_TIMING_1U (5)
35#define VI_VERT_TIMING_ODD (6)
36#define VI_VERT_TIMING_ODD_U (7)
37#define VI_VERT_TIMING_EVEN (8)
38#define VI_VERT_TIMING_EVEN_U (9)
39
40#define VI_BBI_ODD (10) // burst blanking interval
41#define VI_BBI_ODD_U (11) // burst blanking interval
42#define VI_BBI_EVEN (12) // burst blanking interval
43#define VI_BBI_EVEN_U (13) // burst blanking interval
44
45#define VI_TOP_FIELD_BASE_LEFT (14) // top in 2d, top of left pic in 3d
46#define VI_TOP_FIELD_BASE_LEFT_U (15) // top in 2d, top of left pic in 3d
47
48#define VI_TOP_FIELD_BASE_RIGHT (16) // top of right pic in 3d
49#define VI_TOP_FIELD_BASE_RIGHT_U (17) // top of right pic in 3d
50
51#define VI_BTTM_FIELD_BASE_LEFT (18) // bottom in 2d, bottom of left pic in 3d
52#define VI_BTTM_FIELD_BASE_LEFT_U (19) // bottom in 2d, bottom of left pic in 3d
53
54#define VI_BTTM_FIELD_BASE_RIGHT (20) // bottom of right pic in 3d
55#define VI_BTTM_FIELD_BASE_RIGHT_U (21) // bottom of right pic in 3d
56
57#define VI_VERT_COUNT (22) // vertical display position
58#define VI_HORIZ_COUNT (23) // horizontal display position
59
60#define VI_DISP_INT_0 (24) // display interrupt 0L
61#define VI_DISP_INT_0U (25) // display interrupt 0U
62#define VI_DISP_INT_1 (26) // display interrupt 1L
63#define VI_DISP_INT_1U (27) // display interrupt 1U
64#define VI_DISP_INT_2 (28) // display interrupt 2L
65#define VI_DISP_INT_2U (29) // display interrupt 2U
66#define VI_DISP_INT_3 (30) // display interrupt 3L
67#define VI_DISP_INT_3U (31) // display interrupt 3U
68
69#define VI_HSW (36) // horizontal scaling width
70#define VI_HSR (37) // horizontal scaling register
71
72#define VI_FCT_0 (38) // filter coefficient table 0L
73#define VI_FCT_0U (39) // filter coefficient table 0U
74#define VI_FCT_1 (40) // filter coefficient table 1L
75#define VI_FCT_1U (41) // filter coefficient table 1U
76#define VI_FCT_2 (42) // filter coefficient table 2L
77#define VI_FCT_2U (43) // filter coefficient table 2U
78#define VI_FCT_3 (44) // filter coefficient table 3L
79#define VI_FCT_3U (45) // filter coefficient table 3U
80#define VI_FCT_4 (46) // filter coefficient table 4L
81#define VI_FCT_4U (47) // filter coefficient table 4U
82#define VI_FCT_5 (48) // filter coefficient table 5L
83#define VI_FCT_5U (49) // filter coefficient table 5U
84#define VI_FCT_6 (50) // filter coefficient table 6L
85#define VI_FCT_6U (51) // filter coefficient table 6U
86
87#define VI_CLOCK_SEL (54) // clock select
88#define VI_DTV_STAT (55) // DTV status
89
90#define VI_WIDTH (56)
91
92// offsets for __DSPRegs[i]
93#define DSP_MAILBOX_IN_HI (0)
94#define DSP_MAILBOX_IN_LO (1)
95#define DSP_MAILBOX_OUT_HI (2)
96#define DSP_MAILBOX_OUT_LO (3)
97#define DSP_CONTROL_STATUS (5)
98
99#define DSP_ARAM_SIZE (9)
100#define DSP_ARAM_MODE (11)
101#define DSP_ARAM_REFRESH (13)
102#define DSP_ARAM_DMA_MM_HI (16) // Main mem address
103#define DSP_ARAM_DMA_MM_LO (17)
104#define DSP_ARAM_DMA_ARAM_HI (18) // ARAM address
105#define DSP_ARAM_DMA_ARAM_LO (19)
106#define DSP_ARAM_DMA_SIZE_HI (20) // DMA buffer size
107#define DSP_ARAM_DMA_SIZE_LO (21)
108
109#define DSP_DMA_START_HI (24) // DMA start address
110#define DSP_DMA_START_LO (25)
111#define DSP_DMA_CONTROL_LEN (27)
112#define DSP_DMA_BYTES_LEFT (29)
113
114#define DSP_DMA_START_FLAG (0x8000) // set to start DSP
115
116#endif
volatile u16 __VIRegs[59] AT_ADDRESS(0xCC002000)
unsigned long u32
Definition types.h:9
unsigned short int u16
Definition types.h:7