This source file includes following definitions.
- hook_raw_image_addr
- hook_alt_raw_image_addr
- vid_bitmap_refresh
- shutdown
- vid_get_bitmap_fb
- get_flash_params_count
- vid_get_viewport_fb
- camera_jpeg_count_str
- debug_led
- camera_set_led
- vid_get_viewport_fb_d
- vid_get_viewport_live_fb
- vid_get_viewport_yscale
- vid_get_viewport_width
- vid_get_viewport_height
- vid_get_viewport_display_xoffset
- vid_get_viewport_display_xoffset_proper
- vid_get_viewport_display_yoffset_proper
- vid_get_viewport_height_proper
- vid_get_viewport_fullscreen_height
- vid_get_palette_type
- vid_get_palette_size
- vid_get_bitmap_active_palette
- vid_get_bitmap_active_buffer
- JogDial_CW
- JogDial_CCW
1 #include "platform.h"
2 #include "platform_palette.h"
3 #include "lolevel.h"
4
5 extern int active_raw_buffer;
6 extern char* raw_buffers[];
7
8 char *hook_raw_image_addr()
9 {
10 return raw_buffers[active_raw_buffer & 1];
11 }
12
13 char *hook_alt_raw_image_addr()
14 {
15 return raw_buffers[((active_raw_buffer & 1)^1)];
16 }
17
18
19
20
21
22
23
24 void vid_bitmap_refresh()
25 {
26 extern int full_screen_refresh;
27 extern void _ScreenLock();
28 extern void _ScreenUnlock();
29
30 full_screen_refresh |= 3;
31 _ScreenLock();
32 _ScreenUnlock();
33 }
34
35 #define LED_PR 0xC022D1FC
36 #define AF_LED 0xC022D034
37 void shutdown()
38 {
39 extern void _TurnOffE1(void);
40 _TurnOffE1();
41 while(1);
42 }
43 void *vid_get_bitmap_fb() { return (void*)0x40711000; }
44 int get_flash_params_count(void) { return 0xdc; }
45 void *vid_get_viewport_fb() { return (void*)0x40866b80; }
46
47 char *camera_jpeg_count_str()
48 {
49 extern char jpeg_count_str[];
50 return jpeg_count_str;
51 }
52
53 void debug_led(int state)
54 {
55 volatile long *p=(void*)LED_PR;
56 if (state)
57 p[0]=0x93d800;
58 else
59 p[0]=0x83dc00;
60 }
61
62 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
63 static char led_table[]={0,12};
64 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
65 }
66
67 extern char active_viewport_buffer;
68 extern void* viewport_buffers[];
69
70 void *vid_get_viewport_fb_d()
71 {
72 extern char *viewport_fb_d;
73 return viewport_fb_d;
74 }
75
76 void *vid_get_viewport_live_fb()
77 {
78
79
80
81
82
83 return viewport_buffers[(active_viewport_buffer-1)&3];
84 }
85
86
87 int vid_get_viewport_yscale() {
88 return 2;
89 }
90
91 int vid_get_viewport_width()
92 {
93 if (camera_info.state.mode_play)
94 {
95 return 360;
96 }
97 extern int _GetVRAMHPixelsSize();
98 return _GetVRAMHPixelsSize() >> 1;
99 }
100
101 long vid_get_viewport_height()
102 {
103
104 int m = mode_get();
105 int aspect_ratio=shooting_get_prop(PROPCASE_ASPECT_RATIO);
106
107 if (MODE_IS_VIDEO(m) || is_video_recording())
108 return 240;
109
110 if ((m & MODE_MASK) != MODE_PLAY)
111 {
112
113 if (aspect_ratio==1 || aspect_ratio==2)
114 return 240;
115 }
116 extern int _GetVRAMVPixelsSize();
117 return ((m & MODE_MASK) == MODE_PLAY)?240:_GetVRAMVPixelsSize()>>1;
118 }
119
120
121
122 static long vp_xo[4] = { 0, 0, 0, 44 };
123
124 int vid_get_viewport_display_xoffset()
125 {
126 int m = mode_get();
127 int aspect_ratio=shooting_get_prop(PROPCASE_ASPECT_RATIO);
128
129 if ((m & MODE_MASK) != MODE_PLAY) {
130 return (vp_xo[aspect_ratio]);
131 }
132 else
133 return 0;
134 }
135
136 int vid_get_viewport_display_xoffset_proper() { return vid_get_viewport_display_xoffset()<<1; }
137 int vid_get_viewport_display_yoffset_proper() { return vid_get_viewport_display_yoffset()<<1; }
138 int vid_get_viewport_height_proper() { return vid_get_viewport_height() * 2; }
139 int vid_get_viewport_fullscreen_height() { return 480; }
140 int vid_get_palette_type() { return 3; }
141 int vid_get_palette_size() { return 256 * 4; }
142
143 void *vid_get_bitmap_active_palette()
144 {
145 extern void *palette_buffer_ptr;
146 return palette_buffer_ptr;
147 }
148
149 extern int active_bitmap_buffer;
150 extern char* bitmap_buffer[];
151
152 void *vid_get_bitmap_active_buffer() {
153 return bitmap_buffer[active_bitmap_buffer&1];
154 }
155
156
157
158
159
160 void JogDial_CW(void)
161 {
162 _PostLogicalEventToUI(0x872, 1);
163 }
164
165 void JogDial_CCW(void)
166 {
167 _PostLogicalEventToUI(0x873, 1);
168 }