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