This source file includes following definitions.
- shutdown
- debug_led
- camera_set_led
- vid_bitmap_refresh
- vid_get_viewport_fb
- vid_get_viewport_live_fb
- get_flash_params_count
- 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
5 #define LED_PR 0xC0220088
6 #define LED_AF 0xC0220080
7
8
9 void shutdown()
10 {
11 volatile long *p = (void*)LED_PR;
12
13 asm(
14 "MRS R1, CPSR\n"
15 "AND R0, R1, #0x80\n"
16 "ORR R1, R1, #0x80\n"
17 "MSR CPSR_cf, R1\n"
18 :::"r1","r0");
19
20 *p = 0x44;
21
22 while(1);
23 }
24
25
26 void debug_led(int state)
27 {
28 *(int*)LED_PR=state ? 0x46 : 0x44;
29 }
30
31 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
32 static char led_table[2]={7,9};
33 if(state<=1) _LEDDrive(led_table[led%sizeof(led_table)], (!state)&1);
34 }
35
36 void vid_bitmap_refresh()
37 {
38 extern int full_screen_refresh;
39 extern void _ScreenLock();
40 extern void _ScreenUnlock();
41
42 full_screen_refresh |= 3;
43 _ScreenLock();
44 _ScreenUnlock();
45 }
46
47
48
49 extern char active_viewport_buffer;
50 extern void* viewport_buffers[];
51
52 void *vid_get_viewport_fb()
53 {
54
55 return viewport_buffers[0];
56 }
57
58 void *vid_get_viewport_live_fb()
59 {
60 if (MODE_IS_VIDEO(mode_get()))
61 return viewport_buffers[0];
62
63
64 return viewport_buffers[(active_viewport_buffer)&3];
65 }
66
67
68 int get_flash_params_count(void) {
69 return 0xa0;
70 }
71
72
73
74
75 int vid_get_palette_type() { return 4; }
76 int vid_get_palette_size() { return 16*4; }
77
78 void *vid_get_bitmap_active_palette() {
79 return (void *)*(unsigned int*)(0x49e8+0x20);
80 }
81 void *vid_get_bitmap_active_buffer()
82 {
83 return (void*)(*(int*)(0x49e8+0x0c));
84 }