This source file includes following definitions.
- shutdown
- debug_led
- camera_set_led
- get_flash_params_count
- JogDial_CW
- JogDial_CCW
- vid_get_viewport_width
- vid_get_viewport_height
- vid_get_palette_type
- vid_get_palette_size
- vid_get_viewport_fullscreen_height
- vid_get_viewport_fullscreen_width
- vid_get_viewport_display_xoffset
- vid_get_viewport_display_yoffset
1 #include "platform.h"
2 #include "lolevel.h"
3
4 void shutdown()
5 {
6 volatile long *p = (void*)0xc02200dc;
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 = 0x46;
16
17 while(1);
18 }
19
20
21 #define LED_PR 0xc0220084
22 #define LED_AF 0xc022008c
23
24 void debug_led(int state)
25 {
26 volatile long *p = (void*)LED_PR;
27
28
29 if (state) {
30 p[0]=0x47;
31 }
32 else {
33 p[0]=0x44;
34 }
35 }
36
37 void camera_set_led(int led, int state, int bright)
38 {
39
40
41
42
43
44
45
46
47
48 struct led_control led_c;
49
50 led_c.led_num=led%16;
51 led_c.action=state<=1 ? !state : state;
52 led_c.brightness=bright;
53 led_c.blink_count=255;
54 _PostLEDMessage(&led_c);
55 }
56
57
58 int get_flash_params_count(void){
59 return 94;
60 }
61
62
63
64
65
66
67
68
69 void JogDial_CW(void){
70 _PostLogicalEventForNotPowerType(0x864, 2);
71 }
72
73 void JogDial_CCW(void){
74 _PostLogicalEventForNotPowerType(0x865, 2);
75 }
76
77
78
79 int vid_get_viewport_width() {
80 return vid_get_viewport_width_proper()>>1;
81 }
82
83 long vid_get_viewport_height()
84 {
85 return vid_get_viewport_height_proper();
86 }
87
88 int vid_get_palette_type() { return 1; }
89 int vid_get_palette_size() { return 16*4; }
90
91 int vid_get_viewport_fullscreen_height() {
92
93 int m = mode_get();
94 if((m&MODE_MASK) != MODE_PLAY && ((m&MODE_SHOOTING_MASK) == MODE_STITCH)) {
95 return 240;
96 }
97 return vid_get_viewport_height_proper();
98 }
99
100 int vid_get_viewport_fullscreen_width() {
101
102 int m = mode_get();
103 if((m&MODE_MASK) != MODE_PLAY && ((m&MODE_SHOOTING_MASK) == MODE_STITCH)) {
104 return 720;
105 }
106 return vid_get_viewport_width_proper();
107 }
108
109 int vid_get_viewport_display_xoffset() {
110 int m = mode_get();
111 if((m&MODE_MASK) == MODE_PLAY) {
112 return 0;
113 } else if((m&MODE_SHOOTING_MASK) == MODE_STITCH) {
114 short dir=0;
115 short seq=0;
116 get_property_case(PROPCASE_STITCH_DIRECTION,&dir,sizeof(dir));
117 get_property_case(PROPCASE_STITCH_SEQUENCE,&seq,sizeof(seq));
118
119
120 if(dir==0) {
121 return seq?132:44;
122 } else {
123 return seq?44:132;
124 }
125 }
126 return 0;
127 }
128
129 int vid_get_viewport_display_yoffset() {
130 int m = mode_get();
131 if((m&MODE_MASK) == MODE_PLAY) {
132 return 0;
133 }
134 return ((m&MODE_SHOOTING_MASK) == MODE_STITCH)?60:0;
135 }
136
137
138
139
140
141
142
143
144
145
146