This source file includes following definitions.
- vid_bitmap_refresh
- shutdown
- debug_led
- camera_set_led
- get_flash_params_count
- vid_get_viewport_width
- vid_get_viewport_xoffset
- vid_get_viewport_height
- vid_get_viewport_yoffset
- vid_get_palette_type
- vid_get_palette_size
- vid_get_bitmap_active_palette
- vid_get_bitmap_active_buffer
1 #include "platform.h"
2 #include "lolevel.h"
3
4 void vid_bitmap_refresh()
5 {
6 extern int full_screen_refresh;
7 extern void _ScreenLock();
8 extern void _ScreenUnlock();
9
10 full_screen_refresh |= 3;
11 _ScreenLock();
12 _ScreenUnlock();
13 }
14
15
16 void shutdown()
17 {
18 volatile long *p = (void*)0xC022001C;
19
20 asm(
21 "MRS R1, CPSR\n"
22 "AND R0, R1, #0x80\n"
23 "ORR R1, R1, #0x80\n"
24 "MSR CPSR_cf, R1\n"
25 :::"r1","r0");
26
27 *p = 0x44;
28
29 while(1);
30 }
31
32 #define LED_PR 0xC0220130
33
34
35 void debug_led(int state)
36 {
37 *(int*)LED_PR=state ? 0x46 : 0x44;
38 }
39
40
41
42
43 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
44 static char led_table[2]={0,9};
45 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
46 }
47
48 int get_flash_params_count(void){
49 return 0xA0;
50 }
51
52
53
54
55 int vid_get_viewport_width()
56 {
57
58
59 static long vp_w[5] = { 360, 360, 360, 272 };
60 return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
61 }
62
63 int vid_get_viewport_xoffset()
64 {
65
66
67 static long vp_w[5] = { 0, 0, 0, 44 };
68 return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
69 }
70
71 long vid_get_viewport_height()
72 {
73
74
75 static long vp_h[5] = { 240, 180, 214, 240 };
76 return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
77 }
78
79 int vid_get_viewport_yoffset()
80 {
81
82
83 static long vp_h[5] = { 0, 30, 13, 0 };
84 return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
85 }
86
87
88
89
90 int vid_get_palette_type() { return 3; }
91 int vid_get_palette_size() { return 256 * 4; }
92
93 void *vid_get_bitmap_active_palette() {
94 extern int active_palette_buffer;
95 extern char* palette_buffer[];
96 void* p = palette_buffer[active_palette_buffer];
97
98 if (p) p += 8;
99 return p;
100 }
101
102 extern int active_bitmap_buffer;
103 extern char* bitmap_buffer[];
104
105 void *vid_get_bitmap_active_buffer() {
106 return bitmap_buffer[active_bitmap_buffer];
107 }