changeset 1800:1b5700ad3ffa

Dragon changes by Phill
author boisy
date Wed, 13 Apr 2005 01:31:38 +0000
parents 78b6ac6bba2c
children 75f1d0fc33e1
files level1/modules/clock_d64.asm level1/modules/drvr51.asm level1/modules/kbvdio.asm level1/modules/makefile.dragon level1/modules/term_d64.asm
diffstat 5 files changed, 8 insertions(+), 2625 deletions(-) [+]
line wrap: on
line diff
--- a/level1/modules/clock_d64.asm	Mon Apr 11 23:33:58 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,208 +0,0 @@
-;
-; Dragon 64 clock module, Disassembled Nov 2004, 
-;	P.Harvey-Smith.
-;
-
-		nam   Clock
-         ttl   os9 system module    
-
-* Disassembled 1900/00/00 00:12:38 by Disasm v1.5 (C) 1988 by RML
-
-         ifp1
-		 use   defsfile
-         endc
-tylg     set   Systm+Objct   
-atrv     set   ReEnt+rev
-rev      set   $01
-         mod   eom,name,tylg,atrv,start,size
-u0000    rmb   0
-size     equ   .
-name     equ   *
-         fcs   /Clock/
-         fcb   $02 
-
-L0013    fcb   	F$Time 
-		 FDB	GetTimeHandler-*-2
-;         fcb   $00 
-;         fcb   $82 
-         fcb   $80 	; Terminator
-         fcb   $00 
-		 
-DaysInMonths
-         fcb   $1F 
-         fcb   $1C 
-         fcb   $1F 
-         fcb   $1E 
-         fcb   $1F 
-         fcb   $1E 
-         fcb   $1F 
-         fcb   $1F 
-         fcb   $1E 
-         fcb   $1F 
-         fcb   $1E 
-         fcb   $1F 
-AltIRQ    
-		CLRA
-		TFR		A,DP
-		DEC		<D.Tick
-		BNE		ALTIRQExit
-		LDD		<D.Min
-		INCB	
-		CMPB	#$3C	; 60 
-		BCS		LabA
-		INCA
-		CMPA	#$3C	; 60 
-		BCS		Labb
-		LDD		<D.Day
-		INCB
-		CMPB	#$18	; 24 Hours
-		BCS		LabD
-		INCA
-		LEAX	DaysInMonths,PCR
-		LDB		<D.Month
-		CMPB	#2		; Febuary ?
-		BNE		NotLeap
-		LDB		<D.Year	; Test for leap year
-		BEQ		NotLeap
-		ANDB	#$03
-		BNE		NotLeap
-		DECA
-		
-NotLeap	LDB		<D.Month
-		CMPA	B,X		; Lookup number of days
-		BLS		LabE
-		LDD		<D.Year
-		INCB			
-		CMPB	#$0D	; End of year ?
-		BCS	    LabF
-		
-		INCA			; Happy new year !
-		LDB		#$1		; Back to January
-		
-LabF	STD		<D.Year
-
-		LDA		#$01
-LabE	CLRB		
-LabD	STD		<D.Day
-		CLRA
-LabB	CLRB
-LabA	STD		<D.Min
-		LDA		<D.TSec
-		STA		<D.Tick
-AltIRQExit
-		JMP		[D.Clock]
-;		 fcb   $4F O
-;         fcb   $1F 
-;         fcb   $8B 
-;         fcb   $0A 
-;         fcb   $59 Y
-;         fcb   $26 &
-;         fcb   $46 F
-;         fcb   $DC \
-;         fcb   $57 W
-;         fcb   $5C \
-;         fcb   $C1 A
-;         fcb   $3C <
-;         fcb   $25 %
-;         fcb   $39 9
-;         fcb   $4C L
-;         fcb   $81 
-;         fcb   $3C <
-;         fcb   $25 %
-;         fcb   $33 3
-;         fcb   $DC \
-;         fcb   $55 U
-;         fcb   $5C \
-;         fcb   $C1 A
-;         fcb   $18 
-;         fcb   $25 %
-;         fcb   $29 )
-;         fcb   $4C L
-;         fcb   $30 0
-;         fcb   $8D 
-;         fcb   $FF 
-;         fcb   $D4 T
-;         fcb   $D6 V
-;         fcb   $54 T
-;         fcb   $C1 A
-;         fcb   $02 
-;         fcb   $26 &
-;         fcb   $09 
-;         fcb   $D6 V
-;         fcb   $53 S
-;         fcb   $27 '
-;         fcb   $05 
-;         fcb   $C4 D
-;         fcb   $03 
-;         fcb   $26 &
-;         fcb   $01 
-;         fcb   $4A J
-;         fcb   $D6 V
-;         fcb   $54 T
-;         fcb   $A1 !
-;         fcb   $85 
-;         fcb   $23 #
-;         fcb   $0E 
-;         fcb   $DC \
-;         fcb   $53 S
-;         fcb   $5C \
-;         fcb   $C1 A
-;         fcb   $0D 
-;         fcb   $25 %
-;         fcb   $03 
-;         fcb   $4C L
-;         fcb   $C6 F
-;         fcb   $01 
-;         fcb   $DD ]
-;         fcb   $53 S
-;         fcb   $86 
-;         fcb   $01 
-;         fcb   $5F _
-;         fcb   $DD ]
-;         fcb   $55 U
-;         fcb   $4F O
-;         fcb   $5F _
-;         fcb   $DD ]
-;         fcb   $57 W
-;         fcb   $96 
-;         fcb   $5A Z
-;         fcb   $97 
-;         fcb   $59 Y
-;         fcb   $6E n
-;         fcb   $9F 
-;         fcb   $00 
-;         fcb   $81 
-start    equ   *
-		pshs	x
-		ldx		#$0666
-		puls	x
-         pshs  dp,cc
-         clra  
-         tfr   a,dp
-         lda   #$32
-         sta   <D.TSec		; Ticks/Second
-         sta   <D.Tick
-         lda   #$05
-         sta   <D.TSlice	; Ticks/Timeslice
-         sta   <D.Slice
-         orcc  #$50
-         leax  >AltIRQ,pcr
-         stx   >D.AltIRQ
-         leay  >L0013,pcr
-         os9   F$SSvc   
-         puls  pc,dp,cc
-
-GetTimeHandler
-         ldx   $04,u
-         ldd   <D.Year
-         std   ,x
-         ldd   <D.Day
-         std   $02,x
-         ldd   <D.Min
-         std   $04,x
-         clrb  
-         rts   
-
-emod
-eom      equ   *
-         end
--- a/level1/modules/drvr51.asm	Mon Apr 11 23:33:58 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1098 +0,0 @@
-********************************************************************
-* drvr51 - Driver for The 51 column by 24 line video display
-*
-* $Id$
-*
-* Edt/Rev  YYYY/MM/DD  Modified by
-* Comment
-* ------------------------------------------------------------------
-*   1      ????/??/??
-* Original Dragon distribution version
-*
-*          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
-
-* Disassembled 02/07/06 21:17:23 by Disasm v1.6 (C) 1988 by RML
-
-         ifp1
-         use   defsfile.dragon
-         endc
-
-tylg     set   Drivr+Objct   
-atrv     set   ReEnt+rev
-rev      set   $00
-edition  set   1
-
-         mod   eom,name,tylg,atrv,start,size
-
-         org   0
-u0000    rmb   1
-u0001    rmb   1
-u0002    rmb   1
-u0003    rmb   1
-u0004    rmb   1
-u0005    rmb   1
-u0006    rmb   1
-u0007    rmb   1
-u0008    rmb   1
-u0009    rmb   1
-u000A    rmb   1
-u000B    rmb   1
-u000C    rmb   1
-u000D    rmb   1
-u000E    rmb   1
-u000F    rmb   8
-u0017    rmb   4
-u001B    rmb   2
-u001D    rmb   1
-u001E    rmb   1
-u001F    rmb   1
-u0020    rmb   2
-u0022    rmb   2
-u0024    rmb   1
-u0025    rmb   1
-u0026    rmb   1
-u0027    rmb   1
-u0028    rmb   1
-u0029    rmb   1
-u002A    rmb   1
-u002B    rmb   1
-u002C    rmb   1
-u002D    rmb   1		SHIFT flag
-u002E    rmb   1		CONTROL flag
-u002F    rmb   1		SHIFTLOCK toggle
-u0030    rmb   1
-u0031    rmb   1
-u0032    rmb   1
-u0033    rmb   1
-u0034    rmb   1
-u0035    rmb   1
-u0036    rmb   1
-u0037    rmb   1
-u0038    rmb   1
-u0039    rmb   1
-u003A    rmb   100
-size     equ   .
-
-         fcb   UPDAT.
-
-name     fcs   /drvr51/
-         fcb   edition
-
-start    lbra  Init
-         lbra  Read
-         lbra  Write
-         lbra  GetStat
-         lbra  SetStat
-         lbra  Term
-
-Init     pshs  u,a
-         ldu   <u001D,u
-         ldd   #$0200
-         os9   F$SRtMem
-         ldu   $01,s
-         tst   <u002C,u
-         beq   L0044
-         ldu   <u002D,u
-         ldd   #$1800
-         os9   F$SRtMem 
-         ldu   $01,s
-L0044    ldb   #$81
-         leax  <u001D,u
-L0049    clr   ,x+
-         decb  
-         bne   L0049
-         ldd   #$1900
-         os9   F$SRqMem 
-         bcs   L009C
-         tfr   u,d
-         ldu   $01,s
-         tfr   d,x
-         bita  #$01
-         beq   L0066
-         leax  >$0100,x
-         bra   L0068
-L0066    adda  #$18
-L0068    stx   <u0022,u
-         tfr   d,u
-         ldd   #$0100
-         os9   F$SRtMem 
-         ldu   $01,s
-         lda   #$10
-         sta   <u0037,u
-         pshs  cc
-         orcc  #IntMasks
-         leay  >L00AD,pcr
-         sty   >D.IRQ
-         ldx   #$FF00
-         lda   $03,x
-         ora   #$01
-         sta   $03,x
-         inc   >InitFlag,pcr
-         puls  cc
-         lbsr  L0475
-         lbsr  L02C3
-         clrb  
-L009C    puls  pc,u,a
-InitFlag fcb   $00
-Term     pshs  cc
-         orcc  #IntMasks
-         ldx   >D.AltIRQ
-         stx   >D.IRQ
-         puls  cc
-         clrb  
-         rts   
-L00AD    ldu   >D.KbdSta
-         ldx   #$FF00
-         lda   $03,x
-         bmi   L00BB
-         jmp   [>D.SvcIRQ]
-L00BB    lda   $02,x
-         lda   >D.DskTmr
-         beq   L00CB
-         deca  
-         sta   >D.DskTmr
-         bne   L00CB
-
-		 IFNE	DragonAlpha		; Turn off all drives
-		 lbsr	AlphaDskCtl
-		 ELSE
-         sta   >DskCtl
-		 ENDC
-
-;         sta   >$FF48
-L00CB    lbsr  L04E5
-         jmp   [>D.AltIRQ]
-L00D2    pshs  x,b
-         lda   u0004,u
-         sta   u0005,u
-         ldx   #$0000
-         os9   F$Sleep  
-         ldx   <D.Proc
-         ldb   <$36,x
-         beq   L00EC
-         cmpb  #$03
-         bhi   L00EC
-         coma  
-         puls  pc,x,a
-
-L00EC    puls  x,b
-Read     tst   >InitFlag,pcr
-         bne   L00F9
-         lbsr  Init
-         bcs   L011C
-L00F9    leax  <u003A,u
-         orcc  #IRQMask
-         ldb   <u001D,u
-         cmpb  <u001E,u
-         beq   L00D2
-         lda   b,x
-         incb  
-         cmpb  #$64
-         bcs   L010E
-         clrb  
-L010E    stb   <u001D,u
-         andcc #^(IRQMask+Carry)
-         tst   u000E,u
-         beq   L011C
-         clr   u000E,u
-         comb  
-         ldb   #E$Read		READ error
-L011C    rts   
-
-Write    tst   >InitFlag,pcr
-         bne   L012C
-         pshs  a
-         lbsr  Init
-         puls  a
-         bcs   L0139
-L012C    ldb   <u001F,u
-         bne   L0165
-         cmpa  #$1B		escape?
-         bne   L013A
-         inc   <u001F,u		flag ESC seq
-         clrb  
-L0139    rts   
-L013A    cmpa  #$20
-         bcs   L0144
-         cmpa  #$7F
-         bcc   L0144
-         bra   L0173
-L0144    leax  >L066E,pcr
-L0148    tst   ,x
-         bne   L0150
-L014C    clr   <u001F,u
-         rts   
-L0150    cmpa  ,x+
-         bne   L0161
-         ldd   ,x
-         leax  >L066E,pcr
-         leax  d,x
-         stx   <u0020,u
-         jmp   ,x
-L0161    leax  $02,x
-         bra   L0148
-L0165    inc   <u001F,u
-         leax  >L0681,pcr
-         cmpb  #$01
-         beq   L0148
-         jmp   [<u0020,u]
-L0173    inc   <u0032,u
-         bsr   L01B3
-         tst   <u0039,u
-         beq   L0185
-         lda   #$F8
-         leay  <-$40,y
-         lbsr  L0236
-L0185    lda   <u0024,u
-         inca  
-         cmpa  #$33
-         bcs   L01A2
-         clr   <u0024,u
-         lda   <u0025,u
-         inca  
-         cmpa  #$18
-         bcs   L019D
-         lbsr  L033E
-         bra   L01A5
-L019D    sta   <u0025,u
-         bra   L01A5
-L01A2    sta   <u0024,u
-L01A5    clr   <u0033,u
-         ldd   <u0024,u
-         std   <u0030,u
-         dec   <u0032,u
-         clrb  
-         rts   
-L01B3    tfr   a,b
-         subb  #$20
-         clra  
-         leax  >L06A0,pcr
-         lslb  
-         rola  
-         lslb  
-         rola  
-         leax  d,x
-         ldb   #$05
-         lda   <u0024,u
-         mul   
-         pshs  b
-         lsra  
-         rorb  
-         lsra  
-         rorb  
-         lsra  
-         rorb  
-         puls  a
-         anda  #$07
-         pshs  b
-         sta   <u0026,u
-         tst   <u0034,u
-         bne   L01FF
-         tfr   a,b
-         lda   #$F8
-         tstb  
-         beq   L01FA
-L01E5    lsra  
-         decb  
-         bhi   L01E5
-         bne   L01EE
-         rorb  
-         bra   L01FA
-L01EE    pshs  b
-         ldb   #$80
-L01F2    lsra  
-         rorb  
-         dec   ,s
-         bne   L01F2
-         leas  $01,s
-L01FA    coma  
-         comb  
-         std   <u0035,u
-L01FF    ldy   <u0022,u
-         lda   <u0025,u
-         ldb   ,s+
-         leay  d,y
-         lda   #$04
-         pshs  a
-         inc   <u0032,u
-L0211    lda   ,x
-         anda  #$F0
-         bsr   L0236
-         lda   ,x+
-         anda  #$0F
-         bsr   L0227
-         dec   ,s
-         bne   L0211
-         dec   <u0032,u
-         clrb  
-         puls  pc,b
-L0227    ldb   <u0026,u
-         subb  #$04
-         bhi   L023B
-         beq   L0250
-L0230    lsla  
-         incb  
-         bne   L0230
-         bra   L0250
-L0236    ldb   <u0026,u
-         beq   L0250
-L023B    lsra  
-         decb  
-         bhi   L023B
-         bne   L0244
-         rorb  
-         bra   L0250
-L0244    pshs  b
-         ldb   #$80
-L0248    lsra  
-         rorb  
-         dec   ,s
-         bne   L0248
-         leas  $01,s
-L0250    tst   <u0034,u
-         bne   L0273
-         tst   <u0038,u
-         beq   L0262
-         coma  
-         comb  
-         eora  <u0035,u
-         eorb  <u0036,u
-L0262    pshs  b,a
-         ldd   <u0035,u
-         anda  ,y
-         andb  $01,y
-         addd  ,s++
-L026D    std   ,y
-         leay  <$20,y
-         rts   
-L0273    eora  ,y
-         eorb  $01,y
-         bra   L026D
-
-* $07 - BEL (ding!)
-L0279    ldx   #$FF20
-         ldb   #$64
-L027E    lda   ,x
-         eora  #$C0
-         sta   ,x
-         lda   #$19
-L0286    deca  
-         nop   
-         nop   
-         bne   L0286
-         decb  
-         bne   L027E
-         lbra  L014C
-
-* $08 - BS (left arrow)
-L0291    dec   <u0024,u
-         bpl   L02A6
-         lda   #$32
-         sta   <u0024,u
-
-* $1b44 - (cursor up)
-L029B    dec   <u0025,u
-         bpl   L02A6
-         clr   <u0025,u
-         lbsr  L035E
-L02A6    lbsr  L0484
-         lbra  L014C
-
-* $0a, $1b45 - LF, (cursor down)
-L02AC    lda   <u0025,u
-         inca  
-         cmpa  #$18
-         bcs   L02B9
-         lbsr  L033E
-         bra   L02BC
-L02B9    sta   <u0025,u
-L02BC    bra   L02A6
-
-* $0d - CR (return)
-L02BE    clr   <u0024,u
-         bra   L02A6
-
-* $0c - FF (clear screen)
-L02C3    ldy   <u0022,u
-         leay  >$0080,y
-         lda   #$18
-         pshs  a
-         inc   <u0032,u
-L02D2    bsr   L0314
-         dec   ,s
-         bne   L02D2
-         leas  $01,s
-         clra  
-         clrb  
-         sta   <u0033,u
-         std   <u0030,u
-         std   <u0024,u
-         dec   <u0032,u
-         ldx   #$FF20
-         lda   $02,x
-         ora   #$F0
-         sta   $02,x
-         ldx   #$FFC0
-         lda   #$06
-         ldb   #$03
-         bsr   L0305
-         lda   <u0022,u
-         lsra  
-         ldb   #$07
-         bsr   L0305
-         lbra  L014C
-L0305    lsra  
-         bcc   L030E
-         leax  $01,x
-         sta   ,x+
-         bra   L0310
-L030E    sta   ,x++
-L0310    decb  
-         bne   L0305
-         rts   
-L0314    lda   #$10
-L0316    pshs  a
-         lda   <u0038,u
-         tfr   a,b
-L031D    std   <-$80,y
-         std   <-$60,y
-         std   <-$40,y
-         std   <-$20,y
-         std   <$20,y
-         std   <$40,y
-         std   <$60,y
-         std   ,y++
-         dec   ,s
-         bne   L031D
-         leay  >$00E0,y
-         puls  pc,b
-L033E    ldy   <u0022,u
-         inc   <u0032,u
-         pshs  u
-         leau  >$0100,y
-         lda   #$10
-         bsr   L037C
-         puls  u
-         dec   <u0031,u
-L0354    leay  >$0080,y
-         bsr   L0314
-         dec   <u0032,u
-         rts   
-L035E    ldy   <u0022,u
-         leay  >$17F0,y
-         inc   <u0032,u
-         pshs  u
-         leau  >-$0100,y
-         lda   #$F0
-         bsr   L037C
-         leay  ,u
-         puls  u
-         inc   <u0031,u
-         bra   L0354
-L037C    ldb   #$17
-         pshs  b
-L0380    ldb   #$10
-L0382    ldx   ,u
-         stx   ,y
-         ldx   u0002,u
-         stx   $02,y
-         ldx   u0004,u
-         stx   $04,y
-         ldx   u0006,u
-         stx   $06,y
-         ldx   u0008,u
-         stx   $08,y
-         ldx   u000A,u
-         stx   $0A,y
-         ldx   u000C,u
-         stx   $0C,y
-         ldx   u000E,u
-         stx   $0E,y
-         leay  a,y
-         leau  a,u
-         decb  
-         bne   L0382
-         dec   ,s
-         bne   L0380
-         puls  pc,b
-
-* $1b42 - clear to end of line
-L03AF    inc   <u0032,u
-         bsr   L03BA
-         dec   <u0032,u
-         lbra  L014C
-L03BA    clr   <u0033,u
-         ldb   <u0024,u
-         pshs  b
-         bitb  #$07
-         bne   L03CB
-         lda   #$05
-         mul   
-         bra   L03F3
-L03CB    lda   #$01
-         pshs  a
-L03CF    lda   #$20
-         lbsr  L01B3
-         lda   <u0024,u
-         inca  
-         sta   <u0024,u
-         cmpa  #$33
-         bcs   L03E3
-         leas  $01,s
-         bra   L040D
-L03E3    dec   ,s
-         bpl   L03CF
-         lda   <u0024,u
-         ldb   #$05
-         mul   
-         bitb  #$08
-         bne   L03CF
-         leas  $01,s
-L03F3    lsrb  
-         lsrb  
-         lsrb  
-         ldy   <u0022,u
-         lda   <u0025,u
-         leay  d,y
-         leay  >$0080,y
-         lda   #$20
-         pshs  b
-         suba  ,s+
-         lsra  
-         lbsr  L0316
-L040D    puls  a
-         sta   <u0024,u
-         rts   
-
-* $1b4A - clear to end of screen
-L0413    inc   <u0032,u
-         bsr   L03BA
-         lda   #$17
-         suba  <u0025,u
-         bls   L042A
-         pshs  a
-L0421    lbsr  L0314
-         dec   ,s
-         bne   L0421
-         leas  $01,s
-L042A    dec   <u0032,u
-         lbra  L014C
-
-* $0b - (cursor home)
-L0430    clr   <u0024,u
-         clr   <u0025,u
-         lbra  L02A6
-
-* $1b41xxyy - move cursor to col xx (0-50) row yy (0-23)
-L0439    ldb   <u001F,u
-         subb  #$02
-         bne   L0442
-         clrb  
-         rts   
-L0442    decb  
-         bne   L0450
-         cmpa  #51
-         bcs   L044B
-         lda   #50
-L044B    sta   <u0024,u
-L044D    clrb  
-         rts   
-L0450    cmpa  #24
-         bcs   L0456
-         lda   #23
-L0456    sta   <u0025,u
-L0459    lbra  L02A6
-
-* $1b43 - (cursor right)
-L045C    inc   <u0024,u
-         lda   <u0024,u
-         cmpa  #$33
-         bcs   L0459
-         clr   <u0024,u
-         lbra  L02AC
-
-* $1b46 - reverse on
-L046C    lda   #$FF
-         coma  
-L046F    sta   <u0038,u
-         lbra  L014C
-
-* $1b47 - reverse off
-L0475    lda   #$FF
-         bra   L046F
-
-* $1b48 - underline on
-L0479    lda   #$FF
-L047B    sta   <u0039,u
-         lbra  L014C
-
-* $1b49 - underline off
-L0481    clra  
-         bra   L047B
-L0484    ldd   <u0024,u
-         inc   <u0032,u
-         tst   <u0033,u
-         bne   L0494
-         std   <u0030,u
-         bra   L04B9
-L0494    pshs  b,a
-         ldd   <u0030,u
-         inc   <u0034,u
-         tstb  
-         bmi   L04AB
-         cmpb  #$18
-         bcc   L04AB
-         std   <u0024,u
-         lda   #$7F
-         lbsr  L01B3
-L04AB    puls  b,a
-         std   <u0024,u
-         std   <u0030,u
-         clr   <u0033,u
-         dec   <u0034,u
-L04B9    dec   <u0032,u
-         clrb  
-         rts   
-
-GetStat  cmpa  #$01
-         bne   L04D0
-         lda   <u001D,u
-         cmpa  <u001E,u
-         beq   L04CC
-L04CA    clrb  
-         rts   
-L04CC    comb  
-         ldb   #E$NotRdy
-         rts   
-L04D0    cmpa  #$06
-         beq   L04CA
-         cmpa  #$02
-         bne   SetStat
-         ldx   $06,y
-         ldd   <u0022,u
-         std   $04,x
-         clrb  
-         rts   
-
-SetStat  comb  
-         ldb   #E$UnkSvc
-         rts   
-
-L04E5    tst   <u0032,u
-         bne   L0512
-         dec   <u0037,u
-         bne   L0512
-         lda   #$10
-         sta   <u0037,u
-         inc   <u0034,u
-         ldd   <u0024,u
-         pshs  b,a
-         ldd   <u0030,u
-         std   <u0024,u
-         lda   #$7F
-         lbsr  L01B3
-         puls  b,a
-         std   <u0024,u
-         com   <u0033,u
-         dec   <u0034,u
-L0512    ldx   #$FF00
-         lda   #$FF
-         sta   $02,x
-         bsr   L053B
-         anda  #$03
-         bne   L0526
-         clra  
-         sta   $02,x		strobe all keys	
-         bsr   L053B		any keys pressed?
-         bne   L052D		yes, do scan
-L0526    clr   <u0027,u
-         clr   <u0028,u
-         rts   
-L052D    tst   <u0028,u
-         bne   L0541
-         sta   <u0028,u
-L0535    clrb  
-         rts   
-L0537    clrb  
-         stb   $02,x
-         rts   
-L053B    lda   ,x		read keyboard rows
-         coma  
-         anda  #$7F		mask off joystick row
-         rts   
-L0541    cmpa  <u0028,u
-         bne   L0526
-         clr   <u002A,u
-         clr   <u002B,u
-         clr   <u002C,u
-         clr   <u002D,u
-         clr   <u002E,u
-         ldb   #$01		start kbd scan with column#0
-L0557    comb  
-         stb   $02,x		strobe keyboard column
-         bsr   L053B		read keyboard rows
-         beq   L05A1		no keys seen, do next column
-         bita  #$40		is this a row 6 key?
-         beq   L0583
-         cmpb  #$7F		SHIFT key pressed?
-         bne   L056B
-         inc   <u002D,u		yes, flag SHIFT
-         bra   L057F
-L056B    cmpb  #$FD		CONTROL pressed? (CLEAR key)
-         bne   L0574
-         inc   <u002E,u		yes, flag CONTROL
-         bra   L057F
-L0574    tst   <u002C,u
-         bne   L0537
-         stb   <u002C,u
-         com   <u002C,u
-L057F    anda  #$3F
-         beq   L05A1
-L0583    pshs  b,a
-         clrb  
-L0586    lsra  
-         bcc   L058A
-         incb  
-L058A    tsta  
-         bne   L0586
-         cmpb  #$01
-         puls  b,a
-         bne   L0537
-         tst   <u002A,u
-         bne   L0537
-         sta   <u002A,u
-         stb   <u002B,u
-         com   <u002B,u
-L05A1    comb  
-         lslb  
-         bne   L0557
-         stb   $02,x
-         ldb   <u002C,u
-         beq   L05B5
-         tst   <u002A,u
-         bne   L0535
-         lda   #$40
-         bra   L05BF
-L05B5    ldb   <u002B,u
-         lda   <u002A,u
-         lbeq  L0526
-L05BF    pshs  b
-         tst   <u0027,u
-         beq   L05D0
-         dec   <u0027,u
-         beq   L05D4
-         puls  b
-         lbra  L0665
-L05D0    ldb   #$32
-         bra   L05D6
-L05D4    ldb   #$05
-L05D6    stb   <u0027,u
-         lbsr  L0667
-         lslb  
-         lslb  
-         lslb  
-         puls  a
-         pshs  b
-         lbsr  L0667
-         orb   ,s+
-         stb   <u0029,u
-         leax  >L0820,pcr	NORMAL keys
-         lda   b,x
-         tst   <u002E,u		CONTROL flag on?
-         beq   L05FE
-         leax  >L0886,pcr	CONTROL keys
-         lda   b,x
-         bra   L0609
-L05FE    tst   <u002D,u		SHIFT flag on?
-         beq   L0612
-         leax  >L0853,pcr	SHIFTED keys
-         lda   b,x
-L0609    cmpa  #$1F		SHIFTLOCK toggle key?
-         bne   L0621
-         com   <u002F,u
-         bra   L0665
-L0612    tst   <u002F,u		SHIFTLOCK flag on?
-         beq   L0621
-         cmpa  #$61		less than 'a ?
-         bcs   L0621
-         cmpa  #$7A		more than 'z ?
-         bhi   L0621
-         suba  #$20		only does lower->UPPER
-L0621    leax  <u003A,u
-         ldb   <u001E,u
-         sta   b,x
-         incb  
-         cmpb  #$64
-         bcs   L062F
-         clrb  
-L062F    cmpb  <u001D,u
-         bne   L0638
-         inc   u000E,u
-         bra   L063B
-L0638    stb   <u001E,u
-L063B    tsta  
-         beq   L065A
-         cmpa  u000D,u
-L0640    bne   L064A
-         ldx   u0009,u
-         beq   L065A
-L0646    sta   $08,x
-         bra   L065A
-L064A    ldb   #$03
-         cmpa  u000B,u
-         beq   L0656
-         ldb   #$02
-         cmpa  u000C,u
-         bne   L065A
-L0656    lda   u0003,u
-         bra   L065E
-L065A    ldb   #S$Wake
-         lda   u0005,u
-L065E    beq   L0663
-         os9   F$Send   
-L0663    clr   u0005,u
-L0665    clrb  
-         rts   
-L0667    clrb  
-L0668    incb  
-         lsra  
-         bne   L0668
-         decb  
-         rts   
-
-* control characters dispatch table
-L066E  fcb $07		BEL (beep)
-       fdb L0279-L066E	$FC0B
-       fcb $08		BS (left arrow)
-       fdb L0291-L066E	$FC23
-       fcb $0A		LF (down arrow)
-       fdb L02AC-L066E	$FC3E
-       fcb $0D		CR (return)
-       fdb L02BE-L066E	$FC50
-       fcb $0C		FF (clear screen)
-       fdb L02C3-L066E	$FC55
-       fcb $0B		(cursor home)
-       fdb L0430-L066E	$FDC2
-       fcb $00
-
-* escape sequences dispatch table
-L0681  fcb $41		cursor xy
-       fdb L0439-L066E	$FDCB
-       fcb $42		clear EOL
-       fdb L03AF-L066E	$FD41
-       fcb $43		cursor right
-       fdb L045C-L066E	$FDEE
-       fcb $44		cursor up
-       fdb L029B-L066E	$FC2D
-       fcb $45		cursor down
-       fdb L02AC-L066E	$FC3E
-       fcb $46		reverse on
-       fdb L046C-L066E	$FDFE
-       fcb $47		reverse off
-       fdb L0475-L066E	$FE07
-       fcb $48		underline on
-       fdb L0479-L066E	$FE0B
-       fcb $49		underline off
-       fdb L0481-L066E	$FE13
-       fcb $4A		clear EOS
-       fdb L0413-L066E	$FDA5
-       fcb $00
-
-L06A0
-* 4x8 bitmap table for characters $20-$7f
-* each nibble represents a row of 4 dots
-* chars 20-27
-	fcb $00,$00,$00,$00  ....  .@..  .@.@  .@@.  ..@.  @..@  .@..  .@..
-	fcb $44,$40,$40,$00  ....  .@..  .@.@  @@@@  .@@@  ...@  @.@.  .@..
-	fcb $55,$00,$00,$00  ....  .@..  ....  .@@.  @...  ..@.  .@..  ....
-	fcb $6F,$6F,$60,$00  ....  ....  ....  @@@@  .@@.  .@..  @.@.  ....
-	fcb $27,$86,$1E,$20  ....  .@..  ....  .@@.  ...@  @...  @@.@  ....
-	fcb $91,$24,$89,$00  ....  ....  ....  ....  @@@.  @..@  ....  ....
-	fcb $4A,$4A,$D0,$00  ....  ....  ....  ....  ..@.  ....  ....  ....
-	fcb $44,$00,$00,$00  ....  ....  ....  ....  ....  ....  ....  ....
-* chars 29-2f
-	fcb $24,$44,$20,$00  ..@.  .@..  @..@  .@..  ....  ....  ....  ....
-	fcb $42,$22,$40,$00  .@..  ..@.  .@@.  .@..  ....  ....  ....  ...@
-	fcb $96,$F6,$90,$00  .@..  ..@.  @@@@  @@@.  ....  @@@@  ....  ..@.
-	fcb $44,$E4,$40,$00  .@..  ..@.  .@@.  .@..  ..@.  ....  .@@.  .@..
-	fcb $00,$02,$24,$00  ..@.  .@..  @..@  .@..  ..@.  ....  .@@.  @...
-	fcb $00,$F0,$00,$00  ....  ....  ....  ....  .@..  ....  ....  ....
-	fcb $00,$06,$60,$00  ....  ....  ....  ....  ....  ....  ....  ....
-	fcb $01,$24,$80,$00  ....  ....  ....  ....  ....  ....  ....  ....
-* chars 30-37
-	fcb $69,$BD,$60,$00  .@@.  ..@.  .@@.  @@@.  ..@.  @@@@  .@@@  @@@@
-	fcb $26,$22,$70,$00  @..@  .@@.  @..@  ...@  .@@.  @...  @...  ...@
-	fcb $69,$2C,$F0,$00  @.@@  ..@.  ..@.  .@@.  @.@.  @@@.  @@@.  ..@.
-	fcb $E1,$61,$E0,$00  @@.@  ..@.  @@..  ...@  @@@@  ...@  @..@  .@..
-	fcb $26,$AF,$20,$00  .@@.  .@@@  @@@@  @@@.  ..@.  @@@.  .@@.  .@..
-	fcb $F8,$E1,$E0,$00  ....  ....  ....  ....  ....  ....  ....  ....
-	fcb $78,$E9,$60,$00  ....  ....  ....  ....  ....  ....  ....  ....
-	fcb $F1,$24,$40,$00  ....  ....  ....  ....  ....  ....  ....  ....
-* chars 38-3f
-	fcb $69,$69,$60,$00  .@@.  .@@.  ....  ....  ..@.  ....  .@..  .@@.
-	fcb $69,$71,$60,$00  @..@  @..@  ....  ....  .@..  @@@@  ..@.  @..@
-	fcb $00,$40,$40,$00  .@@.  .@@@  .@..  ..@.  @...  ....  ...@  ..@.
-	fcb $00,$20,$24,$00  @..@  ...@  ....  ....  .@..  @@@@  ..@.  ..@.
-	fcb $24,$84,$20,$00  .@@.  .@@.  .@..  ..@.  ..@.  ....  .@..  ....
-	fcb $0F,$0F,$00,$00  ....  ....  ....  .@..  ....  ....  ....  ..@.
-	fcb $42,$12,$40,$00  ....  ....  ....  ....  ....  ....  ....  ....
-	fcb $69,$22,$02,$00  ....  ....  ....  ....  ....  ....  ....  ....
-* chars 40-47
-	fcb $69,$BB,$87,$00  .@@.  .@@.  @@@.  .@@@  @@@.  @@@@  @@@@  .@@@
-	fcb $69,$F9,$90,$00  @..@  @..@  @..@  @...  @..@  @...  @...  @...
-	fcb $E9,$E9,$E0,$00  @.@@  @@@@  @@@.  @...  @..@  @@@.  @@@.  @.@@
-	fcb $78,$88,$70,$00  @.@@  @..@  @..@  @...  @..@  @...  @...  @..@
-	fcb $E9,$99,$E0,$00  @...  @..@  @@@.  .@@@  @@@.  @@@@  @...  .@@@
-	fcb $F8,$E8,$F0,$00  .@@@  ....  ....  ....  ....  ....  ....  ....
-	fcb $F8,$E8,$80,$00  ....  ....  ....  ....  ....  ....  ....  ....
-	fcb $78,$B9,$70,$00  ....  ....  ....  ....  ....  ....  ....  ....
-* chars 48-4f
-	fcb $99,$F9,$90,$00  @..@  @@@.  @@@@  @..@  @...  @@@@  @..@  .@@.
-	fcb $E4,$44,$E0,$00  @..@  .@..  ..@.  @.@.  @...  @@.@  @@.@  @..@
-	fcb $F2,$2A,$40,$00  @@@@  .@..  ..@.  @@..  @...  @@.@  @.@@  @..@
-	fcb $9A,$CA,$90,$00  @..@  .@..  @.@.  @.@.  @...  @..@  @..@  @..@
-	fcb $88,$88,$F0,$00  @..@  @@@.  .@..  @..@  @@@@  @..@  @..@  .@@.
-	fcb $FD,$D9,$90,$00  ....  ....  ....  ....  ....  ....  ....  ....
-	fcb $9D,$B9,$90,$00  ....  ....  ....  ....  ....  ....  ....  ....
-	fcb $69,$99,$60,$00  ....  ....  ....  ....  ....  ....  ....  ....
-* chars 50-57
-	fcb $E9,$E8,$80,$00  @@@.  .@@.  @@@.  .@@@  @@@.  @..@  @..@  @..@
-	fcb $69,$9B,$70,$00  @..@  @..@  @..@  @...  .@..  @..@  @..@  @..@
-	fcb $E9,$EA,$90,$00  @@@.  @..@  @@@.  .@@.  .@..  @..@  @..@  @@.@
-	fcb $78,$61,$E0,$00  @...  @.@@  @.@.  ...@  .@..  @..@  .@@.  @@.@
-	fcb $E4,$44,$40,$00  @...  .@@@  @..@  @@@.  .@..  .@@.  .@@.  @@@@
-	fcb $99,$99,$60,$00  ....  ....  ....  ....  ....  ....  ....  ....
-	fcb $99,$96,$60,$00  ....  ....  ....  ....  ....  ....  ....  ....
-	fcb $99,$DD,$F0,$00  ....  ....  ....  ....  ....  ....  ....  ....
-* chars 58-5f
-	fcb $99,$69,$90,$00  @..@  @..@  @@@@  @@@.  ....  .@@@  .@@.  ....
-	fcb $99,$71,$E0,$00  @..@  @..@  ...@  @...  @...  ...@  @..@  ....
-	fcb $F1,$68,$F0,$00  .@@.  .@@@  .@@.  @...  .@..  ...@  ....  ....
-	fcb $E8,$88,$E0,$00  @..@  ...@  @...  @...  ..@.  ...@  ....  ....
-	fcb $08,$42,$10,$00  @..@  @@@.  @@@@  @@@.  ...@  .@@@  ....  ....
-	fcb $71,$11,$70,$00  ....  ....  ....  ....  ....  ....  ....  @@@@
-	fcb $69,$00,$00,$00  ....  ....  ....  ....  ....  ....  ....  ....
-	fcb $00,$00,$0F,$00  ....  ....  ....  ....  ....  ....  ....  ....
-* chars 60-67
-	fcb $22,$00,$00,$00  ..@.  ....  @...  ....  ...@  ....  ..@@  ....
-	fcb $07,$99,$70,$00  ..@.  .@@@  @@@.  .@@@  .@@@  .@@@  .@..  .@@.
-	fcb $8E,$99,$E0,$00  ....  @..@  @..@  @...  @..@  @.@.  @@@@  @..@
-	fcb $07,$88,$70,$00  ....  @..@  @..@  @...  @..@  @@..  .@..  @..@
-	fcb $17,$99,$70,$00  ....  .@@@  @@@.  .@@@  .@@@  .@@@  .@..  .@@@
-	fcb $07,$AC,$70,$00  ....  ....  ....  ....  ....  ....  ....  ...@
-	fcb $34,$F4,$40,$00  ....  ....  ....  ....  ....  ....  ....  @@@.
-	fcb $06,$99,$71,$E0  ....  ....  ....  ....  ....  ....  ....  ....
-* chars 68-6f
-	fcb $8E,$99,$90,$00  @...  .@..  ..@.  @...  .@..  ....  ....  ....
-	fcb $40,$44,$40,$00  @@@.  ....  ....  @.@.  .@..  .@@@  .@@@  .@@.
-	fcb $20,$22,$22,$C0  @..@  .@..  ..@.  @@..  .@..  @@.@  @..@  @..@
-	fcb $8A,$CA,$90,$00  @..@  .@..  ..@.  @.@.  .@..  @@.@  @..@  @..@
-	fcb $44,$44,$40,$00  @..@  .@..  ..@.  @..@  .@..  @..@  @..@  .@@.
-	fcb $0E,$DD,$90,$00  ....  ....  ..@.  ....  ....  ....  ....  ....
-	fcb $0E,$99,$90,$00  ....  ....  @@..  ....  ....  ....  ....  ....
-	fcb $06,$99,$60,$00  ....  ....  ....  ....  ....  ....  ....  ....
-* chars 70-77
-	fcb $0E,$99,$E8,$80  ....  ....  ....  ....  .@..  ....  ....  ....
-	fcb $07,$99,$71,$10  @@@.  .@@@  .@@@  .@@@  @@@@  @..@  @..@  @..@
-	fcb $07,$88,$80,$00  @..@  @..@  @...  @@..  .@..  @..@  @..@  @@.@
-	fcb $07,$C3,$E0,$00  @..@  @..@  @...  ..@@  .@..  @..@  .@@.  @@.@
-	fcb $4F,$44,$30,$00  @@@.  .@@@  @...  @@@.  ..@@  .@@@  .@@.  .@@.
-	fcb $09,$99,$70,$00  @...  ...@  ....  ....  ....  ....  ....  ....
-	fcb $09,$96,$60,$00  @...  ...@  ....  ....  ....  ....  ....  ....
-	fcb $09,$DD,$60,$00  ....  ....  ....  ....  ....  ....  ....  ....
-* chars 78-7f
-	fcb $09,$66,$90,$00  ....  ....  ....  ..@@  .@..  @@..  ....  @@@@
-	fcb $09,$99,$71,$E0  @..@  @..@  @@@@  .@..  .@..  ..@.  .@.@  @@@@
-	fcb $0F,$24,$F0,$00  .@@.  @..@  ..@.  @@..  ....  ..@@  @.@.  @@@@
-	fcb $34,$C4,$30,$00  .@@.  @..@  .@..  .@..  .@..  ..@.  ....  @@@@
-	fcb $44,$04,$40,$00  @..@  .@@@  @@@@  ..@@  .@..  @@..  ....  @@@@
-	fcb $C2,$32,$C0,$00  ....  ...@  ....  ....  ....  ....  ....  @@@@
-	fcb $05,$A0,$00,$00  ....  @@@.  ....  ....  ....  ....  ....  @@@@
-	fcb $FF,$FF,$FF,$F0  ....  ....  ....  ....  ....  ....  ....  ....
-
-* NOTE: these tables and the keyboard matrix are in DRAGON column order!
-* UNSHIFTED keytable
-L0820	fcb $30,$31,$32,$33	0 1 2 3
-	fcb $34,$35,$36,$37	4 5 6 7
-	fcb $38,$39,$3A,$3B	8 9 : ;
-	fcb $2C,$2D,$2E,$2F	, - . /
-	fcb $40,$61,$62,$63	@ a b c
-	fcb $64,$65,$66,$67	d e f g
-	fcb $68,$69,$6A,$6B	h i j k
-	fcb $6C,$6D,$6E,$6F	l m n o
-	fcb $70,$71,$72,$73	p q r s
-	fcb $74,$75,$76,$77	t u v w
-	fcb $78,$79,$7A,$0C	x y z up
-	fcb $0A,$08,$09,$20	down left right space
-	fcb $0D,$00,$05		ENTER CLEAR BREAK
-
-* SHIFTED keytable
-L0853	fcb $30,$21,$22,$23	0 ! " #
-	fcb $24,$25,$26,$27	$ % & '
-	fcb $28,$29,$2A,$2B	( ) * +
-	fcb $3C,$3D,$3E,$3F	< = > ?
-	fcb $7C,$41,$42,$43	| A B C
-	fcb $44,$45,$46,$47	D E F G
-	fcb $48,$49,$4A,$4B	H I J K
-	fcb $4C,$4D,$4E,$4F	L M N O
-	fcb $50,$51,$52,$53	P Q R S
-	fcb $54,$55,$56,$57	T U V W
-	fcb $58,$59,$5A,$1C	X Y Z fs
-	fcb $1A,$18,$19,$20	sub can em space
-	fcb $0D,$00,$03		ENTER CLEAR shft-BREAK
-
-* CONTROL keytable
-L0886	fcb $1F,$7C,$00,$7E	shift-toggle | nul ~
-	fcb $00,$00,$00,$5E	nul nul nul ^
-	fcb $5B,$5D,$00,$00	[ ] nul nul
-	fcb $7B,$5F,$7D,$5C	{ _ } \
-	fcb $00,$01,$02,$03	^@ ^A ^B ^C
-	fcb $04,$05,$06,$07	^D ^E ^F ^G
-	fcb $08,$09,$0A,$0B	^H ^I ^J ^K
-	fcb $0C,$0D,$0E,$0F	^L ^M ^N ^O
-	fcb $10,$11,$12,$13	^P ^Q ^R ^S
-	fcb $14,$15,$16,$17	^T ^U ^V ^W
-	fcb $18,$19,$1A,$13	^X ^Y ^Z dc3
-	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
--- a/level1/modules/kbvdio.asm	Mon Apr 11 23:33:58 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1255 +0,0 @@
-********************************************************************
-* KBVDIO - keyboard/video driver
-*
-* $Id$
-*
-* Edt/Rev  YYYY/MM/DD  Modified by
-* Comment
-* ------------------------------------------------------------------
-*          ????/??/??
-* Original Dragon Data distribution version
-*
-*          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
-
-* Disassembled 02/04/21 22:37:57 by Disasm v1.6 (C) 1988 by RML
-
-         ifp1
-         use   defsfile.dragon
-         endc
-
-tylg     set   Drivr+Objct   
-atrv     set   ReEnt+rev
-rev      set   $00
-edition  set   4
-
-         mod   eom,name,tylg,atrv,start,size
-
-u0000    rmb   2
-u0002    rmb   1
-u0003    rmb   1
-u0004    rmb   1
-u0005    rmb   4
-u0009    rmb   2
-u000B    rmb   1
-u000C    rmb   1
-u000D    rmb   11
-u0018    rmb   1
-u0019    rmb   1
-u001A    rmb   1
-u001B    rmb   1
-u001C    rmb   1
-u001D    rmb   2
-u001F    rmb   2
-u0021    rmb   1
-u0022    rmb   1
-u0023    rmb   1
-u0024    rmb   1
-u0025    rmb   1
-u0026    rmb   2
-u0028    rmb   1
-u0029    rmb   2
-u002B    rmb   1
-u002C    rmb   1
-u002D    rmb   2
-u002F    rmb   1
-u0030    rmb   1
-u0031    rmb   2
-u0033    rmb   1
-u0034    rmb   1
-u0035    rmb   1
-u0036    rmb   1
-u0037    rmb   1
-u0038    rmb   1
-u0039    rmb   1
-u003A    rmb   1
-vhwaddr  rmb   2		address of keyboard hardware
-u003D    rmb   1		SHIFTLOCK toggle
-u003E    rmb   1
-u003F    rmb   1
-u0040    rmb   1
-u0041    rmb   1
-u0042    rmb   1
-u0043    rmb   1
-u0044    rmb   1
-u0045    rmb   1		SHIFT key flag
-u0046    rmb   1		CONTROL key flag
-u0047    rmb   1
-u0048    rmb   1
-u0049    rmb   1
-u004A    rmb   1
-u004B    rmb   10
-u0055    rmb   26
-u006F    rmb   91
-size     equ   .
-         fcb   $07 
-
-name     fcs   /KBVDIO/
-         fcb   edition
-
-start    lbra  Init
-         lbra  Read
-         lbra  Write
-         lbra  GetStat
-         lbra  SetStat
-         lbra  Term
-
-Init     lbsr  AllocMem		allocate video memory
-         lbra  L002D		unsure why this is here.. timing?
-L002D    pshs  cc		save CC
-         orcc  #IRQMask		mask IRQs
-         stu   >D.KbdSta	save our static mem
-         ldd   >D.IRQ		get current IRQ vector address
-         std   >D.AltIRQ	store in Alt. IRQ vector
-         leax  >OurIRQ,pcr	point to our IRQ address
-         stx   >D.IRQ		store in D.IRQ
-         ldx   #$FF00		get address of PIA
-         stx   <vhwaddr,u	store in statics for IRQ routine
-         clra  
-         clrb  
-         std   <u0048,u
-         sta   $01,x		clear $FF01
-         sta   ,x		clear $FF00
-         sta   $03,x		clear $FF03
-         comb  			B = $FF now
-         stb   <u003D,u
-         stb   $02,x		put $FF in $FF02
-         stb   <u003F,u
-         stb   <u0040,u
-         stb   <u0041,u
-         lda   #$34
-         sta   $01,x		put $34 in $FF01
-         lda   #$3F
-         sta   $03,x		put $3F in $FF03
-         lda   $02,x		get byte at $FF02
-         puls  pc,cc		get CC and return
-         ldb   #E$Write
-         orcc  #Carry		set carry
-         rts   			and return
-
-GetStat  cmpa  #SS.Ready	SS.Ready call?
-         bne   L0082		branch if not
-         lda   <u0049,u
-         suba  <u0048,u
-         bne   GSOk
-         ldb   #E$NotRdy
-         bra   L009A
-L0082    cmpa  #SS.EOF		End of file?
-         beq   GSOk		branch if so
-         cmpa  #SS.DStat
-         lbeq  L04E4
-         cmpa  #SS.Joy		joystick value acquisition?
-         lbeq  L085F
-         cmpa  #SS.AlfaS	Alfa display status?
-         lbeq  L04CD		branch if so
-
-SetStat  ldb   #E$UnkSvc
-L009A    orcc  #Carry
-         rts   
-
-Term     pshs  cc		save CC
-         orcc  #IRQMask		mask IRQs
-         ldx   >D.AltIRQ	get Alt. IRQ address
-         stx   >D.IRQ		and restore it to D.IRQ
-         puls  pc,cc		get CC and return
-
-L00A9    incb  
-         cmpb  #$7F
-         bls   L00AF
-GSOk     clrb  
-L00AF    rts   
-
-* Driver's IRQ Routine
-OurIRQ   ldu   >D.KbdSta	get pointer to driver's statics
-         ldx   <vhwaddr,u	get keyboard hardware address
-         lda   $03,x		get byte
-         bmi   L00BE		branch if hi bit set
-         jmp   [>D.SvcIRQ]	else jump on
-L00BE    lda   $02,x
-         lda   #$FF
-         sta   $02,x
-         lda   ,x
-         coma  
-         anda  #$03
-         bne   L00D4
-         clr   $02,x
-         lda   ,x
-         coma  
-         anda  #$7F
-         bne   L00F1
-L00D4    clra  
-         coma  
-         sta   <u003F,u
-         sta   <u0040,u
-         sta   <u0041,u
-L00DF
-		 lda   >D.DskTmr
-         beq   L00ED
-         deca  
-         sta   >D.DskTmr
-         bne   L00ED
-
-		 IFNE	DragonAlpha		; Turn off all drives
-		 lbsr	AlphaDskCtl
-		 ELSE
-         sta   >DskCtl
-		 ENDC
-
-;		 sta   >$FF48
-L00ED    jmp   [>D.AltIRQ]
-L00F1    bsr   L013F
-         bmi   L00DF
-         sta   <u0047,u
-         cmpa  #$1F		control-zero?
-         bne   L0101
-         com   <u003D,u		yes, toggle SHIFTLOCK
-         bra   L00DF
-L0101    ldb   <u0048,u
-         leax  <u004A,u
-         abx   
-         bsr   L00A9
-         cmpb  <u0049,u
-         beq   L0112
-         stb   <u0048,u
-L0112    sta   ,x
-         beq   L0132
-         cmpa  u000D,u
-         bne   L0122
-         ldx   u0009,u
-         beq   L0132
-         sta   $08,x
-         bra   L0132
-L0122    ldb   #$03
-         cmpa  u000B,u
-         beq   L012E
-         ldb   #$02
-         cmpa  u000C,u
-         bne   L0132
-L012E    lda   u0003,u
-         bra   L0136
-L0132    ldb   #S$Wake
-         lda   V.WAKE,u
-L0136    beq   L013B
-         os9   F$Send   	send signal to process
-L013B    clr   V.WAKE,u
-         bra   L00DF
-
-L013F    clra  
-         sta   <u003E,u
-         sta   <u0045,u
-         sta   <u0046,u
-         coma  
-         sta   <u0042,u
-         sta   <u0043,u
-         sta   <u0044,u
-         deca  
-         sta   $02,x		strobe column #0 ($FF02)
-L0156    lda   ,x		read row register ($FF00)
-         coma  			flip bits to active-high
-         anda  #$7F		mask off joystick row
-         beq   L0169		no keypress in this column
-         ldb   #$FF
-L015F    incb  
-         lsra  
-         bcc   L0165		no key in this row, move along
-         bsr   L01AF		keypress detected, process row & col
-L0165    cmpb  #$06		final row checked?
-         bcs   L015F
-L0169    inc   <u003E,u		bump column counter
-         orcc  #Carry
-         rol   $02,x		strobe next column
-         bcs   L0156
-         lbsr  L01F8
-         bmi   L01AE
-         suba  #$1B
-         bcc   L0191		not an alpha key
-         adda  #$1B
-         ldb   <u0046,u		control key pressed?
-         bne   L0190		yes, return CTRL code
-         adda  #$40		no, convert to ASCII
-         ldb   <u0045,u		shift key pressed?
-         eorb  <u003D,u
-         andb  #$01
-         bne   L0190
-         adda  #$20
-L0190    rts   
-L0191    ldb   #3		three values per key
-         mul   
-         lda   <u0045,u		shift key pressed?
-         beq   L019C
-         incb  			yes, use 2nd value
-         bra   L01A3
-L019C    lda   <u0046,u		control key pressed?
-         beq   L01A3
-         addb  #$02		yes, use 3rd value
-L01A3    pshs  x
-         leax  >L023E,pcr
-         clra  
-         lda   d,x
-         puls  x
-L01AE    rts   
-
-* convert row number in B.reg from DRAGON to COCO order
-L01AF    pshs  b
-         cmpb  #$06
-         beq   L01BF
-         cmpb  #$01
-         bhi   L01BD
-         addb  #$04
-         bra   L01BF
-L01BD    subb  #$02
-L01BF    lslb  			multiply row * 8
-         lslb  
-         lslb  
-         addb  <u003E,u		add column.  B.reg now = keycode ($00-$37)
-         cmpb  #$31		is this the CLEAR key?
-         bne   L01CE
-         inc   <u0046,u		yes, set control pressed flag
-         puls  pc,b
-L01CE    cmpb  #$37		is this a SHIFT key?
-         bne   L01D7
-         com   <u0045,u		yes, set shift pressed flag
-         puls  pc,b
-L01D7    pshs  x
-         leax  <u0042,u
-         bsr   L01E2
-         puls  x
-         puls  pc,b
-L01E2    pshs  a
-         lda   ,x
-         bpl   L01EC
-         stb   ,x
-         puls  pc,a
-L01EC    lda   $01,x
-         bpl   L01F4
-         stb   $01,x
-         puls  pc,a
-L01F4    stb   $02,x
-         puls  pc,a
-L01F8    pshs  y,x,b
-         leax  <u003F,u
-         ldb   #$03
-         pshs  b
-L0201    leay  <u0042,u
-         ldb   #$03
-         lda   ,x
-         bmi   L021D
-L020A    cmpa  ,y
-         bne   L0214
-         clr   ,y
-         com   ,y
-         bra   L021D
-L0214    leay  $01,y
-         decb  
-         bne   L020A
-         lda   #$FF
-         sta   ,x
-L021D    leax  $01,x
-         dec   ,s
-         bne   L0201
-         leas  $01,s
-         leax  <u0042,u
-         lda   #$03
-L022A    ldb   ,x+
-         bpl   L0235
-         deca  
-         bne   L022A
-         orcc  #Negative
-         puls  pc,y,x,b
-
-L0235    leax  <u003F,u
-         bsr   L01E2
-         tfr   b,a
-         puls  pc,y,x,b
-
-*RVH: the following is a non-alpha key lookup table with
-*normal/shift/control codes for each key (1D,1E,7F missing)
-L023E    fcb   $0C,$1C,$13	UP-ARROW (FF| FS|DC3)
-L0241    fcb   $0A,$1A,$12	DN-ARROW (LF|SUB|DC2)
-L0244    fcb   $08,$18,$10	LF-ARROW (BS|CAN|DLE)
-L0247    fcb   $09,$19,$11	RT-ARROW (HT| EM|DC1)
-L024A    fcb   $20,$20,$20	SPACEBAR
-L024D    fcb   $30,$30,$1F	0 0 . (1F=shiftlock toggle)
-L0250    fcb   $31,$21,$7C	1 ! |
-L0253    fcb   $32,$22,$00	2 " null
-L0256    fcb   $33,$23,$7E	3 # ~
-L0259    fcb   $34,$24,$00	4 $ null
-L025C    fcb   $35,$25,$00	5 % null
-L025F    fcb   $36,$26,$00	6 & null
-L0262    fcb   $37,$27,$5E	7 ' ^
-L0265    fcb   $38,$28,$5B	8 ( [
-L0268    fcb   $39,$29,$5D	9 ) ]
-L026B    fcb   $3A,$2A,$00	: * null
-L026E    fcb   $3B,$2B,$00	; + null
-L0271    fcb   $2C,$3C,$7B	, < {
-L0274    fcb   $2D,$3D,$5F	- = _
-L0277    fcb   $2E,$3E,$7D	. > }
-L027A    fcb   $2F,$3F,$5C	/ ? \
-L027D    fcb   $0D,$0D,$0D	ENTER
-L0280    fcb   $00,$00,$00	CLEAR?
-L0283    fcb   $05,$03,$1B	BREAK  (ENQ|ETX|ESC)
-
-Read     leax  <u004A,u
-         ldb   <u0049,u
-         orcc  #IRQMask
-         cmpb  <u0048,u
-         beq   L029F
-         abx   
-         lda   ,x
-         lbsr  L00A9
-         stb   <u0049,u
-         andcc #^(IRQMask+Carry)
-         rts   
-
-L029F    lda   V.BUSY,u
-         sta   V.WAKE,u
-         andcc #^IRQMask
-         ldx   #$0000
-         os9   F$Sleep  
-         clr   V.WAKE,u
-         ldx   <u004B
-L02AF    ldb   <$36,x
-         beq   Read
-         cmpb  #$04
-L02B6    bcc   Read
-         coma  
-         rts   
-
-* Allocate video memory on a 512 byte boundary
-AllocMem pshs  y,x
-         clr   <u0025,u
-         clr   <u002C,u
-L02C2    pshs  u		save static mem pointer
-         ldd   #768
-L02C7    os9   F$SRqMem		get 768 bytes
-         tfr   u,d		put pointer into D
-         tfr   u,x		and X
-         bita  #$01		odd or even page?
-         beq   L02D8		branch if even
-         leax  >256,x		else memory not on 512 byte boundary
-L02D6    bra   L02DC
-L02D8    leau  >512,u		free last page
-L02DC    ldd   #256		get page amount
-         os9   F$SRtMem 	and return page to system
-         puls  u		get static mem pointer
-         stx   <u001D,u		save pointer to page
-         clra  
-         clrb  
-         bsr   L0303
-         stx   <u0021,u
-         leax  >512,x
-         stx   <u001F,u
-         lbsr  L0459		clear screen
-         lda   #$60
-         sta   <u0023,u
-         sta   <u002B,u
-         clrb  
-         puls  pc,y,x
-
-L0303    pshs  x,a
-         lda   >$FF22
-         anda  #$07
-         ora   ,s+
-         sta   >$FF22
-         tstb  
-         bne   L0320
-         stb   >$FFC0
-         stb   >$FFC2
-         stb   >$FFC4
-         lda   <u001D,u
-         bra   L032C
-L0320    stb   >$FFC0
-         stb   >$FFC3
-         stb   >$FFC5
-         lda   <u002D,u
-L032C    ldb   #$07
-         ldx   #$FFC6
-         lsra  
-L0332    lsra  
-         bcs   L033B
-         sta   ,x+
-         leax  $01,x
-         bra   L033F
-L033B    leax  $01,x
-         sta   ,x+
-L033F    decb  
-         bne   L0332
-         clrb  
-         puls  pc,x
-
-Write    ldb   <u0025,u
-         bne   L0387
-         tsta  
-         bmi   L0371
-         cmpa  #$1F
-         bls   L03BC
-         cmpa  #$7C
-         bne   L0359
-         lda   #$61
-         bra   L0371
-L0359    cmpa  #$7E
-         bne   L0361
-         lda   #$6D
-         bra   L0371
-L0361    cmpa  #$60
-         bcs   L036B
-         suba  #$20
-         ora   #$40
-         bra   L0371
-L036B    cmpa  #$40
-         bcs   L0371
-         suba  #$40
-L0371    ldx   <u0021,u
-         eora  #$40
-         sta   ,x+
-         stx   <u0021,u
-         cmpx  <u001F,u
-         bcs   L0382
-         bsr   L039C
-L0382    lbsr  L0415
-         clrb  
-         rts   
-L0387    cmpb  #$01
-         beq   L0394
-         clr   <u0025,u
-         sta   <u0029,u
-         jmp   [<u0026,u]
-L0394    sta   <u0028,u
-         inc   <u0025,u
-* no operation entry point
-L039A    clrb  
-         rts   
-L039C    ldx   <u001D,u
-         leax  <$20,x
-L03A2    ldd   ,x++
-         std   <-$22,x
-         cmpx  <u001F,u
-         bcs   L03A2
-         leax  <-$20,x
-         stx   <u0021,u
-         lda   #$20
-         ldb   #$60
-L03B6    stb   ,x+
-         deca  
-         bne   L03B6
-L03BB    rts   
-L03BC    cmpa  #27
-         bcc   L03BB
-         cmpa  #$10
-         bcs   L03CE
-         ldb   <u002C,u
-         bne   L03CE
-         ldb   #E$NotRdy
-         orcc  #Carry
-         rts   
-
-L03CE    leax  <L03D6,pcr
-         lsla  
-         ldd   a,x
-         jmp   d,x
-
-* dispatch table for display function codes
-L03D6    fdb   L039A-L03D6	$FFC4	00: no-op
-         fdb   L0467-L03D6	$0091	01: home cursor
-         fdb   L047B-L03D6	$00A5	02: cursor xy
-         fdb   L04A6-L03D6	$00D0	03: erase line
-         fdb   L039A-L03D6	$FFC4	04: no-op
-         fdb   L039A-L03D6	$FFC4	05: no-op
-         fdb   L044B-L03D6	$0075	06: cursor right
-         fdb   L039A-L03D6	$FFC4	07: no-op
-         fdb   L043D-L03D6	$0067	08: cursor left
-         fdb   L04B8-L03D6	$00E2	09: cursor up
-         fdb   L0424-L03D6	$004E	0A: cursor down
-         fdb   L039A-L03D6	$FFC4	0B: no-op
-         fdb   L0459-L03D6	$0083	0C: clear screen
-         fdb   L040C-L03D6	$0036	0D: return cursor to start of line
-         fdb   L04C8-L03D6	$00F2	0E: display alpha
-         fdb   L0520-L03D6	$014A	0F: display graphics
-         fdb   L0604-L03D6	$022E	10: preset screen to specific color
-         fdb   L05DF-L03D6	$0209	11: set color
-         fdb   L05F3-L03D6	$021D	12: end graphics
-         fdb   L0624-L03D6	$024E	13: erase graphics
-         fdb   L062F-L03D6	$0259	14: home graphics cursor
-         fdb   L0648-L03D6	$0272	15: Set Graphics Cursor 
-         fdb   L06B5-L03D6	$02DF	16: Draw Line 
-         fdb   L06B0-L03D6	$02DA	17: Erase Line 
-         fdb   L065F-L03D6	$0289	18: Set Point 
-         fdb   L065A-L03D6	$0284	19: Erase Point 
-         fdb   L077E-L03D6	$03A8	1A: Draw Circle 
-
-* $0D - return cursor to start of line (carriage return)
-L040C    bsr   L0472
-         tfr   x,d
-         andb  #$E0
-         stb   <u0022,u
-L0415    ldx   <u0021,u
-         lda   ,x
-         sta   <u0023,u
-         lda   #$20
-         sta   ,x
-         andcc #^Carry
-         rts   
-
-* $0A - cursor down
-L0424    bsr   L0472
-         leax  <$20,x
-         cmpx  <u001F,u
-         bcs   L0438
-         leax  <-$20,x
-         pshs  x
-         lbsr  L039C
-         puls  x
-L0438    stx   <u0021,u
-         bra   L0415
-
-* $08 - cursor left
-L043D    bsr   L0472
-         cmpx  <u001D,u
-         bls   L0449
-         leax  -$01,x
-         stx   <u0021,u
-L0449    bra   L0415
-
-* $06 - cursor right
-L044B    bsr   L0472
-         leax  $01,x
-         cmpx  <u001F,u
-         bcc   L0457
-         stx   <u0021,u
-L0457    bra   L0415
-
-* $0C - clear screen
-L0459    bsr   L0467
-         lda   #$60
-L045D    sta   ,x+
-         cmpx  <u001F,u
-         bcs   L045D
-         lbra  L0415
-
-* $01 - home cursor
-L0467    bsr   L0472
-         ldx   <u001D,u
-         stx   <u0021,u
-         lbra  L0415
-L0472    ldx   <u0021,u
-         lda   <u0023,u
-         sta   ,x
-         rts   
-
-* $02 XX YY - cursor xy (move cursor to XX-32,YY-32)
-L047B    leax  <L0481,pcr
-         lbra  L064B
-L0481    bsr   L0472
-         ldb   <u0029,u
-         subb  #$20
-         lda   #$20
-         mul   
-         addb  <u0028,u
-         adca  #$00
-         subd  #$0020
-         addd  <u001D,u
-         cmpd  <u001F,u
-         bcc   L04A3
-         std   <u0021,u
-         lbsr  L0415
-         clrb  
-L04A3    lbra  L0415
-
-* $03 - erase line
-L04A6    lbsr  L040C		do a CR
-         ldb   #$20		32 chars per line
-         lda   #$60		space char for VDG screen
-         ldx   <u0021,u
-L04B0    sta   ,x+		fill screen line with 'space'
-         decb  
-         bne   L04B0
-         lbra  L0415
-
-* $09 - cursor up
-L04B8    bsr   L0472
-         leax  <-$20,x
-         cmpx  <u001D,u
-         bcs   L04C5
-         stx   <u0021,u
-L04C5    lbra  L0415
-
-* $0E - display alpha
-L04C8    clra  
-         clrb  
-         lbra  L0303
-L04CD    ldx   $06,y
-         ldd   <u001D,u
-         std   $04,x
-         ldd   <u0021,u
-         std   $06,x
-         ldb   <u003D,u
-         stb   $01,x
-         clrb  
-         rts   
-
-* 4-color mode color table
-L04E0    fcb   $00,$55,$AA,$FF
-
-L04E4    lda   <u002C,u	
-         bne   L04EE	
-L04E9    ldb   #E$NotRdy
-         orcc  #Carry
-         rts   
-
-L04EE    ldd   <u0034,u
-         lbsr  L0684
-         tfr   a,b
-         andb  ,x
-L04F8    bita  #$01
-         bne   L0507
-         lsra  
-         lsrb  
-         tst   <u0024,u
-         bmi   L04F8
-         lsra  
-         lsrb  
-         bra   L04F8
-L0507    pshs  b
-         ldb   <u003A,u
-         andb  #$FC
-L050E    orb   ,s+
-         ldx   $06,y
-         stb   $01,x
-         ldd   <u0034,u
-         std   $06,x
-         ldd   <u002D,u
-         std   $04,x
-         clrb  
-         rts   
-
-* $0F - display graphics
-L0520    leax  <L0526,pcr
-         lbra  L064B
-L0526    ldb   <u002C,u
-         bne   L0566
-         pshs  u
-         ldd   #$1900
-         os9   F$SRqMem 
-         tfr   u,d
-         puls  u
-         bcs   L0585
-         tfr   a,b
-         bita  #$01
-         beq   L0543
-         adda  #$01
-         bra   L0545
-L0543    addb  #$18
-L0545    pshs  u,a
-         tfr   b,a
-         clrb  
-         tfr   d,u
-         ldd   #$0100
-         os9   F$SRtMem 
-         puls  u,a
-         bcs   L0585
-         clrb  
-         std   <u002D,u
-         addd  #$1800
-         std   <u002F,u
-         inc   <u002C,u
-         lbsr  L0624
-L0566    lda   <u0029,u
-         sta   <u003A,u
-         anda  #$03
-         leax  >L04E0,pcr
-         lda   a,x
-         sta   <u0036,u
-         sta   <u0037,u
-         lda   <u0028,u
-         cmpa  #$01
-         bls   L0586
-         ldb   #E$BMode		illegal mode
-         orcc  #Carry
-L0585    rts   
-
-L0586    tsta  
-         beq   L05A6
-         ldd   #$C003
-         std   <u0038,u
-         lda   #$01
-         sta   <u0024,u
-         lda   #$E0
-         ldb   <u0029,u
-         andb  #$08
-         beq   L059F
-         lda   #$F0
-L059F    ldb   #$03
-         leax  <L05D3,pcr
-         bra   L05BE
-L05A6    ldd   #$8001
-         std   <u0038,u
-         lda   #$FF
-         sta   <u0036,u
-         sta   <u0037,u
-         sta   <u0024,u
-         lda   #$F0
-         ldb   #$07
-         leax  <L05D7,pcr
-L05BE    stb   <u0033,u
-         stx   <u0031,u
-         ldb   <u0029,u
-         andb  #$04
-         lslb  
-         pshs  b
-         ora   ,s+
-         ldb   #$01
-         lbra  L0303
-
-* 4-color mode pixel masks
-L05D3    fcb   $C0,$30,$0C,$03
-
-* 2-color mode pixel masks
-L05D7    fcb   $80,$40,$20,$10,$08,$04,$02,$01
-
-* $11 - set color
-L05DF    leax  <L05E5,pcr
-         lbra  L0781
-L05E5    clr   <u0028,u
-         lda   <u0024,u
-         bmi   L05F0
-         inc   <u0028,u
-L05F0    lbra  L0566
-
-* $12 - end graphics
-L05F3    pshs  u
-         ldu   <u002D,u
-         ldd   #6144		size of graphics screen
-         os9   F$SRtMem 
-         puls  u
-         clr   <u002C,u
-         rts   
-
-* $10 - preset screen to specified color
-L0604    leax  <L060A,pcr
-         lbra  L0781
-L060A    lda   <u0029,u
-         tst   <u0024,u
-         bpl   L061A
-         ldb   #$FF
-         anda  #$01
-         beq   L0624
-         bra   L0625
-L061A    anda  #$03
-         leax  >L04E0,pcr
-         ldb   a,x
-         bra   L0625
-
-* $13 - erase graphics
-L0624    clrb  
-L0625    ldx   <u002D,u
-L0628    stb   ,x+
-         cmpx  <u002F,u
-         bcs   L0628
-
-* $14 - home graphics cursor
-L062F    clra  
-         clrb  
-         std   <u0034,u
-         rts   
-L0635    ldd   <u0028,u
-         cmpb  #192
-         bcs   L063E
-         ldb   #192-1
-L063E    tst   <u0024,u
-         bmi   L0644
-         lsra  
-L0644    std   <u0028,u
-         rts   
-
-* $15 - set graphics cursor
-L0648    leax  <L0653,pcr
-L064B    stx   <u0026,u
-         inc   <u0025,u
-         clrb  
-         rts   
-L0653    bsr   L0635
-         std   <u0034,u
-         clrb  
-         rts   
-
-* $19 - erase point
-L065A    clr   <u0036,u
-         bra   L065F
-
-* $18 - set point
-L065F    leax  <L0664,pcr
-         bra   L064B
-L0664    bsr   L0635
-         std   <u0034,u
-         bsr   L0673
-         lda   <u0037,u
-         sta   <u0036,u
-         clrb  
-         rts   
-L0673    bsr   L0684
-         tfr   a,b
-         comb  
-         andb  ,x
-         stb   ,x
-         anda  <u0036,u
-         ora   ,x
-         sta   ,x
-         rts   
-L0684    pshs  y,b,a
-         ldb   <u0024,u
-         bpl   L068C
-         lsra  
-L068C    lsra  
-         lsra  
-         pshs  a
-         ldb   #$BF
-         subb  $02,s
-         lda   #$20
-         mul   
-         addb  ,s+
-         adca  #$00
-         ldy   <u002D,u
-         leay  d,y
-         lda   ,s
-         sty   ,s
-         anda  <u0033,u
-         ldx   <u0031,u
-         lda   a,x
-         puls  pc,y,x
-
-* $17 - erase line
-L06B0    clr   <u0036,u
-         bra   L06B5
-
-* $16 - draw line
-L06B5    leax  <L06BA,pcr
-         bra   L064B
-L06BA    lbsr  L0635
-         leas  -$0E,s
-         std   $0C,s
-         bsr   L0684
-         stx   $02,s
-         sta   $01,s
-         ldd   <u0034,u
-         bsr   L0684
-         sta   ,s
-         clra  
-         clrb  
-         std   $04,s
-         lda   #$BF
-         suba  <u0035,u
-         sta   <u0035,u
-         lda   #$BF
-         suba  <u0029,u
-         sta   <u0029,u
-         lda   #$FF
-         sta   $06,s
-         clra  
-         ldb   <u0034,u
-         subb  <u0028,u
-         sbca  #$00
-         bpl   L06F7
-         nega  
-         negb  
-         sbca  #$00
-         neg   $06,s
-L06F7    std   $08,s
-         bne   L0700
-         ldd   #$FFFF
-         std   $04,s
-L0700    lda   #$E0
-         sta   $07,s
-         clra  
-         ldb   <u0035,u
-         subb  <u0029,u
-         sbca  #$00
-         bpl   L0715
-         nega  
-         negb  
-         sbca  #$00
-         neg   $07,s
-L0715    std   $0A,s
-         bra   L0721
-L0719    sta   ,s
-         ldd   $04,s
-         subd  $0A,s
-         std   $04,s
-L0721    lda   ,s
-         tfr   a,b
-         anda  <u0036,u
-         comb  
-         andb  ,x
-         pshs  b
-         ora   ,s+
-         sta   ,x
-         cmpx  $02,s
-         bne   L073B
-         lda   ,s
-         cmpa  $01,s
-         beq   L076F
-L073B    ldd   $04,s
-         bpl   L0749
-         addd  $08,s
-         std   $04,s
-         lda   $07,s
-         leax  a,x
-         bra   L0721
-L0749    lda   ,s
-         ldb   $06,s
-         bpl   L075F
-         lsla  
-         ldb   <u0024,u
-         bmi   L0756
-         lsla  
-L0756    bcc   L0719
-         lda   <u0039,u
-         leax  -$01,x
-         bra   L0719
-L075F    lsra  
-         ldb   <u0024,u
-         bmi   L0766
-         lsra  
-L0766    bcc   L0719
-         lda   <u0038,u
-         leax  $01,x
-         bra   L0719
-L076F    ldd   $0C,s
-         std   <u0034,u
-         leas  $0E,s
-         lda   <u0037,u
-         sta   <u0036,u
-         clrb  
-         rts   
-
-* $1A - draw circle
-L077E    leax  <L0789,pcr
-L0781    stx   <u0026,u
-         com   <u0025,u
-         clrb  
-         rts   
-L0789    leas  -$04,s
-         ldb   <u0029,u		get radius
-         stb   $01,s		stack it
-         clra  
-         sta   ,s
-         addb  $01,s
-         adca  #$00
-         nega  
-         negb  
-         sbca  #$00
-         addd  #$0003
-         std   $02,s
-L07A0    lda   ,s
-         cmpa  $01,s
-         bcc   L07D2
-         ldb   $01,s
-         bsr   L07E0
-         clra  
-         ldb   $02,s
-         bpl   L07BA
-         ldb   ,s
-         lslb  
-         rola  
-         lslb  
-         rola  
-         addd  #$0006
-         bra   L07CA
-L07BA    dec   $01,s
-         clra  
-         ldb   ,s
-         subb  $01,s
-         sbca  #$00
-         lslb  
-         rola  
-         lslb  
-         rola  
-         addd  #$000A
-L07CA    addd  $02,s
-         std   $02,s
-         inc   ,s
-         bra   L07A0
-L07D2    lda   ,s
-         cmpa  $01,s
-         bne   L07DC
-         ldb   $01,s
-         bsr   L07E0
-L07DC    leas  $04,s
-         clrb  
-         rts   
-L07E0    leas  -$08,s
-         sta   ,s
-         clra  
-         std   $02,s
-         nega  
-         negb  
-         sbca  #$00
-         std   $06,s
-         ldb   ,s
-         clra  
-         std   ,s
-         nega  
-         negb  
-         sbca  #$00
-         std   $04,s
-         ldx   $06,s
-         bsr   L0829
-         ldd   $04,s
-         ldx   $02,s
-         bsr   L0829
-         ldd   ,s
-         ldx   $02,s
-         bsr   L0829
-         ldd   ,s
-         ldx   $06,s
-         bsr   L0829
-         ldd   $02,s
-         ldx   ,s
-         bsr   L0829
-         ldd   $02,s
-         ldx   $04,s
-         bsr   L0829
-         ldd   $06,s
-         ldx   $04,s
-         bsr   L0829
-         ldd   $06,s
-         ldx   ,s
-         bsr   L0829
-         leas  $08,s
-         rts   
-L0829    pshs  b,a
-         ldb   <u0035,u
-         clra  
-         leax  d,x
-         cmpx  #$0000
-         bmi   L083B
-         cmpx  #$00BF
-         ble   L083D
-L083B    puls  pc,b,a
-L083D    ldb   <u0034,u
-         clra  
-         tst   <u0024,u
-         bmi   L0848
-         lslb  
-         rola  
-L0848    addd  ,s++
-         tsta  
-         beq   L084E
-         rts   
-L084E    pshs  b
-         tfr   x,d
-         puls  a
-         tst   <u0024,u
-         lbmi  L0673
-         lsra  
-         lbra  L0673
-L085F    ldx   $06,y
-         pshs  y,cc
-         orcc  #IRQMask
-         lda   #$FF
-         clr   >$FF02
-         ldb   >$FF00
-         ldy   $04,x
-         bne   L0878
-         andb  #$01
-         bne   L087C
-         bra   L087D
-L0878    andb  #$02
-         beq   L087D
-L087C    clra  
-L087D    sta   $01,x
-         lda   >$FF03
-         ora   #$08
-         ldy   $04,x
-         bne   L088B
-         anda  #$F7
-L088B    sta   >$FF03
-         lda   >$FF01
-         anda  #$F7
-         bsr   L08AA
-         std   $04,x
-         lda   >$FF01
-         ora   #$08
-         bsr   L08AA
-         pshs  b,a
-         ldd   #$003F
-         subd  ,s++
-         std   $06,x
-         clrb  
-         puls  pc,y,cc
-L08AA    sta   >$FF01
-         clrb  
-         bsr   L08BA
-         bsr   L08BA
-         bsr   L08BA
-         bsr   L08BA
-         lsrb  
-         lsrb  
-         clra  
-         rts   
-L08BA    pshs  b
-         lda   #$7F
-         tfr   a,b
-L08C0    lsrb  
-         cmpb  #$03
-         bhi   L08CC
-         lsra  
-         lsra  
-         tfr   a,b
-         addb  ,s+
-         rts   
-L08CC    addb  #$02
-         andb  #$FC
-         pshs  b
-         anda  #$FC
-         sta   >$FF20
-         tst   >$FF00
-         bpl   L08E0
-         adda  ,s+
-         bra   L08C0
-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
-
--- a/level1/modules/makefile.dragon	Mon Apr 11 23:33:58 2005 +0000
+++ b/level1/modules/makefile.dragon	Wed Apr 13 01:31:38 2005 +0000
@@ -1,3 +1,7 @@
+#
+#modules/makefile.dragon
+#
+
 include ../../rules.mak
 
 CLOCKELIM       = -aRTCElim=1
