1706
|
1 *
|
|
2 * Routines for converting screen types.
|
|
3 * Each routine expects a pointer in X to one line of screen data.
|
|
4 * Data is converted in-place.
|
|
5 *
|
|
6 * These conversions lose no data.
|
|
7 * MGE57: Converts type 5 line to type 7 line.
|
|
8 * MGE67: Converts type 6 line to type 7 line.
|
|
9 * MGE68: Converts type 6 line to type 8 line.
|
|
10 * These conversions, of necessity, lose some data.
|
|
11 * MGE76: Converts type 7 line to type 6 line by throwing out odd pixels
|
|
12 * MAC75: Converts type 7 line to type 5 line by keeping hi-order bit of pixel
|
|
13 * MAC76: Converts type 7 line to type 6 line by averaging pairs of pixels
|
|
14 *
|
|
15
|
|
16 ifp1
|
1777
|
17 use os9defs.a
|
1706
|
18 endc
|
|
19
|
|
20 psect view_convert_a,0,0,0,0,0
|
|
21
|
|
22 *
|
|
23 * Converts type 6 (320 4-color) into type 7 (640 4-color)
|
|
24 *
|
|
25 MGE67tab fcb $00,$05,$0a,$0f,$50,$55,$5a,$5f,$a0,$a5,$aa,$af,$f0,$f5,$fa,$ff
|
|
26 MGE67:
|
|
27 pshs y
|
|
28 leay MGE67tab,pcr
|
|
29 bsr MGEconv
|
|
30 puls y,pc
|
|
31
|
|
32 *
|
|
33 * Converts type 5 (2-color) line of data into type 7 (4-color)
|
|
34 *
|
|
35 MGE57tab fcb $00,$01,$04,$05,$10,$11,$14,$15,$40,$41,$44,$45,$50,$51,$54,$55
|
|
36 MGE57:
|
|
37 pshs y
|
|
38 leay MGE57tab,pcr
|
|
39 bsr MGEconv
|
|
40 puls y,pc
|
|
41
|
|
42 MGE68tab fcb $00,$01,$02,$03,$10,$11,$12,$13,$20,$21,$22,$23,$30,$31,$32,$33
|
|
43 MGE68:
|
|
44 pshs y
|
|
45 leay MGE68tab,pcr
|
|
46 bsr MGEconv
|
|
47 puls y,pc
|
|
48
|
|
49 MGEconv
|
|
50 pshs a,b,x,y,u
|
|
51 leau 80,x U pts to end of source.
|
|
52 leax 160,x X pts to end of destination.
|
|
53 ldb #80
|
|
54 MGEconvloop
|
|
55 lda ,-u
|
|
56 anda #$0f
|
|
57 lda a,y
|
|
58 sta ,-x
|
|
59 lda ,u
|
|
60 lsra
|
|
61 lsra
|
|
62 lsra
|
|
63 lsra
|
|
64 lda a,y
|
|
65 sta ,-x
|
|
66 decb
|
|
67 bne MGEconvloop
|
|
68 puls a,b,x,y,u,pc
|
|
69
|
|
70 *
|
|
71 * Throw out every other pixel to convert 640 4-color to 320 4-color
|
|
72 MGE76table fcb $00,$10,$20,$30,$40,$50,$60,$70,$80,$90,$a0,$b0,$c0,$d0,$e0,$f0
|
|
73 MGE76:
|
|
74 pshs a,b,x,u,y
|
|
75 leay MGE76table,pcr
|
|
76 tfr x,u
|
|
77 ldb #160
|
|
78 pshs b
|
|
79 MGE76loop
|
|
80 lda 1,x
|
|
81 anda #$0f
|
|
82 ldb ,x++
|
|
83 andb #$0f
|
|
84 ora b,y
|
|
85 sta ,u+
|
|
86 dec ,s
|
|
87 bne MGE76loop
|
|
88 puls b
|
|
89 puls a,b,x,u,y,pc
|
|
90
|
|
91
|
|
92 *
|
|
93 * Convert type 7 data to type 5 data for MAC screen.
|
|
94 *
|
|
95 MAC75:
|
|
96 pshs a,b,x,y,u
|
|
97 leau ,x
|
|
98 ldy #160
|
|
99 MAC75loop
|
|
100 ldb ,x+
|
|
101 lslb
|
|
102 rola
|
|
103 lslb
|
|
104 lslb
|
|
105 rola
|
|
106 lslb
|
|
107 lslb
|
|
108 rola
|
|
109 lslb
|
|
110 lslb
|
|
111 rola
|
|
112 ldb ,x+
|
|
113 lslb
|
|
114 rola
|
|
115 lslb
|
|
116 lslb
|
|
117 rola
|
|
118 lslb
|
|
119 lslb
|
|
120 rola
|
|
121 lslb
|
|
122 lslb
|
|
123 rola
|
|
124 sta ,u+
|
|
125 leay -1,y
|
|
126 bne MAC75loop
|
|
127 puls a,b,x,y,u,pc
|
|
128
|
|
129 * Convert type 7 to type 6 by averaging pairs of pixels.
|
|
130 MAC76table fcb $00,$40,$40,$80,$00,$40,$80,$80,$40,$40,$80,$c0,$40,$80,$80,$c0
|
|
131 MAC76:
|
|
132 pshs a,b,x,y,u
|
|
133 leau ,x
|
|
134 leay MAC76table,pcr
|
|
135 ldb #160
|
|
136 pshs b
|
|
137 MAC76loop
|
|
138 ldb ,x
|
|
139 lsrb
|
|
140 lsrb
|
|
141 lsrb
|
|
142 lsrb
|
|
143 ldb b,y
|
|
144 lslb
|
|
145 rola
|
|
146 lslb
|
|
147 rola
|
|
148 ldb ,x+
|
|
149 andb #$0f
|
|
150 ldb b,y
|
|
151 lslb
|
|
152 rola
|
|
153 lslb
|
|
154 rola
|
|
155 ldb ,x
|
|
156 lsrb
|
|
157 lsrb
|
|
158 lsrb
|
|
159 lsrb
|
|
160 ldb b,y
|
|
161 lslb
|
|
162 rola
|
|
163 lslb
|
|
164 rola
|
|
165 ldb ,x+
|
|
166 andb #$0f
|
|
167 ldb b,y
|
|
168 lslb
|
|
169 rola
|
|
170 lslb
|
|
171 rola
|
|
172 sta ,u+
|
|
173 dec ,s
|
|
174 bne MAC76loop
|
|
175 puls b
|
|
176 puls a,b,x,y,u,pc
|
|
177
|
|
178 endsect
|