annotate level2/modules/vdgint.asm @ 899:6841c75afc62

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