@@ -23,7 +27,7 @@
 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
+		clock2_messemu clock2_jvemu 
 
 RBF		= rbf.mn \
 		ddisk.dr \
@@ -34,10 +38,9 @@
 SCF		= scf.mn \
 		sc6551.dr vrn.dr printer.dr sio.dr sspak.dr dgnio.dr \
 		co32.io co80.io co51.io\
-		nil.dd p.dd pipe.dd ssp.dd kbvdio.dr akbvdio.dr \
-		drvr51.dr adrvr51.dr \
+		nil.dd p.dd pipe.dd ssp.dd \
 		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
+		term32.dt term80.dt t1_d64.dd p1_d64.dd
 
 PIPE		= pipeman.mn \
 		piper.dr \
@@ -119,7 +122,7 @@
 	$(AS) $< $(ASOUT)$@ $(AFLAGS) $(SSDD80) -aDNum=0
 
 d1_dalpha.dd: ddiskdesc.asm
-	$(AS) $< $(ASOUT)$@ $(AFLAGS) $(DSDD40) -aDNum=1
+	$(AS) $< $(ASOUT)$@ $(AFLAGS) $(SSDD40) -aDNum=1
 
 d2_dalpha.dd: ddiskdesc.asm
 	$(AS) $< $(ASOUT)$@ $(AFLAGS) $(DSDD80) -aDNum=2
