comparison 3rdparty/utils/view/view_clp.a @ 1706:6b23465701c0

Tim Kientzle's VIEW
author boisy
date Tue, 10 Aug 2004 23:46:24 +0000
parents
children b7fb6a9aead4
comparison
equal deleted inserted replaced
1705:bd792517eea1 1706:6b23465701c0
1 *
2 *
3 * CLP format display, and PUB format
4 *
5
6 ifp1
7 use /dd/defs/os9defs.a
8 endc
9
10 psect view_clp_a,0,0,0,0,0
11
12 vsect
13 gpload fcb $1b,$2b,0,2,0,0,0,0,0,0,0
14 putblk fcb $1b,$2d,0,2,0,0,0,0
15 size rmb 2
16 endsect
17
18 pals fcb $3f,$09,$00,$12,$24,$36,$2d,$1b Same as OS9 default palettes
19 fcb $3f,$09,$00,$12,$24,$36,$2d,$1b
20
21 CLPshowpic:
22 * Set up some miscellaneous vars
23 lda #8
24 sta <cyclestart
25 lda #15
26 sta <cycleend
27 ldd #5
28 std <cyclerate
29 lda #0
30 sta <extranum
31
32 * Set the palettes
33 ldb #16
34 leax pals,pcr
35 leau palette,y
36 paloop
37 lda ,x+
38 sta ,u+
39 decb
40 bne paloop
41
42 * Set up the GPLoad command parameters.
43 leax gpload,y
44
45 * PUB format?
46 lda <format
47 cmpa #PUBFormat
48 bne noPUB
49 ldb #4
50 leau PUBstuff,pcr
51 PUBloop
52 lda ,u+
53 sta b,x
54 incb
55 cmpb #11
56 bne PUBloop
57 bra dogpload
58
59 * PUB format clips are type 5, 80x40, 400 bytes.
60 PUBstuff fcb 5,0,80,0,40,1,$90
61
62 noPUB
63
64 * Handle CLP format.
65 ldb #4 Start with byte 5 in GPLoad command.
66 headloop
67 lbsr I_GetByte Get remainder of GPLoad header.
68 lbcs _error
69 sta b,x
70 incb
71 cmpb #11
72 bne headloop
73
74 dogpload
75 lda <PID Use PID for buffer number.
76 sta 2,x
77
78 lda 4,x Set screen type.
79 sta <type
80 lbsr setscreen
81 lbsr setpals
82
83 ldd 9,x Set size of buffer.
84 std size
85
86 pshs y
87 ldy #11 Send the GPLoad.
88 lda <outpath
89 os9 I$Write
90 puls y
91
92 pshs y Now copy buffer contents to screen.
93 leax linebuff,y
94 loop
95 ldd size Read size bytes...
96 beq loopend
97 cmpd #$100 ... But not more than 256 at a time.
98 bhi toobig
99 ldd #$100
100 toobig
101 tfr d,y
102 lbsr I_Read Get it.
103 bcs looperr Exit on error or EOF.
104 pshs y
105 ldd size Count down the size to copy.
106 subd ,s++
107 std size
108 lda <outpath
109 os9 I$Write Output it to screen
110 bra loop
111
112 looperr
113 cmpb #E$EOF
114 lbne _error
115
116 loopend
117 puls y
118 leax putblk,y
119 lda <PID
120 sta 2,x
121 lda <outpath
122 pshs y
123 ldy #8
124 os9 I$Write
125 lbcs _error
126 puls y
127
128 rts
129
130 endsect