# HG changeset patch # User boisy # Date 1100654661 0 # Node ID 7bdc60c48533703c45ca637419de8c6f8754e2d1 # Parent 843c3687eabd6cc0546ef22fd5e9e4207465c231 Additional Dragon changes from Phill Harvey-Smith diff -r 843c3687eabd -r 7bdc60c48533 level1/modules/boot_d64.asm --- a/level1/modules/boot_d64.asm Wed Nov 17 01:22:14 2004 +0000 +++ b/level1/modules/boot_d64.asm Wed Nov 17 01:24:21 2004 +0000 @@ -16,7 +16,7 @@ * Disassembled 1900/00/00 00:05:56 by Disasm v1.5 (C) 1988 by RML ifp1 - use defsfile + use defsfile.dragon endc IFNE DragonAlpha diff -r 843c3687eabd -r 7bdc60c48533 level1/modules/clock.asm --- a/level1/modules/clock.asm Wed Nov 17 01:22:14 2004 +0000 +++ b/level1/modules/clock.asm Wed Nov 17 01:24:21 2004 +0000 @@ -82,7 +82,7 @@ ldx R$X,u address of caller's time packet ldu #D.Time destination address ldb D.XSWI + pshs y + leax IRQPkt,PC ; point at IRQ definition packet + leay IRQFlag,pcr + tfr y,d + leay IRQHandler,pcr + os9 F$IRQ + puls y + + ldd #$0100 ; Request a page of system ram pshs u ; used to verify writes os9 F$SRqMem @@ -205,6 +237,10 @@ clrb Return rts +IRQHandler + inc $8000 + rts + * GetStat * * Entry: @@ -242,7 +278,17 @@ * CC = carry set on error * B = error code * -Read lda #$91 ; Retry count +Read + pshs a,x + lda DrivSel,u ; mask in drives - ORB >SideSel,U * Set up Side - stb SideSel,U ; Set up Side IFNE DragonAlpha ; Turn on drives & NMI lbsr AlphaDskCtl ELSE sta >DskCtl ENDC + + stb CDrvTab,U CMPD #0 ; Skip calculation of track 0 BEQ SeekT1 - CMPD 1,X ; Has an illegal LSN been + CMPD DD.TOT+1,X ; Has an illegal LSN been BLO SeekT2 E.Sect COMB LDB #E$Sect @@ -543,8 +590,8 @@ SeekT11 STB >SecReg ; Write sector number to controler LBSR Delay CMPB >SecReg - BNE SeekT11 - + BNE SeekT11 + SeekTS LDB TrkReg TST >Settle,U ; If settle has been flagged then wait for settle @@ -655,7 +702,9 @@ beq Delay3 lda #$F0 sta >D.DskTmr ;>$006F - bra FDCCmdWait + lda #$1 + sta IRQFlag + bra FDCCmdWait FDCCmdMotorOn lda #MotorOn ; Turn on motor @@ -736,9 +785,9 @@ ;Start drive motors StartMotor pshs x,b,a - lda >D.DskTmr ; if timer = 0 then wait for motors to - bne SpinUp ; spin up - lda #MotorOn + lda >D.DskTmr ; if timer <> 0 then skip as motor already on + bne SpinUp + lda #MotorOn ; else spin up IFNE DragonAlpha bsr AlphaDskCtl @@ -746,12 +795,13 @@ sta >DskCtl ENDC - ldx #$A000 + ldx #$A000 ; Wait a little while for motors to get up to speed StartMotorLoop nop nop leax -1,x bne StartMotorLoop + SpinUp lda #$F0 ; Start external motor timer sta >D.DskTmr ; external to driver puls pc,x,b,a @@ -776,86 +826,50 @@ ; Takes byte that would be output to $FF48, reformats it and ; outputs to Alpha AY-8912's IO port, which is connected to ; Drive selects, motor on and enable precomp. +; This code now expects Alpha NMI/DDEN etc codes, as defined +; at top of this file (and dgndefs). The exception to this is +; the drive number is still passed in the bottom 2 bits and +; converted with a lookup table. +; We do not need to preserve the ROM select bit as this code +; operates in RAM only mode. ; Also sets NMIFlag. -AlphaDskCtlB - pshs A - tfr b,a - bsr AlphaDskCtl - puls A - rts + +DrvTab FCB Drive0A,Drive1A,Drive2A,Drive3A AlphaDskCtl - PSHS A,B,CC - - anda #~DDenMask ; Dragon Alpha has DDen perminently enabled + PSHS x,A,B,CC PSHS A - ANDA #NMIMask ; mak out nmi enable bit + ANDA #NMIEn ; mask out nmi enable bit sta >NMIFlag,u ; Save it for later use - lda ,s - anda #EnpMask ; Extract enp mask - pshs a ; save it - - lda 1,s - ANDA #DSMask ; Mask Out drive select bits - -; Shift a bit in B left, a times, to convert drive number -; to DS bit. - - ldb #$01 -ShiftNext - cmpa #$00 ; Done all shifts ? - beq ShiftDone - lslb - deca - bra ShiftNext + lda ,s ; Convert drives + anda #%00000011 ; mask out drive number + leax DrvTab,pcr ; point at table + lda a,x ; get bitmap + ldb ,s + andb #%11111100 ; mask out drive number + stb ,s + ora ,s ; recombine + sta ,s -ShiftDone - lda 1,s - anda #MotorMask ; Extract motor bit - cmpa #MotorMask ; Motor on ? - beq MotorIsOn ; Yes leave it on. - - clrb ; No zero out DS bits - -MotorIsOn - ora ,s ; Recombine with ENP bit. - leas 1,s ; drop off stack - lsla - lsla - pshs b - ora ,s - leas 1,s - - pshs a ; Save motor/drive select state - ldb PIADA ; get BDIR/BC1/Rom select - andb #$FC ; Mask out BCDIR/BC1, so we don't change other bits - pshs b ; save mask lda #AYIOREG ; AY-8912 IO register - sta PIADB ; Output to PIA - orb #AYREGLatch ; Latch register to modify - stb PIADA + sta PIA2DB ; Output to PIA + ldb #AYREGLatch ; Latch register to modify + stb PIA2DA - clrb - orb ,s ; Restore saved bits - stb PIADA ; Idle AY + clr PIA2DA ; Idle AY - lda 1,s ; Fetch saved Drive Selects - sta PIADB ; output to PIA + lda ,s+ ; Fetch saved Drive Selects + sta PIA2DB ; output to PIA ldb #AYWriteReg ; Write value to latched register - orb ,s ; Restore saved bits - stb PIADA ; Set register - - clrb - orb ,s ; Restore saved bits - stb PIADA ; Idle AY - - leas 3,s ; drop saved bytes - - PULS A,B,CC + stb PIA2DA ; Set register + + clr PIA2DA ; Idle AY + + PULS x,A,B,CC RTS ENDC diff -r 843c3687eabd -r 7bdc60c48533 level1/modules/defsfile.dragon --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/level1/modules/defsfile.dragon Wed Nov 17 01:24:21 2004 +0000 @@ -0,0 +1,2 @@ + use ../defsfile.dragon + diff -r 843c3687eabd -r 7bdc60c48533 level1/modules/drvr51.asm --- a/level1/modules/drvr51.asm Wed Nov 17 01:22:14 2004 +0000 +++ b/level1/modules/drvr51.asm Wed Nov 17 01:24:21 2004 +0000 @@ -11,6 +11,9 @@ * * 2003/09/22 Rodney Hamilton * Recoded fcb arrays, added labels & some comments +* 2004/11/15 P.Harvey-Smith. +* Added code to turn off the drives on the Dragon Alpha. +* nam drvr51 ttl Driver for The 51 column by 24 line video display @@ -18,7 +21,7 @@ * Disassembled 02/07/06 21:17:23 by Disasm v1.6 (C) 1988 by RML ifp1 - use defsfile + use defsfile.dragon endc tylg set Drivr+Objct @@ -156,7 +159,14 @@ deca sta >D.DskTmr bne L00CB - sta >$FF48 + + IFNE DragonAlpha ; Turn off all drives + lbsr AlphaDskCtl + ELSE + sta >DskCtl + ENDC + +; sta >$FF48 L00CB lbsr L04E5 jmp [>D.AltIRQ] L00D2 pshs x,b @@ -1053,6 +1063,36 @@ fcb $12,$10,$11,$20 dc2 dle dc1 space fcb $0D,$00,$1B ENTER CLEAR esc + IFNE DragonAlpha +; Warning this version of AlphaDskCtl, does NOT convert DragonDos +; $FF48 codes to alpha ones, they must be in Alpha format. +; This is only used for timed turn off of drive motors. +; We do not need to preserve the ROM select bit as this code +; operates in RAM only mode. + +AlphaDskCtl + pshs a,b,cc + + pshs a + lda #AYIOREG ; AY-8912 IO register + sta PIA2DB ; Output to PIA + ldb #AYREGLatch ; Latch register to modify + stb PIA2DA + + CLR PIA2DA ; Idle AY + + lda ,s+ ; Fetch saved Drive Selects + sta PIA2DB ; output to PIA + ldb #AYWriteReg ; Write value to latched register + stb PIA2DA ; Set register + + clr PIA2DA ; Idle AY + + PULS A,B,CC + RTS + + ENDC + emod eom equ * end diff -r 843c3687eabd -r 7bdc60c48533 level1/modules/kbvdio.asm --- a/level1/modules/kbvdio.asm Wed Nov 17 01:22:14 2004 +0000 +++ b/level1/modules/kbvdio.asm Wed Nov 17 01:24:21 2004 +0000 @@ -11,6 +11,9 @@ * * 2004/01/04 Rodney Hamilton * Recoded anonymous fcb arrays, added some comments +* 2004/11/15 P.Harvey-Smith. +* Added code to turn off the drives on the Dragon Alpha. +* nam KBVDIO ttl keyboard/video driver @@ -18,7 +21,7 @@ * Disassembled 02/04/21 22:37:57 by Disasm v1.6 (C) 1988 by RML ifp1 - use defsfile + use defsfile.dragon endc tylg set Drivr+Objct @@ -185,12 +188,20 @@ sta D.DskTmr +L00DF + lda >D.DskTmr beq L00ED deca sta >D.DskTmr bne L00ED - sta >$FF48 + + IFNE DragonAlpha ; Turn off all drives + lbsr AlphaDskCtl + ELSE + sta >DskCtl + ENDC + +; sta >$FF48 L00ED jmp [>D.AltIRQ] L00F1 bsr L013F bmi L00DF @@ -1204,6 +1215,40 @@ L08E0 suba ,s+ bra L08C0 + + + + IFNE DragonAlpha + +; Warning this version of AlphaDskCtl, does NOT convert DragonDos +; $FF48 codes to alpha ones, they must be in Alpha format. +; This is only used for timed turn off of drive motors. +; We do not need to preserve the ROM select bit as this code +; operates in RAM only mode. + +AlphaDskCtl + pshs a,b,cc + + pshs a + lda #AYIOREG ; AY-8912 IO register + sta PIA2DB ; Output to PIA + ldb #AYREGLatch ; Latch register to modify + stb PIA2DA + + CLR PIA2DA ; Idle AY + + lda ,s+ ; Fetch saved Drive Selects + sta PIA2DB ; output to PIA + ldb #AYWriteReg ; Write value to latched register + stb PIA2DA ; Set register + + clr PIA2DA ; Idle AY + + PULS A,B,CC + RTS + + ENDC + emod eom equ * end diff -r 843c3687eabd -r 7bdc60c48533 level1/modules/makefile.dragon --- a/level1/modules/makefile.dragon Wed Nov 17 01:22:14 2004 +0000 +++ b/level1/modules/makefile.dragon Wed Nov 17 01:24:21 2004 +0000 @@ -11,21 +11,21 @@ CLOCKMESSEMU = -aRTCMessEmu=1 CLOCKJVEMU = -aRTCJVEmu=1 -DEPENDS = ./makefile +DEPENDS = ./makefile.dragon TPB = $(3RDPARTY)/booters -BOOTERS = boot_1773_6ms boot_1773_30ms \ - boot_burke boot_rampak boot_wd1002 boot_d64 boot_dalpha +BOOTERS = boot_d64 boot_dalpha + BOOTTRACK = rel $(BOOTERS) rel_dalpha KERNEL = krn krnp2 SYSMODS = ioman init sysgo_dd sysgo_h0 + CLOCKS = clock_60hz clock_50hz \ clock2_elim clock2_disto2 clock2_disto4 clock2_bnb \ clock2_smart clock2_harris clock2_cloud9 clock2_soft \ clock2_messemu clock2_jvemu clock_d64 RBF = rbf.mn \ - rb1773.dr rb1773_scii_ff74.dr rb1773_scii_ff58.dr \ ddisk.dr adisk.dr \ ddd0_35s.dd d0_35s.dd d1_35s.dd d2_35s.dd d3_35s.dd \ ddd0_40d.dd d0_40d.dd d1_40d.dd d2_40d.dd \ @@ -35,7 +35,8 @@ SCF = scf.mn \ sc6551.dr vrn.dr printer.dr sio.dr sspak.dr ccio.dr \ co32.io co80.io \ - nil.dd p.dd pipe.dd ssp.dd kbvdio.dr \ + nil.dd p.dd pipe.dd ssp.dd kbvdio.dr akbvdio.dr \ + drvr51.dr adrvr51.dr \ term_sio.dt term_sc6551.dt t1.dd t2_sc6551.dd t3_sc6551.dt \ term32.dt term80.dt term_d64.dt t1_d64.dd p1_d64.dd @@ -54,18 +55,6 @@ $(CD) kernel; make $@ $(CP) kernel/$@ . -boot_1773_6ms: boot_1773.asm - $(AS) $< $(ASOUT)$@ $(AFLAGS) -aDNum=0 -aSTEP=0 - -boot_1773_30ms: boot_1773.asm - $(AS) $< $(ASOUT)$@ $(AFLAGS) -aDNum=0 -aSTEP=3 - -rb1773_scii_ff74.dr: rb1773.asm - $(AS) $< $(ASOUT)$@ $(AFLAGS) -aSCII=1 - -rb1773_scii_ff58.dr: rb1773.asm - $(AS) $< $(ASOUT)$@ $(AFLAGS) -aSCII=1 -aSCIIALT=1 - boot_d64: boot_d64.asm $(AS) $< $(ASOUT)$@ $(AFLAGS) -aDNum=0 -aSTEP=0 @@ -92,6 +81,8 @@ -aInterlv=3 -aSAS=8 -aDensity=1 DSDD40 = -aCyls=40 -aSides=2 -aSectTrk=18 -aSectTrk0=18 \ -aInterlv=3 -aSAS=8 -aDensity=1 +SSDD80 = -aCyls=80 -aSides=1 -aSectTrk=18 -aSectTrk0=18 \ + -aInterlv=3 -aSAS=8 -aDensity=1 -aD35 DSDD80 = -aCyls=80 -aSides=2 -aSectTrk=18 -aSectTrk0=18 \ -aInterlv=3 -aSAS=8 -aDensity=1 -aD35 @@ -163,6 +154,12 @@ rel_dalpha: rel.asm $(AS) $(AFLAGS) $(ASOUT)$@ $< -aDragon64=0 -aDragonAlpha=1 +akbvdio.dr: kbvdio.asm + $(AS) $(AFLAGS) $(ASOUT)$@ $< -aDragon64=0 -aDragonAlpha=1 + +adrvr51.dr: drvr51.asm + $(AS) $(AFLAGS) $(ASOUT)$@ $< -aDragon64=0 -aDragonAlpha=1 + sysgo_dd: sysgo.asm $(AS) $(AFLAGS) $(ASOUT)$@ $< -aDD=1 diff -r 843c3687eabd -r 7bdc60c48533 rules.mak --- a/rules.mak Wed Nov 17 01:22:14 2004 +0000 +++ b/rules.mak Wed Nov 17 01:24:21 2004 +0000 @@ -42,6 +42,7 @@ OS9FORMAT = $(OS9TOOLSDIR)/os9 format OS9FORMAT_SS35 = $(OS9TOOLSDIR)/os9 format -t35 -ss -dd -4 OS9FORMAT_SS40 = $(OS9TOOLSDIR)/os9 format -t40 -ss -dd -4 +OS9FORMAT_SS80 = $(OS9TOOLSDIR)/os9 format -t80 -ss -dd -9 OS9FORMAT_DS40 = $(OS9TOOLSDIR)/os9 format -t40 -ds -dd -4 OS9FORMAT_DS80 = $(OS9TOOLSDIR)/os9 format -t80 -ds -dd -9 OS9GEN = $(OS9TOOLSDIR)/os9 gen