This source file includes following definitions.
- debug_led
- vid_bitmap_refresh
- shutdown
- camera_set_led
- get_flash_params_count
- JogDial_CW
- JogDial_CCW
- vid_get_palette_type
- vid_get_palette_size
- vid_get_bitmap_active_buffer
- vid_get_bitmap_active_palette
1
2
3
4
5
6
7
8
9
10
11
12
13 #define LED_AF 0xC022000C
14 #define LED_GREEN 0xC0220014
15
16 #define LED_ON *((long*) LED_GREEN) = 0x46
17 #define LED_OFF *((long*) LED_GREEN) = 0x44
18
19 void debug_led(int state)
20 {
21 if (state)
22 LED_ON;
23 else
24 LED_OFF;
25 }
26
27 #include "platform.h"
28 #include "lolevel.h"
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 void vid_bitmap_refresh()
47 {
48 extern int enabled_refresh_physical_screen;
49 extern int full_screen_refresh;
50
51
52
53
54 extern void _LockAndRefresh();
55 extern void _UnlockAndRefresh();
56
57 _LockAndRefresh();
58
59 enabled_refresh_physical_screen=1;
60 full_screen_refresh |= 3;
61
62 _UnlockAndRefresh();
63 }
64
65 void shutdown()
66 {
67 volatile long *p = (void*)0xC022001C;
68
69 asm(
70 "MRS R1, CPSR\n"
71 "AND R0, R1, #0x80\n"
72 "ORR R1, R1, #0x80\n"
73 "MSR CPSR_cf, R1\n"
74 :::"r1","r0");
75
76 *p = 0x44;
77
78 while(1);
79 }
80
81
82
83
84
85
86 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
87 static char led_table[]={7,9};
88 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
89 }
90
91 int get_flash_params_count(void){
92 return 0x9f;
93 }
94
95 void JogDial_CW(void){
96 _PostLogicalEventForNotPowerType(0x874, 2);
97 }
98
99 void JogDial_CCW(void){
100 _PostLogicalEventForNotPowerType(0x875, 2);
101 }
102
103
104
105 int vid_get_palette_type() { return 3; }
106 int vid_get_palette_size() { return 256 * 4; }
107
108 void *vid_get_bitmap_active_buffer()
109 {
110 extern int active_bitmap_buffer;
111 extern char* bitmap_buffer[];
112 return bitmap_buffer[active_bitmap_buffer];
113 }
114
115 void *vid_get_bitmap_active_palette()
116 {
117 extern int active_palette_buffer;
118 extern char* palette_buffer[];
119 void* p = palette_buffer[active_palette_buffer];
120
121 if (p) p += 8;
122 return p;
123 }