# HG changeset patch # User boisy # Date 1105989663 0 # Node ID ea3988b5403cc6085cce52c95f7d509d2c9cca2d # Parent 94aaf037f7ba540df00b34208f9a1c8d25925c91 Incremented rev to indicate PHS's changes diff -r 94aaf037f7ba -r ea3988b5403c level1/modules/clock.asm --- a/level1/modules/clock.asm Fri Jan 07 16:52:26 2005 +0000 +++ b/level1/modules/clock.asm Mon Jan 17 19:21:03 2005 +0000 @@ -22,39 +22,41 @@ * 9r6 2003/09/04 Boisy G. Pitre * Combined Level One and Level Two sources * -* 2004/11/27 P.Harvey-Smith +* 9r7 2004/11/27 Phill Harvey-Smith * Fixed bug in init routine that was causing DP and CC to -* be pulled off the stack and stored in D.Proc under level 1 +* be pulled off the stack and stored in D.Proc under Level 1 * nam Clock ttl OS-9 System Clock - ifp1 + IFP1 use defsfile - ifgt Level-1 + IFGT Level-1 use cc3iodefs - endc - endc + ENDC + ENDC -Edtn equ 9 -rev equ 6 - - +tylg set Systm+Objct +atrv set ReEnt+rev +rev set 7 +edition set 9 + + *------------------------------------------------------------ * * Start of module * - mod len,name,Systm+Objct,ReEnt+rev,Init,0 + mod len,name,tylg,atrv,init,0 name fcs "Clock" - fcb Edtn + fcb edition - ifeq Level-1 + IFEQ Level-1 TkPerTS equ TkPerSec/10 ticks per time slice - else + ELSE TkPerTS equ 2 ticks per time slice - endc + ENDC * * Table to set up Service Calls @@ -63,10 +65,10 @@ fdb FTime-*-2 fcb F$VIRQ fdb FVIRQ-*-2 - ifgt Level-1 + IFGT Level-1 fcb F$Alarm fdb FALARM-*-2 - endc + ENDC fcb F$STime fdb FSTime-*-2 fcb $80 end of service call installation table @@ -80,14 +82,14 @@ * variables, then fall through to code to update RTC. * FSTime equ * - ifgt Level-1 + IFGT Level-1 ldx $FFFE level 1: jump to reset vector - else + ELSE lda #E$MNF jmp $FF98 set 50 Hz VSYNC - endc - endc + ENDC + ENDC sta 1,x enable DDRA sta ,x set port A all inputs @@ -175,9 +177,9 @@ sta 1,x CA2 (MUX0) out low, port A, disable HBORD high-to-low IRQs stb 3,x CB2 (MUX1) out low, port B, disable VBORD low-to-high IRQs - ifgt Level-1 + IFGT Level-1 lda ,x clear possible pending PIA0 HBORD IRQ - endc + ENDC lda 2,x clear possible pending PIA0 VBORD IRQ * Don't need to explicitly read RTC during initialization @@ -188,31 +190,31 @@ leax SvcIRQ,pcr set IRQ handler stx IRQEnR enable GIME VBORD IRQs - endc + ENDC * Call Clock2 init routine ldy $0643 stb >$0645 std >$FFA1 andcc #^IntMasks - endc + ENDC ldd Vi.Cnt,x decrement tick count - ifne H6309 + IFNE H6309 decd --- subd #1 - else + ELSE subd #$0001 - endc + ENDC bne notzero is this one done? lda Vi.Stat,x should we reset? bmi doreset @@ -430,7 +432,7 @@ virqent ldx ,y++ bne virqloop - ifgt Level-2 + IFGT Level-2 puls d orcc #Carry stb >$0643 @@ -439,28 +441,28 @@ stb >$0645 stb >$FFA1 andcc #^IntMasks - else + ELSE puls a get VIRQ status flag: high bit set if VIRQ - endc + ENDC ora $0643 grab current map type ldb >$0645 pshs d save it @@ -471,18 +473,18 @@ inca sta >$0645 sta >$FFA2 map in SCF, CC3IO, WindInt, etc. - endc + ENDC jsr [>D.AltIRQ] go update mouse, gfx cursor, keyboard, etc. - ifgt Level-2 + IFGT Level-2 puls d restore original map type ---x orcc #IntMasks sta >$0643 into system DAT image ---x stb >$0645 std >$FFA1 and into RAM ---x andcc #$AF - endc + ENDC dec $0643 Level 3: get map type ldb >$0645 pshs d save for later - endc + ENDC d@ jsr [>D.Poll] call poll routine bcc d@ until error (error -> no interrupt found) - ifgt Level-2 + IFGT Level-2 puls d orcc #IntMasks sta >$0643 stb >$0645 std >$FFA1 andcc #^IntMasks - endc + ENDC * * Reset GIME to avoid missed IRQs @@ -582,11 +584,11 @@ ldb PollCnt,x number of polling table entries from INIT ldx R$X,u zero means delete entry beq RemVIRQ - ifgt Level-2 + IFGT Level-2 bra FindVIRQ ---x v.loop leay 4,y ---x - endc + ENDC FindVIRQ ldx ,y++ is VIRQ entry null? beq AddVIRQ if yes, add entry here @@ -598,27 +600,27 @@ rts AddVIRQ - ifgt Level-2 + IFGT Level-2 ldx R$Y,u stx ,y lda >$0643 ldb >$0645 std 2,y - else + ELSE leay -2,y point to first null VIRQ entry ldx R$Y,u stx ,y - endc + ENDC ldy R$D,u sty ,x bra virqexit - ifgt Level-2 + IFGT Level-2 v.chk leay 4,y RemVIRQ ldx ,y - else + ELSE RemVIRQ ldx ,y++ - endc + ENDC beq virqexit cmpx R$Y,u bne RemVIRQ @@ -629,22 +631,22 @@ DelVIRQ pshs x,y DelVLup - ifgt Level-2 + IFGT Level-2 ldq ,y++ move entries up in table leay 2,y stq -8,y bne DelVLup puls x,y,pc - else + ELSE ldx ,y++ move entries up in table stx -4,y bne DelVLup puls x,y leay -2,y rts - endc + ENDC - ifgt Level-1 + IFGT Level-1 *------------------------------------------------------------ * * Handle F$Alarm call @@ -679,14 +681,14 @@ comb ldb #E$IllArg rts - endc + ENDC *------------------------------------------------------------ * * Handle F$Time System call * FTime equ * - ifgt Level-1 + IFGT Level-1 ldx #D.Time address of system time packet RetTime ldy