This source file includes following definitions.
- hook_raw_image_addr
- shutdown
- debug_led
- camera_set_led
- camera_jpeg_count_str
- vid_bitmap_refresh
- get_flash_params_count
- _GetBatteryTemperature
- vid_get_bitmap_active_palette
- vid_get_palette_type
- vid_get_palette_size
- vid_get_bitmap_active_buffer
- vid_get_viewport_fb
- vid_get_viewport_live_fb
- vid_get_viewport_fb_d
- vid_get_bitmap_fb
- vid_get_viewport_yoffset
- vid_get_viewport_width
- vid_get_viewport_width_proper
- vid_get_viewport_height
- vid_get_viewport_height_proper
- vid_get_viewport_fullscreen_height
- vid_get_viewport_display_xoffset_proper
- vid_get_viewport_display_yoffset_proper
1 #include "platform.h"
2 #include "lolevel.h"
3
4 char *hook_raw_image_addr()
5 {
6 return (char*) 0x10E52420;
7 }
8
9
10
11
12
13
14
15 #define LED_PR 0xC0220088
16 #define LED_AF 0xC0220080
17
18
19 void shutdown()
20 {
21 volatile long *p = (void*)LED_PR;
22
23 asm(
24 "MRS R1, CPSR\n"
25 "AND R0, R1, #0x80\n"
26 "ORR R1, R1, #0x80\n"
27 "MSR CPSR_cf, R1\n"
28 :::"r1","r0");
29
30 *p = 0x44;
31
32 while(1);
33 }
34
35
36 void debug_led(int state)
37 {
38 *(int*)LED_PR=state ? 0x46 : 0x44;
39 }
40
41
42
43
44 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
45 static char led_table[2]={7,9};
46 if(state<=1) _LEDDrive(led_table[led%sizeof(led_table)], (!state)&1);
47 }
48
49 char *camera_jpeg_count_str()
50 {
51 extern char jpeg_count_str[];
52 return jpeg_count_str;
53 }
54
55
56 void vid_bitmap_refresh() {
57 extern int enabled_refresh_physical_screen;
58 extern int full_screen_refresh;
59
60
61
62
63 extern void _ScreenLock();
64 extern void _ScreenUnlock();
65
66 _ScreenLock();
67
68 enabled_refresh_physical_screen=1;
69 full_screen_refresh=3;
70
71 _ScreenUnlock();
72 }
73
74
75 int get_flash_params_count(void){
76 return 0x94;
77 }
78
79
80
81 int _GetBatteryTemperature()
82 {
83 return -99;
84 }
85
86
87
88 void *vid_get_bitmap_active_palette() {
89 return (void*)(*(int*)(0x4970+0x20));
90 }
91
92
93 int vid_get_palette_type() { return 4; }
94 int vid_get_palette_size() { return 16*4; }
95
96 void *vid_get_bitmap_active_buffer()
97 {
98 return (void*)(*(int*)(0x4970+0xC));
99 }
100
101
102
103
104
105
106 extern char active_viewport_buffer;
107 extern void* viewport_buffers[];
108
109 void *vid_get_viewport_fb()
110 {
111
112 return viewport_buffers[0];
113 }
114
115 void *vid_get_viewport_live_fb()
116 {
117 if (MODE_IS_VIDEO(mode_get()) || is_video_recording())
118 return viewport_buffers[0];
119
120
121 return viewport_buffers[(active_viewport_buffer)&3];
122 }
123
124 void *vid_get_viewport_fb_d()
125 {
126 extern char *viewport_fb_d;
127 return viewport_fb_d;
128 }
129
130 void *vid_get_bitmap_fb(){
131 return (void*)0x10361000;
132 }
133
134 int vid_get_viewport_yoffset() {
135 return 0;
136 }
137
138 extern int _GetVRAMHPixelsSize();
139 extern int _GetVRAMVPixelsSize();
140
141 int vid_get_viewport_width() {
142 return 360;
143 }
144
145 int vid_get_viewport_width_proper() {
146 return ((mode_get()&MODE_MASK) == MODE_PLAY)?720:_GetVRAMHPixelsSize();
147 }
148
149 long vid_get_viewport_height() {
150 return 240;
151 }
152
153 int vid_get_viewport_height_proper() {
154 int m = mode_get();
155
156 if ((m&MODE_MASK) != MODE_PLAY && shooting_get_prop(PROPCASE_RESOLUTION) == 8) {
157 return 240;
158 }
159 return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:_GetVRAMVPixelsSize();
160 }
161
162 int vid_get_viewport_fullscreen_height() {
163 int m = mode_get();
164
165 if ((m&MODE_MASK) != MODE_PLAY && shooting_get_prop(PROPCASE_RESOLUTION) == 8) {
166 return 120;
167 }
168 return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:_GetVRAMVPixelsSize();
169 }
170
171 int vid_get_viewport_display_xoffset_proper() { return vid_get_viewport_display_xoffset(); }
172 int vid_get_viewport_display_yoffset_proper() { return vid_get_viewport_display_yoffset(); }
173