This source file includes following definitions.
- hook_raw_image_addr
- hook_yuv_shooting_buf_addr
- hook_yuv_shooting_buf_width
- hook_yuv_shooting_buf_height
- vid_get_bitmap_fb
- vid_get_viewport_fb
- vid_get_viewport_fb_d
- vid_get_viewport_width_proper
- vid_get_viewport_width
- vid_get_viewport_height_proper
- vid_get_viewport_height
- review_fullscreen_mode
- postreview_fullscreen_mode
- raw_shoot_avail
- mf_slider_active
- vid_get_viewport_live_fb
- camera_jpeg_count_str
- vid_get_palette_type
- vid_get_palette_size
- vid_get_bitmap_active_palette
- vid_get_bitmap_active_buffer
- vid_get_viewport_fullscreen_height
- vid_get_viewport_fullscreen_width
- vid_get_viewport_display_xoffset
- vid_get_viewport_xoffset
- vid_get_viewport_display_yoffset
- vid_get_viewport_yoffset
1 #include "platform.h"
2 #include "keyboard.h"
3
4 char *hook_raw_image_addr()
5 {
6 return (char*)0x105B8AC0;
7
8 }
9
10
11
12
13
14 #if 0
15
16
17
18
19 char *hook_yuv_shooting_buf_addr() {
20 return (char*)0x105599A0;
21 }
22
23
24
25
26
27
28 int hook_yuv_shooting_buf_width() {
29 if (shooting_get_resolution() !=0 && shooting_get_resolution() !=8)
30 return *(int*)0x33394;
31 return 0;
32 }
33
34 int hook_yuv_shooting_buf_height() {
35 if (shooting_get_resolution() !=0 && shooting_get_resolution() !=8)
36 return *(int*)0x33398;
37 return 0;
38 }
39 #endif
40
41 void *vid_get_bitmap_fb()
42 {
43 return (void*)0x103C79A0;
44 }
45
46 void *vid_get_viewport_fb()
47 {
48 return (void*)0x105F17A0;
49 }
50
51 void *vid_get_viewport_fb_d()
52 {
53
54 int x=(*(int*)0x63AD0);
55 return (void *)x;
56
57
58
59 }
60
61 extern int _GetVRAMHPixelsSize();
62 extern int _GetVRAMVPixelsSize();
63
64
65
66
67
68
69 int vid_get_viewport_width_proper() {
70 int m = mode_get();
71 if((m&MODE_MASK) == MODE_PLAY) {
72 return 704;
73 }
74 #ifdef FAKE_ASPECT
75
76 if((m&MODE_SHOOTING_MASK) == MODE_PORTRAIT) {
77 return 528;
78 }
79 #endif
80
81 if((m&MODE_SHOOTING_MASK) == MODE_STITCH) {
82 return 352;
83 }
84 return _GetVRAMHPixelsSize();
85 }
86
87 int vid_get_viewport_width() {
88 return vid_get_viewport_width_proper()>>1;
89 }
90
91 int vid_get_viewport_height_proper() {
92 int m = mode_get();
93
94 if((m&MODE_MASK) == MODE_PLAY) {
95 return 240;
96 }
97 #ifdef FAKE_ASPECT
98
99 if((m&MODE_SHOOTING_MASK) == MODE_LANDSCAPE) {
100 return 180;
101 }
102 #endif
103
104 if((m&MODE_SHOOTING_MASK) == MODE_STITCH) {
105 return 120;
106 }
107 return _GetVRAMVPixelsSize();
108 }
109
110 long vid_get_viewport_height() {
111 return vid_get_viewport_height_proper();
112 }
113
114
115 #if 0
116 int review_fullscreen_mode(){
117 char r;
118 get_parameter_data(53, &r, 1);
119 return r==0;
120 }
121
122 int postreview_fullscreen_mode(){
123 char r;
124 get_parameter_data(54, &r, 1);
125 return r==0;
126 }
127
128
129 static int file_size_table[3][5]={{3110,2562,1666,1057,288},
130 {1954,1441, 928, 608,176},
131 {960, 736, 480, 320,112}};
132
133
134 long raw_shoot_avail(){
135 long jpegs,size,quality;
136 jpegs=atoi((char*)0x6E8D0);
137 get_property_case(23, (void *)&quality, 4);
138 get_property_case(24, (void *)&size, 4);
139 if ((size>4) || (quality>2)) return 0;
140 return (file_size_table[quality][size]*jpegs)/(file_size_table[quality][size]+(hook_raw_size()>>10));
141 }
142
143
144 int mf_slider_active()
145 {
146 return *(long*)0x6C8B0==0x100;
147 }
148 #endif
149
150 void *vid_get_viewport_live_fb()
151 {
152 void **fb=(void **)0x5288;
153 unsigned char buff = *((unsigned char*)0x5298);
154 if (buff == 0) {
155 buff = 2;
156 }
157 else {
158 buff--;
159 }
160 return fb[buff];
161 }
162
163
164 char *camera_jpeg_count_str()
165 {
166 return (char*)0x6E8D0 ;
167 }
168
169
170 int vid_get_palette_type() { return 1; }
171 int vid_get_palette_size() { return 16*4; }
172
173 void *vid_get_bitmap_active_palette() {
174 return (void *)0x634E0;
175 }
176
177 void *vid_get_bitmap_active_buffer()
178 {
179 return (void*)(*(int*)0x5ED0);
180 }
181
182 int vid_get_viewport_fullscreen_height() {
183
184 int m = mode_get();
185 if((m&MODE_MASK) != MODE_PLAY && ((m&MODE_SHOOTING_MASK) == MODE_STITCH
186 #ifdef FAKE_ASPECT
187 || (m&MODE_SHOOTING_MASK) == MODE_LANDSCAPE
188 #endif
189 )) {
190 return 240;
191 }
192 return vid_get_viewport_height_proper();
193 }
194 int vid_get_viewport_fullscreen_width() {
195
196 int m = mode_get();
197 if((m&MODE_MASK) != MODE_PLAY && ((m&MODE_SHOOTING_MASK) == MODE_STITCH
198 #ifdef FAKE_ASPECT
199 || (m&MODE_SHOOTING_MASK) == MODE_PORTRAIT
200 #endif
201 )) {
202 return 704;
203 }
204 return vid_get_viewport_width_proper();
205 }
206
207 int vid_get_viewport_display_xoffset() {
208 int m = mode_get();
209 if((m&MODE_MASK) == MODE_PLAY) {
210 return 0;
211 } else if((m&MODE_SHOOTING_MASK) == MODE_STITCH) {
212 short dir=0;
213 short seq=0;
214 get_property_case(PROPCASE_STITCH_DIRECTION,&dir,sizeof(dir));
215 get_property_case(PROPCASE_STITCH_SEQUENCE,&seq,sizeof(seq));
216
217
218 if(dir==0) {
219 return seq?132:44;
220 } else {
221 return seq?44:132;
222 }
223 #ifdef FAKE_ASPECT
224 } else if((m&MODE_SHOOTING_MASK) == MODE_PORTRAIT) {
225 return 44;
226 #endif
227 }
228 return 0;
229 }
230
231 #ifdef FAKE_ASPECT
232 int vid_get_viewport_xoffset() {
233 int m = mode_get();
234 if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_PORTRAIT) {
235 return 44;
236 }
237 return 0;
238 }
239 #endif
240
241 int vid_get_viewport_display_yoffset() {
242 int m = mode_get();
243 if((m&MODE_MASK) == MODE_PLAY) {
244 return 0;
245 }
246 #ifdef FAKE_ASPECT
247 if((m&MODE_SHOOTING_MASK) == MODE_LANDSCAPE) {
248 return 30;
249 }
250 #endif
251 return ((m&MODE_SHOOTING_MASK) == MODE_STITCH)?60:0;
252 }
253
254 #ifdef FAKE_ASPECT
255 int vid_get_viewport_yoffset() {
256 int m = mode_get();
257 if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_LANDSCAPE) {
258 return 30;
259 }
260 return 0;
261 }
262 #endif