annotate 3rdparty/utils/view/view_convert.a @ 1777:b7fb6a9aead4

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