This source file includes following definitions.
- vid_bitmap_refresh
- shutdown
- debug_led
- camera_set_led
- get_flash_params_count
- JogDial_CW
- JogDial_CCW
- vid_get_viewport_byte_width
- vid_get_viewport_width
- vid_get_viewport_display_xoffset
- vid_get_viewport_height
- vid_get_viewport_display_yoffset
- vid_get_viewport_buffer_width_proper
- vid_get_palette_type
- vid_get_palette_size
- vid_get_aspect_ratio
- vid_get_viewport_width_proper
- vid_get_viewport_height_proper
- vid_get_viewport_live_fb
- vid_get_bitmap_active_palette
1 #include "platform.h"
2 #include "lolevel.h"
3
4
5
6
7
8
9
10
11
12
13
14
15
16 void vid_bitmap_refresh()
17 {
18 extern int enabled_refresh_physical_screen;
19 extern int full_screen_refresh;
20
21
22
23
24 extern void _LockAndRefresh();
25 extern void _UnlockAndRefresh();
26
27 _LockAndRefresh();
28
29 enabled_refresh_physical_screen=1;
30 full_screen_refresh=3;
31
32 _UnlockAndRefresh();
33 }
34
35
36
37
38 void shutdown()
39 {
40 volatile long *p = (void*)0xC022001C;
41
42 asm(
43 "MRS R1, CPSR\n"
44 "AND R0, R1, #0x80\n"
45 "ORR R1, R1, #0x80\n"
46 "MSR CPSR_cf, R1\n"
47 :::"r1","r0");
48
49 *p = 0x44;
50
51 while(1);
52 }
53
54 #define LED_PR 0xC0220130
55
56
57 void debug_led(int state)
58 {
59 *(int*)LED_PR=state ? 0x46 : 0x44;
60 }
61
62 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
63 static char led_table[5]={4,5,7,8,9};
64 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
65 }
66
67 int get_flash_params_count(void){
68 return 120;
69 }
70
71 void JogDial_CW(void){
72 _PostLogicalEventForNotPowerType(0x876, 2);
73 }
74
75 void JogDial_CCW(void){
76 _PostLogicalEventForNotPowerType(0x877, 2);
77 }
78
79
80
81
82
83
84
85
86 int vid_get_viewport_byte_width() {
87 return 960 * 6 / 4;
88 }
89
90
91
92 int vid_get_viewport_width()
93 {
94
95
96
97
98
99
100
101
102
103
104 if( ( (shooting_get_prop(PROPCASE_RESOLUTION) == 8) && (!MODE_IS_VIDEO(mode_get())) ) ||
105 ( (MODE_IS_VIDEO(mode_get())) && (shooting_get_prop(PROPCASE_VIDEO_RESOLUTION) == 4) ) )
106 return 480;
107 else
108 return 360;
109 }
110
111 int vid_get_viewport_display_xoffset()
112 {
113
114
115
116
117
118
119
120
121
122
123 if( ( (shooting_get_prop(PROPCASE_RESOLUTION) == 8) && (!MODE_IS_VIDEO(mode_get())) ) ||
124 ( (MODE_IS_VIDEO(mode_get())) && (shooting_get_prop(PROPCASE_VIDEO_RESOLUTION) == 4) ) )
125 return 0;
126 else
127 return 60;
128 }
129
130 long vid_get_viewport_height()
131 {
132
133
134
135
136
137 return 240;
138 }
139
140 int vid_get_viewport_display_yoffset()
141 {
142
143
144
145
146 return 0;
147 }
148
149 int vid_get_viewport_buffer_width_proper() { return 960; }
150 int vid_get_palette_type() { return 3; }
151 int vid_get_palette_size() { return 256 * 4; }
152 int vid_get_aspect_ratio() { return 1; }
153 extern int _GetVRAMHPixelsSize();
154 extern int _GetVRAMVPixelsSize();
155
156 int vid_get_viewport_width_proper() {
157 return ((mode_get()&MODE_MASK) == MODE_PLAY)?960:_GetVRAMHPixelsSize();
158 }
159
160 int vid_get_viewport_height_proper() {
161 return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:_GetVRAMVPixelsSize();
162 }
163
164
165 extern char active_viewport_buffer;
166 extern void* viewport_buffers[];
167
168 void *vid_get_viewport_live_fb()
169 {
170
171
172
173
174
175
176
177
178
179
180 unsigned char buff = active_viewport_buffer;
181 if (buff == 0) {
182 buff = 2;
183 }
184 else {
185 buff--;
186 }
187 return viewport_buffers[buff];
188 }
189
190 void *vid_get_bitmap_active_palette()
191 {
192 extern int active_palette_buffer;
193 extern int** palette_buffer_ptr;
194 return (palette_buffer_ptr[active_palette_buffer]+0x3);
195 }