forked from reticulatedpines/magiclantern_hg_02
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvram.h
230 lines (199 loc) · 4.82 KB
/
vram.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
#ifndef _video_h_
#define _video_h_
/** \file
* Interface to the 5D Mark II's video ram (VRAM).
*/
/*
* Copyright (C) 2009 Trammell Hudson <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "arm-mcr.h"
/** VRAM accessors */
extern uint32_t
vram_get_number(
uint32_t number
);
/** Write the VRAM to a BMP file named "A:/test.bmp" */
extern void
dispcheck( void );
extern const char * vram_instance_str_ptr;
/** Retrieve the vram info? */
extern void
vram_image_pos_and_size(
uint32_t * x,
uint32_t * y,
uint32_t * w,
uint32_t * h
);
/** VRAM info structure (maybe?) */
struct vram_object
{
const char * name; // "Vram Instance" 0xFFCA79E5
uint32_t off_0x04;
uint32_t off_0x08;
uint32_t off_0x0c;
uint32_t off_0x10;
struct semaphore * sem; // off 0x14;
};
extern struct vram_object *
vram_instance( void );
extern int
vram_get_lock(
struct vram_object * vram
);
struct bmp_vram_info
{
uint8_t * vram0;
uint32_t off_0x04;
uint8_t * vram2;
//uint32_t off_0x0c;
};
extern struct bmp_vram_info bmp_vram_info[];
/** VRAM info in the BSS.
*
* Pixels are in an unknown format.
* This points to the image VRAM, not the bitmap vram
*/
struct vram_info
{
uint16_t * vram; // off 0x00
uint32_t width; // maybe off 0x04
uint32_t pitch; // maybe off 0x08
uint32_t height; // off 0x0c
uint32_t vram_number; // off 0x10
};
SIZE_CHECK_STRUCT( vram_info, 0x14 );
extern struct vram_info vram_info[2];
extern void
vram_schedule_callback(
struct vram_info * vram,
int arg1,
int arg2,
int width,
int height,
void (*handler)( void * ),
void * arg
);
/** HDMI config.
* This structure is largely unknown.
*/
struct hdmi_config
{
uint32_t off_0x00;
uint32_t off_0x04;
uint32_t off_0x08;
uint32_t off_0x0c;
uint32_t off_0x10;
uint32_t off_0x14;
uint32_t off_0x18;
uint32_t off_0x1c;
uint32_t off_0x20;
uint32_t off_0x24;
// 0 == 720x480, 1 = 704x480, 2== 704x576, 3==1920x1080?
// according to ImgDDev_select_parameter up to 0xA?
uint32_t disp_type; // off_0x28;
uint32_t off_0x2c;
// 0 == 720x480, 1 = 704x480, 2== 704x576, 3==1920x1080
uint32_t hdmi_mode; // off_0x30;
uint32_t off_0x34;
thunk img_request_notify_blank; // off_0x38;
thunk bmp_request_notify_blank; // off_0x3c;
uint32_t off_0x40;
uint32_t off_0x44;
uint32_t off_0x48;
// 0xc0f14070 == video enabled?
uint32_t image_vbuf_playback_enabled; // off_0x4c;
uint32_t off_0x50;
uint32_t off_0x54;
uint32_t off_0x58;
uint32_t off_0x5c;
uint32_t off_0x60;
uint32_t off_0x64;
uint32_t off_0x68;
uint32_t off_0x6c;
uint32_t off_0x70;
uint32_t off_0x74;
uint32_t off_0x78;
uint32_t off_0x7c;
uint32_t off_0x80;
uint32_t off_0x84;
uint32_t off_0x88;
uint32_t off_0x8c;
uint32_t off_0x90;
uint32_t off_0x94;
uint32_t off_0x98;
uint32_t off_0x9c;
uint32_t off_0xa0;
uint32_t off_0xa4;
uint32_t off_0xa8;
uint32_t off_0xac;
uint32_t off_0xb0;
struct semaphore * sem; // off_0xb4;
struct semaphore * bmpddev_sem; // off_0xb8;
struct semaphore * imb_cbr_semaphore; // off_0xbc;
uint32_t off_0xc0;
uint32_t off_0xc4;
uint32_t off_0xc8;
uint32_t off_0xcc;
uint32_t off_0xd0;
uint32_t off_0xd4;
uint32_t off_0xd8;
uint32_t off_0xdc;
uint32_t off_0xe0;
uint32_t off_0xe4;
uint32_t off_0xe8;
uint32_t off_0xec;
uint32_t off_0xf0;
uint32_t off_0xf4;
uint32_t off_0xf8;
uint32_t off_0xfc;
uint32_t off_0x100;
uint32_t off_0x104;
uint32_t off_0x108;
uint32_t off_0x10c;
uint32_t off_0x110;
uint32_t off_0x114;
uint32_t off_0x118;
uint32_t off_0x11c;
uint32_t off_0x120;
uint32_t off_0x124;
struct bmp_vram_info * bmp_info; // off_0x128;
uint32_t off_0x12c;
uint32_t off_0x130;
uint32_t off_0x134;
uint32_t off_0x138;
uint32_t off_0x13c;
uint32_t off_0x140;
uint32_t off_0x144;
void * off_0x148;
uint32_t off_0x14c;
void * off_0x150;
uint32_t off_0x154;
uint32_t off_0x158;
uint32_t off_0x15c;
uint32_t off_0x160;
uint32_t off_0x164;
uint32_t off_0x168;
uint32_t off_0x16c;
uint32_t off_0x170;
uint32_t off_0x174;
uint32_t off_0x178;
uint32_t off_0x17c;
};
extern struct hdmi_config hdmi_config;
#endif