annotate 3rdparty/utils/view/view_save.a @ 1797:3084051a2863

Updated
author boisy
date Mon, 11 Apr 2005 15:42:16 +0000
parents b7fb6a9aead4
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 * Save current picture to a file
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
3 * DoSave: - Save current screen to file in specified format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
4 * Currently supports VEFFormat, VEFSqFormat, MGEFormat, CM3Format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
5 * Note: Since SetSave does not clear a file (DoSave resets the filesize to
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
6 * zero when it starts), VIEW can be used to convert a file in place
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
7 * by just saving back to the original file.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
8 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
9
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
10 ifp1
1777
b7fb6a9aead4 Removed /dd/defs so that rma could assemble
boisy
parents: 1706
diff changeset
11 use os9defs.a
1706
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
12 endc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
13
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
14 check macro
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
15 pshs b,cc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
16 ldb #\1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
17 os9 F$PErr
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
18 puls b,cc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
19 endm
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
20
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
21 StdIn equ 0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
22 StdOut equ 1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
23 StdErr equ 2
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
24
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
25 psect view_save_a,0,0,0,0,0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
26
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
27 vsect dp
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
28 SaveFormat: rmb 1 Also used in view_setsave.a
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
29 SavePath: rmb 1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
30 LineSize rmb 2
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
31 endsect
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
32
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
33
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
34 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
35 * Do the actual save.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
36 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
37 DoSave:
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
38 pshs a,b,x,y,u
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
39 lda #$ff
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
40 sta <abort Set to abort on signal.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
41
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
42 * Set up line buffer for screen I/O
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
43 lbsr setbuffer
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
44
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
45 * First, set file size to zero, in case it was pre-existing.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
46 lda SavePath
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
47 lbeq DoSaveEnd
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
48
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
49 ldb #SS.Size
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
50 ldx #0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
51 tfr x,u
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
52 os9 I$SetStt
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
53 lbcs _error
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
54
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
55
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
56 * We'll need to know the size in bytes of one line, so figure that out
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
57 lda <type
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
58 ldb #80 Types 5 and 6 are 80 bytes/line
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
59 cmpa #7
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
60 blo Dosize
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
61 ldb #160 Types 7 and 8 are 160 bytes/line
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
62 Dosize
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
63 clra
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
64 std LineSize
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
65
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
66 lda SaveFormat If MGE Format save, write an MGE format header.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
67 cmpa #MGE640Format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
68 beq DoMGE1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
69 cmpa #MGEFormat
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
70 bne DoMGE
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
71 DoMGE1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
72 lbsr MGEHeader
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
73 DoMGE
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
74
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
75 lda SaveFormat If VEF Format save, write a VEF format header.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
76 cmpa #VEFFormat
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
77 beq DoVEF1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
78 cmpa #VEFSqFormat
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
79 bne DoVEF
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
80 DoVEF1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
81 lbsr VEFHeader
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
82 DoVEF
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
83
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
84 lda SaveFormat
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
85 cmpa #CM3Format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
86 bne DoCM3
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
87 lbsr CM3Header
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
88 DoCM3
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
89
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
90 * Now output rest of file
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
91 ldd #0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
92 DoOut
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
93 lbsr fetchline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
94 lbsr comline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
95 lbsr putline Copy the line back to the screen, for visual feedback.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
96 lbsr comline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
97 lbsr outline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
98 lbsr putline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
99 addd #1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
100 cmpd #192
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
101 bne DoOut
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
102
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
103 lda SaveFormat For MGE format, add 8 blank lines to end of file.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
104 cmpa #MGE640Format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
105 beq DoMGE11
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
106 cmpa #MGEFormat
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
107 bne DoMGE10
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
108 DoMGE11
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
109 lbsr Save8
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
110 DoMGE10
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
111
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
112 * Now close the file
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
113 lda SavePath
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
114 os9 I$Close
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
115 lbcs _error
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
116
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
117 * Print message on successful completion
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
118 leax str1done,pcr Output first part of message
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
119 lbsr O_Write
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
120
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
121 ldb SaveFormat
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
122 leax strVEF,pcr
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
123 cmpb #VEFFormat Is it VEF?
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
124 beq DoneSave
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
125
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
126 leax strMGE,pcr
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
127 cmpb #MGEFormat Is it MGE?
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
128 bne DoneSave1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
129 ldb <type
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
130 cmpb #6 Type 6/8 are MGE
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
131 beq DoneSave
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
132 cmpb #8
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
133 beq DoneSave
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
134 leax str640,pcr Types 5/7 are 640.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
135 bra DoneSave
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
136 DoneSave1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
137
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
138 leax str640,pcr
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
139 cmpb #MGE640Format Is it 640?
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
140 bne DoneSave2
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
141 ldb <type
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
142 cmpb #8 Type 8 is MGE
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
143 bne DoneSave
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
144 leax strMGE,pcr
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
145 bra DoneSave
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
146 DoneSave2
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
147
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
148 leax strVEFSq,pcr
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
149 cmpb #VEFSqFormat Is it VEF Squashed?
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
150 beq DoneSave
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
151
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
152 leax strCM3,pcr
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
153 cmpb #CM3Format CM3 format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
154 bne DoneSave3
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
155 ldb <type
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
156 cmpb #6 Type 6/8 are normal CM3
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
157 beq DoneSave
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
158 cmpb #8
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
159 beq DoneSave
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
160 leax strCM3640,pcr Types 5/7 are 640 across CM3.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
161 bra DoneSave
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
162 DoneSave3
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
163
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
164 * Add other formats here
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
165 DoneSave
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
166 lbsr O_Write
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
167
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
168 leax str2done,pcr Output second part.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
169 lbsr O_Write
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
170
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
171 DoSaveEnd
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
172 puls a,b,x,y,u,pc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
173
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
174 strVEF fcc "normal VEF"
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
175 fcb 0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
176 strMGE fcc "MGE"
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
177 fcb 0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
178 str640 fcc "640 (MGE 640x200)"
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
179 fcb 0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
180 strVEFSq fcc "VEF Squashed"
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
181 fcb 0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
182 strCM3 fcc "CM3"
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
183 fcb 0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
184 strCM3640 fcc "CM3 (640x192)"
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
185 fcb 0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
186 str1done fcc "Picture saved in "
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
187 fcb 0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
188 str2done fcc " format."
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
189 fcb $0d,0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
190
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
191 * Clear out linebuff
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
192 clrline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
193 pshs a,b,x
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
194 leax linebuff,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
195 clra
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
196 ldb #200
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
197 DoClear
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
198 sta ,x+
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
199 decb
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
200 bne DoClear
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
201 puls a,b,x,pc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
202
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
203 * Complement linebuff
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
204 comline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
205 pshs b,x
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
206 ldb #160
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
207 leax linebuff,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
208 comline1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
209 com ,x+
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
210 decb
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
211 bne comline1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
212 puls b,x,pc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
213
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
214 * Output an MGE header
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
215 MGEHeader
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
216 pshs a,b,x,y,u
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
217 leax altbuff,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
218 clr ,x+ Initial 0 byte.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
219 lbsr copypals
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
220 clr ,x+ Mark RGB
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
221 lda #$ff
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
222 sta ,x+ We're not using MGE compression (blech!)
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
223 leau MGEname,pcr Give this a generic name.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
224 ldb #30
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
225 MGEhead1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
226 lda ,u+
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
227 sta ,x+
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
228 decb
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
229 bne MGEhead1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
230 ldd <cyclerate
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
231 stb ,x+ Save cycle rate
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
232 lda <cyclestart
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
233 lsla
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
234 lsla
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
235 lsla
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
236 lsla
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
237 ora <cycleend
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
238 sta ,x+ Save first/last palette rotation values.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
239
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
240 leax altbuff,y Write the actual header.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
241 lda SavePath
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
242 ldy #51
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
243 os9 I$Write
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
244 puls a,b,x,y,u,pc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
245
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
246 MGEname fcc "OS9 picture"
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
247 fcb 0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
248
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
249 * Output a CM3 header
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
250 CM3Header
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
251 pshs a,b,x,y,u
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
252 leax altbuff,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
253 lda #1 Single screen w/o patterns
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
254 sta ,x+
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
255 lbsr copypals 16 palette values
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
256 ldd <cyclerate
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
257 bne CM3head0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
258 ldb #1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
259 CM3head0
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
260 stb ,x+ Cycle rate
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
261 ldd <extrarate
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
262 bne CM3head1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
263 ldb #1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
264 CM3head1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
265 stb ,x+ Extra rate
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
266 leau extrapals,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
267 ldd ,u++
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
268 std ,x++ Copy extrapals to header
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
269 ldd ,u++
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
270 std ,x++
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
271 ldd ,u++
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
272 std ,x++
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
273 ldd ,u++
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
274 std ,x++
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
275 lda <cycle
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
276 beq CM3head2
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
277 lda #$80
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
278 CM3head2
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
279 sta ,x+ Cycle enable flag
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
280 lda <extranum
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
281 beq CM3head3
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
282 lda #$80
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
283 CM3head3
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
284 sta ,x+ Extra enable flag
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
285 lda #192
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
286 sta ,x+ Number lines in picture
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
287
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
288 pshs y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
289 lda SavePath
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
290 leax altbuff,y Now, save the header.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
291 ldy #30
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
292 os9 I$Write
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
293 lbcs _error
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
294 puls y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
295
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
296 leax alt2buff,y CM3 uses alt2buff to store last line data
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
297 ldy #500
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
298 clra
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
299 clrb
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
300 CM3head4
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
301 std ,x++
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
302 leay -1,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
303 bne CM3head4
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
304
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
305 puls a,b,x,y,u,pc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
306
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
307 * Output a VEF header
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
308 VEFHeader
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
309 pshs a,b,x,y,u
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
310 leax altbuff,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
311 clra For normal format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
312 ldb SaveFormat
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
313 cmpb #VEFFormat Plain vanilla??
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
314 beq Do1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
315 lda #$80 For Squashed format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
316 Do1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
317 sta ,x+
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
318 lda #9
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
319 suba <type Get VEF screen type
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
320 cmpa #2
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
321 bhi Do2
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
322 deca
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
323 Do2
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
324 sta ,x+
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
325
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
326 bsr copypals Now copy the palettes.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
327
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
328 * Now save the header out to the file.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
329 leax altbuff,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
330 lda SavePath
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
331 pshs y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
332 ldy #18
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
333 os9 I$Write
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
334 lbcs _error
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
335 puls y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
336 bsr Save8
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
337 puls a,b,x,y,u,pc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
338
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
339 * Write out 8 blank lines to file.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
340 Save8
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
341 pshs b
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
342 lbsr clrline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
343 ldb #8
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
344 DoBlank
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
345 lbsr outline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
346 decb
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
347 bne DoBlank
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
348 puls b,pc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
349
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
350 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
351 * Copy palettes to X, advance X by 16 bytes.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
352 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
353 copypals
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
354 pshs a,b
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
355 lda <outpath
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
356 ldb #SS.Palet
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
357 os9 I$GetStt
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
358 leax 16,x
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
359 puls a,b,pc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
360
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
361 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
362 * Output linebuff to file
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
363 outline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
364 pshs a
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
365 lda SaveFormat
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
366 cmpa #VEFSqFormat
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
367 bne outline1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
368 puls a
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
369 lbra outsqline Only VEF Squashed format uses outsqline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
370 outline1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
371 cmpa #VEFFormat
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
372 bne outline2
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
373 puls a
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
374 lbra outVEFline Unsquashed VEF line.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
375 outline2
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
376 cmpa #MGEFormat
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
377 bne outline3
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
378 puls a
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
379 bra outMGEline Unsquashed MGE line.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
380 outline3
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
381 cmpa #MGE640Format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
382 bne outline4
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
383 puls a
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
384 bra outMGEline Unsquashed MGE line.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
385 outline4
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
386 cmpa #CM3Format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
387 bne outline5
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
388 puls a
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
389 bra outCM3line Output CM3 line.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
390 outline5
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
391 * Additional formats go here.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
392 outlineend
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
393 puls a
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
394 rts
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
395
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
396 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
397 * Output linebuff to file in normal MGE format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
398 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
399 outMGEline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
400 pshs a,b,x,y,u
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
401 lbsr MGEsame
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
402 leax altbuff,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
403 lda <type
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
404 cmpa #5
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
405 bne outMGE1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
406 lbsr MGE57 Convert type 5 to type 7.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
407 bra outMGE3
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
408 outMGE1
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
409 cmpa #6
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
410 bne outMGE2
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
411 ldb SaveFormat
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
412 cmpb #MGE640Format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
413 beq outMGE11
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
414 lbsr MGE68 For MGE, convert type 6 to type 8.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
415 bra outMGE3
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
416 outMGE11
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
417 lbsr MGE67 For 640, convert type 6 to type 7.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
418 bra outMGE3
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
419 outMGE2
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
420 * Other conversions here.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
421 outMGE3
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
422 lda SavePath
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
423 leax altbuff,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
424 ldy #160 After conversion, we always have 160 bytes/line
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
425 os9 I$Write
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
426 lbcs _error
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
427 puls a,b,x,y,u,pc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
428
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
429 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
430 * Output linebuff to file in CM3 format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
431 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
432 outCM3line
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
433 pshs a,b,x,y,u
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
434 lbsr MGEsame copy data to altbuff
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
435 leax altbuff,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
436 lda <type
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
437 cmpa #5
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
438 bne outCM31
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
439 lbsr MGE57 Convert type 5 -> type 7
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
440 bra outCM33
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
441 outCM31
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
442 cmpa #6
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
443 bne outCM32
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
444 lbsr MGE68 Convert type 6 -> type 8
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
445 bra outCM33
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
446 outCM32
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
447 outCM33
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
448
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
449 lbsr CM3compress compress data from linebuff into altbuff
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
450
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
451 lda SavePath
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
452 leax altbuff,y Output line data.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
453 ldy ,x++ Get size of data.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
454 os9 I$Write
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
455 lbcs _error
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
456 puls a,b,x,y,u,pc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
457
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
458 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
459 * Output linebuff to file in normal VEF format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
460 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
461 outVEFline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
462 pshs a,b,x,y,u
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
463 lda SavePath
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
464 leax linebuff,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
465 ldy LineSize
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
466 os9 I$Write
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
467 lbcs _error
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
468 puls a,b,x,y,u,pc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
469
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
470 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
471 * Output linebuff to file in Squashed VEF format
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
472 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
473 outsqline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
474 pshs a,b,x,y,u
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
475 ldd LineSize
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
476 lsrb
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
477 rora Divide by two.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
478 leax linebuff,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
479 lbsr VEFSquash Squash the first half of the line
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
480 bsr sqoutline output the packet
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
481 leax d,x
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
482 lbsr VEFSquash Squash the second half
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
483 bsr sqoutline output it.
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
484 puls a,b,x,y,u,pc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
485
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
486 *
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
487 * Output packet in Altbuff to SavePath
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
488 sqoutline
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
489 pshs a,b,x,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
490 leax altbuff,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
491 ldb ,x
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
492 incb
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
493 clra
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
494 tfr d,y
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
495 lda SavePath
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
496 os9 I$Write
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
497 lbcs _error
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
498 puls a,b,x,y,pc
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
499
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
500
6b23465701c0 Tim Kientzle's VIEW
boisy
parents:
diff changeset
501 endsect