This source file includes following definitions.
- debug_led
- hook_raw_image_addr
- camera_jpeg_count_str
- vid_bitmap_refresh
- shutdown
- get_flash_params_count
- camera_set_led
- vid_get_bitmap_fb
- vid_get_viewport_fb
- vid_get_viewport_fb_d
- vid_get_viewport_live_fb
- vid_get_viewport_width
- vid_get_viewport_height
- vid_get_viewport_display_xoffset
- vid_get_palette_type
- vid_get_palette_size
- vid_get_bitmap_active_buffer
- vid_get_bitmap_active_palette
- _MakeAFScan
- state_check_for_movie_af
1 #include "platform.h"
2 #include "platform_palette.h"
3 #include "lolevel.h"
4
5 #define LED_PR 0xc022d1fc
6 #define LED_AF 0xc022d200
7
8 void debug_led(int state)
9 {
10 *(int*)LED_PR=state ? 0x93d800 : 0x83dc00;
11 }
12
13 char *hook_raw_image_addr()
14 {
15 return (char*)0x452bbf40;
16 }
17
18
19 char *camera_jpeg_count_str()
20 {
21 extern char jpeg_count_str[];
22 return jpeg_count_str;
23 }
24
25 void vid_bitmap_refresh()
26 {
27 extern int full_screen_refresh;
28 extern void _ScreenLock();
29 extern void _ScreenUnlock();
30
31 full_screen_refresh |= 3;
32 _ScreenLock();
33 _ScreenUnlock();
34 }
35
36
37 void shutdown()
38 {
39 extern void _TurnOffE1(void);
40 _TurnOffE1();
41 while(1);
42 }
43
44
45 int get_flash_params_count(void) { return 0xd4; }
46
47
48
49 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
50 static char led_table[]={0,4};
51 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
52 }
53
54
55 void *vid_get_bitmap_fb() { return (void*)0x40711000; }
56 void *vid_get_viewport_fb() { return (void*)0x40866b80; }
57 void *vid_get_viewport_fb_d()
58 {
59 extern char *viewport_fb_d;
60 return viewport_fb_d;
61 }
62
63 extern char active_viewport_buffer;
64 extern void* viewport_buffers[];
65
66 void *vid_get_viewport_live_fb()
67 {
68
69
70 return viewport_buffers[(active_viewport_buffer-1)&3];
71 }
72
73 extern int _GetVRAMHPixelsSize();
74 extern int _GetVRAMVPixelsSize();
75
76
77 int vid_get_viewport_width()
78 {
79 if ((mode_get() & MODE_MASK) == MODE_PLAY)
80 {
81 return 360;
82 }
83 return _GetVRAMHPixelsSize() >> 1;
84 }
85
86 long vid_get_viewport_height()
87 {
88 if ((mode_get() & MODE_MASK) == MODE_PLAY)
89 {
90 return 240;
91 }
92 return _GetVRAMVPixelsSize();
93 }
94
95
96
97 static long vp_xo[4] = { 0, 0, 0, 44 };
98
99 int vid_get_viewport_display_xoffset()
100 {
101 int m = mode_get();
102 int aspect_ratio=shooting_get_prop(PROPCASE_ASPECT_RATIO);
103
104 if ((m & MODE_MASK) != MODE_PLAY) {
105 return (vp_xo[aspect_ratio]);
106 }
107 else
108 return 0;
109 }
110
111
112
113
114
115
116 int vid_get_palette_type() { return 3; }
117 int vid_get_palette_size() { return 256 * 4; }
118
119
120 extern int active_bitmap_buffer;
121 extern char* bitmap_buffer[];
122 void *vid_get_bitmap_active_buffer()
123 {
124 return bitmap_buffer[active_bitmap_buffer&1];
125 }
126
127 void *vid_get_bitmap_active_palette()
128 {
129 extern void *palette_buffer_ptr;
130 return palette_buffer_ptr;
131 }
132
133
134
135 static int af_locked_in_movierec = 0;
136
137 void _MakeAFScan(__attribute__ ((unused))int *a, __attribute__ ((unused))int b) {
138 _DoAFLock();
139 af_locked_in_movierec = 1;
140 }
141
142 void state_check_for_movie_af() {
143 if ((get_movie_status() != VIDEO_RECORD_IN_PROGRESS) && af_locked_in_movierec) {
144 af_locked_in_movierec = 0;
145 _UnlockAF();
146 }
147 }