FreeCalypso > hg > fc-selenite
comparison src/cs/drivers/drv_app/r2d/lcds/D_Sample/r2d_board_dsample_ia.s @ 0:b6a5e36de839
src/cs: initial import from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 15 Jul 2018 04:39:26 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:b6a5e36de839 |
---|---|
1 | |
2 | |
3 | |
4 | |
5 | |
6 .state32 | |
7 | |
8 .sect ".r2dlcd" | |
9 | |
10 | |
11 .include "r2d_asm_configs.inc" | |
12 .include "r2d_asm_utils.inc" | |
13 .include "r2d_asm_patch_utils.inc" | |
14 | |
15 | |
16 .if (R2D_ASM = R2D_ON) | |
17 | |
18 | |
19 .ref _r2d_lcd_alpha_operator | |
20 .ref _r2d_lcd_foreground_pixel | |
21 .ref _r2d_lcd_to_color | |
22 .ref _r2d_color_to_lcd | |
23 | |
24 .def _r2d_ialpha_op | |
25 .def _r2d_iforeground_pixel_test | |
26 | |
27 .def _r2d_icolor_to_lcd | |
28 .def _r2d_ilcd_to_color | |
29 | |
30 | |
31 .global _r2d_lcd_start_copy | |
32 .global _r2d_lcd_start_or | |
33 .global _r2d_lcd_start_and | |
34 .global _r2d_lcd_start_xor | |
35 .global _r2d_lcd_start_notcopy | |
36 .global _r2d_lcd_start_notor | |
37 .global _r2d_lcd_start_notand | |
38 .global _r2d_lcd_start_notxor | |
39 .global _r2d_lcd_start_alpha | |
40 .global _r2d_lcd_start_erase | |
41 .global _r2d_lcd_start_foreground_pixel | |
42 .global _r2d_start_get_color | |
43 .global _r2d_start_color_to_lcd | |
44 .global _r2d_start_lcd_to_color | |
45 | |
46 _r2d_lcd_start_copy: | |
47 MOV calca,calca | |
48 MOV calcb,calca | |
49 MOV calcb,calcb | |
50 _r2d_lcd_end_copy | |
51 | |
52 _r2d_lcd_start_or: | |
53 MOVS calca,calca,LSL #16 | |
54 MOVNEQ calcb,calca,LSR #16 | |
55 NOP | |
56 _r2d_lcd_end_or | |
57 | |
58 _r2d_lcd_start_and: | |
59 MOV calca,calca | |
60 AND calcb,calcb,calca | |
61 MOV calcb,calcb | |
62 _r2d_lcd_end_and | |
63 | |
64 _r2d_lcd_start_xor: | |
65 MOV calca,calca | |
66 EOR calcb,calcb,calca | |
67 MOV calcb,calcb | |
68 _r2d_lcd_end_xor | |
69 | |
70 _r2d_lcd_start_notcopy: | |
71 MOV calca,calca | |
72 MVN calcb,calca | |
73 MOV calcb,calcb | |
74 _r2d_lcd_end_notcopy | |
75 | |
76 _r2d_lcd_start_notor: | |
77 MOV calca,calca | |
78 ORR calcb,calcb,calca | |
79 MVN calcb,calcb | |
80 _r2d_lcd_end_notor | |
81 | |
82 _r2d_lcd_start_notand: | |
83 MOV calca,calca | |
84 AND calcb,calcb,calca | |
85 MVN calcb,calcb | |
86 _r2d_lcd_end_notand | |
87 | |
88 _r2d_lcd_start_notxor: | |
89 MOV calca,calca | |
90 EOR calcb,calcb,calca | |
91 MVN calcb,calcb | |
92 _r2d_lcd_end_notxor | |
93 | |
94 _r2d_lcd_start_alpha | |
95 ; Identifying code telling the patcher that a special | |
96 ; construct required to branch to a C function is used | |
97 .long BRANCH_ID | |
98 ; The absolute address of the C function which is going to be | |
99 ; converted to a PC relative offset by the patcher | |
100 .long _r2d_ialpha_op | |
101 _r2d_lcd_stop_alpha | |
102 | |
103 _r2d_lcd_start_erase: | |
104 MOVS calca,calca,LSL #16 | |
105 MOVNEQ calcb,#0 | |
106 NOP | |
107 _r2d_lcd_end_erase | |
108 | |
109 _r2d_lcd_start_foreground_pixel | |
110 ; Identifying code telling the patcher that a special | |
111 ; construct required to branch to a C function is used | |
112 .long BRANCH_ID | |
113 ; The absolute address of the C function which is going to be | |
114 ; converted to a PC relative offset by the patcher | |
115 .long _r2d_iforeground_pixel_test | |
116 _r2d_lcd_stop_foreground_pixel | |
117 | |
118 | |
119 _r2d_start_lcd_to_color | |
120 ; Identifying code telling the patcher that a special | |
121 ; construct required to branch to a C function is used | |
122 .long BRANCH_ID | |
123 ; The absolute address of the C function which is going to be | |
124 ; converted to a PC relative offset by the patcher | |
125 .long _r2d_ilcd_to_color | |
126 _r2d_stop_lcd_to_color | |
127 | |
128 _r2d_start_color_to_lcd | |
129 ; Identifying code telling the patcher that a special | |
130 ; construct required to branch to a C function is used | |
131 .long BRANCH_ID | |
132 ; The absolute address of the C function which is going to be | |
133 ; converted to a PC relative offset by the patcher | |
134 .long _r2d_icolor_to_lcd | |
135 _r2d_stop_color_to_lcd | |
136 | |
137 | |
138 | |
139 ; Stub function allowing to branch to a C one whose interface | |
140 ; is UINT32 r2d_lcd_some_operator(UINT32 old,UINT32 value) | |
141 _r2d_ialpha_op: | |
142 R2D_OP_SAVE_CONTEXT | |
143 BL _r2d_lcd_alpha_operator | |
144 R2D_OP_RESTORE_CONTEXT | |
145 | |
146 ; Check kind of pixel | |
147 _r2d_iforeground_pixel_test: | |
148 R2D_COL_SAVE_CONTEXT | |
149 BL _r2d_lcd_foreground_pixel | |
150 R2D_COL_RESTORE_CONTEXT | |
151 | |
152 ; All color conversion subroutines | |
153 _r2d_icolor_to_lcd: | |
154 R2D_COLCONV_SAVE_CONTEXT | |
155 BL _r2d_color_to_lcd | |
156 R2D_COLCONV_RESTORE_CONTEXT | |
157 | |
158 _r2d_ilcd_to_color: | |
159 R2D_COLCONV_SAVE_CONTEXT | |
160 BL _r2d_lcd_to_color | |
161 R2D_COLCONV_RESTORE_CONTEXT | |
162 | |
163 .endif | |
164 .end |