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