# HG changeset patch # User boisy # Date 1034261409 0 # Node ID 4f81e616d3977b22b967a241466999380d7d0db7 # Parent b40c041a891213cf511de5ddbc74481e1c28986e clock.asm now has B&B and TC^3 clock code diff -r b40c041a8912 -r 4f81e616d397 level1/modules/clock.asm --- a/level1/modules/clock.asm Thu Oct 10 14:47:31 2002 +0000 +++ b/level1/modules/clock.asm Thu Oct 10 14:50:09 2002 +0000 @@ -7,35 +7,68 @@ * * Ed. Comments Who YY/MM/DD * ------------------------------------------------------------------ -* 5 From Tandy OS-9 Level One VR 02.00.00 -* 6 Modified to handle leap years properly for BGP 99/05/03 +* 5 Tandy/Microware original version +* 6 Modified to handle leap years properly for BGP 99/05/03 * 1900 and 2100 A.D. +* Added TC^3 SCSI/B&B RTC Clock Support BGP 02/05/14 nam Clock ttl OS-9 Level One V2 Clock module - ifp1 + IFP1 use defsfile - endc + ENDC tylg set Systm+Objct atrv set ReEnt+rev -rev set $01 +rev set $1 edition set 6 - mod eom,name,tylg,atrv,ClkEnt,size + mod eom,name,tylg,atrv,ClkEnt,RTC.Base size equ . name fcs /Clock/ fcb edition +* If no RTC defines are set, then this is a software clock + IFEQ RTCBB+RTCTC3 +SOFT set 1 + ENDC + + IFNE RTCBB +MPIFlag set 1 +SlotSlct set $22 +RTC.Base equ $FF5C + ENDC + IFNE RTCTC3 +RTC.Base equ $FF7C + ENDC + IFNE SOFT +RTC.Base equ size + ENDC + + IFNE RTCBB+RTCTC3 +RTC.Zero equ -4 Send zero bit by writing this offset +RTC.One equ -3 Send one bit by writing this offset +RTC.Read equ 0 Read data from this offset + ENDC + SysTbl fcb F$Time fdb FTime-*-2 fcb F$VIRQ fdb FVIRQ-*-2 + + IFEQ SOFT + + fcb F$STime + fdb FSTime-*-2 + + ENDC + fcb $80 + IFNE SOFT * table of days of the month MonthChk fcb 00 fcb 31 January @@ -51,12 +84,117 @@ fcb 30 November fcb 31 December + ELSE + +FSTime ldx R$X,u + ldd ,x + std MPI.Slct Select slot + pshs b + andb #$F0 + orb SlotSlct,pcr + stb >MPI.Slct + ENDC + + lbsr SendMsg Initialize clock + ldx #D.Sec + ldb #8 Tfr 8 bytes + +tfrloop jsr ,y Tfr 1 byte + bitb #$03 + beq skipstuf Skip over day-of-week, etc. + leax -1,x +skipstuf decb + bne tfrloop + + IFNE MPIFlag + puls b + stb >MPI.Slct restore MPAK slot + ENDC + + puls u,y,cc,pc + +ClkMsg fcb $C5,$3A,$A3,$5C,$C5,$3A,$A3,$5C +* Enable clock with message $C53AA35CC53AA35C +SendMsg lda RTC.Read,u Send Initialization message to clock + leax D.SvcIRQ] -L0032 lda PIA.U4+2 clear interrupt? +L0032 lda PIA.U4+2 clear interrupt? dec $@ - $(PADROM) \$$1200 $@ -c=\$$E5 - -# Kernel track for Tandy/RS controller (WD1773) -kernel_1773: $(KERNEL_1773) $(DEPENDS) - $(MERGE) $(KERNEL_1773)>$@ - $(PADROM) \$$1200 $@ -c=\$$E5 - -# Kernel track for Tandy/RS controller (WD1773) -kernel_ide: $(KERNEL_IDE) $(DEPENDS) - $(MERGE) $(KERNEL_IDE)>$@ - $(PADROM) \$$1200 $@ -c=\$$E5 - -kernel_d64: $(KERNEL_D64) $(DEPENDS) - $(MERGE) $(KERNEL_D64)>$@ - $(PADROM) \$$1000 $@ -c=\$$E5 - oscode: oscode.asm $(AS) $(AFLAGS) $(ASOUT)$@ $< -aDragon64=0 @@ -124,6 +99,12 @@ sysgo_rom: sysgo.asm $(AS) $(AFLAGS) $(ASOUT)$@ $< -aDiskGo=0 +clock_tc3: clock.asm + $(AS) $(AFLAGS) $(ASOUT)$@ $< -aRTCTC3=1 -aTPS=60 + +clock_bb: clock.asm + $(AS) $(AFLAGS) $(ASOUT)$@ $< -aRTCBB=1 -aTPS=60 + clean: $(RM) $(ALLOBJS) $(OS92UNIX) $(HELP)