This source file includes following definitions.
- shutdown
- debug_led
- camera_set_led
- get_flash_params_count
- vid_get_viewport_height
- vid_bitmap_refresh
- vid_get_bitmap_active_palette
- vid_get_viewport_fb
- vid_get_viewport_live_fb
- load_chdk_palette
- vid_get_palette_type
- vid_get_palette_size
1 #include "platform.h"
2 #include "platform_palette.h"
3 #include "lolevel.h"
4
5 void shutdown()
6 {
7 extern void _TurnOffE1(void);
8 _TurnOffE1();
9 while(1);
10 }
11
12 #define LED_PR 0xC02200F0
13
14
15 void debug_led(int state)
16 {
17 *(int*)LED_PR=state ? 0x46 : 0x44;
18 }
19
20 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
21 static char led_table[2]={0,9};
22 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
23 }
24
25 int get_flash_params_count(void){
26 return 0xa0;
27 }
28
29 long vid_get_viewport_height()
30 {
31 return 240;
32 }
33
34 void vid_bitmap_refresh() {
35
36 extern int full_screen_refresh;
37 extern void _ScreenUnlock();
38 extern void _ScreenLock();
39
40 full_screen_refresh |= 3;
41 _ScreenLock();
42 _ScreenUnlock();
43 }
44
45 void *vid_get_bitmap_active_palette() {
46 extern int active_palette_buffer;
47 extern char* palette_buffer[];
48 void* p = palette_buffer[active_palette_buffer];
49
50 if (p) p += 8;
51 return p;
52 }
53
54 extern char active_viewport_buffer;
55 extern void* viewport_buffers[];
56
57 void *vid_get_viewport_fb()
58 {
59
60 return viewport_buffers[0];
61 }
62
63 void *vid_get_viewport_live_fb()
64 {
65 if (camera_info.state.mode_video)
66 return viewport_buffers[0];
67
68
69 return viewport_buffers[(active_viewport_buffer-1)&3];
70 }
71
72 #ifdef CAM_LOAD_CUSTOM_COLORS
73
74
75 void load_chdk_palette() {
76
77 extern int active_palette_buffer;
78
79 if ((active_palette_buffer == 0) || (active_palette_buffer == 4))
80 {
81 int *pal = (int*)vid_get_bitmap_active_palette();
82 if (pal && pal[CHDK_COLOR_BASE+0] != 0x33ADF62)
83 {
84 pal[CHDK_COLOR_BASE+0] = 0x33ADF62;
85 pal[CHDK_COLOR_BASE+1] = 0x326EA40;
86 pal[CHDK_COLOR_BASE+2] = 0x34CD57F;
87 pal[CHDK_COLOR_BASE+3] = 0x373BFAE;
88 pal[CHDK_COLOR_BASE+4] = 0x34BD6CA;
89 pal[CHDK_COLOR_BASE+5] = 0x395AB95;
90 pal[CHDK_COLOR_BASE+6] = 0x34766F0;
91 pal[CHDK_COLOR_BASE+7] = 0x31250F3;
92 pal[CHDK_COLOR_BASE+8] = 0x37F408F;
93 pal[CHDK_COLOR_BASE+9] = 0x3512D5B;
94 pal[CHDK_COLOR_BASE+10] = 0x3A9A917;
95 pal[CHDK_COLOR_BASE+11] = 0x3819137;
96 pal[CHDK_COLOR_BASE+12] = 0x3DED115;
97 pal[CHDK_COLOR_BASE+13] = 0x0090000;
98
99 extern char palette_control;
100 palette_control = 1;
101 vid_bitmap_refresh();
102 }
103
104
105
106
107
108
109
110
111
112
113
114
115 }
116 }
117 #endif
118
119 int vid_get_palette_type() { return 3; }
120 int vid_get_palette_size() { return 256 * 4; }