]> git.sesse.net Git - rdpsrv/blob - Xserver/programs/Xserver/cfb/stipple68k.s
Support RDP5 logon packets.
[rdpsrv] / Xserver / programs / Xserver / cfb / stipple68k.s
1 /*
2  * $XConsortium: stipple68k.s,v 1.3 94/04/17 20:29:09 keith Exp $
3  * $XFree86: xc/programs/Xserver/cfb/stipple68k.s,v 3.0 1996/08/13 11:27:37 dawes Exp $
4  *
5 Copyright (c) 1990  X Consortium
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
20 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24 Except as contained in this notice, the name of the X Consortium shall not be
25 used in advertising or otherwise to promote the sale, use or other dealings
26 in this Software without prior written authorization from the X Consortium.
27  *
28  * Author:  Keith Packard, MIT X Consortium
29  */
30
31 /*
32  * Stipple code for 68k processors
33  */
34
35 #ifdef __ELF__
36 #ifdef TETEXT
37 #define _cfbStippleStack cfbStippleStackTE
38 #else
39 #define _cfbStippleStack cfbStippleStack
40 #endif
41 #else
42 #ifdef TETEXT
43 #define _cfbStippleStack _cfbStippleStackTE
44 #endif
45 #endif
46
47
48 #define atemp   a0
49 #define addr    a1
50 #define stipple a2
51 #define stride  a3
52 #define case    a4
53
54 #define ctemp   d0
55 #define value   d1
56 #define count   d2
57 #define shift   d3
58 #define c       d4
59 #define lshift  d5
60 #define rshift  d6
61
62 #define PushMask        #0x3e38
63 #define PopMask         #0x1c7c
64 #define NumReg  8
65 #define arg0    36
66 #define arg1    40
67 #define arg2    44
68 #define arg3    48
69 #define arg4    52
70 #define arg5    56
71 #define arg6    60
72
73 #ifdef __ELF__
74 #define ForEachLine     .L2
75 #define ForEachBits     .L5
76 #define a0 %A0
77 #define a1 %A1
78 #define a2 %A2
79 #define a3 %A3
80 #define a4 %A4
81 #define a5 %A5
82 #define a6 %A6
83 #define sp %SP
84 #define d0 %D0
85 #define d1 %D1
86 #define d2 %D2
87 #define d3 %D3
88 #define d4 %D4
89 #define d5 %D5
90 #define d6 %D6
91 #define d7 %D7
92 #else
93 #define ForEachLine     L2
94 #define ForEachBits     L5
95 #endif
96 #define CASE_SIZE       5
97
98 .text
99         .even
100         .globl _cfbStippleStack
101 _cfbStippleStack:
102         moveml  PushMask,sp@-
103         movel   sp@(arg0),addr
104         movel   sp@(arg1),stipple
105         movel   sp@(arg2),value
106         movel   sp@(arg3),stride
107         movew   sp@(arg4+2),count
108         movel   sp@(arg5),shift
109         subqw   #1,count                /* predecrement count */
110         lea     CaseBegin,case
111         movew   #28,lshift
112         addl    shift,lshift
113         movew   #28,rshift
114         subql   #4,shift
115         negl    shift
116 ForEachLine:
117         movel   addr,atemp
118         addl    stride,addr
119         movel   stipple@+,c
120 #ifdef TETEXT
121         jeq     NextLine
122 #endif
123         /* Get first few bits */
124         movel   c,ctemp
125         lsrl    lshift,ctemp
126         lsll    #CASE_SIZE,ctemp
127         lsll    shift,c                 /* set up for next bits */
128         jmp     case@(ctemp:l)
129
130 ForEachBits:
131         addl    #4,atemp
132         movel   c,ctemp
133         lsrl    rshift,ctemp            /* better than lsrl, andi */
134         lsll    #CASE_SIZE,ctemp
135         lsll    #4,c                    /* set up for next bits */
136         jmp     case@(ctemp:l)
137
138 #define Break                           \
139         andl    c,c                     ; \
140         jne     ForEachBits             ; \
141         dbra    count,ForEachLine       ; \
142         moveml  sp@+,PopMask            ; \
143         rts                             ;
144
145 CaseBegin:
146         jne     ForEachBits             /* 0 */
147 NextLine:
148         dbra    count,ForEachLine
149         moveml  sp@+,PopMask
150         rts
151         
152         . = CaseBegin + 0x20
153
154         moveb   value,atemp@(3)         /* 1 */
155         Break
156
157         . = CaseBegin + 0x40
158
159         moveb   value,atemp@(2)         /* 2 */
160         Break
161
162         . = CaseBegin + 0x60
163
164         movew   value,atemp@(2)         /* 3 */
165         Break
166
167         . = CaseBegin + 0x80
168
169         moveb   value,atemp@(1)         /* 4 */
170         Break
171
172         . = CaseBegin + 0xa0
173
174         moveb   value,atemp@(3)         /* 5 */
175         moveb   value,atemp@(1)
176         Break
177
178         . = CaseBegin + 0xc0
179
180         movew   value,atemp@(1)         /* 6 */
181         Break
182
183         . = CaseBegin + 0xe0
184
185         movew   value,atemp@(2)         /* 7 */
186         moveb   value,atemp@(1) 
187         Break
188
189         . = CaseBegin + 0x100
190
191         moveb   value,atemp@            /* 8 */
192         Break
193
194         . = CaseBegin + 0x120
195
196         moveb   value,atemp@(3)         /* 9 */
197         moveb   value,atemp@
198         Break
199
200         . = CaseBegin + 0x140
201
202         moveb   value,atemp@(2)         /* a */
203         moveb   value,atemp@
204         Break
205
206         . = CaseBegin + 0x160
207
208         movew   value,atemp@(2)         /* b */
209         moveb   value,atemp@
210         Break
211
212         . = CaseBegin + 0x180
213
214         movew   value,atemp@            /* c */
215         Break
216
217         . = CaseBegin + 0x1a0
218
219         moveb   value,atemp@(3)         /* d */
220         movew   value,atemp@
221         Break
222
223         . = CaseBegin + 0x1c0
224
225         moveb   value,atemp@(2)         /* e */
226         movew   value,atemp@
227         Break
228
229         . = CaseBegin + 0x1e0
230
231         movel   value,atemp@            /* f */
232         Break