Mercurial > hg > Members > kono > nitros9-code
comparison level1/modules/clock.asm @ 2714:8399491c0821 lwtools-port
Reworked sources so that serial polling for the atari works.
author | Boisy Pitre <boisy.pitre@nuance.com> |
---|---|
date | Thu, 26 Jul 2012 09:56:22 -0500 |
parents | 90d13dbd887a |
children | c2112f93923a |
comparison
equal
deleted
inserted
replaced
2713:37d3ee1458b6 | 2714:8399491c0821 |
---|---|
129 stb <D.TSec set ticks per second | 129 stb <D.TSec set ticks per second |
130 ldb #TkPerTS get ticks per time slice | 130 ldb #TkPerTS get ticks per time slice |
131 stb <D.TSlice set ticks per time slice | 131 stb <D.TSlice set ticks per time slice |
132 stb <D.Slice set first time slice | 132 stb <D.Slice set first time slice |
133 IFNE atari | 133 IFNE atari |
134 * Atari gets its clock source from the NMI | 134 leax SvcIRQ,pcr set IRQ handler |
135 leax SvcIRQ,pcr set NMI handler | 135 stx <D.IRQ |
136 stx <D.NMI | |
137 ELSE | 136 ELSE |
138 leax SvcIRQ,pcr set IRQ handler | 137 leax SvcIRQ,pcr set IRQ handler |
139 stx <D.IRQ | 138 stx <D.IRQ |
140 ENDC | 139 ENDC |
141 | 140 |
145 * Call Clock2 init routine | 144 * Call Clock2 init routine |
146 ldy <D.Clock2 get entry point to Clock2 | 145 ldy <D.Clock2 get entry point to Clock2 |
147 jsr ,y call init entry point of Clock2 | 146 jsr ,y call init entry point of Clock2 |
148 | 147 |
149 * Initialize clock hardware | 148 * Initialize clock hardware |
150 IFNE atari | 149 IFNE atari |
151 * Atari - Tell ANTIC to assert NMI on Vertical Blank | 150 lda #IRQST.TIMER1 |
152 lda #$40 | 151 pshs cc |
153 sta NMIEN enable VBlank NMI | 152 orcc #IntMasks |
154 rts | 153 ora <D.IRQENShdw |
154 sta <D.IRQENShdw | |
155 sta IRQEN | |
156 lda #%00101001 | |
157 sta AUDCTL | |
158 clr AUDC1 | |
159 lda #$FF | |
160 sta AUDF1 | |
161 sta STIMER | |
162 puls cc,pc | |
155 ELSE | 163 ELSE |
156 ldx #PIA0Base point to PIA0 | 164 ldx #PIA0Base point to PIA0 |
157 clra no error for return... | 165 clra no error for return... |
158 pshs cc save IRQ enable status (and Carry clear) | 166 pshs cc save IRQ enable status (and Carry clear) |
159 orcc #IntMasks stop interrupts | 167 orcc #IntMasks stop interrupts |
180 * | 188 * |
181 * For CoCo 1/2, called once every 16.667 milliseconds | 189 * For CoCo 1/2, called once every 16.667 milliseconds |
182 SvcIRQ | 190 SvcIRQ |
183 clra | 191 clra |
184 tfr a,dp set direct page to zero | 192 tfr a,dp set direct page to zero |
185 IFNE atari | 193 IFNE atari |
186 sta NMIRES clear NMI interrupt | 194 lda IRQST get hw byte |
195 bita #IRQST.TIMER1 | |
196 beq L0032 branch if interrupt occurred | |
197 jmp [>D.SvcIRQ] else service other possible IRQ | |
198 L0032 | |
199 lda #$FF | |
200 sta AUDF1 | |
201 lda <D.IRQENShdw | |
202 tfr a,b A = clear interrupt, B = set interrupt | |
203 anda #^IRQST.TIMER1 | |
204 orb #IRQST.TIMER1 | |
205 sta IRQEN | |
206 stb IRQEN | |
207 stb <D.IRQENShdw | |
208 sta STIMER | |
187 ELSE | 209 ELSE |
188 tst PIA0Base+3 get hw byte | 210 tst PIA0Base+3 get hw byte |
189 bmi L0032 branch if sync flag on | 211 bmi L0032 branch if sync flag on |
190 jmp [>D.SvcIRQ] else service other possible IRQ | 212 jmp [>D.SvcIRQ] else service other possible IRQ |
191 L0032 tst PIA0Base+2 clear interrupt | 213 L0032 tst PIA0Base+2 clear interrupt |