annotate level2/modules/covdg.asm @ 2926:53961f90b9dd

d64/makefile: Stop building if error in subdirectory build
author Tormod Volden <debian.tormod@gmail.com>
date Sat, 18 Jan 2014 09:54:17 +0100
parents b8c7b7fbf3c9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1 ********************************************************************
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2 * CoVDG - CoCo 3 VDG I/O module
1e312b144f4d Major changes:
boisy
parents:
diff changeset
3 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
4 * $Id$
1e312b144f4d Major changes:
boisy
parents:
diff changeset
5 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
6 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
7 * Edt/Rev YYYY/MM/DD Modified by
1e312b144f4d Major changes:
boisy
parents:
diff changeset
8 * Comment
1e312b144f4d Major changes:
boisy
parents:
diff changeset
9 * ------------------------------------------------------------------
1e312b144f4d Major changes:
boisy
parents:
diff changeset
10 * 4 2003/01/09 Boisy G. Pitre
1e312b144f4d Major changes:
boisy
parents:
diff changeset
11 * Quite a few changes:
1e312b144f4d Major changes:
boisy
parents:
diff changeset
12 * - Merged in CoCo 2 gfx code from original OS-9 Level 2 code.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
13 * - Incorporated code tweaks for 6809 and 6309 code from the vdgint_small
1e312b144f4d Major changes:
boisy
parents:
diff changeset
14 * and vdgint_tiny source files.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
15 * - Fixed long-standing cursor color bug.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
16 * - Fixed long-standing F$SRtMem bug in CoCo 2 "graphics end" code $12
1e312b144f4d Major changes:
boisy
parents:
diff changeset
17 * (see comments)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
18 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
19 * 4r1 2003/09/16 Robert Gault
1e312b144f4d Major changes:
boisy
parents:
diff changeset
20 * Added patch to work 1MB and 2MB CoCo 3s.
1938
14e43c3ec661 Reset editions
boisy
parents: 1933
diff changeset
21 *
14e43c3ec661 Reset editions
boisy
parents: 1933
diff changeset
22 * 1 2005/11/26 Boisy G. Pitre
14e43c3ec661 Reset editions
boisy
parents: 1933
diff changeset
23 * Renamed from VDGInt, reset edition.
1981
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
24 *
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
25 * 2006/01/17 Robert Gault
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
26 * Changed the Select routine to permit the use of display 1b 21 within
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
27 * scripts when changing from a window to a vdg screen. See descriptions
1981
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
28 * in cowin.asm. RG
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
29 *
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
30 * 2007/02/28 Robert Gault
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
31 * Changed the Line drawing routine to set the error at half the largest
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
32 * change to improve symmetry. Most noticeable in lines with either dX or
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
33 * dY = 1.
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
34
1e312b144f4d Major changes:
boisy
parents:
diff changeset
35 nam CoVDG
1e312b144f4d Major changes:
boisy
parents:
diff changeset
36 ttl CoCo 3 VDG I/O module
1e312b144f4d Major changes:
boisy
parents:
diff changeset
37
1e312b144f4d Major changes:
boisy
parents:
diff changeset
38 * Disassembled 98/09/31 12:15:57 by Disasm v1.6 (C) 1988 by RML
1e312b144f4d Major changes:
boisy
parents:
diff changeset
39
1e312b144f4d Major changes:
boisy
parents:
diff changeset
40 ifp1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
41 use defsfile
2624
b8c7b7fbf3c9 Major changes:
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2110
diff changeset
42 use cocovtio.d
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
43 use vdgdefs
1e312b144f4d Major changes:
boisy
parents:
diff changeset
44 endc
1e312b144f4d Major changes:
boisy
parents:
diff changeset
45
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
46 FFStSz equ 512 flood fill stack size in bytes
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
47
1e312b144f4d Major changes:
boisy
parents:
diff changeset
48 tylg set Systm+Objct
1e312b144f4d Major changes:
boisy
parents:
diff changeset
49 atrv set ReEnt+rev
1938
14e43c3ec661 Reset editions
boisy
parents: 1933
diff changeset
50 rev set $00
14e43c3ec661 Reset editions
boisy
parents: 1933
diff changeset
51 edition set 1
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
52
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
53 skip2 equ $8C cmpx instruction
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
54
1e312b144f4d Major changes:
boisy
parents:
diff changeset
55 mod eom,name,tylg,atrv,start,size
1e312b144f4d Major changes:
boisy
parents:
diff changeset
56
1e312b144f4d Major changes:
boisy
parents:
diff changeset
57 u0000 rmb 0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
58 size equ .
1e312b144f4d Major changes:
boisy
parents:
diff changeset
59
1e312b144f4d Major changes:
boisy
parents:
diff changeset
60 fcb $07
1e312b144f4d Major changes:
boisy
parents:
diff changeset
61
1e312b144f4d Major changes:
boisy
parents:
diff changeset
62 name fcs /CoVDG/
1e312b144f4d Major changes:
boisy
parents:
diff changeset
63 fcb edition
1e312b144f4d Major changes:
boisy
parents:
diff changeset
64
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
65 start lbra Read actually more like INIZ...
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
66 lbra Write
1e312b144f4d Major changes:
boisy
parents:
diff changeset
67 lbra GetStat
1e312b144f4d Major changes:
boisy
parents:
diff changeset
68 lbra SetStat
1e312b144f4d Major changes:
boisy
parents:
diff changeset
69 lbra Term
1e312b144f4d Major changes:
boisy
parents:
diff changeset
70
1e312b144f4d Major changes:
boisy
parents:
diff changeset
71 * Update Window
1e312b144f4d Major changes:
boisy
parents:
diff changeset
72 * Called from VTIO
1e312b144f4d Major changes:
boisy
parents:
diff changeset
73 * Entry: A = function code
1e312b144f4d Major changes:
boisy
parents:
diff changeset
74 * 0 = select new window to be active
1e312b144f4d Major changes:
boisy
parents:
diff changeset
75 * 1 = update mouse packet
1e312b144f4d Major changes:
boisy
parents:
diff changeset
76 * >1 = only used by CoGrf/CoWin
1e312b144f4d Major changes:
boisy
parents:
diff changeset
77 * U = device memory pointer
1e312b144f4d Major changes:
boisy
parents:
diff changeset
78 * X = path descriptor pointer
1e312b144f4d Major changes:
boisy
parents:
diff changeset
79
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
80 tsta zero?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
81 bne L0035 branch if not
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
82 ldb <VD.DGBuf,u get number of currently displayed buffer
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
83 lbne ShowS branch if not zero
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
84 ldd <VD.TFlg1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
85 lbra DispAlfa
1e312b144f4d Major changes:
boisy
parents:
diff changeset
86
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
87 L0035 deca set x,y size of window?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
88 beq L003B branch if so
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
89 clrb no errors
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
90 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
91
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
92 L003B ldx <D.CCMem pointer to start of CC memory
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
93 leax <G.Mouse+Pt.AcX,x to X,Y coor, X,Y window
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
94 * leax <$54,x to X,Y coor, X,Y window
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
95 IFNE H6309
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
96 ldq ,x get X,Y coordinate
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
97 stq $04,x copy to window relative X,Y
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
98 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
99 ldd ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
100 std $04,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
101 ldd $02,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
102 std $06,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
103 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
104 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
105 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
106
1e312b144f4d Major changes:
boisy
parents:
diff changeset
107 * Terminate device
1e312b144f4d Major changes:
boisy
parents:
diff changeset
108 Term pshs u,y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
109 ldb #$03
1e312b144f4d Major changes:
boisy
parents:
diff changeset
110 L004E pshs b
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
111 lbsr GetScrn get screen table entry into X
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
112 lbsr FreeBlks free blocks used by screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
113 puls b get count
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
114 decb decrement
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
115 bne L004E branch until zero
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
116 clr <VD.Start,u no screens in use
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
117 ldd #512 size of alpha screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
118 ldu <VD.ScrnA,u get pointer to alpha screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
119 beq ClrStat branch if none
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
120 os9 F$SRtMem else return memory
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
121 ClrStat ldb #$E1 size of 1 page -$1D (SCF memory requirements)
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
122 leax <VD.Strt1,u point to start of VDG statics
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
123 L006F clr ,x+ set stored byte to zero
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
124 decb decrement
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
125 bne L006F until zero
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
126 bra L00D5 and exit
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
127
1e312b144f4d Major changes:
boisy
parents:
diff changeset
128 * Read bytes from IN
1e312b144f4d Major changes:
boisy
parents:
diff changeset
129 * Actually, this is more like an INIZ of the device.
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
130 Read pshs u,y,x save regs
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
131 bsr SetupPal set up palettes
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
132 lda #$AF
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
133 sta <VD.CColr,u default color cursor
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
134 pshs u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
135 ldd #768 gets 1 page on an odd page boundary
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
136 os9 F$SRqMem request from top of sys ram
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
137 bcs L00D6 error out of no system mem
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
138 tfr u,d U = addr of memory
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
139 tfr u,x
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
140 bita #$01 test to see if on even page
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
141 beq IsEven branch if even
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
142 leax >256,x else point 100 bytes into mem
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
143 bra IsOdd and free
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
144 IsEven leau >512,u we only need 2 pages for the screen memory
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
145 IsOdd ldd #256 1 page return
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
146 os9 F$SRtMem return system memory
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
147 puls u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
148 stx <VD.ScrnA,u save start address of the screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
149 stx <VD.CrsrA,u and start cursor position
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
150 leax >512,x point to end of screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
151 stx <VD.ScrnE,u save it
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
152 lda #$60 get default character
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
153 sta <VD.CChar,u put character under the cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
154 sta <VD.Chr1,u only referenced here ??
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
155 lbsr ClrScrn clear the screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
156 inc <VD.Start,u increment VDG screen in use
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
157 ldd <VD.Strt1,u seemling useless??
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
158 lbsr L054C set to true lowercase, screen size
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
159 leax <VD.NChar,u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
160 stx <VD.EPlt1,u where to get next character from
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
161 stx <VD.EPlt2,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
162 ldu <D.CCMem
1e312b144f4d Major changes:
boisy
parents:
diff changeset
163 IFNE H6309
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
164 oim #$02,<G.BCFFlg,u set to VDGINT found
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
165 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
166 ldb <G.BCFFlg,u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
167 orb #$02 set to VDGINT found
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
168 stb <G.BCFFlg,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
169 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
170 L00D5 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
171 L00D6 puls pc,u,y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
172
1e312b144f4d Major changes:
boisy
parents:
diff changeset
173 SetupPal pshs u,y,x,b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
174 lda #$08
1e312b144f4d Major changes:
boisy
parents:
diff changeset
175 sta <VD.PlFlg,u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
176 leax >L011A,pcr default palette
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
177 leay <VD.Palet,u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
178 L00E6 leau >L00F8,pcr CMP to RGB conversion
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
179 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
180 L00EA tfr u,w
1e312b144f4d Major changes:
boisy
parents:
diff changeset
181 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
182 L00EA pshs u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
183 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
184 leau >L012A,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
185 ldb #16
1e312b144f4d Major changes:
boisy
parents:
diff changeset
186 L00F2 lda ,x+
1e312b144f4d Major changes:
boisy
parents:
diff changeset
187 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
188 jmp ,w
1e312b144f4d Major changes:
boisy
parents:
diff changeset
189 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
190 jmp [,s]
1e312b144f4d Major changes:
boisy
parents:
diff changeset
191 ENDC
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
192 L00F6 lda a,u remap to CMP values
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
193 L00F8 sta ,y+ and save RGB data
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
194 decb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
195 bne L00F2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
196 IFEQ H6309
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
197 leas $02,s clean up stack
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
198 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
199 L00FF puls pc,u,y,x,b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
200
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
201 SetPals pshs u,y,x,b,a puts palette data in.
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
202 lda >WGlobal+G.CrDvFl is this screen active?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
203 beq L00FF 0 = not active
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
204 leax <VD.Palet,u point X to palette table
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
205 ldy #$FFB0 point Y to palette register
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
206 lda >WGlobal+G.MonTyp universal RGB/CMP 0 = CMP, 1 = RGB, 2 = MONO
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
207 bne L00E6 if not 0 (CMP) don't re-map colors
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
208 leau >L00F6,pcr else do re-map colors
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
209 bra L00EA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
210
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
211 L011A fcb $12,$36,$09,$24 default palette data
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
212 fcb $3f,$1b,$2d,$26
1e312b144f4d Major changes:
boisy
parents:
diff changeset
213 fcb $00,$12,$00,$3f
1e312b144f4d Major changes:
boisy
parents:
diff changeset
214 fcb $00,$12,$00,$26
1e312b144f4d Major changes:
boisy
parents:
diff changeset
215
1e312b144f4d Major changes:
boisy
parents:
diff changeset
216 * converts CMP to RGB
1e312b144f4d Major changes:
boisy
parents:
diff changeset
217 L012A fdb $000c,$020e,$0709,$0510
1e312b144f4d Major changes:
boisy
parents:
diff changeset
218 fdb $1c2c,$0d1d,$0b1b,$0a2b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
219 fdb $2211,$1221,$0301,$1332
1e312b144f4d Major changes:
boisy
parents:
diff changeset
220 fdb $1e2d,$1f2e,$0f3c,$2f3d
1e312b144f4d Major changes:
boisy
parents:
diff changeset
221 fdb $1708,$1506,$2716,$2636
1e312b144f4d Major changes:
boisy
parents:
diff changeset
222 fdb $192a,$1a3a,$1829,$2838
1e312b144f4d Major changes:
boisy
parents:
diff changeset
223 fdb $1404,$2333,$2535,$2434
1e312b144f4d Major changes:
boisy
parents:
diff changeset
224 fdb $203B,$313E,$3739,$3F30
1e312b144f4d Major changes:
boisy
parents:
diff changeset
225
1e312b144f4d Major changes:
boisy
parents:
diff changeset
226 * Entry: A = char to write
1e312b144f4d Major changes:
boisy
parents:
diff changeset
227 * Y = path desc ptr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
228 Write equ *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
229 IFNE COCO2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
230 cmpa #$0F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
231 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
232 cmpa #$0E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
233 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
234 bls Dispatch
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
235 cmpa #$1B escape code?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
236 lbeq Escape yes, do escape immediately
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
237 IFNE COCO2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
238 cmpa #$1E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
239 bcs Do1E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
240 cmpa #$1F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
241 bls Dispatch
1e312b144f4d Major changes:
boisy
parents:
diff changeset
242 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
243 cmpa #$1F
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
244 lbls NoOp ignore gfx codes if not CoCo 2 compatible
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
245 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
246 tsta
1e312b144f4d Major changes:
boisy
parents:
diff changeset
247 bmi L01BA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
248 ldb <VD.CFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
249 beq L019A
1e312b144f4d Major changes:
boisy
parents:
diff changeset
250 cmpa #$5E
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
251 bne L018A re-map characters from ASCII-VDG
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
252 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
253 bra L01BA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
254 L018A cmpa #$5F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
255 bne L0192
1e312b144f4d Major changes:
boisy
parents:
diff changeset
256 lda #$1F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
257 bra L01BA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
258 L0192 cmpa #$60
1e312b144f4d Major changes:
boisy
parents:
diff changeset
259 bne L01AA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
260 lda #$67
1e312b144f4d Major changes:
boisy
parents:
diff changeset
261 bra L01BA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
262
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
263 L019A cmpa #$7C true lowercase
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
264 bne L01A2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
265 lda #$21
1e312b144f4d Major changes:
boisy
parents:
diff changeset
266 bra L01BA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
267 L01A2 cmpa #$7E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
268 bne L01AA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
269 lda #$2D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
270 bra L01BA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
271 L01AA cmpa #$60
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
272 bcs L01B2 re-map ASCII
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
273 suba #$60
1e312b144f4d Major changes:
boisy
parents:
diff changeset
274 bra L01BA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
275 L01B2 cmpa #$40
1e312b144f4d Major changes:
boisy
parents:
diff changeset
276 bcs L01B8
1e312b144f4d Major changes:
boisy
parents:
diff changeset
277 suba #$40
1e312b144f4d Major changes:
boisy
parents:
diff changeset
278 L01B8 eora #$40
1e312b144f4d Major changes:
boisy
parents:
diff changeset
279 L01BA ldx <VD.CrsrA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
280 sta ,x+
1e312b144f4d Major changes:
boisy
parents:
diff changeset
281 stx <VD.CrsrA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
282 cmpx <VD.ScrnE,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
283 bcs L01CA
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
284 lbsr SScrl if at end of screen, scroll it
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
285 L01CA lbsr ShowCrsr ends with a CLRB/RTS anyhow
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
286 NoOp clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
287 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
288
1e312b144f4d Major changes:
boisy
parents:
diff changeset
289 IFNE COCO2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
290 Do1E lbsr ChkDvRdy
1e312b144f4d Major changes:
boisy
parents:
diff changeset
291 bcc Dispatch
1e312b144f4d Major changes:
boisy
parents:
diff changeset
292 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
293 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
294
1e312b144f4d Major changes:
boisy
parents:
diff changeset
295 Dispatch leax >DCodeTbl,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
296 lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
297 ldd a,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
298 jmp d,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
299
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
300 DCodeTbl fdb NoOp-DCodeTbl $00 - No Operation
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
301 fdb CurHome-DCodeTbl $01 - Home Cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
302 fdb CurXY-DCodeTbl $02 - Move Cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
303 fdb DelLine-DCodeTbl $03 - Delete Line
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
304 fdb ErEOLine-DCodeTbl $04 - Erase to End Of Line
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
305 fdb CrsrSw-DCodeTbl $05 - Switch Cursor Color
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
306 fdb CurRght-DCodeTbl $06 - Move Cursor Right
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
307 fdb NoOp-DCodeTbl $07 - Bell (Handled by VTIO)
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
308 fdb CurLeft-DCodeTbl $08 - Move Cursor Left
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
309 fdb CurUp-DCodeTbl $09 - Move Cursor Up
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
310 fdb CurDown-DCodeTbl $0A - Move Cursor Down
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
311 fdb ErEOScrn-DCodeTbl $0B - Erase to End Of Screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
312 fdb ClrScrn-DCodeTbl $0C - Clear Screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
313 fdb Retrn-DCodeTbl $0D - Carriage Return
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
314 fdb Do0E-DCodeTbl $0E - Display Alpha Screen
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
315
1e312b144f4d Major changes:
boisy
parents:
diff changeset
316 IFNE COCO2
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
317 fdb Do0F-DCodeTbl $0F - Display Graphics
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
318 fdb Do10-DCodeTbl $10 - Preset Screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
319 fdb Do11-DCodeTbl $11 - Set Color
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
320 fdb Do12-DCodeTbl $12 - End Graphics
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
321 fdb Do13-DCodeTbl $13 - Erase Graphics
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
322 fdb Do14-DCodeTbl $14 - Home Graphics Cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
323 fdb Do15-DCodeTbl $15 - Set Graphics Cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
324 fdb Do16-DCodeTbl $16 - Draw Line
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
325 fdb Do17-DCodeTbl $17 - Erase Line
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
326 fdb Do18-DCodeTbl $18 - Set Point
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
327 fdb Do19-DCodeTbl $19 - Erase Point
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
328 fdb Do1A-DCodeTbl $1A - Draw Circle
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
329 fdb Escape-DCodeTbl $1B - Escape
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
330 fdb Do1C-DCodeTbl $1C - Erase Circle
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
331 fdb Do1D-DCodeTbl $1D - Flood Fill
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
332 fdb NoOp-DCodeTbl $1E - No Operation
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
333 fdb NoOp-DCodeTbl $1F - No Operation
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
334 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
335
1e312b144f4d Major changes:
boisy
parents:
diff changeset
336 * Code fragment from original CoCo 3 VDGInt by Tandy - not referenced
1e312b144f4d Major changes:
boisy
parents:
diff changeset
337 * comb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
338 * ldb #E$Write
1e312b144f4d Major changes:
boisy
parents:
diff changeset
339 * rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
340
1e312b144f4d Major changes:
boisy
parents:
diff changeset
341 * $1B does palette changes
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
342 Escape ldx <VD.EPlt1,u now X points to VD.NChar
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
343 lda ,x get char following
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
344 cmpa #$30 default color?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
345 bne L0209 branch if not
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
346 lbsr SetupPal do default palette
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
347 lbra L026E put palette and exit
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
348
1981
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
349 * The reasons for the commented out lines below are discussed in cowin.asm
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
350 * where the functions are identical. RG
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
351 L0209 cmpa #$31 change palette?
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
352 IFNE COCO2
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
353 lbeq PalProc branch if so
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
354 cmpa #$21
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
355 lbne NoOp return without error
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
356 ldx PD.RGS,y get registers
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
357 lda R$A,x get path
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
358 ldx <D.Proc get current proc
1981
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
359 * There does not seem to be a reason for the next two lines. RG
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
360 * cmpa >P$SelP,x compare against selected path
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
361 * beq L0249 branch if empty
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
362 ldb >P$SelP,x else load selected path from process descriptor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
363 sta >P$SelP,x and store passed path
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
364 pshs y save our path desc ptr
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
365 bsr L024A get device table entry for path
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
366 ldy V$STAT,y get driver statics
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
367 ldx <D.CCMem get CoCo memory
1981
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
368 * Again, there does not seem to be a reason for this or the next branch. RG
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
369 * cmpy <G.CurDev,x
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
370 puls y restore our path desc ptr
1981
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
371 * bne L0248
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
372 inc <VD.DFlag,u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
373 ldy <G.CurDev,x get current static mem
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
374 sty <G.PrWMPt,x copy to previous
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
375 stu <G.CurDev,x and save new static mem ptr
1981
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
376 * Give system a chance to stabilize. RG
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
377 ldx #2
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
378 os9 F$Sleep
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
379 L0248 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
380 L0249 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
381
1e312b144f4d Major changes:
boisy
parents:
diff changeset
382 * Entry: A = path to process
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
383 L024A leax <P$Path,x point to path table in process descriptor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
384 lda b,x get system path number
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
385 ldx <D.PthDBT point to path descriptor base table
1981
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
386 * protect regB incase of error report. RG
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
387 pshs b
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
388 os9 F$Find64 put found path descriptor in Y
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
389 ldy PD.DEV,y load Y with device table entry
1981
21bf55c38692 Changes to permit selection of vdg windows within a script file.
robert
parents: 1938
diff changeset
390 puls b,pc
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
391 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
392 bne NoOp
1e312b144f4d Major changes:
boisy
parents:
diff changeset
393 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
394
1e312b144f4d Major changes:
boisy
parents:
diff changeset
395 PalProc leax <DoPals,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
396 ldb #$02
1e312b144f4d Major changes:
boisy
parents:
diff changeset
397 lbra GChar
1e312b144f4d Major changes:
boisy
parents:
diff changeset
398
1e312b144f4d Major changes:
boisy
parents:
diff changeset
399 DoPals ldx <VD.EPlt1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
400 ldd ,x
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
401 cmpa #16 max 16 palettes
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
402 lbhi IllArg
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
403 cmpb #63 color has max. 63
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
404 lbhi IllArg
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
405 leax <VD.Palet,u to palette buffer
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
406 stb a,x save it
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
407 L026E lbsr SetPals
1e312b144f4d Major changes:
boisy
parents:
diff changeset
408 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
409 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
410
1e312b144f4d Major changes:
boisy
parents:
diff changeset
411 * anda #$0F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
412 * andb #$3F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
413 * leax <VD.Palet,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
414 * stb a,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
415 *L026E inc <VD.DFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
416 * clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
417 * rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
418
1e312b144f4d Major changes:
boisy
parents:
diff changeset
419 * Screen scroll
1e312b144f4d Major changes:
boisy
parents:
diff changeset
420 SScrl ldx <VD.ScrnA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
421 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
422 ldd #$2060
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
423 leay a,x down one line
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
424 ldw #512-32
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
425 tfm y+,x+ scroll screen up
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
426 stx <VD.CrsrA,u save new cursor address
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
427 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
428 leax <32,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
429 L0279 ldd ,x++
1e312b144f4d Major changes:
boisy
parents:
diff changeset
430 std <-34,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
431 cmpx <VD.ScrnE,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
432 bcs L0279
1e312b144f4d Major changes:
boisy
parents:
diff changeset
433 leax <-32,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
434 stx <VD.CrsrA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
435 lda #32
1e312b144f4d Major changes:
boisy
parents:
diff changeset
436 ldb #$60
1e312b144f4d Major changes:
boisy
parents:
diff changeset
437 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
438 L028D stb ,x+
1e312b144f4d Major changes:
boisy
parents:
diff changeset
439 deca
1e312b144f4d Major changes:
boisy
parents:
diff changeset
440 bne L028D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
441 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
442
1e312b144f4d Major changes:
boisy
parents:
diff changeset
443 * $0D - carriage return
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
444 Retrn bsr HideCrsr hide cursor
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
445 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
446 aim #$E0,<VD.CrsAL,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
447 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
448 tfr x,d
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
449 andb #$E0 strip out bits 0-4
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
450 stb <VD.CrsAL,u save updated cursor address
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
451 ENDC
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
452 ShowCrsr ldx <VD.CrsrA,u get cursor address
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
453 lda ,x get char at cursor position
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
454 sta <VD.CChar,u save it
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
455 lda <VD.CColr,u get cusor character
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
456 beq RtsOk branch if none
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
457 L02A9 sta ,x else turn on cursor
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
458 RtsOk clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
459 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
460
1e312b144f4d Major changes:
boisy
parents:
diff changeset
461 * $0A - moves cursor down
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
462 CurDown bsr HideCrsr hide cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
463 leax <32,x move X down one line
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
464 cmpx <VD.SCrnE,u at the end of the screen?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
465 bcs L02C1 branch if not
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
466 leax <-32,x else go back up one line
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
467 pshs x save X
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
468 lbsr SScrl and scroll the screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
469 puls x and restore pointer
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
470 L02C1 stx <VD.CrsrA,u save cursor pointer
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
471 bra ShowCrsr show cursor
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
472
1e312b144f4d Major changes:
boisy
parents:
diff changeset
473 * $08 - moves cursor left one
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
474 CurLeft bsr HideCrsr hide cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
475 cmpx <VD.ScrnA,u compare against start of screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
476 bls ShowCrsr ignore it if at the screen start
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
477 leax -$01,x else back up one
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
478 stx <VD.CrsrA,u save updated pointer
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
479 bra ShowCrsr and show cur
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
480
1e312b144f4d Major changes:
boisy
parents:
diff changeset
481 * $06 - moves cursor right one
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
482 CurRght bsr HideCrsr hide cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
483 leax 1,x move to the right
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
484 cmpx <VD.SCrnE,u compare against start of screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
485 bcc ShowCrsr if past end, ignore it
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
486 stx <VD.CrsrA,u else save updated pointer
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
487 bra ShowCrsr and show cursor
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
488
1e312b144f4d Major changes:
boisy
parents:
diff changeset
489 * $0B - erase from current char to end of screen
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
490 ErEOScrn bsr HideCrsr kill the cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
491 * bra L02E8 and clear the rest of the screen
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
492 fcb skip2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
493
1e312b144f4d Major changes:
boisy
parents:
diff changeset
494 * $0C - clear screen & home cursor
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
495 ClrScrn bsr CurHome home cursor (returns X pointing to start of screen)
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
496 lda #$60 get default char
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
497 ClrSLoop sta ,x+ save at location
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
498 cmpx <VD.SCrnE,u end of screen?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
499 bcs ClrSLoop branch if not
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
500 bra ShowCrsr now show cursor
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
501
1e312b144f4d Major changes:
boisy
parents:
diff changeset
502 * $01 - Homes the cursor
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
503 CurHome bsr HideCrsr hide cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
504 ldx <VD.ScrnA,u get pointer to screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
505 stx <VD.CrsrA,u save as new cursor position
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
506 bra ShowCrsr and show it
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
507
1e312b144f4d Major changes:
boisy
parents:
diff changeset
508 * Hides the cursor from the screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
509 * Exit: X = address of cursor
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
510 HideCrsr ldx <VD.CrsrA,u get address of cursor in X
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
511 lda <VD.CChar,u get value of char under cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
512 sta ,x put char in place of cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
513 clrb must be here, in general, for [...] BRA HideCrsr
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
514 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
515
1e312b144f4d Major changes:
boisy
parents:
diff changeset
516 * $05 - turns cursor on/off, color
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
517 CrsrSw lda <VD.NChar,u get next char
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
518 suba #C$SPAC take out ASCII space
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
519 bne L0313 branch if not zero
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
520 sta <VD.CColr,u else save cursor color zero (no cursor)
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
521 bra HideCrsr and hide cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
522 L0313 cmpa #$0B greater than $0B?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
523 bge RtsOk yep, just ignore byte
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
524 cmpa #$01 is it one?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
525 bgt L031F branch if greater
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
526 lda #$AF else get default blue cursor color
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
527 bra L032F and save cursor color
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
528 L031F cmpa #$02 is it two?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
529 bgt L0327 branch if larger
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
530 lda #$A0 else get black cursor color
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
531 bra L032F and save it
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
532 ** BUG ** BUG ** BUG ** BUG
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
533 L0327 suba #$03 ** BUG FIXED ! ** !!! Was SUBB
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
534 lsla shift into upper nibble
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
535 lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
536 lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
537 lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
538 ora #$8F
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
539 L032F sta <VD.CColr,u save new cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
540 ldx <VD.CrsrA,u get cursor address
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
541 lbra L02A9 branch to save cursor in X
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
542
1e312b144f4d Major changes:
boisy
parents:
diff changeset
543 * $02 - moves cursor to X,Y
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
544 CurXY ldb #$02 we want to claim the next two chars
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
545 leax <DoCurXY,pcr point to processing routine
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
546 lbra GChar get two chars
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
547
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
548 DoCurXY bsr HideCrsr hide cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
549 ldb <VD.NChr2,u get ASCII Y-pos
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
550 subb #C$SPAC take out ASCII space
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
551 lda #32 go down
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
552 mul multiply it
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
553 addb <VD.NChar,u add in X-pos
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
554 adca #$00
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
555 subd #C$SPAC take out another ASCII space
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
556 addd <VD.ScrnA,u add top of screen address
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
557 cmpd <VD.ScrnE,u at end of the screen?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
558 lbcc RtsOk exit if off the screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
559 std <VD.CrsrA,u otherwise save new cursor address
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
560 lbra ShowCrsr and show cursor
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
561
1e312b144f4d Major changes:
boisy
parents:
diff changeset
562 * $04 - clear characters to end of line
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
563 ErEOLine bsr HideCrsr hide cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
564 tfr x,d move current cursor position to D
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
565 andb #$1F number of characters put on this line
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
566 negb negative
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
567 bra L0374 and clear one line
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
568 * pshs b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
569 * ldb #32
1e312b144f4d Major changes:
boisy
parents:
diff changeset
570 * subb ,s+
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
571 * bra L0376 and clear one line
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
572
1e312b144f4d Major changes:
boisy
parents:
diff changeset
573 * $03 - erase line cursor is on
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
574 DelLine lbsr Retrn do a carriage return
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
575 * ldb #32 B = $00 from Retrn
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
576 L0374 addb #32 B = $00 from Retrn
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
577 L0376 lda #$60 get default char
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
578 ldx <VD.CrsrA,u get cursor address
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
579 L037B sta ,x+ save default char
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
580 decb decrement
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
581 bne L037B and branch if not end
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
582 lbra ShowCrsr else show cursor
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
583
1e312b144f4d Major changes:
boisy
parents:
diff changeset
584 * $09 - moves cursor up one line
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
585 CurUp lbsr HideCrsr hide cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
586 leax <-32,x move X up one line
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
587 cmpx <VD.ScrnA,u compare against start of screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
588 lbcs ShowCrsr branch if we went beyond
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
589 stx <VD.CrsrA,u else store updated X
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
590 L0391 lbra ShowCrsr and show cursor
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
591
1e312b144f4d Major changes:
boisy
parents:
diff changeset
592 * $0E - switches from graphics to alpha mode
1e312b144f4d Major changes:
boisy
parents:
diff changeset
593 Do0E equ *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
594 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
595 clrd
1e312b144f4d Major changes:
boisy
parents:
diff changeset
596 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
597 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
598 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
599 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
600 DispAlfa pshs x,y,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
601 IFNE COCO2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
602 stb <VD.Alpha,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
603 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
604 clr <VD.DGBuf,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
605 lda >PIA1Base+2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
606 anda #$07
1e312b144f4d Major changes:
boisy
parents:
diff changeset
607 ora ,s+
1e312b144f4d Major changes:
boisy
parents:
diff changeset
608 tstb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
609 bne L03AD
1e312b144f4d Major changes:
boisy
parents:
diff changeset
610 anda #$EF
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
611 ora <VD.CFlag,u lowercase flag
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
612 L03AD sta <VD.TFlg1,u save VDG info
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
613 tst >WGlobal+G.CrDvFl is this screen currently showing?
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
614 lbeq L0440
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
615 sta >PIA1Base+2 set lowercase in hardware
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
616 ldy #$FFC6 Ok, now set up via old CoCo 2 mode
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
617 IFNE COCO2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
618 tstb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
619 bne L03CB
1e312b144f4d Major changes:
boisy
parents:
diff changeset
620 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
621 * Set up VDG screen for text
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
622 stb -6,y $FFC0
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
623 stb -4,y $FFC2
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
624 stb -2,y $FFC4
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
625 lda <VD.ScrnA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
626 IFNE COCO2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
627 bra L03D7
1e312b144f4d Major changes:
boisy
parents:
diff changeset
628 * Set up VDG screen for graphics
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
629 L03CB stb -6,y $FFC0
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
630 stb -3,y $FFC3
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
631 stb -1,y $FFC5
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
632 lda <VD.SBAdd,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
633 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
634 L03D7 lbsr SetPals
1e312b144f4d Major changes:
boisy
parents:
diff changeset
635 ldb <D.HINIT
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
636 orb #$80 set CoCo 2 compatible mode
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
637 stb <D.HINIT
1e312b144f4d Major changes:
boisy
parents:
diff changeset
638 stb >$FF90
1e312b144f4d Major changes:
boisy
parents:
diff changeset
639 ldb <D.VIDMD
1e312b144f4d Major changes:
boisy
parents:
diff changeset
640 andb #$78
1e312b144f4d Major changes:
boisy
parents:
diff changeset
641 stb >$FF98
1e312b144f4d Major changes:
boisy
parents:
diff changeset
642 stb <D.VIDMD
1e312b144f4d Major changes:
boisy
parents:
diff changeset
643 pshs a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
644 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
645 clrd
1e312b144f4d Major changes:
boisy
parents:
diff changeset
646 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
647 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
648 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
649 ENDC
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
650 std >$FF99 set resolution AND border color
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
651 std <D.VIDRS
1e312b144f4d Major changes:
boisy
parents:
diff changeset
652 puls a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
653 tfr a,b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
654 anda #$1F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
655 pshs a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
656 andb #$E0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
657 lsrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
658 lsrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
659 lsrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
660 lsrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
661 ldx <D.SysDAT
1e312b144f4d Major changes:
boisy
parents:
diff changeset
662 * leax a,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
663 abx
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
664 * lda $01,x get block number to use
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
665 * pshs a
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
666 * anda #$F8 keep high bits only
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
667 * lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
668 * lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
669 * clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
670 * PATCH START: Mod for >512K systems, Robert Gault
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
671 ldb 1,x get block number to use
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
672 pshs b
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
673 andb #$F8 keep high bits only
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
674 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
675 lslb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
676 rola
1e312b144f4d Major changes:
boisy
parents:
diff changeset
677 lslb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
678 rola
1e312b144f4d Major changes:
boisy
parents:
diff changeset
679 sta >$FF9B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
680 tfr b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
681 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
682 * PATCH END: Mod for >512K systems, Robert Gault
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
683 std <D.VOFF1 display it
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
684 std >$FF9D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
685 ldd #$0F07
1e312b144f4d Major changes:
boisy
parents:
diff changeset
686 sta <D.VOFF2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
687 sta >$FF9C
1e312b144f4d Major changes:
boisy
parents:
diff changeset
688 puls a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
689 asla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
690 asla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
691 asla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
692 asla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
693 asla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
694 ora ,s+
1e312b144f4d Major changes:
boisy
parents:
diff changeset
695 * Y now holds $FFC6, so we don't need to work with X here
1e312b144f4d Major changes:
boisy
parents:
diff changeset
696 * ldx #$FFC6
1e312b144f4d Major changes:
boisy
parents:
diff changeset
697 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
698 L0430 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
699 bcc L041A
1e312b144f4d Major changes:
boisy
parents:
diff changeset
700 leay 1,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
701 sta ,y+
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
702 fcb skip2 skip 2 bytes
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
703 L041A sta ,y++ rather than additional leax 1,x on next line
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
704 decb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
705 bne L0430
1e312b144f4d Major changes:
boisy
parents:
diff changeset
706 L0440 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
707 puls pc,y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
708
1e312b144f4d Major changes:
boisy
parents:
diff changeset
709 GChar1 ldb #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
710 GChar stb <VD.NGChr,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
711 stx <VD.RTAdd,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
712 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
713 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
714
1e312b144f4d Major changes:
boisy
parents:
diff changeset
715 IFNE COCO2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
716 * $0F - display graphics
1e312b144f4d Major changes:
boisy
parents:
diff changeset
717 Do0F leax <DispGfx,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
718 ldb #$02
1e312b144f4d Major changes:
boisy
parents:
diff changeset
719 bra GChar
1e312b144f4d Major changes:
boisy
parents:
diff changeset
720
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
721 DispGfx ldb <VD.Rdy,u memory already alloced?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
722 bne L0468 branch if so
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
723 lbsr Get8KHi else get an 8k block from high ram
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
724 bcs L0486 branch if error
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
725 stb <VD.GBuff,u save starting block number
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
726 stb <VD.Blk,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
727 tfr d,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
728 ldd <D.Proc
1e312b144f4d Major changes:
boisy
parents:
diff changeset
729 pshs u,b,a
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
730 ldd <D.SysPrc get system proc desc
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
731 std <D.Proc make current
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
732 ldb #$01 one block
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
733 os9 F$MapBlk map it in to our space
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
734 tfr u,x get address into x
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
735 puls u,b,a restore other regs
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
736 std <D.Proc restore process pointer
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
737 bcs L0486 branch if error occurred
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
738 stx <VD.SBAdd,u else store address of gfx mem
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
739 inc <VD.Rdy,u we're ready
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
740 lda #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
741 ldb #$20
1e312b144f4d Major changes:
boisy
parents:
diff changeset
742 bsr L04D9
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
743 lbsr Do13 erase gfx screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
744 L0468 lda <VD.NChr2,u get character after next
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
745 sta <VD.PMask,u store color set (0-3)
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
746 anda #$03 mask off pertinent bytes
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
747 leax >Mode1Clr,pcr point to mask byte table
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
748 lda a,x get byte
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
749 sta <VD.Msk1,u save mask byte here
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
750 sta <VD.Msk2,u and here
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
751 lda <VD.NChar,u get next char, mode byte (0-1)
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
752 cmpa #$01 compare against max
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
753 bls L0487 branch if valid
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
754 comb
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
755 ldb #E$BMode else invalid mode specified, send error
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
756 L0486 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
757
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
758 L0487 tsta test user supplied mode byte
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
759 beq L04A7 branch if 256x192
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
760 ldd #$C003
1e312b144f4d Major changes:
boisy
parents:
diff changeset
761 std <VD.MCol,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
762 lda #$01
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
763 sta <VD.Mode,u 128x192 mode
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
764 lda #$E0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
765 ldb <VD.NChr2,u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
766 andb #$08
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
767 beq L04A0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
768 lda #$F0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
769 L04A0 ldb #$03
1e312b144f4d Major changes:
boisy
parents:
diff changeset
770 leax <L04EB,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
771 bra L04C4
1e312b144f4d Major changes:
boisy
parents:
diff changeset
772 L04A7 ldd #$8001
1e312b144f4d Major changes:
boisy
parents:
diff changeset
773 std <VD.MCol,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
774 lda #$FF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
775 tst <VD.Msk1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
776 beq L04BA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
777 sta <VD.Msk1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
778 sta <VD.Msk2,u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
779 L04BA sta <VD.Mode,u 256x192 mode
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
780 lda #$F0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
781 ldb #$07
1e312b144f4d Major changes:
boisy
parents:
diff changeset
782 leax <L04EF,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
783 L04C4 stb <VD.PixBt,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
784 stx <VD.MTabl,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
785 ldb <VD.NChr2,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
786 andb #$04
1e312b144f4d Major changes:
boisy
parents:
diff changeset
787 lslb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
788 pshs b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
789 ora ,s+
1e312b144f4d Major changes:
boisy
parents:
diff changeset
790 ldb #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
791 * Indicate screen is current; next line is critical for >512K - Robert Gault
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
792 stb >WGlobal+G.CrDvFl is this screen currently showing?
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
793 lbra DispAlfa
1e312b144f4d Major changes:
boisy
parents:
diff changeset
794
1e312b144f4d Major changes:
boisy
parents:
diff changeset
795 L04D9 pshs x,b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
796 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
797 ldb $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
798 ldx <D.SysMem
1e312b144f4d Major changes:
boisy
parents:
diff changeset
799 leax d,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
800 puls b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
801 L04E4 sta ,x+
1e312b144f4d Major changes:
boisy
parents:
diff changeset
802 decb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
803 bne L04E4
1e312b144f4d Major changes:
boisy
parents:
diff changeset
804 puls pc,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
805
1e312b144f4d Major changes:
boisy
parents:
diff changeset
806 L04EB fdb $C030,$0C03
1e312b144f4d Major changes:
boisy
parents:
diff changeset
807
1e312b144f4d Major changes:
boisy
parents:
diff changeset
808 L04EF fcb $80,$40,$20,$10,$08,$04,$02,$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
809
1e312b144f4d Major changes:
boisy
parents:
diff changeset
810 * $11 - set color
1e312b144f4d Major changes:
boisy
parents:
diff changeset
811 Do11 leax <SetColor,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
812 lbra GChar1
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
813 SetColor lda <VD.NChar,u get next char
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
814 sta <VD.NChr2,u save in next after
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
815 L0503 clr <VD.NChar,u and clear next
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
816 lda <VD.Mode,u which mode?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
817 bmi L050E branch if 256x192
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
818 inc <VD.NChar,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
819 L050E lbra L0468
1e312b144f4d Major changes:
boisy
parents:
diff changeset
820
1e312b144f4d Major changes:
boisy
parents:
diff changeset
821 * $12 - end graphics
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
822 Do12 ldx <VD.SBAdd,u get screen address
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
823 beq L051B branch if empty
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
824 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
825 ldb #$20
1e312b144f4d Major changes:
boisy
parents:
diff changeset
826 bsr L04D9
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
827 L051B leay <VD.GBuff,u point Y to graphics buffer block numbers
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
828 ldb #$03 number of blocks starting at VD.GBuff
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
829 pshs u,b save our static pointer, and counter (3)
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
830 L0522 lda ,y+ get next block
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
831 beq L052D if empty, continue
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
832 clrb else clear B
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
833 tfr d,x transfer D to X
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
834 incb 1 block to deallocate
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
835 os9 F$DelRAM deallocate it
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
836 L052D dec ,s dec counter
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
837 bgt L0522 if not zero, get more
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
838 * Note: this seems to be a bug. Here, Y is pointing to VD.HiRes ($4D), which
1e312b144f4d Major changes:
boisy
parents:
diff changeset
839 * is the block number of any CoCo 3 Hi-Res screen. This $0E command just
1e312b144f4d Major changes:
boisy
parents:
diff changeset
840 * deals with CoCo 2 graphics modes. What I think should happen here is
1e312b144f4d Major changes:
boisy
parents:
diff changeset
841 * that the byte flood fill buffer should be checked for non-zero,
1e312b144f4d Major changes:
boisy
parents:
diff changeset
842 * then freed. It looks as though this code would work IF the Hi-Res
1e312b144f4d Major changes:
boisy
parents:
diff changeset
843 * variables from $4D-$5B, which are CoCo 3 specific, didn't exist. So
1e312b144f4d Major changes:
boisy
parents:
diff changeset
844 * this bug was introduced when the CoCo 3 specific static vars were added
1e312b144f4d Major changes:
boisy
parents:
diff changeset
845 * between VD.AGBuf and VD.FFMem
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
846 ldu VD.FFMem-VD.HiRes,y get flood fill stack memory ptr
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
847 beq L053B
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
848 ldd #FFStSz get flood fill stack size
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
849 os9 F$SRtMem
1e312b144f4d Major changes:
boisy
parents:
diff changeset
850 L053B puls u,b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
851 clr <VD.Rdy,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
852 lbra Do0E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
853
1e312b144f4d Major changes:
boisy
parents:
diff changeset
854 * $10 - preset screen to a specific color
1e312b144f4d Major changes:
boisy
parents:
diff changeset
855 Do10 leax <PrstScrn,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
856 lbra GChar1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
857
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
858 PrstScrn lda <VD.NChar,u get next char
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
859 tst <VD.Mode,u which mode?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
860 bpl L0559 branch if 128x192 4 color
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
861 ldb #$FF assume we will clear with $FF
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
862 anda #$01 mask out all but 1 bit (2 colors)
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
863 beq Do13 erase graphic screen with color $00
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
864 bra L0564 else erase with color $FF
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
865 L0559 anda #$03 mask out all but 2 bits (4 colors)
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
866 leax >Mode1Clr,pcr point to color table
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
867 ldb a,x get appropriate byte
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
868 bra L0564 and start the clearing
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
869
1e312b144f4d Major changes:
boisy
parents:
diff changeset
870 * $13 - erase graphics
1e312b144f4d Major changes:
boisy
parents:
diff changeset
871 Do13 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
872 L0564 ldx <VD.SBAdd,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
873 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
874 * Note: 6309 version clears from top to bottom
1e312b144f4d Major changes:
boisy
parents:
diff changeset
875 * 6809 version clears from bottom to top
1e312b144f4d Major changes:
boisy
parents:
diff changeset
876 ldw #$1800
1e312b144f4d Major changes:
boisy
parents:
diff changeset
877 pshs b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
878 tfm s,x+
1e312b144f4d Major changes:
boisy
parents:
diff changeset
879 puls b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
880 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
881 leax >$1801,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
882 L056B stb ,-x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
883 cmpx <VD.SBAdd,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
884 bhi L056B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
885 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
886
1e312b144f4d Major changes:
boisy
parents:
diff changeset
887 * $14 - home graphics cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
888 Do14 equ *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
889 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
890 clrd
1e312b144f4d Major changes:
boisy
parents:
diff changeset
891 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
892 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
893 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
894 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
895 std <VD.GCrsX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
896 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
897
1e312b144f4d Major changes:
boisy
parents:
diff changeset
898 * 128x192 4 color pixel table
1e312b144f4d Major changes:
boisy
parents:
diff changeset
899 Mode1Clr fcb $00,$55,$aa,$ff
1e312b144f4d Major changes:
boisy
parents:
diff changeset
900
1e312b144f4d Major changes:
boisy
parents:
diff changeset
901 * Fix X/Y coords:
1e312b144f4d Major changes:
boisy
parents:
diff changeset
902 * - if Y > 191 then cap it at 191
1e312b144f4d Major changes:
boisy
parents:
diff changeset
903 * - adjust X coord if in 128x192 mode
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
904 FixXY ldd <VD.NChar,u get next 2 chars
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
905 cmpb #192 Y greater than max?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
906 bcs L0585 branch if lower than
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
907 ldb #191
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
908 L0585 tst <VD.Mode,u which mode?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
909 bmi L058B branch if 256x192
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
910 lsra else divide X by 2
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
911 L058B std <VD.NChar,u and save
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
912 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
913
1e312b144f4d Major changes:
boisy
parents:
diff changeset
914 * $15 - set graphics cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
915 Do15 leax <SetGC,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
916 GChar2 ldb #$02
1e312b144f4d Major changes:
boisy
parents:
diff changeset
917 lbra GChar
1e312b144f4d Major changes:
boisy
parents:
diff changeset
918
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
919 SetGC bsr FixXY fix coords
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
920 std <VD.GCrsX,u and save new gfx cursor pos
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
921 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
922 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
923
1e312b144f4d Major changes:
boisy
parents:
diff changeset
924 * $19 - erase point
1e312b144f4d Major changes:
boisy
parents:
diff changeset
925 Do19 clr <VD.Msk1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
926 * $18 - set point
1e312b144f4d Major changes:
boisy
parents:
diff changeset
927 Do18 leax <DrawPnt,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
928 bra GChar2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
929
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
930 DrawPnt bsr FixXY fix coords
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
931 std <VD.GCrsX,u save as new gfx cursor pos
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
932 bsr DrwPt2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
933 lbra L067C
1e312b144f4d Major changes:
boisy
parents:
diff changeset
934 DrwPt2 lbsr XY2Addr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
935 L05B3 tfr a,b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
936 comb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
937 andb ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
938 stb ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
939 anda <VD.Msk1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
940 ora ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
941 sta ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
942 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
943
1e312b144f4d Major changes:
boisy
parents:
diff changeset
944 * $17 - erase line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
945 Do17 clr <VD.Msk1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
946
1e312b144f4d Major changes:
boisy
parents:
diff changeset
947 * $16 - draw line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
948 Do16 leax <DrawLine,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
949 bra GChar2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
950
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
951 DrawLine bsr FixXY fix up coords
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
952 leas -$0E,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
953 std $0C,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
954 lbsr XY2Addr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
955 stx $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
956 sta $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
957 ldd <VD.GCrsX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
958 lbsr XY2Addr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
959 sta ,s
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
960 * IFNE H6309 no longer needed RG
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
961 * clrd
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
962 * ELSE
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
963 * clra
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
964 * clrb
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
965 * ENDC
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
966 * std $04,s
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
967 lda #$BF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
968 suba <VD.GCrsY,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
969 sta <VD.GCrsY,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
970 lda #$BF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
971 suba <VD.NChr2,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
972 sta <VD.NChr2,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
973 lda #$FF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
974 sta $06,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
975 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
976 ldb <VD.GCrsX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
977 subb <VD.NChar,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
978 sbca #$00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
979 bpl L0608
1e312b144f4d Major changes:
boisy
parents:
diff changeset
980 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
981 negd
1e312b144f4d Major changes:
boisy
parents:
diff changeset
982 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
983 nega
1e312b144f4d Major changes:
boisy
parents:
diff changeset
984 negb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
985 sbca #$00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
986 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
987 neg $06,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
988 L0608 std $08,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
989 bne L0611
1e312b144f4d Major changes:
boisy
parents:
diff changeset
990 ldd #$FFFF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
991 std $04,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
992 L0611 lda #$E0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
993 sta $07,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
994 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
995 ldb <VD.GCrsY,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
996 subb <VD.NChr2,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
997 sbca #$00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
998 bpl L0626
1e312b144f4d Major changes:
boisy
parents:
diff changeset
999 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1000 negd
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1001 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1002 nega
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1003 negb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1004 sbca #$00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1005 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1006 neg $07,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1007 L0626 std $0A,s
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1008 * New routine to halve the error value RG
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1009 cmpd $08,s is dX>dY
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1010 pshs cc save answer
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1011 IFNE H6309 assume true and negate regD
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1012 negd
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1013 ELSE
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1014 nega
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1015 negb
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1016 sbca #0
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1017 ENDC
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1018 puls cc
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1019 bhs ch1
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1020 ldd $08,s get dY
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1021 ch1 equ *
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1022 IFNE H6309
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1023 asrd
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1024 ELSE
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1025 asra
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1026 rorb
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1027 ENDC
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1028 cmpd #0
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1029 beq L0632 error must not be zero
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1030 * End of new routine RG
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1031 std $04,s
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1032 bra L0632
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1033 L062A sta ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1034 ldd $04,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1035 subd $0A,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1036 std $04,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1037 L0632 lda ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1038 lbsr L05B3
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1039 cmpx $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1040 bne L0641
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1041 lda ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1042 cmpa $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1043 beq L0675
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1044 L0641 ldd $04,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1045 bpl L064F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1046 addd $08,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1047 std $04,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1048 lda $07,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1049 leax a,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1050 bra L0632
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1051 L064F lda ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1052 ldb $06,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1053 bpl L0665
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1054 lsla
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1055 ldb <VD.Mode,u which mode?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1056 bmi L065C branch if 256x192
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1057 lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1058 L065C bcc L062A
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1059 lda <VD.MCol2,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1060 leax -$01,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1061 bra L062A
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1062 L0665 lsra
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1063 ldb <VD.Mode,u which mode?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1064 bmi L066C branch if 256x192
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1065 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1066 L066C bcc L062A
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1067 lda <VD.MCol,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1068 leax $01,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1069 bra L062A
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1070 L0675 ldd $0C,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1071 std <VD.GCrsX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1072 leas $0E,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1073 L067C lda <VD.Msk2,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1074 sta <VD.Msk1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1075 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1076 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1077
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1078 * $1C - erase circle
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1079 Do1C clr <VD.Msk1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1080 * $1A - draw circle
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1081 Do1A leax <Circle,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1082 lbra GChar1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1083
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1084 Circle leas -$04,s
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1085 ldb <VD.NChar,u get radius
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1086 stb $01,s store on stack
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1087 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1088 sta ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1089 addb $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1090 adca #$00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1091 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1092 negd
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1093 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1094 nega
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1095 negb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1096 sbca #$00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1097 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1098 addd #$0003
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1099 std $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1100 L06AB lda ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1101 cmpa $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1102 bcc L06DD
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1103 ldb $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1104 bsr L06EB
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1105 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1106 ldb $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1107 bpl L06C5
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1108 ldb ,s
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1109 IFNE H6309
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1110 lsld
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1111 lsld
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1112 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1113 lslb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1114 rola
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1115 lslb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1116 rola
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1117 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1118 addd #$0006
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1119 bra L06D5
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1120 L06C5 dec $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1121 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1122 ldb ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1123 subb $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1124 sbca #$00
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1125 IFNE H6309
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1126 lsld
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1127 lsld
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1128 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1129 lslb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1130 rola
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1131 lslb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1132 rola
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1133 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1134 addd #$000A
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1135 L06D5 addd $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1136 std $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1137 inc ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1138 bra L06AB
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1139 L06DD lda ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1140 cmpa $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1141 bne L06E7
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1142 ldb $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1143 bsr L06EB
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1144 L06E7 leas $04,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1145 bra L067C
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1146 L06EB leas -$08,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1147 sta ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1148 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1149 std $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1150 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1151 negd
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1152 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1153 nega
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1154 negb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1155 sbca #$00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1156 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1157 std $06,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1158 ldb ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1159 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1160 std ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1161 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1162 negd
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1163 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1164 nega
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1165 negb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1166 sbca #$00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1167 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1168 std $04,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1169 ldx $06,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1170 bsr L0734
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1171 ldd $04,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1172 ldx $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1173 bsr L0734
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1174 ldd ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1175 ldx $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1176 bsr L0734
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1177 ldd ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1178 ldx $06,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1179 bsr L0734
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1180 ldd $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1181 ldx ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1182 bsr L0734
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1183 ldd $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1184 ldx $04,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1185 bsr L0734
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1186 ldd $06,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1187 ldx $04,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1188 bsr L0734
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1189 ldd $06,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1190 ldx ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1191 bsr L0734
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1192 leas $08,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1193 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1194 L0734 pshs b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1195 ldb <VD.GCrsY,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1196 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1197 leax d,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1198 cmpx #$0000
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1199 bmi L0746
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1200 cmpx #$00BF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1201 ble L0748
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1202 L0746 puls pc,b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1203 L0748 ldb <VD.GCrsX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1204 clra
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1205 tst <VD.Mode,u which mode?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1206 bmi L0753 branch if 256x192
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1207 IFNE H6309
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1208 lsld
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1209 ELSE
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1210 lslb else multiply D by 2
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1211 rola
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1212 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1213 L0753 addd ,s++
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1214 tsta
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1215 beq L0759
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1216 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1217 L0759 pshs b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1218 tfr x,d
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1219 puls a
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1220 tst <VD.Mode,u which mode?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1221 lbmi DrwPt2 branch if 256x192
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1222 lsra else divide a by 2
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1223 lbra DrwPt2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1224
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1225 * $1D - flood fill
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1226 Do1D clr <VD.FF6,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1227 leas -$07,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1228 lbsr L08DD
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1229 lbcs L0878
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1230 lda #$FF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1231 sta <VD.FFFlg,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1232 ldd <VD.GCrsX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1233 lbsr L0883
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1234 lda <VD.FF1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1235 sta <VD.FF2,u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1236 tst <VD.Mode,u which mode?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1237 bpl L0793 branch if 128x192
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1238 tsta
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1239 beq L0799
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1240 lda #$FF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1241 bra L0799
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1242 L0793 leax >Mode1Clr,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1243 lda a,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1244 L0799 sta <VD.FFMsk,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1245 cmpa <VD.Msk1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1246 lbeq L0878
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1247 ldd <VD.GCrsX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1248 L07A6 suba #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1249 bcs L07B1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1250 lbsr L0883
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1251 bcs L07B1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1252 beq L07A6
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1253 L07B1 inca
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1254 std $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1255 L07B4 lbsr L08B6
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1256 adda #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1257 bcs L07C2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1258 lbsr L0883
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1259 bcs L07C2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1260 beq L07B4
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1261 L07C2 deca
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1262 ldx $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1263 lbsr L0905
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1264 neg <VD.FFFlg,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1265 lbsr L0905
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1266 L07CE lbsr L092B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1267 lbcs L0878
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1268 tst <VD.FFFlg,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1269 bpl L07E5
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1270 subb #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1271 bcs L07CE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1272 std $03,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1273 tfr x,d
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1274 decb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1275 bra L07EF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1276 L07E5 incb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1277 cmpb #$BF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1278 bhi L07CE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1279 std $03,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1280 tfr x,d
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1281 incb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1282 L07EF std $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1283 lbsr L0883
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1284 bcs L07CE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1285 L07F6 bne L0804
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1286 suba #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1287 bcc L07FF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1288 inca
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1289 bra L0808
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1290 L07FF lbsr L0883
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1291 bcc L07F6
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1292 L0804 adda #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1293 bcs L07CE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1294 L0808 cmpd $03,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1295 bhi L07CE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1296 bsr L0883
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1297 bcs L07CE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1298 bne L0804
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1299 std $05,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1300 cmpd $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1301 bcc L082D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1302 ldd $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1303 decb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1304 cmpd $05,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1305 beq L082D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1306 neg <VD.FFFlg,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1307 ldx $05,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1308 lbsr L0905
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1309 neg <VD.FFFlg,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1310 L082D ldd $05,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1311 L082F std $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1312 L0831 bsr L0883
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1313 bcs L083D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1314 bne L083D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1315 bsr L08B6
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1316 adda #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1317 bcc L0831
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1318 L083D deca
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1319 ldx $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1320 lbsr L0905
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1321 std $05,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1322 adda #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1323 bcs L0858
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1324 L0849 cmpd $03,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1325 bcc L0858
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1326 adda #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1327 bsr L0883
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1328 bcs L0858
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1329 bne L0849
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1330 bra L082F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1331 L0858 inc $03,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1332 inc $03,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1333 ldd $03,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1334 cmpa #$02
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1335 lbcs L07CE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1336 ldd $05,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1337 cmpd $03,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1338 lbcs L07CE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1339 neg <VD.FFFlg,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1340 ldx $03,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1341 lbsr L0905
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1342 lbra L07CE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1343 L0878 leas $07,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1344 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1345 ldb <VD.FF6,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1346 beq L0882
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1347 L0880 orcc #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1348 L0882 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1349 L0883 pshs b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1350 cmpb #191
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1351 bhi L08B2
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1352 tst <VD.Mode,u which mode?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1353 bmi L0892 branch if 256x192
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1354 cmpa #$7F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1355 bhi L08B2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1356 L0892 lbsr XY2Addr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1357 tfr a,b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1358 andb ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1359 L0899 bita #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1360 bne L08A8
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1361 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1362 lsrb
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1363 tst <VD.Mode,u which mode?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1364 bmi L0899 branch if 256x192
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1365 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1366 lsrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1367 bra L0899
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1368 L08A8 stb <VD.FF1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1369 cmpb <VD.FF2,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1370 andcc #^Carry
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1371 puls pc,b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1372 L08B2 orcc #Carry
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1373 puls pc,b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1374 L08B6 pshs b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1375 lbsr XY2Addr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1376 bita #$80
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1377 beq L08D8
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1378 ldb <VD.FFMsk,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1379 cmpb ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1380 bne L08D8
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1381 ldb <VD.Msk1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1382 stb ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1383 puls b,a
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1384 tst <VD.Mode,u which mode?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1385 bmi L08D5 branch if 256x192
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1386 adda #$03
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1387 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1388 L08D5 adda #$07
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1389 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1390 L08D8 lbsr L05B3
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1391 puls pc,b,a
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1392 L08DD ldx <VD.FFSTp,u get top of flood fill stack
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1393 beq AlcFFStk if zero, we need to allocate stack
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1394 stx <VD.FFSPt,u else reset flood fill stack ptr
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1395 L08E5 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1396 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1397
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1398 * Allocate Flood Fill Stack
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1399 AlcFFStk pshs u save U for now
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1400 ldd #FFStSz get 512 bytes
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1401 os9 F$SRqMem from system
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1402 bcc AllocOk branch if ok
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1403 puls pc,u else pull out with error
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1404 AllocOk tfr u,d move pointer to alloced mem to D
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1405 puls u get stat pointer we saved earlier
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1406 std <VD.FFMem,u save pointer to alloc'ed mem
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1407 addd #FFStSz point D to end of alloc'ed mem
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1408 std <VD.FFSTp,u and save here as top of fill stack
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1409 std <VD.FFSPt,u and here
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1410 bra L08E5 do a clean return
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1411
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1412 L0905 pshs b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1413 ldd <VD.FFSPt,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1414 subd #$0004
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1415 cmpd <VD.FFMem,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1416 bcs L0924
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1417 std <VD.FFSPt,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1418 tfr d,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1419 lda <VD.FFFlg,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1420 sta ,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1421 stx $01,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1422 puls b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1423 sta $03,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1424 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1425 L0924 ldb #$F5
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1426 stb <VD.FF6,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1427 puls pc,b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1428 L092B ldd <VD.FFSPt,u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1429 cmpd <VD.FFSTp,u top of flood fill stack?
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1430 lbcc L0880
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1431 tfr d,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1432 addd #$0004
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1433 std <VD.FFSPt,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1434 lda ,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1435 sta <VD.FFFlg,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1436 ldd $01,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1437 tfr d,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1438 lda $03,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1439 andcc #^Carry
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1440 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1441 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1442
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1443 GetStat ldx PD.RGS,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1444 cmpa #SS.AlfaS
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1445 beq Rt.AlfaS
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1446 cmpa #SS.ScSiz
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1447 beq Rt.ScSiz
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1448 cmpa #SS.Cursr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1449 beq Rt.Cursr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1450 IFNE COCO2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1451 cmpa #SS.DSTAT
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1452 lbeq Rt.DSTAT
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1453 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1454 cmpa #SS.Palet
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1455 lbeq Rt.Palet
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1456 comb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1457 ldb #E$UnkSvc
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1458 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1459
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1460 * Returns window or screen size
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1461 Rt.ScSiz equ *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1462 IFNE H6309
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1463 ldq #$00200010 a fast cheat
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1464 stq R$X,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1465 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1466 * ldb <VD.Col,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1467 ldd #$0020
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1468 std R$X,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1469 * ldb <VD.Row,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1470 ldb #$10
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1471 std R$Y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1472 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1473 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1474 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1475
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1476 * Get palette information
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1477 Rt.Palet pshs u,y,x
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1478 leay <VD.Palet,u point to palette data in proc desc
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1479 ldu R$X,x pointer to 16 byte palette buffer
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1480 ldx <D.Proc current proc desc
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1481 ldb P$Task,x destination task number
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1482 clra from task 0
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1483 tfr y,x
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1484 ldy #16 move 16 bytes
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1485 os9 F$Move
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1486 puls pc,u,y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1487
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1488 * Return VDG alpha screen memory info
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1489 Rt.AlfaS ldd <VD.ScrnA,u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1490 anda #$E0 keep bits 4-6
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1491 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1492 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1493 lsra
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1494 lsra move to bits 0-2
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1495 ldy <D.SysDAT
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1496 ldd a,y
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1497 lbsr L06E1 map it in the process' memory area
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1498 bcs L0521
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1499 pshs b,a offset to block address
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1500 ldd <VD.ScrnA,u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1501 anda #$1F make sure it's within the block
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1502 addd ,s
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1503 std R$X,x memory address of the buffer
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1504 ldd <VD.CrsrA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1505 anda #$1F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1506 addd ,s++
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1507 std R$Y,x memory address of the cursor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1508 lda <VD.Caps,u save caps lock status in A and exit
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1509 bra L051E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1510
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1511 * Returns VDG alpha screen cursor info
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1512 Rt.Cursr ldd <VD.CrsrA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1513 subd <VD.ScrnA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1514 pshs b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1515 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1516 andb #$1F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1517 addb #$20
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1518 std R$X,x save column position in ASCII
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1519 puls b,a then divide by 32
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1520 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1521 rolb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1522 rolb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1523 rolb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1524 rolb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1525 clra
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1526 andb #$0F only 16 lines to a screen
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1527 addb #$20
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1528 std R$Y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1529 ldb <VD.CFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1530 lda <VD.CChar,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1531 bmi L051E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1532 cmpa #$60
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1533 bcc L0509
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1534 cmpa #$20
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1535 bcc L050D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1536 tstb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1537 beq L0507
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1538 cmpa #$00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1539 bne L04FF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1540 lda #$5E
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1541 bra L051E save it and exit
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1542
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1543 L04FF cmpa #$1F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1544 bne L0507
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1545 lda #$5F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1546 bra L051E
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1547 L0507 ora #$20 turn it into ASCII from VDG codes
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1548 L0509 eora #$40
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1549 bra L051E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1550 L050D tstb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1551 bne L051E
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1552 cmpa #$21 remap specific codes
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1553 bne L0518
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1554 lda #$7C
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1555 bra L051E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1556 L0518 cmpa #$2D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1557 bne L051E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1558 lda #$7E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1559 L051E sta R$A,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1560 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1561 L0521 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1562
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1563 IFNE COCO2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1564 Rt.DSTAT bsr ChkDvRdy
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1565 bcs L0A4F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1566 ldd <VD.GCrsX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1567 lbsr XY2Addr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1568 tfr a,b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1569 andb ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1570 L0A23 bita #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1571 bne L0A32
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1572 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1573 lsrb
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1574 tst <VD.Mode,u which mode?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1575 bmi L0A23 branch if 256x192
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1576 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1577 lsrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1578 bra L0A23
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1579 L0A32 pshs b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1580 ldb <VD.PMask,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1581 andb #$FC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1582 orb ,s+
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1583 ldx PD.RGS,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1584 stb R$A,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1585 ldd <VD.GCrsX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1586 std R$Y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1587 ldb <VD.Blk,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1588 lbsr L06E1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1589 bcs L0A4F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1590 std R$X,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1591 L0A4E clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1592 L0A4F rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1593
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1594 ChkDvRdy ldb <VD.Rdy,u is device ready?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1595 bne L0A4E branch if so
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1596 lbra NotReady else return error
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1597
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1598 * Entry: A = X coor, B = Y coor
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1599 XY2Addr pshs y,b,a save off
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1600 ldb <VD.Mode,u get video mode
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1601 bpl L0A60 branch if 128x192 (divide A by 4)
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1602 lsra else divide A by 8
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1603 L0A60 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1604 lsra
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1605 pshs a save on stack
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1606 ldb #191 get max Y
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1607 subb $02,s subtract from Y on stack
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1608 lda #32 bytes per line
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1609 mul
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1610 addb ,s+ add offset on stack
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1611 adca #$00
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1612 ldy <VD.SBAdd,u get base address
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1613 leay d,y move D bytes into address
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1614 lda ,s pick up original X coor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1615 sty ,s put offset addr on stack
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1616 anda <VD.PixBt,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1617 ldx <VD.MTabl,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1618 lda a,x
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1619 puls pc,y,x X = offset address, Y = base
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1620 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1621
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1622 SetStat ldx PD.RGS,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1623 cmpa #SS.ComSt
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1624 beq Rt.ComSt
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1625 IFNE COCO2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1626 cmpa #SS.AAGBf
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1627 beq Rt.AAGBf
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1628 cmpa #SS.SLGBf
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1629 beq Rt.SLGBf
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1630 ENDC
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1631 cmpa #SS.ScInf new NitrOS-9 call
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1632 lbeq Rt.ScInf
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1633 cmpa #SS.DScrn
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1634 lbeq Rt.DScrn
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1635 cmpa #SS.PScrn
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1636 lbeq Rt.PScrn
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1637 cmpa #SS.AScrn
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1638 lbeq Rt.AScrn
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1639 cmpa #SS.FScrn
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1640 lbeq Rt.FScrn
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1641 comb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1642 ldb #E$UnkSvc
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1643 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1644
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1645 * Allow switch between true/fake lowercase
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1646 Rt.ComSt ldd R$Y,x
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1647 L054C ldb #$10 sets screen to lowercase
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1648 bita #$01 Y = 0 = true lowercase, Y = 1 = fake lower
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1649 bne L0553
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1650 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1651 L0553 stb <VD.CFlag,u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1652 ldd #$2010 32x16
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1653 inc <VD.DFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1654 std <VD.Col,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1655 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1656
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1657 IFNE COCO2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1658 Rt.AAGBf ldb <VD.Rdy,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1659 beq NotReady
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1660 ldd #$0201
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1661 leay <VD.AGBuf,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1662 lbsr L06C7
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1663 bcs L0AEB
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1664 pshs a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1665 lbsr Get8KHi
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1666 bcs L0AEC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1667 stb ,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1668 lbsr L06E1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1669 bcs L0AEC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1670 std R$X,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1671 puls b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1672 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1673 std R$Y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1674 L0AEB rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1675 L0AEC puls pc,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1676
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1677 NotReady comb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1678 ldb #E$NotRdy
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1679 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1680
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1681 Rt.SLGBf ldb <VD.Rdy,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1682 beq NotReady
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1683 ldd R$Y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1684 cmpd #$0002
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1685 lbhi IllArg
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1686 leay <VD.GBuff,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1687 ldb b,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1688 lbeq IllArg
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1689 pshs x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1690 stb <VD.Blk,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1691 lda <VD.SBAdd,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1692 anda #$E0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1693 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1694 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1695 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1696 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1697 ldx <D.SysPrc
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1698 leax <P$DATImg,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1699 leax a,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1700 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1701 std ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1702 ldx <D.SysPrc
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1703 os9 F$SetTsk
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1704 puls x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1705 ldd R$X,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1706 beq L0B2B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1707 ldb #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1708 L0B2B stb <VD.DFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1709 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1710 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1711 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1712
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1713 * Display Table
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1714 * 1st entry = display code
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1715 * 2nd entry = # of 8K blocks
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1716 DTabl fcb $14 0: 640x192, 2 color
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1717 fcb $02 16K
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1718 fcb $15 1: 320x192, 4 color
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1719 fcb $02 16K
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1720 fcb $16 2: 160x192, 16 color
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1721 fcb $02 16K
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1722 fcb $1D 3: 640x192, 4 color
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1723 fcb $04 32K
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1724 fcb $1E 4: 320x192, 16 color
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1725 fcb $04 32K
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1726
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1727 * Allocates and maps a hires screen into process address
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1728 Rt.AScrn ldd R$X,x get screen type from caller's X
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1729 cmpd #$0004 screen type 0-4
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1730 lbhi IllArg if higher than legal limit, return error
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1731 pshs y,x,b,a else save off regs
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1732 ldd #$0303
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1733 leay <VD.HiRes,u pointer to screen descriptor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1734 lbsr L06C7 gets next free screen descriptor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1735 bcs L05AF branch if none found
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1736 sta ,s save screen descriptor on stack
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1737 ldb $01,s get screen type
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1738 * stb $02,y and store in VD.SType
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1739 stb (VD.SType-VD.HiRes),y and store in VD.SType
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1740 leax >DTabl,pcr point to display table
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1741 lslb multiply index by 2 (word entries)
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1742 abx point to display code, #blocks
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1743 ldb $01,x get number of blocks
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1744 * stb $01,y VD.NBlk
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1745 stb (VD.NBlk-VD.HiRes),y VD.NBlk
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1746 lda #$FF start off with zero screens allocated
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1747 BA010 inca count up by one
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1748 ldb (VD.NBlk-VD.HiRes),y get number of blocks
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1749 pshs a needed to protect regA; RG.
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1750 os9 F$AlHRAM allocate a screen
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1751 puls a
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1752 bcs DeAll de-allocate ALL allocated blocks on error
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1753 pshs b save starting block number of the screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1754 andb #$3F keep block BL= block MOD 63
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1755 pshs b
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1756 addb (VD.NBlk-VD.HiRes),y add in the block size of the screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1757 decb in case last block is $3F,$7F,$BF,$FF; RG.
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1758 andb #$3F (BL+S) mod 63 < BL? (overlap 512k bank)
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1759 cmpb ,s+ is all of it in this bank?
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1760 blo BA010 if not, allocate another screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1761 puls b restore the block number for this screen
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1762 stb ,y VD.HiRes - save starting block number
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1763 bsr DeMost deallocate all of the other screens
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1764 leas a,s move from within DeMost; RG.
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1765 ldb ,y restore the starting block number again
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1766
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1767 lda $01,x number of blocks
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1768 lbsr L06E3
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1769 bcs L05AF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1770 ldx $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1771 std R$X,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1772 ldb ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1773 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1774 std R$Y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1775 L05AF leas $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1776 puls pc,y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1777 L05B3X leas $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1778
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1779 IllArg comb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1780 ldb #E$IllArg
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1781 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1782
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1783 * De-allocate the screens
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1784 DeAll bsr DeMost de-allocate all of the screens
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1785 bra L05AF restore stack and exit
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1786
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1787 DeMost tsta
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1788 beq DA020 quick exit if zero additional screens
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1789
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1790 ldb (VD.NBlk-VD.HiRes),y get # blocks of screen to de-allocate
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1791 pshs a save count of blocks for later
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1792 pshs d,y,x save rest of regs
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1793 leay 9,s account for d,y,x,a,calling PC
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1794 clra
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1795 DA010 ldb ,y+ get starting block number
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1796 tfr d,x in X
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1797 ldb 1,s get size of the screen to de-allocate
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1798 pshs a needed to protect regA; RG.
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1799 os9 F$DelRAM de-allocate the blocks *** IGNORING ERRORS ***
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1800 puls a
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1801 dec ,s count down
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1802 bne DA010
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1803 puls d,y,x restore registers
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1804 puls a and count of extra bytes on the stack
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1805 * leas a,s removed because it yanks wrong data; RG.
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1806 DA020 rts and exit
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1807
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1808 * Get current screen info for direct writes - added in NitrOS-9
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1809 Rt.ScInf pshs x save caller's regs ptr
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1810 ldd R$Y,x get screen
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1811 bmi L05C8
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1812 bsr L05DE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1813 bcs L05DC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1814 lbsr L06FF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1815 bcs L05DC
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1816 L05C8 ldx ,s get caller's regs ptr from stack
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1817 ldb R$Y+1,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1818 bmi L05DB
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1819 bsr L05DE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1820 bcs L05DC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1821 lbsr L06E3
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1822 bcs L05DC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1823 ldx ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1824 std R$X,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1825 L05DB clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1826 L05DC puls pc,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1827 L05DE beq L05F1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1828 cmpb #$03
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1829 bhi L05F1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1830 bsr GetScrn
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1831 beq L05F1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1832 ldb ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1833 beq L05F1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1834 lda $01,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1835 andcc #^Carry
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1836 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1837 L05F1 bra IllArg
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1838
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1839 * Convert screen to a different type
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1840 Rt.PScrn ldd R$X,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1841 cmpd #$0004
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1842 bhi IllArg
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1843 pshs b,a save screen type, and a zero
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1844 leax >DTabl,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1845 lslb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1846 incb
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1847 lda b,x get number of blocks the screen requires
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1848 sta ,s kill 'A' on the stack
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1849 ldx PD.RGS,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1850 bsr L061B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1851 bcs L05B3X
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1852 lda ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1853 cmpa $01,x
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1854 lbhi L05B3X if new one takes more blocks than old
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1855 lda $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1856 sta $02,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1857 leas $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1858 bra L0633
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1859 L061B ldd R$Y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1860 beq L0633
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1861 cmpd #$0003
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1862 lbgt IllArg
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1863 bsr GetScrn point X to 3 byte screen descriptor
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1864 lbeq IllArg
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1865 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1866 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1867
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1868 * Displays screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1869 Rt.DScrn bsr L061B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1870 bcs L063A
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1871 L0633 stb <VD.DGBuf,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1872 inc <VD.DFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1873 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1874 L063A rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1875
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1876 * Entry: B = screen 1-3
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1877 * Exit: X = ptr to screen entry
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1878 *GetScrn pshs b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1879 * leax <VD.GBuff,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1880 * lda #$03
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1881 * mul
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1882 * leax b,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1883 * puls pc,b,a
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1884 GetScrn leax <VD.GBuff,U point X to screen descriptor table
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1885 abx
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1886 abx
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1887 abx
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1888 tst ,x is this screen valid? (0 = not)
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1889 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1890
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1891 * Frees memory of screen allocated by SS.AScrn
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1892 Rt.FScrn ldd R$Y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1893 lbeq IllArg
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1894 cmpd #$03
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1895 lbhi IllArg
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1896 cmpb <VD.DGBuf,u
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1897 lbeq IllArg illegal arg if screen is being displayed
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1898 bsr GetScrn point to buffer
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1899 lbeq IllArg error if screen unallocated
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1900 * Entry: X = pointer to screen table entry
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1901 FreeBlks lda $01,x get number of blocks
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1902 ldb ,x get starting block
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1903 beq L066D branch if none
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1904 pshs a else save count
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1905 clra clear A
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1906 sta ,x clear block # in entry
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1907 tfr d,x put starting block # in X
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1908 puls b get block numbers
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1909 os9 F$DelRAM delete
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1910 L066D rts and return
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1911
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1912 ShowS cmpb #$03 no more than 3 graphics buffers
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1913 bhi L066D
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1914 bsr GetScrn point X to appropriate screen descriptor
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1915 beq L066D branch if not allocated
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1916 ldb $02,x VD.SType - screen type 0-4
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1917 cmpb #$04
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1918 bhi L066D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1919 lslb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1920 pshs x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1921 leax >DTabl,pcr
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1922 lda b,x get proper display code
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1923 puls x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1924 clrb
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1925 std >$FF99 set border color, too
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1926 std >D.VIDRS
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1927 lda >D.HINIT
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1928 anda #$7F make coco 3 only mode
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1929 sta >D.HINIT
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1930 sta >$FF90
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1931 lda >D.VIDMD
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1932 ora #$80 graphics mode
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1933 anda #$F8 1 line/character row
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1934 sta >D.VIDMD
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1935 sta >$FF98
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1936 * lda ,x get block #
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1937 * lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1938 * lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1939 *** start of 2MB patch by RG
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1940 ldb ,x get block # (2Meg patch)
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1941 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1942 lslb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1943 rola
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1944 lslb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1945 rola
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1946 sta >$FF9B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1947 tfr b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1948 *** end of 2MB patch by RG
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1949 clrb
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1950 std <D.VOFF1 display it
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1951 std >$FF9D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1952 clr >D.VOFF2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1953 clr >$FF9C
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1954 lbra SetPals
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1955
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1956 * Get next free screen descriptor
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1957 L06C7 clr ,-s clear an area on the stack
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1958 inc ,s set to 1
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1959 L06CB tst ,y check block #
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1960 beq L06D9 if not used yet
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1961 leay b,y go to next screen descriptor
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1962 inc ,s increment count on stack
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1963 deca decrement A
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1964 bne L06CB
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1965 comb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1966 ldb #E$BMode
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1967 L06D9 puls pc,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1968
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1969 * Get B 8K blocks from high RAM
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1970 Get8KHi ldb #$01
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1971 L06DDX os9 F$AlHRAM allocate a screen
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1972 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1973
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1974 L06E1 lda #$01 map screen into memory
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1975 L06E3 pshs u,x,b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1976 bsr L0710
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1977 bcc L06F9
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1978 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1979 ldb $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1980 tfr d,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1981 ldb ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1982 os9 F$MapBlk
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1983 stb $01,s save error code if any
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1984 tfr u,d
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1985 bcs L06FD
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1986 L06F9 leas $02,s destroy D on no error
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1987 puls pc,u,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1988
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1989 L06FD puls pc,u,x,b,a if error, then restore D
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1990
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1991 L06FF pshs y,x,a deallocate screen
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1992 bsr L0710
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1993 bcs L070E
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
1994 ldd #DAT.Free set memory to unused
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1995 L0708 std ,x++
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1996 dec ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1997 bne L0708
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1998 L070E puls pc,y,x,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1999
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2000 L0710 equ *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2001 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2002 pshs a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2003 lde #$08
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2004 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2005 pshs b,a
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
2006 lda #$08 number of blocks to check
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2007 sta $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2008 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2009 ldx <D.Proc
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
2010 leax <P$DATImg+$10,x to end of CoCo's DAT image map
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2011 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2012 addb ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2013 decb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2014 L071F cmpd ,--x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2015 beq L072A
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2016 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2017 dece
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2018 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2019 dec $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2020 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2021 bne L071F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2022 bra L0743
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2023 L072A equ *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2024 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2025 dece
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2026 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2027 dec $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2028 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2029 dec ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2030 beq L0738
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2031 decb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2032 cmpd ,--x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2033 beq L072A
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2034 bra L0743
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2035 L0738 equ *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2036 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2037 tfr e,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2038 ELSE
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
2039 lda $01,s get lowest block number found
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2040 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2041 lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2042 lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2043 lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2044 lsla
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
2045 lsla multiply by 32 (convert to address)
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
2046 clrb clear carry
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2047 IFNE H6309
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2048 puls b,pc
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2049 L0743 puls a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2050 ELSE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2051 leas $02,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2052 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2053 L0743 puls b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2054 ENDC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2055 comb
2110
8b36468b2edb realigned tabs
boisy
parents: 1981
diff changeset
2056 ldb #E$BPAddr bad page address
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2057 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2058
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2059 emod
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2060 eom equ *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2061 end