This source file includes following definitions.
- vid_bitmap_refresh
- shutdown
- debug_led
- camera_set_led
- get_flash_params_count
- JogDial_CW
- JogDial_CCW
- vid_get_viewport_width
- vid_get_viewport_height
- vid_get_viewport_yscale
- vid_get_palette_type
- vid_get_palette_size
- vid_get_viewport_height_proper
- vid_get_viewport_fullscreen_height
- vid_get_bitmap_active_palette
- load_chdk_palette
1 #include "platform.h"
2 #include "platform_palette.h"
3 #include "lolevel.h"
4
5 void vid_bitmap_refresh()
6 {
7 _ScreenLock();
8 _RefreshPhysicalScreen(1);
9 }
10
11
12 void shutdown()
13 {
14 volatile long *p = (void*)0xC022001C;
15
16 asm(
17 "MRS R1, CPSR\n"
18 "AND R0, R1, #0x80\n"
19 "ORR R1, R1, #0x80\n"
20 "MSR CPSR_cf, R1\n"
21 :::"r1","r0");
22
23 *p = 0x44;
24
25 while(1);
26 }
27
28
29
30
31
32
33
34
35
36 #define LED_PR 0xC02200D4
37
38 void debug_led(int state)
39 {
40 *(int*)LED_PR=state ? 0x46 : 0x44;
41 }
42
43
44
45
46
47
48
49
50
51
52
53
54
55 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
56 static char led_table[8]={0,1,2,3,8,9,14,15};
57 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
58 }
59
60 int get_flash_params_count(void){
61 return 0x78 ;
62
63 }
64
65 void JogDial_CW(void){
66 _PostLogicalEventForNotPowerType(0x874, 1);
67 }
68
69 void JogDial_CCW(void){
70 _PostLogicalEventForNotPowerType(0x875, 1);
71 }
72
73
74
75
76 int vid_get_viewport_width()
77 {
78 return 360 ;
79 }
80
81 long vid_get_viewport_height()
82 {
83 return 240;
84 }
85
86
87 int vid_get_viewport_yscale() {
88 return 2;
89 }
90
91
92 int vid_get_palette_type() { return 3; }
93 int vid_get_palette_size() { return 256*4; }
94
95
96 int vid_get_viewport_height_proper() { return 480; }
97 int vid_get_viewport_fullscreen_height() { return 480; }
98
99 void *vid_get_bitmap_active_palette()
100 {
101 extern int active_palette_buffer;
102 extern char** palette_buffer_ptr;
103 return palette_buffer_ptr[active_palette_buffer]+16;
104 }
105
106 void load_chdk_palette()
107 {
108 extern char** palette_buffer_ptr;
109 extern int active_palette_buffer;
110
111 if ((active_palette_buffer == 0) || (active_palette_buffer == 1))
112 {
113 int *pal = (int*)vid_get_bitmap_active_palette();
114 if (pal[CHDK_COLOR_BASE+0] != 0x33ADF62)
115 {
116 pal[CHDK_COLOR_BASE+0] = 0x33ADF62;
117 pal[CHDK_COLOR_BASE+1] = 0x326EA40;
118 pal[CHDK_COLOR_BASE+2] = 0x34CD57F;
119 pal[CHDK_COLOR_BASE+3] = 0x373BFAE;
120 pal[CHDK_COLOR_BASE+4] = 0x34BD6CA;
121 pal[CHDK_COLOR_BASE+5] = 0x395AB95;
122 pal[CHDK_COLOR_BASE+6] = 0x34766F0;
123 pal[CHDK_COLOR_BASE+7] = 0x31250F3;
124 pal[CHDK_COLOR_BASE+8] = 0x37F408F;
125 pal[CHDK_COLOR_BASE+9] = 0x3512D5B;
126 pal[CHDK_COLOR_BASE+10] = 0x3A9A917;
127 pal[CHDK_COLOR_BASE+11] = 0x3819137;
128 pal[CHDK_COLOR_BASE+12] = 0x3DED115;
129 pal[CHDK_COLOR_BASE+13] = 0x0090000;
130
131
132
133 vid_bitmap_refresh();
134 }
135 }
136 }
137