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