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