annotate level1/atari/modules/vtio.asm @ 2624:b8c7b7fbf3c9

Major changes: o os9defs, rbfdefs, scfdefs now os9.d, rbf.d, and scf.d o vtiodefs now broken into cocovtio.d (for coco and dragon) and atarivtio.d o systype now broken into coco.d, dragon.d and atari.d o all references to the above in other files have changed
author Boisy Pitre <boisy.pitre@nuance.com>
date Fri, 24 Feb 2012 08:51:08 -0600
parents 1df7d248bb24
children d1ea3dc90082
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
1 ********************************************************************
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
2 * VTIO - NitrOS-9 Video Terminal I/O driver for Atari XE/XL
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
3 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
4 * $Id$
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
5 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
7 * Comment
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
8 * ------------------------------------------------------------------
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
9 * 1 2012/02/20 Boisy G. Pitre
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
10 * Started from VTIO for the Atari XE/XL
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
11
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
12 nam VTIO
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
13 ttl NitrOS-9 Video Terminal I/O driver for Atari XE/XL
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
14
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
15 ifp1
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
16 use defsfile
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
17 use scfdefs
2624
b8c7b7fbf3c9 Major changes:
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2622
diff changeset
18 use atarivtio.d
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
19 endc
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
20
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
21 tylg set Drivr+Objct
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
22 atrv set ReEnt+rev
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
23 rev set $00
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
24 edition set 1
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
25
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
26 mod eom,name,tylg,atrv,start,size
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
27
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
28 size equ V.Last
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
29
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
30 fcb UPDAT.+EXEC.
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
31
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
32 name fcs /VTIO/
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
33 fcb edition
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
34
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
35 start lbra Init
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
36 lbra Read
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
37 lbra Write
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
38 lbra GetStat
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
39 lbra SetStat
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
40 lbra Term
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
41
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
42
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
43 * The display list sets up the ANTIC chip to display the main screen.
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
44 * It is copied to the Atari Screen Area in low memory (see atari.d)
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
45 * The size of this code MUST be <= G.DListSize
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
46 DList
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
47 fcb $70,$70,$70 3 * 8 blank scanlines
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
48 fcb $42 Mode 2 with LMS (Load Memory Scan). Mode 2 = 40 column hires text, next 2 bytes L/H determine screen origin
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
49 fdbs G.ScrStart+(G.Cols*0) origin
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
50 fcb 2,2,2,2,2,2,2,2,2,2
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
51 fcb 2,2,2,2,2,2,2,2,2,2
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
52 fcb 2,2,2
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
53 * 23 extra mode 2 lines for total of 24. 240 scanlines can be used for display area, but a hires line cannot be on scanline 240 due to an Antic bug
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
54 fcb $41 this is the end of Display List command JVB (Jump and wait for Vertical Blank)
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
55 fdb $0000
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
56 DListSz equ *-DList
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
57
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
58 * Init
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
59 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
60 * Entry:
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
61 * Y = address of device descriptor
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
62 * U = address of device memory area
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
63 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
64 * Exit:
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
65 * CC = carry set on error
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
66 * B = error code
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
67 *
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
68 Init
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
69 stu >D.KbdSta store devmem ptr
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
70 pshs u
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
71
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
72 * setup static vars
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
73 clra
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
74 clrb
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
75 std V.CurRow,u
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
76
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
77 * Clear screen memory
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
78 ldy #G.DList
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
79 pshs y
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
80 ldy #G.ScrStart
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
81 ldd #$0000
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
82 clearLoop@
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
83 std ,y++
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
84 cmpy ,s
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
85 bne clearLoop@
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
86 puls u G.DList address is aleady in U
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
87
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
88 * copy the display list into our memory area to the globa location in low RAM
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
89 leax DList,pcr
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
90 ldy #DListSz
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
91 dlcopy@
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
92 ldd ,x++
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
93 std ,u++
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
94 leay -2,y
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
95 bne dlcopy@
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
96 * patch last word to be address of start of DList (byte swap for ANTIC)
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
97 leau -DListSz,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
98 tfr u,d
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
99 exg a,b
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
100 std DListSz-2,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
101
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
102 * tell the ANTIC where the dlist is
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
103 std DLISTL
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
104
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
105 * tell the ANTIC where the character set is (page aligned, currently in Krn)
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
106 lda #G.CharSetAddr>>8
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
107 sta CHBASE
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
108
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
109 * set background color
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
110 lda #$00
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
111 sta COLBK
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
112
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
113 * set text color
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
114 lda #$0F
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
115 sta COLPF0
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
116 sta COLPF1
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
117 sta COLPF3
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
118 lda #$94
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
119 sta COLPF2
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
120
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
121 * tell ANTIC to start DMA
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
122 lda #$22
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
123 sta DMACTL
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
124
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
125 * tell ANTIC to enable character set 2
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
126 lda #$02
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
127 sta CHACTL
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
128
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
129 * install keyboard ISR
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
130 ldd #IRQST POKEY IRQ status address
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
131 leay IRQSvc,pcr pointer to our service routine
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
132 leax IRQPkt,pcr F$IRQ requires a 3 byte packet
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
133 ldu ,s use our saved devmem as ISR static
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
134 os9 F$IRQ install the ISR
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
135 bcs initex
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
136
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
137 * tell POKEY to enable keyboard scanning
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
138 lda #%11000000
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
139 sta IRQEN
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
140
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
141 * clear carry and return
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
142 clrb
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
143 initex puls u,pc
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
144
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
145
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
146 * Term
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
147 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
148 * Entry:
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
149 * U = address of device memory area
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
150 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
151 * Exit:
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
152 * CC = carry set on error
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
153 * B = error code
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
154 *
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
155 Term
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
156 * clear carry and return
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
157 clrb
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
158 rts
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
159
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
160
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
161 * Read
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
162 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
163 * Entry:
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
164 * Y = address of path descriptor
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
165 * U = address of device memory area
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
166 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
167 * Exit:
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
168 * A = character read
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
169 * CC = carry set on error
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
170 * B = error code
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
171 *
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
172 Read
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
173 leax V.InBuf,u point X to input buffer
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
174 ldb V.IBufT,u get tail pointer
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
175 orcc #IRQMask mask IRQ
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
176 cmpb V.IBufH,u same as head pointer
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
177 beq Put2Bed if so, buffer is empty, branch to sleep
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
178 abx X now points to curr char
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
179 lda ,x get char
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
180 bsr cktail check for tail wrap
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
181 stb V.IBufT,u store updated tail
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
182 andcc #^(IRQMask+Carry) unmask IRQ
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
183 rts
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
184
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
185 Put2Bed lda V.BUSY,u get calling process ID
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
186 sta V.WAKE,u store in V.WAKE
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
187 andcc #^IRQMask clear interrupts
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
188 ldx #$0000
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
189 os9 F$Sleep sleep forever
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
190 clr V.WAKE,u clear wake
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
191 ldx <D.Proc get pointer to current proc desc
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
192 ldb <P$Signal,x get signal recvd
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
193 beq Read branch if no signal
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
194 cmpb #S$Window window signal?
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
195 bcc Read branch if so
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
196 coma
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
197 rts
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
198 * Check if we need to wrap around tail pointer to zero
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
199 cktail incb increment pointer
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
200 cmpb #KBufSz-1 at end?
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
201 bls readex branch if not
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
202 * clear carry and return
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
203 clrb else clear pointer (wrap to head)
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
204 readex rts
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
205
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
206
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
207 * Write
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
208 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
209 * Entry:
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
210 * A = character to write
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
211 * Y = address of path descriptor
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
212 * U = address of device memory area
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
213 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
214 * Exit:
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
215 * CC = carry set on error
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
216 * B = error code
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
217 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
218 Write
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
219 bsr hidecursor
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
220
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
221 cmpa #C$SPAC space or greater?
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
222 bcs ChDispatch branch if not
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
223
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
224 wchar suba #$20
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
225 pshs a
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
226 lda V.CurRow,u
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
227 ldb #G.Cols
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
228 mul
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
229 addb V.CurCol,u
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
230 adca #0
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
231 ldx #G.ScrStart
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
232 leax d,x
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
233 puls a
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
234 sta ,x
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
235 ldd V.CurRow,u
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
236 incb
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
237 cmpb #G.Cols
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
238 blt ok
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
239 clrb
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
240 incrow
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
241 inca
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
242 cmpa #G.Rows
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
243 blt clrline
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
244 SCROLL EQU 1
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
245 IFNE SCROLL
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
246 deca set A to G.Rows - 1
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
247 pshs d save off Row/Col
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
248 ldx #G.ScrStart get start of screen memory
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
249 ldy #G.Cols*(G.Rows-1) set Y to size of screen minus last row
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
250 scroll_loop
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
251 ldd G.Cols,x get two bytes on next row
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
252 std ,x++ store on this row
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
253 leay -2,y decrement Y
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
254 bne scroll_loop branch if not 0
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
255 puls d recover Row/Col
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
256 ELSE
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
257 clra
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
258 ENDC
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
259 * clear line
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
260 clrline std V.CurRow,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
261 bsr DelLine
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
262 bra drawcursor
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
263 ok std V.CurRow,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
264 bra drawcursor
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
265
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
266 * calculates the cursor location in screen memory
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
267 * Exit: X = address of cursor
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
268 * All other regs preserved
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
269 calcloc
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
270 pshs d
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
271 lda V.CurRow,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
272 ldb #G.Cols
2619
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
273 mul
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
274 addb V.CurCol,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
275 adca #0
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
276 ldx #G.ScrStart
2619
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
277 leax d,x
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
278 puls d,pc
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
279
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
280 drawcursor
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
281 bsr calcloc
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
282 lda ,x
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
283 sta V.CurChr,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
284 lda #$80
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
285 sta ,x
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
286 rts
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
287
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
288 hidecursor
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
289 pshs a
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
290 bsr calcloc
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
291 lda V.CurChr,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
292 sta ,x
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
293 puls a,pc
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
294
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
295 ChDispatch
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
296 cmpa #$0D $0D?
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
297 bhi drawcursor branch if higher than
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
298 leax <DCodeTbl,pcr deal with screen codes
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
299 lsla adjust for table entry size
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
300 ldd a,x get address in D
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
301 jmp d,x and jump to routine
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
302
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
303 * display functions dispatch table
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
304 DCodeTbl fdb NoOp-DCodeTbl $00:no-op (null)
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
305 fdb CurHome-DCodeTbl $01:HOME cursor
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
306 fdb CurXY-DCodeTbl $02:CURSOR XY
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
307 fdb DelLine-DCodeTbl $03:ERASE LINE
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
308 fdb ErEOLine-DCodeTbl $04:CLEAR TO EOL
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
309 fdb Do05-DCodeTbl $05:CURSOR ON/OFF
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
310 fdb CurRght-DCodeTbl $005e $06:CURSOR RIGHT
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
311 fdb NoOp-DCodeTbl $07:no-op (bel:handled in VTIO)
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
312 fdb CurLeft-DCodeTbl $08:CURSOR LEFT
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
313 fdb CurUp-DCodeTbl $09:CURSOR UP
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
314 fdb CurDown-DCodeTbl $0A:CURSOR DOWN
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
315 fdb ErEOScrn-DCodeTbl $0B:ERASE TO EOS
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
316 fdb ClrScrn-DCodeTbl $0C:CLEAR SCREEN
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
317 fdb Retrn-DCodeTbl $0D:RETURN
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
318
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
319 DelLine
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
320 lda V.CurRow,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
321 ldb #G.Cols
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
322 mul
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
323 ldx #G.ScrStart
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
324 leax d,x
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
325 lda #G.Cols
2619
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
326 clrloop@ clr ,x+
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
327 deca
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
328 bne clrloop@
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
329 rts
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
330
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
331 ClrScrn
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
332 ErEOScrn
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
333 CurUp
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
334 NoOp
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
335 CurHome
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
336 CurXY
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
337 ErEOLine
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
338 Do05
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
339 CurRght
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
340 bra drawcursor
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
341
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
342 CurLeft
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
343 ldd V.CurRow,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
344 beq leave
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
345 decb
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
346 bpl erasechar
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
347 ldb #G.Cols-1
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
348 deca
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
349 bpl erasechar
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
350 clra
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
351 erasechar
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
352 std V.CurRow,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
353 ldb #G.Cols
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
354 mul
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
355 addb V.CurCol,u
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
356 adca #0
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
357 ldx #G.ScrStart
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
358 leax d,x
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
359 clr 1,x
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
360
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
361 leave ldd V.CurRow,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
362 bra drawcursor
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
363
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
364 CurDown
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
365 ldd V.CurRow,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
366 lbra incrow
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
367
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
368 Retrn
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
369 lda V.CurRow,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
370 ldb #G.Cols
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
371 mul
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
372 addb V.CurCol,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
373 adca #0
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
374 ldx #G.ScrStart
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
375 leax d,x
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
376 lda #C$SPAC-$20
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
377 sta ,x
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
378 clr V.CurCol,u
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
379 lbra drawcursor
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
380
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
381
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
382 * GetStat
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
383 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
384 * Entry:
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
385 * A = function code
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
386 * Y = address of path descriptor
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
387 * U = address of device memory area
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
388 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
389 * Exit:
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
390 * CC = carry set on error
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
391 * B = error code
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
392 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
393 GetStat
2619
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
394 cmpa #SS.ScSiz
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
395 bne gserr
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
396 ldx PD.RGS,y
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
397 ldd #G.Cols
2619
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
398 std R$X,x
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
399 ldd #G.Rows
2619
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
400 std R$Y,x
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
401 * clear carry and return
2619
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
402 clrb
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
403 rts
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
404 gserr
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
405 comb
d888412d8118 o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2618
diff changeset
406 ldb #E$UnkSvc
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
407 rts
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
408
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
409
2617
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
410 * SetStat
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
411 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
412 * Entry:
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
413 * A = function code
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
414 * Y = address of path descriptor
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
415 * U = address of device memory area
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
416 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
417 * Exit:
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
418 * CC = carry set on error
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
419 * B = error code
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
420 *
b1145d2cb659 Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
421 SetStat
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
422 * clear carry and return
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
423 clrb
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
424 rts
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
425
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
426
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
427 IRQPkt equ *
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
428 Pkt.Flip fcb %11000000 flip byte
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
429 Pkt.Mask fcb %11000000 mask byte
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
430 fcb $0A priority
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
431
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
432
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
433 *
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
434 * IRQ routine for keyboard
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
435 *
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
436 IRQSvc
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
437 ldb KBCODE get keyboard code from POKEY
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
438 pshs b
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
439 andb #$7F mask out potential CTRL key
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
440 leax ATASCI,pcr
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
441 lda b,x fetch character for code
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
442 tst ,s+ CTRL key down?
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
443 bpl noctrl@ branch if not
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
444 cmpa #$40
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
445 bcs noctrl@
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
446 anda #$5F
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
447 suba #$40
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
448 noctrl@
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
449 ldb V.IBufH,u get head pointer in B
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
450 leax V.InBuf,u point X to input buffer
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
451 abx X now holds address of head
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
452 lbsr cktail check for tail wrap
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
453 cmpb V.IBufT,u B at tail?
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
454 beq L012F branch if so
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
455 stb V.IBufH,u
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
456 L012F sta ,x store our char at ,X
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
457 beq WakeIt if nul, do wake-up
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
458 cmpa V.PCHR,u pause character?
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
459 bne L013F branch if not
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
460 ldx V.DEV2,u else get dev2 statics
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
461 beq WakeIt branch if none
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
462 sta V.PAUS,x else set pause request
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
463 bra WakeIt
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
464 L013F ldb #S$Intrpt get interrupt signal
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
465 cmpa V.INTR,u our char same as intr?
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
466 beq L014B branch if same
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
467 ldb #S$Abort get abort signal
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
468 cmpa V.QUIT,u our char same as QUIT?
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
469 bne WakeIt branch if not
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
470 L014B lda V.LPRC,u get ID of last process to get this device
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
471 bra L0153 go for it
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
472 WakeIt ldb #S$Wake get wake signal
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
473 lda V.WAKE,u get process to wake
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
474 L0153 beq L0158 branch if none
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
475 os9 F$Send else send wakeup signal
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
476 L0158 clr V.WAKE,u clear process to wake flag
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
477
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
478 * Update the shadow register then the real register to disable and
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
479 * re-enable the keyboard interrupt
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
480 lda D.IRQENShdw
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
481 tfr a,b
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
482 anda #^%11000000
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
483 orb #%11000000
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
484 sta IRQEN
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
485 stb D.IRQENShdw
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
486 stb IRQEN
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
487 rts
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
488
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
489 ATASCI fcb $6C,$6A,$3B,$80,$80,$6B,$2B,$2A ;LOWER CASE
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
490 fcb $6F,$80,$70,$75,$0D,$69,$2D,$3D
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
491
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
492 fcb $76,$80,$63,$80,$80,$62,$78,$7A
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
493 fcb $34,$80,$33,$36,$1B,$35,$32,$31
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
494
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
495 fcb $2C,$20,$2E,$6E,$80,$6D,$2F,$81
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
496 fcb $72,$80,$65,$79,$7F,$74,$77,$71
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
497
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
498 fcb $39,$80,$30,$37,$08,$38,$3C,$3E
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
499 fcb $66,$68,$64,$80,$82,$67,$73,$61
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
500
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
501
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
502 fcb $4C,$4A,$3A,$80,$80,$4B,$5C,$5E ;UPPER CASE
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
503 fcb $4F,$80,$50,$55,$9B,$49,$5F,$7C
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
504
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
505 fcb $56,$80,$43,$80,$80,$42,$58,$5A
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
506 fcb $24,$80,$23,$26,$1B,$25,$22,$21
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
507
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
508 fcb $5B,$20,$5D,$4E,$80,$4D,$3F,$81
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
509 fcb $52,$80,$45,$59,$9F,$54,$57,$51
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
510
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
511 fcb $28,$80,$29,$27,$9C,$40,$7D,$9D
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
512 fcb $46,$48,$44,$80,$83,$47,$53,$41
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
513
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
514
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
515 * fcb $0C,$0A,$7B,$80,$80,$0B,$1E,$1F ;CONTROL
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
516 * fcb $0F,$80,$10,$15,$9B,$09,$1C,$1D
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
517
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
518 * fcb $16,$80,$03,$80,$80,$02,$18,$1A
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
519 * fcb $80,$80,$85,$80,$1B,$80,$FD,$80
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
520
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
521 * fcb $00,$20,$60,$0E,$80,$0D,$80,$81
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
522 * fcb $12,$80,$05,$19,$9E,$14,$17,$11
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
523
2622
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
524 * fcb $80,$80,$80,$80,$FE,$80,$7D,$FF
1df7d248bb24 Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2620
diff changeset
525 * fcb $06,$08,$04,$80,$84,$07,$13,$01
2620
3574de541ad4 Everything WORKS
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2619
diff changeset
526
2618
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
527 emod
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
528 eom equ *
e6507f116064 Atari port now boots
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2617
diff changeset
529 end