This source file includes following definitions.
- shutdown
- debug_led
- get_flash_params_count
- camera_jpeg_count_str
- camera_set_led
- vid_bitmap_refresh
- vid_get_palette_type
- vid_get_palette_size
- vid_get_bitmap_active_palette
- vid_get_bitmap_active_buffer
- vid_get_viewport_fb_d
- vid_get_bitmap_fb
- vid_get_viewport_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 void shutdown()
5 {
6 volatile long *p = (void*)0xc02200a0;
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 0xc02200C4
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 #define LED_AF 0xc0220080
33
34 int get_flash_params_count(void){
35 return 119;
36 }
37
38 char *camera_jpeg_count_str()
39 {
40 extern char jpeg_count_str[];
41 return jpeg_count_str;
42 }
43
44 void camera_set_led(int led, int state, int bright) {
45 struct led_control led_c;
46 char convert_table[11]={0,1,2,3,0,2,3,1,8,10,10};
47
48
49
50
51
52
53
54
55
56
57 led_c.led_num=convert_table[led%11];
58 led_c.action=state<=1 ? !state : state;
59 led_c.brightness=bright;
60 led_c.blink_count=255;
61 _PostLEDMessage(&led_c);
62 }
63
64 void vid_bitmap_refresh()
65 {
66 extern int enabled_refresh_physical_screen;
67 enabled_refresh_physical_screen=1;
68 _RefreshPhysicalScreen(1);
69 }
70
71
72
73 int vid_get_palette_type() { return 4; }
74 int vid_get_palette_size() { return 16*4; }
75
76 void *vid_get_bitmap_active_palette() {
77 return (void *)*(unsigned int*)(0x7534+0x20);
78 }
79 void *vid_get_bitmap_active_buffer()
80 {
81 return (void*)(*(int*)(0x7534+0x0c));
82 }
83
84
85
86
87
88 void *vid_get_viewport_fb_d()
89 {
90 extern char *viewport_fb_d;
91 return viewport_fb_d;
92 }
93
94 void *vid_get_bitmap_fb(){
95 return (void*)0x10361000;
96 }
97
98 void *vid_get_viewport_fb()
99 {
100 return (void*)0x10659DE0;
101 }
102
103 int vid_get_viewport_yoffset() {
104 return 0;
105 }
106
107 extern int _GetVRAMHPixelsSize();
108 extern int _GetVRAMVPixelsSize();
109
110 int vid_get_viewport_width() {
111 return 360;
112 }
113
114 int vid_get_viewport_width_proper() {
115 return ((mode_get()&MODE_MASK) == MODE_PLAY)?720:_GetVRAMHPixelsSize();
116 }
117
118 long vid_get_viewport_height() {
119 return 240;
120 }
121
122 int vid_get_viewport_height_proper() {
123 int m = mode_get();
124
125 if ((m&MODE_MASK) != MODE_PLAY && shooting_get_prop(PROPCASE_RESOLUTION) == 8) {
126 return 240;
127 }
128 return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:_GetVRAMVPixelsSize();
129 }
130
131 int vid_get_viewport_fullscreen_height() {
132 int m = mode_get();
133
134 if ((m&MODE_MASK) != MODE_PLAY && shooting_get_prop(PROPCASE_RESOLUTION) == 8) {
135 return 120;
136 }
137 return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:_GetVRAMVPixelsSize();
138 }
139
140 int vid_get_viewport_display_xoffset_proper() { return vid_get_viewport_display_xoffset(); }
141 int vid_get_viewport_display_yoffset_proper() { return vid_get_viewport_display_yoffset(); }
142