@@ -137,12 +140,6 @@
 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
--- a/level1/modules/term_d64.asm	Mon Apr 11 23:33:58 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-         nam   TERM
-         ttl   os9 device descriptor
-
-* Disassembled 1900/00/00 00:18:24 by Disasm v1.5 (C) 1988 by RML
-
-         ifp1
-*         use   /dd/defs/os9defs
-         use   defsfile
-         use   scfdefs
-         endc
-tylg     set   Devic+Objct   
-atrv     set   ReEnt+rev
-rev      set   $01
-         mod   eom,name,tylg,atrv,mgrnam,drvnam
-         fcb   $03 mode byte
-         fcb   $FF extended controller address
-         fdb   $C000  physical controller address
-         fcb   initsize-*-1  initilization table size
-         fcb   $00 device type:0=scf,1=rbf,2=pipe,3=scf
-         fcb   $01 case:0=up&lower,1=upper only
-         fcb   $01 backspace:0=bsp,1=bsp then sp & bsp
-         fcb   $00 delete:0=bsp over line,1=return
-         fcb   $01 echo:0=no echo
-         fcb   $01 auto line feed:0=off
-         fcb   $00 end of line null count
-         fcb   $01 pause:0=no end of page pause
-         fcb   $10 lines per page
-         fcb   $08 backspace character
-         fcb   $18 delete line character
-         fcb   $0D end of record character
-         fcb   $1B end of file character
-         fcb   $04 reprint line character
-         fcb   $01 duplicate last line character
-         fcb   $17 pause character
-         fcb   $03 interrupt character
-         fcb   $05 quit character
-         fcb   $08 backspace echo character
-         fcb   $07 line overflow character (bell)
-         fcb   $00 init value for dev ctl reg
-         fcb   $00 baud rate
-         fdb   name copy of descriptor name address
-         fcb   $00 acia xon char
-         fcb   $00 acia xoff char
-initsize equ   *
-name     equ   *
-         fcs   /TERM/
-mgrnam   equ   *
-         fcs   /SCF/
-drvnam   equ   *
-         fcs   /KBVDIO/
-         emod
-eom      equ   *
-         end