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