changeset 1512:f3557a63b11c

Rodney's improvements
author boisy
date Sun, 18 Jan 2004 15:08:52 +0000
parents aa2a7c7dd3ec
children f0ac3e8debe9
files level1/modules/co32.asm level1/modules/co80.asm level1/modules/drvr51.asm level1/modules/kbvdio.asm level1/modules/rbf.asm
diffstat 5 files changed, 686 insertions(+), 860 deletions(-) [+]
line wrap: on
line diff
--- a/level1/modules/co32.asm	Thu Jan 15 00:26:48 2004 +0000
+++ b/level1/modules/co32.asm	Sun Jan 18 15:08:52 2004 +0000
@@ -8,6 +8,9 @@
 * ------------------------------------------------------------------
 *   1      ????/??/??
 * From Tandy OS-9 Level One VR 02.00.00
+*
+*          2003/09/22  Rodney Hamilton
+* recoded dispatch table fcbs, fixed cursor color bug
 
          nam   CO32
          ttl   Hardware VDG co-driver for CCIO
@@ -32,11 +35,12 @@
 name     fcs   /CO32/
          fcb   edition
 
-start    lbra  L0035
-         lbra  L008C
-         lbra  L0246
-         lbra  L0250
-         pshs  y,x
+start    equ   *
+Init     lbra  L0035
+Write    lbra  L008C
+GetStat  lbra  L0246
+SetStat  lbra  L0250
+Term     pshs  y,x
          pshs  u
          ldd   #$0200
          ldu   <$1D,u
@@ -45,6 +49,7 @@
          ldb   <$70,u
          andb  #$FD
          bra   L0086
+* Init
 L0035    pshs  y,x
          lda   #$AF
          sta   <$2C,u
@@ -80,6 +85,7 @@
 L0086    stb   <$70,u
          clrb  
          puls  pc,y,x
+* Write
 L008C    tsta  
          bmi   L00D0
          cmpa  #$1F
@@ -121,7 +127,8 @@
          bcs   L00DF
          bsr   L00E3
 L00DF    bsr   L013E
-         clrb  
+* no operation entry point
+L00E1    clrb  
          rts   
 L00E3    ldx   <$1D,u
          leax  <$20,x
@@ -148,9 +155,25 @@
 L0113    comb  
          ldb   #E$Write
          rts   
-L0117    fcb   $ff,$ca,$00,$7d,$00,$c9,$01,$07,$00,$f9,$00,$91,$00
-         fcb   $5e,$ff,$ca,$00,$50,$01,$19,$00,$38,$00,$6c,$00,$70
-         fcb   $00,$1e,$01,$2a
+
+* display functions dispatch table
+L0117    fdb   L00E1-L0117  $ffca  $00:no-op (null)
+         fdb   L0194-L0117  $007d  $01:HOME cursor
+         fdb   L01E0-L0117  $00c9  $02:CURSOR XY
+         fdb   L021E-L0117  $0107  $03:ERASE LINE
+         fdb   L0210-L0117  $00f9  $04:CLEAR TO EOL
+         fdb   L01A8-L0117  $0091  $05:CURSOR ON/OFF
+         fdb   L0175-L0117  $005e  $06:CURSOR RIGHT
+         fdb   L00E1-L0117  $ffca  $07:no-op (bel:handled in CCIO)
+         fdb   L0167-L0117  $0050  $08:CURSOR LEFT
+         fdb   L0230-L0117  $0119  $09:CURSOR UP
+         fdb   L014F-L0117  $0038  $0A:CURSOR DOWN
+         fdb   L0183-L0117  $006c  $0B:ERASE TO EOS
+         fdb   L0187-L0117  $0070  $0C:CLEAR SCREEN
+         fdb   L0135-L0117  $001e  $0D:RETURN
+         fdb   L0241-L0117  $012a  $0E:DISPLAY ALPHA
+
+* $0D - move cursor to start of line (carriage return)
 L0135    bsr   L019E
          tfr   x,d
          andb  #$E0
@@ -163,7 +186,9 @@
 L014B    sta   ,x
 L014D    clrb  
          rts   
-         bsr   L019E
+
+* $0A - cursor down (line feed)
+L014F    bsr   L019E
          leax  <$20,x
          cmpx  <$1F,u
          bcs   L0162
@@ -173,26 +198,36 @@
          puls  x
 L0162    stx   <$21,u
          bra   L013E
-         bsr   L019E
+
+* $08 - cursor left
+L0167    bsr   L019E
          cmpx  <$1D,u
          bls   L0173
          leax  -$01,x
          stx   <$21,u
 L0173    bra   L013E
-         bsr   L019E
+
+* $06 - cursor right
+L0175    bsr   L019E
          leax  $01,x
          cmpx  <$1F,u
          bcc   L0181
          stx   <$21,u
 L0181    bra   L013E
-         bsr   L019E
+
+* $0B - erase to end of screen
+L0183    bsr   L019E
          bra   L0189
+
+* $0C - clear screen
 L0187    bsr   L0194
 L0189    lda   #$60
 L018B    sta   ,x+
          cmpx  <$1F,u
          bcs   L018B
          bra   L013E
+
+* $01 - home cursor
 L0194    bsr   L019E
          ldx   <$1D,u
          stx   <$21,u
@@ -202,7 +237,9 @@
          sta   ,x
          clrb  
          rts   
-         ldb   #$01
+
+* $05 XX - set cursor off/on/color per XX-32
+L01A8    ldb   #$01
          leax  <L01AF,pcr
          bra   L01E5
 L01AF    lda   <$29,u
@@ -220,7 +257,7 @@
          bgt   L01CF
          lda   #$A0
          bra   L01D7
-L01CF    subb  #$03
+L01CF    suba  #$03		bugfix (was subb)
          lsla  
          lsla  
          lsla  
@@ -229,7 +266,9 @@
 L01D7    sta   <$2C,u
          ldx   <$21,u
          lbra  L014B
-         ldb   #$02
+
+* $02 XX YY - move cursor to col XX-32, row YY-32
+L01E0    ldb   #$02
          leax  <L01ED,pcr
 L01E5    stx   <$26,u
          stb   <$25,u
@@ -248,44 +287,56 @@
          lbcc  L014D
          std   <$21,u
          lbra  L013E
-         bsr   L019E
+
+* $04 - erase to end of line
+L0210    bsr   L019E
          tfr   x,d
          andb  #$1F
          pshs  b
          ldb   #$20
          subb  ,s+
          bra   L0223
-         lbsr  L0135
-         ldb   #$20
-L0223    lda   #$60
+
+* $03 - erase line
+L021E    lbsr  L0135		do a CR
+         ldb   #32		line length
+L0223    lda   #$60		space char for VDG screen
          ldx   <$21,u
-L0228    sta   ,x+
+L0228    sta   ,x+		fill screen line with 'space'
          decb  
          bne   L0228
          lbra  L013E
-         lbsr  L019E
+
+* $09 - cursor up
+L0230    lbsr  L019E
          leax  <-$20,x
          cmpx  <$1D,u
          bcs   L023E
          stx   <$21,u
 L023E    lbra  L013E
-         clra  
+
+* $0E - switch screen to alphanumeric mode
+L0241    clra  
          clrb  
          jmp   [<$5B,u]
+* GetStat
 L0246    ldx   $06,y
-         cmpa  #$1C
+         cmpa  #SS.AlfaS	$1C
          beq   L0254
-         cmpa  #$25
+         cmpa  #SS.Cursr	$25
          beq   L0263
+* SetStat
 L0250    comb  
          ldb   #E$UnkSvc
          rts   
+* SS.AlfaS getstat
 L0254    ldd   <$1D,u
          std   $04,x
          ldd   <$21,u
          std   $06,x
          lda   <$50,u
          bra   L02BA
+* SS.Cursr getstat
 L0263    ldd   <$21,u
          subd  <$1D,u
          pshs  b,a
--- a/level1/modules/co80.asm	Thu Jan 15 00:26:48 2004 +0000
+++ b/level1/modules/co80.asm	Sun Jan 18 15:08:52 2004 +0000
@@ -8,6 +8,9 @@
 * ------------------------------------------------------------------
 *   2      ????/??/??
 * From Tandy OS-9 Level One VR 02.00.00
+*
+*          2003/09/22  Rodney Hamilton
+* recoded dispatch table fcbs
 
          nam   CO80
          ttl   WordPak 80-RS co-driver for CCIO
@@ -32,11 +35,14 @@
 name     fcs   /CO80/
          fcb   edition
 
-start    lbra  L0022
-         lbra  L0083
-         lbra  L0054
-         lbra  L007F
-         lbra  L004A
+start    equ   *
+Init     lbra  L0022
+Write    lbra  L0083
+GetStat  lbra  L0054
+SetStat  lbra  L007F
+Term     lbra  L004A
+
+* Init
 L0022    ldx   #$FF78
          lda   #$06
          sta   $01,x
@@ -54,11 +60,13 @@
          ldb   <$70,u
          orb   #$04
          bra   L004F
+* Term
 L004A    ldb   <$70,u
          andb  #$FB
 L004F    stb   <$70,u
          clrb  
          rts   
+* GetStat
 L0054    cmpa  #$25
          bne   L007F
          ldy   $06,y
@@ -77,11 +85,14 @@
          lbsr  L0174
          lda   ,x
          sta   $01,y
+* no operation entry point
 L007D    clrb  
          rts   
+* SetStat
 L007F    ldb   #E$UnkSvc
          coma  
          rts   
+* Write
 L0083    ldx   #$FF78
          cmpa  #$0E
          bcs   L00B6
@@ -113,23 +124,45 @@
          pshs  x
          ldx   #$FF78
          rts   
-L00C5    fcb   $ff,$b8,$00,$8d,$00,$dd,$00,$b4,$00,$b6,$01
-         fcb   $4c,$00,$50,$ff,$b8,$00,$1c,$00,$2e,$00,$5c
-         fcb   $00,$c1,$00,$bf,$00
-         fcb   $3c,$ec,$c8,$58,$26,$02,$5f,$39
+
+* display functions dispatch table
+L00C5    fdb   L007D-L00C5  $ffb8  $00:no-op (null)
+         fdb   L0152-L00C5  $008d  $01:HOME cursor
+         fdb   L01A2-L00C5  $00dd  $02:CURSOR XY
+         fdb   L0179-L00C5  $00b4  $03:ERASE LINE
+         fdb   L017B-L00C5  $00b6  $04:ERASE TO EOL
+         fdb   L0211-L00C5  $014c  $05:CURSOR ON/OFF
+         fdb   L0115-L00C5  $0050  $06:CURSOR RIGHT
+         fdb   L007D-L00C5  $ffb8  $07:no-op (bel:handled in CCIO)
+         fdb   L00E1-L00C5  $001c  $08:CURSOR LEFT
+         fdb   L00F3-L00C5  $002e  $09:CURSOR UP
+         fdb   L0121-L00C5  $005c  $0A:CURSOR DOWN
+         fdb   L0186-L00C5  $00c1  $0B:ERASE TO EOS
+         fdb   L0184-L00C5  $00bf  $0C:CLEAR SCREEN
+         fdb   L0101-L00C5  $003c  $0D:RETURN
+
+* $08 - cursor left
+L00E1    ldd   <$58,u
+         bne   L00E8
+         clrb  	
+         rts   	
 L00E8    decb  
          bge   L00EE
          ldb   #$4F
          deca  
 L00EE    std   <$58,u
          bra   L014F
-         lda   <$58,u
+
+* $09 - cursor up
+L00F3    lda   <$58,u
          beq   L00FF
          deca  
          sta   <$58,u
          lbra  L01CC
 L00FF    clrb  
          rts   
+
+* $0D - move cursor to start of line (carriage return)
 L0101    clr   <$59,u
          bra   L014C
 L0106    ora   <$5A,u
@@ -139,12 +172,16 @@
          ldb   #$0D
          stb   $01,x
          sta   ,x
-         inc   <$59,u
+
+* $06 - cursor right
+L0115    inc   <$59,u
          lda   <$59,u
          cmpa  #$4F
          ble   L014C
          bsr   L0101
-         lda   <$58,u
+
+* $0A - cursor down (line feed)
+L0121    lda   <$58,u
          cmpa  #$17
          bge   L012E
          inca  
@@ -164,6 +201,8 @@
          stb   ,x
 L014C    lda   <$58,u
 L014F    lbra  L01CC
+
+* $01 - home cursor
 L0152    clr   <$58,u
          clr   <$59,u
          ldd   <$54,u
@@ -185,14 +224,20 @@
 L0174    lda   $01,x
          bpl   L0174
          rts   
-         bsr   L0101
-         lda   <$58,u
+
+* $03 - erase line
+L0179    bsr   L0101		do a CR
+L017B    lda   <$58,u
          inca  
-         ldb   #$50
+         ldb   #80		line length
          mul   
          bra   L0189
-         bsr   L0152
-         ldd   #$0780
+
+* $0C - clear screen
+L0184    bsr   L0152		do home cursor, then erase to EOS
+
+* $0B - erase to end of screen
+L0186    ldd   #$0780
 L0189    addd  <$54,u
          bsr   L0161
 L018E    bsr   L016B
@@ -206,7 +251,9 @@
          sta   ,x
 L01A0    clrb  
          rts   
-         leax  >L01B0,pcr
+
+* $02 XX YY - move cursor to col XX-32, row YY-32
+L01A2    leax  >L01B0,pcr
          ldb   #$02
 L01A8    stx   <$26,u
          stb   <$25,u
@@ -260,19 +307,21 @@
 L020C    clr   <$5A,u
 L020F    clrb  
          rts   
-         leax  >L0219,pcr
+
+* $05 XX - set cursor off/on/color per XX-32
+L0211    leax  >L0219,pcr
          ldb   #$01
          bra   L01A8
 L0219    ldx   #$FF78
          lda   <$29,u
-         cmpa  #$20
-         blt   L0201
+         cmpa  #$20		cursor code valid?
+         blt   L0201		 no, error
          beq   L022D
-         cmpa  #$2A
-         bgt   L020F
-L0229    lda   #$05
+         cmpa  #$2A		color code in range?
+         bgt   L020F		 no, ignore
+L0229    lda   #$05		cursor on (all colors=on)
          bra   L022F
-L022D    lda   #$45
+L022D    lda   #$45		cursor off
 L022F    ldb   #$0C
          stb   $01,x
          sta   ,x
--- a/level1/modules/drvr51.asm	Thu Jan 15 00:26:48 2004 +0000
+++ b/level1/modules/drvr51.asm	Sun Jan 18 15:08:52 2004 +0000
@@ -8,7 +8,9 @@
 * ------------------------------------------------------------------
 *   1      ????/??/??
 * Original Dragon distribution version
-
+*
+*          2003/09/22  Rodney Hamilton
+* Recoded fcb arrays, added labels & some comments
 
          nam   drvr51
          ttl   Driver for The 51 column by 24 line video display
@@ -48,8 +50,7 @@
 u001D    rmb   1
 u001E    rmb   1
 u001F    rmb   1
-u0020    rmb   1
-u0021    rmb   1
+u0020    rmb   2
 u0022    rmb   2
 u0024    rmb   1
 u0025    rmb   1
@@ -60,9 +61,9 @@
 u002A    rmb   1
 u002B    rmb   1
 u002C    rmb   1
-u002D    rmb   1
-u002E    rmb   1
-u002F    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
@@ -73,30 +74,7 @@
 u0037    rmb   1
 u0038    rmb   1
 u0039    rmb   1
-u003A    rmb   6
-u0040    rmb   2
-u0042    rmb   2
-u0044    rmb   6
-u004A    rmb   1
-u004B    rmb   5
-u0050    rmb   5
-u0055    rmb   9
-u005E    rmb   2
-u0060    rmb   9
-u0069    rmb   6
-u006F    rmb   1
-u0070    rmb   1
-u0071    rmb   7
-u0078    rmb   6
-u007E    rmb   2
-u0080    rmb   8
-u0088    rmb   6
-u008E    rmb   2
-u0090    rmb   6
-u0096    rmb   3
-u0099    rmb   1
-u009A    rmb   3
-u009D    rmb   1
+u003A    rmb   100
 size     equ   .
 
          fcb   UPDAT.
@@ -109,7 +87,7 @@
          lbra  Write
          lbra  GetStat
          lbra  SetStat
-         lbra  Term+1
+         lbra  Term
 
 Init     pshs  u,a
          ldu   <u001D,u
@@ -153,14 +131,14 @@
          lda   $03,x
          ora   #$01
          sta   $03,x
-         inc   >Term,pcr
+         inc   >InitFlag,pcr
          puls  cc
          lbsr  L0475
          lbsr  L02C3
          clrb  
 L009C    puls  pc,u,a
-Term     fcb   $00
-         pshs  cc
+InitFlag fcb   $00
+Term     pshs  cc
          orcc  #IntMasks
          ldx   >D.AltIRQ
          stx   >D.IRQ
@@ -186,7 +164,7 @@
          sta   u0005,u
          ldx   #$0000
          os9   F$Sleep  
-         ldx   <u004B
+         ldx   <D.Proc
          ldb   <$36,x
          beq   L00EC
          cmpb  #$03
@@ -195,7 +173,7 @@
          puls  pc,x,a
 
 L00EC    puls  x,b
-Read     tst   >Term,pcr
+Read     tst   >InitFlag,pcr
          bne   L00F9
          lbsr  Init
          bcs   L011C
@@ -215,10 +193,10 @@
          beq   L011C
          clr   u000E,u
          comb  
-         ldb   #$F4
+         ldb   #E$Read		READ error
 L011C    rts   
 
-Write    tst   >Term,pcr
+Write    tst   >InitFlag,pcr
          bne   L012C
          pshs  a
          lbsr  Init
@@ -226,9 +204,9 @@
          bcs   L0139
 L012C    ldb   <u001F,u
          bne   L0165
-         cmpa  #$1B
+         cmpa  #$1B		escape?
          bne   L013A
-         inc   <u001F,u
+         inc   <u001F,u		flag ESC seq
          clrb  
 L0139    rts   
 L013A    cmpa  #$20
@@ -387,7 +365,9 @@
 L0273    eora  ,y
          eorb  $01,y
          bra   L026D
-         ldx   #$FF20
+
+* $07 - BEL (ding!)
+L0279    ldx   #$FF20
          ldb   #$64
 L027E    lda   ,x
          eora  #$C0
@@ -400,16 +380,22 @@
          decb  
          bne   L027E
          lbra  L014C
-         dec   <u0024,u
+
+* $08 - BS (left arrow)
+L0291    dec   <u0024,u
          bpl   L02A6
          lda   #$32
          sta   <u0024,u
-         dec   <u0025,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
@@ -418,8 +404,12 @@
          bra   L02BC
 L02B9    sta   <u0025,u
 L02BC    bra   L02A6
-         clr   <u0024,u
+
+* $0d - CR (return)
+L02BE    clr   <u0024,u
          bra   L02A6
+
+* $0c - FF (clear screen)
 L02C3    ldy   <u0022,u
          leay  >$0080,y
          lda   #$18
@@ -522,7 +512,9 @@
          dec   ,s
          bne   L0380
          puls  pc,b
-         inc   <u0032,u
+
+* $1b42 - clear to end of line
+L03AF    inc   <u0032,u
          bsr   L03BA
          dec   <u0032,u
          lbra  L014C
@@ -568,7 +560,9 @@
 L040D    puls  a
          sta   <u0024,u
          rts   
-         inc   <u0032,u
+
+* $1b4A - clear to end of screen
+L0413    inc   <u0032,u
          bsr   L03BA
          lda   #$17
          suba  <u0025,u
@@ -580,43 +574,57 @@
          leas  $01,s
 L042A    dec   <u0032,u
          lbra  L014C
-         clr   <u0024,u
+
+* $0b - (cursor home)
+L0430    clr   <u0024,u
          clr   <u0025,u
          lbra  L02A6
-         ldb   <u001F,u
+
+* $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  #$33
+         cmpa  #51
          bcs   L044B
-         lda   #$32
+         lda   #50
 L044B    sta   <u0024,u
-         clrb  
+L044D    clrb  
          rts   
-L0450    cmpa  #$18
+L0450    cmpa  #24
          bcs   L0456
-         lda   #$17
+         lda   #23
 L0456    sta   <u0025,u
 L0459    lbra  L02A6
-         inc   <u0024,u
+
+* $1b43 - (cursor right)
+L045C    inc   <u0024,u
          lda   <u0024,u
          cmpa  #$33
          bcs   L0459
          clr   <u0024,u
          lbra  L02AC
-         lda   #$FF
+
+* $1b46 - reverse on
+L046C    lda   #$FF
          coma  
 L046F    sta   <u0038,u
          lbra  L014C
+
+* $1b47 - reverse off
 L0475    lda   #$FF
          bra   L046F
-         lda   #$FF
+
+* $1b48 - underline on
+L0479    lda   #$FF
 L047B    sta   <u0039,u
          lbra  L014C
-         clra  
+
+* $1b49 - underline off
+L0481    clra  
          bra   L047B
 L0484    ldd   <u0024,u
          inc   <u0032,u
@@ -651,7 +659,7 @@
 L04CA    clrb  
          rts   
 L04CC    comb  
-         ldb   #$F6
+         ldb   #E$NotRdy
          rts   
 L04D0    cmpa  #$06
          beq   L04CA
@@ -664,7 +672,7 @@
          rts   
 
 SetStat  comb  
-         ldb   #$D0
+         ldb   #E$UnkSvc
          rts   
 
 L04E5    tst   <u0032,u
@@ -691,9 +699,9 @@
          anda  #$03
          bne   L0526
          clra  
-         sta   $02,x
-         bsr   L053B
-         bne   L052D
+         sta   $02,x		strobe all keys	
+         bsr   L053B		any keys pressed?
+         bne   L052D		yes, do scan
 L0526    clr   <u0027,u
          clr   <u0028,u
          rts   
@@ -705,9 +713,9 @@
 L0537    clrb  
          stb   $02,x
          rts   
-L053B    lda   ,x
+L053B    lda   ,x		read keyboard rows
          coma  
-         anda  #$7F
+         anda  #$7F		mask off joystick row
          rts   
 L0541    cmpa  <u0028,u
          bne   L0526
@@ -716,20 +724,20 @@
          clr   <u002C,u
          clr   <u002D,u
          clr   <u002E,u
-         ldb   #$01
+         ldb   #$01		start kbd scan with column#0
 L0557    comb  
-         stb   $02,x
-         bsr   L053B
-         beq   L05A1
-         bita  #$40
+         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
+         cmpb  #$7F		SHIFT key pressed?
          bne   L056B
-         inc   <u002D,u
+         inc   <u002D,u		yes, flag SHIFT
          bra   L057F
-L056B    cmpb  #$FD
+L056B    cmpb  #$FD		CONTROL pressed? (CLEAR key)
          bne   L0574
-         inc   <u002E,u
+         inc   <u002E,u		yes, flag CONTROL
          bra   L057F
 L0574    tst   <u002C,u
          bne   L0537
@@ -785,28 +793,28 @@
          lbsr  L0667
          orb   ,s+
          stb   <u0029,u
-         leax  >L0820,pcr
+         leax  >L0820,pcr	NORMAL keys
          lda   b,x
-         tst   <u002E,u
+         tst   <u002E,u		CONTROL flag on?
          beq   L05FE
-         leax  >L0886,pcr
+         leax  >L0886,pcr	CONTROL keys
          lda   b,x
          bra   L0609
-L05FE    tst   <u002D,u
+L05FE    tst   <u002D,u		SHIFT flag on?
          beq   L0612
-         leax  >L0853,pcr
+         leax  >L0853,pcr	SHIFTED keys
          lda   b,x
-L0609    cmpa  #$1F
+L0609    cmpa  #$1F		SHIFTLOCK toggle key?
          bne   L0621
          com   <u002F,u
          bra   L0665
-L0612    tst   <u002F,u
+L0612    tst   <u002F,u		SHIFTLOCK flag on?
          beq   L0621
-         cmpa  #$61
+         cmpa  #$61		less than 'a ?
          bcs   L0621
-         cmpa  #$7A
+         cmpa  #$7A		more than 'z ?
          bhi   L0621
-         suba  #$20
+         suba  #$20		only does lower->UPPER
 L0621    leax  <u003A,u
          ldb   <u001E,u
          sta   b,x
@@ -849,593 +857,202 @@
          decb  
          rts   
 
-L066E  fcb $07
-       fcb $FC
-       fcb $0B
-       fcb $08
-       fcb $FC
-       fcb $23
-       fcb $0A
-       fcb $FC
-       fcb $3E
-       fcb $0D
-       fcb $FC
-       fcb $50
-       fcb $0C
-       fcb $FC
-       fcb $55
-       fcb $0B
-       fcb $FD
-       fcb $C2
-       fcb $00
-L0681  fcb $41
-       fcb $FD
-       fcb $CB
-       fcb $42
-       fcb $FD
-       fcb $41
-       fcb $43
-       fcb $FD
-       fcb $EE
-       fcb $44
-       fcb $FC
-       fcb $2D
-       fcb $45
-       fcb $FC
-       fcb $3E
-       fcb $46
-       fcb $FD
-       fcb $FE
-       fcb $47
-       fcb $FE
-       fcb $07
-       fcb $48
-       fcb $FE
-       fcb $0B
-       fcb $49
-       fcb $FE
-       fcb $13
-       fcb $4A
-       fcb $FD
-       fcb $A5
-       fcb $00
-L06A0  fcb $00
-       fcb $00
-       fcb $00
-       fcb $00
-       fcb $44
-       fcb $40
-       fcb $40
-       fcb $00
-       fcb $55
-       fcb $00
-       fcb $00
-       fcb $00
-       fcb $6F
-       fcb $6F
-       fcb $60
-       fcb $00
-       fcb $27
-       fcb $86
-       fcb $1E
-       fcb $20
-       fcb $91
-       fcb $24
-       fcb $89
-       fcb $00
-       fcb $4A
-       fcb $4A
-       fcb $D0
-       fcb $00
-       fcb $44
-       fcb $00
-       fcb $00
-       fcb $00
-       fcb $24
-       fcb $44
-       fcb $20
-       fcb $00
-       fcb $42
-       fcb $22
-       fcb $40
-       fcb $00
-       fcb $96
-       fcb $F6
-       fcb $90
-       fcb $00
-       fcb $44
-       fcb $E4
-       fcb $40
-       fcb $00
-       fcb $00
-       fcb $02
-       fcb $24
-       fcb $00
-       fcb $00
-       fcb $F0
-       fcb $00
-       fcb $00
-       fcb $00
-       fcb $06
-       fcb $60
-       fcb $00
-       fcb $01
-       fcb $24
-       fcb $80
-       fcb $00
-       fcb $69
-       fcb $BD
-       fcb $60
-       fcb $00
-       fcb $26
-       fcb $22
-       fcb $70
-       fcb $00
-       fcb $69
-       fcb $2C
-       fcb $F0
-       fcb $00
-       fcb $E1
-       fcb $61
-       fcb $E0
-       fcb $00
-       fcb $26
-       fcb $AF
-       fcb $20
-       fcb $00
-       fcb $F8
-       fcb $E1
-       fcb $E0
-       fcb $00
-       fcb $78
-       fcb $E9
-       fcb $60
-       fcb $00
-       fcb $F1
-       fcb $24
-       fcb $40
+* 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
-       fcb $69
-       fcb $69
-       fcb $60
-       fcb $00
-       fcb $69
-       fcb $71
-       fcb $60
-       fcb $00
-       fcb $00
-       fcb $40
-       fcb $40
-       fcb $00
-       fcb $00
-       fcb $20
-       fcb $24
-       fcb $00
-       fcb $24
-       fcb $84
-       fcb $20
-       fcb $00
-       fcb $0F
-       fcb $0F
-       fcb $00
-       fcb $00
-       fcb $42
-       fcb $12
-       fcb $40
-       fcb $00
-       fcb $69
-       fcb $22
-       fcb $02
-       fcb $00
-       fcb $69
-       fcb $BB
-       fcb $87
-       fcb $00
-       fcb $69
-       fcb $F9
-       fcb $90
-       fcb $00
-       fcb $E9
-       fcb $E9
-       fcb $E0
-       fcb $00
-       fcb $78
-       fcb $88
-       fcb $70
-       fcb $00
-       fcb $E9
-       fcb $99
-       fcb $E0
-       fcb $00
-       fcb $F8
-       fcb $E8
-       fcb $F0
-       fcb $00
-       fcb $F8
-       fcb $E8
-       fcb $80
-       fcb $00
-       fcb $78
-       fcb $B9
-       fcb $70
-       fcb $00
-       fcb $99
-       fcb $F9
-       fcb $90
-       fcb $00
-       fcb $E4
-       fcb $44
-       fcb $E0
-       fcb $00
-       fcb $F2
-       fcb $2A
-       fcb $40
-       fcb $00
-       fcb $9A
-       fcb $CA
-       fcb $90
-       fcb $00
-       fcb $88
-       fcb $88
-       fcb $F0
-       fcb $00
-       fcb $FD
-       fcb $D9
-       fcb $90
-       fcb $00
-       fcb $9D
-       fcb $B9
-       fcb $90
-       fcb $00
-       fcb $69
-       fcb $99
-       fcb $60
-       fcb $00
-       fcb $E9
-       fcb $E8
-       fcb $80
-       fcb $00
-       fcb $69
-       fcb $9B
-       fcb $70
-       fcb $00
-       fcb $E9
-       fcb $EA
-       fcb $90
-       fcb $00
-       fcb $78
-       fcb $61
-       fcb $E0
-       fcb $00
-       fcb $E4
-       fcb $44
-       fcb $40
-       fcb $00
-       fcb $99
-       fcb $99
-       fcb $60
-       fcb $00
-       fcb $99
-       fcb $96
-       fcb $60
-       fcb $00
-       fcb $99
-       fcb $DD
-       fcb $F0
-       fcb $00
-       fcb $99
-       fcb $69
-       fcb $90
-       fcb $00
-       fcb $99
-       fcb $71
-       fcb $E0
-       fcb $00
-       fcb $F1
-       fcb $68
-       fcb $F0
-       fcb $00
-       fcb $E8
-       fcb $88
-       fcb $E0
-       fcb $00
-       fcb $08
-       fcb $42
-       fcb $10
+
+* 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
-       fcb $71
-       fcb $11
-       fcb $70
-       fcb $00
-       fcb $69
-       fcb $00
-       fcb $00
-       fcb $00
-       fcb $00
-       fcb $00
-       fcb $0F
-       fcb $00
-       fcb $22
-       fcb $00
-       fcb $00
-       fcb $00
-       fcb $07
-       fcb $99
-       fcb $70
-       fcb $00
-       fcb $8E
-       fcb $99
-       fcb $E0
-       fcb $00
-       fcb $07
-       fcb $88
-       fcb $70
-       fcb $00
-       fcb $17
-       fcb $99
-       fcb $70
-       fcb $00
-       fcb $07
-       fcb $AC
-       fcb $70
-       fcb $00
-       fcb $34
-       fcb $F4
-       fcb $40
-       fcb $00
-       fcb $06
-       fcb $99
-       fcb $71
-       fcb $E0
-       fcb $8E
-       fcb $99
-       fcb $90
-       fcb $00
-       fcb $40
-       fcb $44
-       fcb $40
-       fcb $00
-       fcb $20
-       fcb $22
-       fcb $22
-       fcb $C0
-       fcb $8A
-       fcb $CA
-       fcb $90
-       fcb $00
-       fcb $44
-       fcb $44
-       fcb $40
-       fcb $00
-       fcb $0E
-       fcb $DD
-       fcb $90
-       fcb $00
-       fcb $0E
-       fcb $99
-       fcb $90
-       fcb $00
-       fcb $06
-       fcb $99
-       fcb $60
-       fcb $00
-       fcb $0E
-       fcb $99
-       fcb $E8
-       fcb $80
-       fcb $07
-       fcb $99
-       fcb $71
-       fcb $10
-       fcb $07
-       fcb $88
-       fcb $80
-       fcb $00
-       fcb $07
-       fcb $C3
-       fcb $E0
-       fcb $00
-       fcb $4F
-       fcb $44
-       fcb $30
-       fcb $00
-       fcb $09
-       fcb $99
-       fcb $70
-       fcb $00
-       fcb $09
-       fcb $96
-       fcb $60
-       fcb $00
-       fcb $09
-       fcb $DD
-       fcb $60
-       fcb $00
-       fcb $09
-       fcb $66
-       fcb $90
-       fcb $00
-       fcb $09
-       fcb $99
-       fcb $71
-       fcb $E0
-       fcb $0F
-       fcb $24
-       fcb $F0
-       fcb $00
-       fcb $34
-       fcb $C4
-       fcb $30
-       fcb $00
-       fcb $44
-       fcb $04
-       fcb $40
-       fcb $00
-       fcb $C2
-       fcb $32
-       fcb $C0
-       fcb $00
-       fcb $05
-       fcb $A0
-       fcb $00
-       fcb $00
-       fcb $FF
-       fcb $FF
-       fcb $FF
-       fcb $F0
-L0820  fcb $30
-       fcb $31
-       fcb $32
-       fcb $33
-       fcb $34
-       fcb $35
-       fcb $36
-       fcb $37
-       fcb $38
-       fcb $39
-       fcb $3A
-       fcb $3B
-       fcb $2C
-       fcb $2D
-       fcb $2E
-       fcb $2F
-       fcb $40
-       fcb $61
-       fcb $62
-       fcb $63
-       fcb $64
-       fcb $65
-       fcb $66
-       fcb $67
-       fcb $68
-       fcb $69
-       fcb $6A
-       fcb $6B
-       fcb $6C
-       fcb $6D
-       fcb $6E
-       fcb $6F
-       fcb $70
-       fcb $71
-       fcb $72
-       fcb $73
-       fcb $74
-       fcb $75
-       fcb $76
-       fcb $77
-       fcb $78
-       fcb $79
-       fcb $7A
-       fcb $0C
-       fcb $0A
-       fcb $08
-       fcb $09
-       fcb $20
-       fcb $0D
-       fcb $00
-       fcb $05
-L0853  fcb $30
-       fcb $21
-       fcb $22
-       fcb $23
-       fcb $24
-       fcb $25
-       fcb $26
-       fcb $27
-       fcb $28
-       fcb $29
-       fcb $2A
-       fcb $2B
-       fcb $3C
-       fcb $3D
-       fcb $3E
-       fcb $3F
-       fcb $7C
-       fcb $41
-       fcb $42
-       fcb $43
-       fcb $44
-       fcb $45
-       fcb $46
-       fcb $47
-       fcb $48
-       fcb $49
-       fcb $4A
-       fcb $4B
-       fcb $4C
-       fcb $4D
-       fcb $4E
-       fcb $4F
-       fcb $50
-       fcb $51
-       fcb $52
-       fcb $53
-       fcb $54
-       fcb $55
-       fcb $56
-       fcb $57
-       fcb $58
-       fcb $59
-       fcb $5A
-       fcb $1C
-       fcb $1A
-       fcb $18
-       fcb $19
-       fcb $20
-       fcb $0D
-       fcb $00
-       fcb $03
-L0886  fcb $1F
-       fcb $7C
-       fcb $00
-       fcb $7E
-       fcb $00
-       fcb $00
-       fcb $00
-       fcb $5E
-       fcb $5B
-       fcb $5D
-       fcb $00
-       fcb $00
-       fcb $7B
-       fcb $5F
-       fcb $7D
-       fcb $5C
-       fcb $00
-       fcb $01
-       fcb $02
-       fcb $03
-       fcb $04
-       fcb $05
-       fcb $06
-       fcb $07
-       fcb $08
-       fcb $09
-       fcb $0A
-       fcb $0B
-       fcb $0C
-       fcb $0D
-       fcb $0E
-       fcb $0F
-       fcb $10
-       fcb $11
-       fcb $12
-       fcb $13
-       fcb $14
-       fcb $15
-       fcb $16
-       fcb $17
-       fcb $18
-       fcb $19
-       fcb $1A
-       fcb $13
-       fcb $12
-       fcb $10
-       fcb $11
-       fcb $20
-       fcb $0D
-       fcb $00
-       fcb $1B
+
+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
 
          emod
 eom      equ   *
+         end
--- a/level1/modules/kbvdio.asm	Thu Jan 15 00:26:48 2004 +0000
+++ b/level1/modules/kbvdio.asm	Sun Jan 18 15:08:52 2004 +0000
@@ -8,6 +8,9 @@
 * ------------------------------------------------------------------
 *          ????/??/??
 * Original Dragon Data distribution version
+*
+*          2004/01/04  Rodney Hamilton
+* Recoded anonymous fcb arrays, added some comments
 
          nam   KBVDIO
          ttl   keyboard/video driver
@@ -64,7 +67,7 @@
 u0039    rmb   1
 u003A    rmb   1
 vhwaddr  rmb   2		address of keyboard hardware
-u003D    rmb   1
+u003D    rmb   1		SHIFTLOCK toggle
 u003E    rmb   1
 u003F    rmb   1
 u0040    rmb   1
@@ -72,8 +75,8 @@
 u0042    rmb   1
 u0043    rmb   1
 u0044    rmb   1
-u0045    rmb   1
-u0046    rmb   1
+u0045    rmb   1		SHIFT key flag
+u0046    rmb   1		CONTROL key flag
 u0047    rmb   1
 u0048    rmb   1
 u0049    rmb   1
@@ -94,64 +97,64 @@
          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
+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
+         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   $02,x		put $FF in $FF02
          stb   <u003F,u
          stb   <u0040,u
          stb   <u0041,u
          lda   #$34
-         sta   $01,x			put $34 in $FF01
+         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   #$F5
-         orcc  #Carry			set carry
-         rts   				and return
+         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
+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
+L0082    cmpa  #SS.EOF		End of file?
+         beq   GSOk		branch if so
          cmpa  #SS.DStat
-         lbeq  L04E0+4
-         cmpa  #SS.Joy			joystick value acquisition?
+         lbeq  L04E4
+         cmpa  #SS.Joy		joystick value acquisition?
          lbeq  L085F
-         cmpa  #SS.AlfaS		Alfa display status?
-         lbeq  L04CD			branch if so
+         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
+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
@@ -160,11 +163,11 @@
 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
+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
@@ -192,9 +195,9 @@
 L00F1    bsr   L013F
          bmi   L00DF
          sta   <u0047,u
-         cmpa  #$1F
+         cmpa  #$1F		control-zero?
          bne   L0101
-         com   <u003D,u
+         com   <u003D,u		yes, toggle SHIFTLOCK
          bra   L00DF
 L0101    ldb   <u0048,u
          leax  <u004A,u
@@ -222,9 +225,10 @@
 L0132    ldb   #S$Wake
          lda   V.WAKE,u
 L0136    beq   L013B
-         os9   F$Send   		send signal to process
+         os9   F$Send   	send signal to process
 L013B    clr   V.WAKE,u
          bra   L00DF
+
 L013F    clra  
          sta   <u003E,u
          sta   <u0045,u
@@ -234,51 +238,53 @@
          sta   <u0043,u
          sta   <u0044,u
          deca  
-         sta   $02,x
-L0156    lda   ,x
-         coma  
-         anda  #$7F
-         beq   L0169
+         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
-         bsr   L01AF
-L0165    cmpb  #$06
+         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
+L0169    inc   <u003E,u		bump column counter
          orcc  #Carry
-         rol   $02,x
+         rol   $02,x		strobe next column
          bcs   L0156
          lbsr  L01F8
          bmi   L01AE
          suba  #$1B
-         bcc   L0191
+         bcc   L0191		not an alpha key
          adda  #$1B
-         ldb   <u0046,u
-         bne   L0190
-         adda  #$40
-         ldb   <u0045,u
+         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   #$03
+L0191    ldb   #3		three values per key
          mul   
-         lda   <u0045,u
+         lda   <u0045,u		shift key pressed?
          beq   L019C
-         incb  
+         incb  			yes, use 2nd value
          bra   L01A3
-L019C    lda   <u0046,u
+L019C    lda   <u0046,u		control key pressed?
          beq   L01A3
-         addb  #$02
+         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
@@ -287,17 +293,17 @@
          addb  #$04
          bra   L01BF
 L01BD    subb  #$02
-L01BF    lslb  
+L01BF    lslb  			multiply row * 8
          lslb  
          lslb  
-         addb  <u003E,u
-         cmpb  #$31
+         addb  <u003E,u		add column.  B.reg now = keycode ($00-$37)
+         cmpb  #$31		is this the CLEAR key?
          bne   L01CE
-         inc   <u0046,u
+         inc   <u0046,u		yes, set control pressed flag
          puls  pc,b
-L01CE    cmpb  #$37
+L01CE    cmpb  #$37		is this a SHIFT key?
          bne   L01D7
-         com   <u0045,u
+         com   <u0045,u		yes, set shift pressed flag
          puls  pc,b
 L01D7    pshs  x
          leax  <u0042,u
@@ -351,16 +357,32 @@
          tfr   b,a
          puls  pc,y,x,b
 
-L023E    fcb   $0C,$1C
-L0240    fcb   $13,$0A,$1A,$12,$08,$18,$10,$09   ........
-L0248    fcb   $19,$11,$20,$20,$20,$30,$30,$1F   ..   00.
-L0250    fcb   $31,$21,$7C,$32,$22,$00,$33,$23   1!|2".3#
-L0258    fcb   $7E,$34,$24,$00,$35,$25,$00,$36   ~4$.5%.6
-L0260    fcb   $26,$00,$37,$27,$5E,$38,$28,$5B   &.7'^8([
-L0268    fcb   $39,$29,$5D,$3A,$2A,$00,$3B,$2B   9)]:*.;+
-L0270    fcb   $00,$2C,$3C,$7B,$2D,$3D,$5F,$2E   .,<{-=_.
-L0278    fcb   $3E,$7D,$2F,$3F,$5C,$0D,$0D,$0D   >}/?\...
-L0280    fcb   $00,$00,$00,$05,$03,$1B ,$30
+*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
@@ -412,7 +434,7 @@
          stx   <u0021,u
          leax  >512,x
          stx   <u001F,u
-         lbsr  L0459
+         lbsr  L0459		clear screen
          lda   #$60
          sta   <u0023,u
          sta   <u002B,u
@@ -489,7 +511,8 @@
          jmp   [<u0026,u]
 L0394    sta   <u0028,u
          inc   <u0025,u
-         clrb  
+* no operation entry point
+L039A    clrb  
          rts   
 L039C    ldx   <u001D,u
          leax  <$20,x
@@ -505,13 +528,13 @@
          deca  
          bne   L03B6
 L03BB    rts   
-L03BC    cmpa  #$1B
+L03BC    cmpa  #27
          bcc   L03BB
          cmpa  #$10
          bcs   L03CE
          ldb   <u002C,u
          bne   L03CE
-         ldb   #$F6
+         ldb   #E$NotRdy
          orcc  #Carry
          rts   
 
@@ -520,16 +543,38 @@
          ldd   a,x
          jmp   d,x
 
-L03D6    fcb   $FF,$C4
-L03D8    fcb   $00,$91,$00,$A5,$00,$D0,$FF,$C4   ...%.P.D
-L03E0    fcb   $FF,$C4,$00,$75,$FF,$C4,$00,$67   .D.u.D.g
-L03E8    fcb   $00,$E2,$00,$4E,$FF,$C4,$00,$83   .b.N.D..
-L03F0    fcb   $00,$36,$00,$F2,$01,$4A,$02,$2E   .6.r.J..
-L03F8    fcb   $02,$09,$02,$1D,$02,$4E,$02,$59   .....N.Y
-L0400    fcb   $02,$72,$02,$DF,$02,$DA,$02,$89   .r._.Z..
-L0408    fcb   $02,$84,$03,$A8
+* 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 
 
-L040C    fcb   $8D,$64,$1F,$10
+* $0D - return cursor to start of line (carriage return)
+L040C    bsr   L0472
+         tfr   x,d
          andb  #$E0
          stb   <u0022,u
 L0415    ldx   <u0021,u
@@ -540,7 +585,8 @@
          andcc #^Carry
          rts   
 
-         bsr   L0472
+* $0A - cursor down
+L0424    bsr   L0472
          leax  <$20,x
          cmpx  <u001F,u
          bcs   L0438
@@ -550,24 +596,32 @@
          puls  x
 L0438    stx   <u0021,u
          bra   L0415
-         bsr   L0472
+
+* $08 - cursor left
+L043D    bsr   L0472
          cmpx  <u001D,u
          bls   L0449
          leax  -$01,x
          stx   <u0021,u
 L0449    bra   L0415
-         bsr   L0472
+
+* $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
@@ -576,7 +630,9 @@
          lda   <u0023,u
          sta   ,x
          rts   
-         leax  <L0481,pcr
+
+* $02 XX YY - cursor xy (move cursor to XX-32,YY-32)
+L047B    leax  <L0481,pcr
          lbra  L064B
 L0481    bsr   L0472
          ldb   <u0029,u
@@ -593,21 +649,27 @@
          lbsr  L0415
          clrb  
 L04A3    lbra  L0415
-         lbsr  L040C
-         ldb   #$20
-         lda   #$60
+
+* $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+
+L04B0    sta   ,x+		fill screen line with 'space'
          decb  
          bne   L04B0
          lbra  L0415
-         bsr   L0472
+
+* $09 - cursor up
+L04B8    bsr   L0472
          leax  <-$20,x
          cmpx  <u001D,u
          bcs   L04C5
          stx   <u0021,u
 L04C5    lbra  L0415
-         clra  
+
+* $0E - display alpha
+L04C8    clra  
          clrb  
          lbra  L0303
 L04CD    ldx   $06,y
@@ -620,10 +682,16 @@
          clrb  
          rts   
 
-L04E0    fcb   $00,$55,$AA,$FF,$A6,$C8,$2C,$26   .U*.&H,&
-L04E8    fcb   $05,$C6,$F6,$1A,$01,$39
+* 4-color mode color table
+L04E0    fcb   $00,$55,$AA,$FF
 
-         ldd   <u0034,u
+L04E4    lda   <u002C,u	
+         bne   L04EE	
+L04E9    ldb   #E$NotRdy
+         orcc  #Carry
+         rts   
+
+L04EE    ldd   <u0034,u
          lbsr  L0684
          tfr   a,b
          andb  ,x
@@ -648,7 +716,9 @@
          std   $04,x
          clrb  
          rts   
-         leax  <L0526,pcr
+
+* $0F - display graphics
+L0520    leax  <L0526,pcr
          lbra  L064B
 L0526    ldb   <u002C,u
          bne   L0566
@@ -688,7 +758,7 @@
          lda   <u0028,u
          cmpa  #$01
          bls   L0586
-         ldb   #$CB
+         ldb   #E$BMode		illegal mode
          orcc  #Carry
 L0585    rts   
 
@@ -725,23 +795,32 @@
          ldb   #$01
          lbra  L0303
 
+* 4-color mode pixel masks
 L05D3    fcb   $C0,$30,$0C,$03
-L05D7    fcb   $80
-L05D8    fcb   $40,$20,$10,$08,$04,$02,$01,$30   @ .....0
-L05E0    fcb   $8C,$03,$16,$01,$9C,$6F,$C8,$28   .....oH(
-L05E8    fcb   $A6,$C8,$24
+
+* 2-color mode pixel masks
+L05D7    fcb   $80,$40,$20,$10,$08,$04,$02,$01
 
-L05EB    bmi   L05F0
+* $11 - set color
+L05DF    leax  <L05E5,pcr
+         lbra  L0781
+L05E5    clr   <u0028,u
+         lda   <u0024,u
+         bmi   L05F0
          inc   <u0028,u
 L05F0    lbra  L0566
-         pshs  u
+
+* $12 - end graphics
+L05F3    pshs  u
          ldu   <u002D,u
-         ldd   #$1800
+         ldd   #6144		size of graphics screen
          os9   F$SRtMem 
          puls  u
          clr   <u002C,u
          rts   
-         leax  <L060A,pcr
+
+* $10 - preset screen to specified color
+L0604    leax  <L060A,pcr
          lbra  L0781
 L060A    lda   <u0029,u
          tst   <u0024,u
@@ -754,25 +833,31 @@
          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
-         clra  
+
+* $14 - home graphics cursor
+L062F    clra  
          clrb  
          std   <u0034,u
          rts   
 L0635    ldd   <u0028,u
-         cmpb  #$C0
+         cmpb  #192
          bcs   L063E
-         ldb   #$BF
+         ldb   #192-1
 L063E    tst   <u0024,u
          bmi   L0644
          lsra  
 L0644    std   <u0028,u
          rts   
-         leax  <L0653,pcr
+
+* $15 - set graphics cursor
+L0648    leax  <L0653,pcr
 L064B    stx   <u0026,u
          inc   <u0025,u
          clrb  
@@ -781,8 +866,12 @@
          std   <u0034,u
          clrb  
          rts   
-         clr   <u0036,u
+
+* $19 - erase point
+L065A    clr   <u0036,u
          bra   L065F
+
+* $18 - set point
 L065F    leax  <L0664,pcr
          bra   L064B
 L0664    bsr   L0635
@@ -822,8 +911,12 @@
          ldx   <u0031,u
          lda   a,x
          puls  pc,y,x
-         clr   <u0036,u
+
+* $17 - erase line
+L06B0    clr   <u0036,u
          bra   L06B5
+
+* $16 - draw line
 L06B5    leax  <L06BA,pcr
          bra   L064B
 L06BA    lbsr  L0635
@@ -922,14 +1015,16 @@
          sta   <u0036,u
          clrb  
          rts   
-         leax  <L0789,pcr
+
+* $1A - draw circle
+L077E    leax  <L0789,pcr
 L0781    stx   <u0026,u
          com   <u0025,u
          clrb  
          rts   
 L0789    leas  -$04,s
-         ldb   <u0029,u
-         stb   $01,s
+         ldb   <u0029,u		get radius
+         stb   $01,s		stack it
          clra  
          sta   ,s
          addb  $01,s
--- a/level1/modules/rbf.asm	Thu Jan 15 00:26:48 2004 +0000
+++ b/level1/modules/rbf.asm	Sun Jan 18 15:08:52 2004 +0000
@@ -8,6 +8,9 @@
 * ------------------------------------------------------------------
 *  24      1985/??/??
 * From Tandy OS-9 Level One VR 02.00.00
+*
+*  25      2003/10/07  Rodney V. Hamilton
+* Fix for LSN0 DD.TOT=0 lockout problem
 
          nam   RBF
          ttl   Disk file manager
@@ -22,7 +25,7 @@
 tylg     set   FlMgr+Objct
 atrv     set   ReEnt+rev
 rev      set   $00
-edition  set   24
+edition  set   25
 
          mod   eom,name,tylg,atrv,start,size
 
@@ -32,7 +35,7 @@
 name     fcs   /RBF/
          fcb   edition
 
-L0011    fcb   DRVMEM
+*L0011    fcb   DRVMEM
 
 * All routines are entered with
 * (Y) = Path descriptor pointer
@@ -206,13 +209,24 @@
          std   <PD.SBL,y
          sta   <PD.SBL+2,y
          ldx   <PD.DTB,y
-         lda   V$STAT,x
+         lda   DD.TOT+2,x
+* resave nonzero DD.TOT here and recopy
+OpenFix  equ   *
          std   <PD.SIZ+2,y
          sta   <PD.SSZ+2,y
-         ldd   V$DRIV,x
+         ldd   DD.TOT,x
          std   PD.SIZ,y
          std   <PD.SSZ,y
-         puls  pc,y
+* BUG FIX: handle special case of DD.TOT=0 in LSN0 which blocks
+* all subsequent accesses.  NOTE: since we can only access LSN0
+* for any non-zero value, set DD.TOT=1 to avoid NOT READY error.
+         bne   OpenRet		MSW nonzero, OK
+         lda   DD.TOT+2,x	MSW=0, check LSB
+         bne   OpenRet		LSB nonzero, OK
+         inca			DD.TOT=0, make it 1
+         sta   DD.TOT+2,x	fix drive table
+         bra   OpenFix		and resave (B=0)
+OpenRet  puls  pc,y		restore & return
 
 L01B3    lda   PD.MOD,y
          lbsr  L07F1
@@ -348,7 +362,7 @@
          ldd   <$35,y
          bne   L02E9
          tst   <$34,y
-         lbeq  L027D
+         beq   L027D
 L02E9    lda   #$42
          lbsr  L07F1
          bcs   L035F
@@ -435,12 +449,12 @@
          ldd   $02,s
          leax  d,x
 L03AA    rts
-L03AB    lbsr  L0414
+L03AB    bsr   L0414
          lda   ,-x
          cmpa  #$0D
          beq   L03BA
          ldd   $02,s
-         lbne  L041A
+         bne   L041A
 L03BA    ldu   $06,y
          ldd   $06,u
          subd  $02,s
@@ -621,7 +635,7 @@
          leas  $02,s
 L051B    puls  pc,u,y,x
 
-GetSTat  ldb   $02,u
+GetStat  ldb   $02,u
          cmpb  #$00
          beq   L0543
          cmpb  #$06
@@ -785,7 +799,7 @@
 L0677    ldu   $03,y
          stu   <PD.DVT,y
          lda   <PD.DRV,y
-         ldb   >L0011,pcr
+         ldb   #DRVMEM
          mul
          addd  $02,u
          addd  #$000F
@@ -841,7 +855,7 @@
          lbsr  L079C
          bra   L070A
 L0705    bsr   L075D
-L0707    lbsr  L0787
+L0707    bsr   L0787
 L070A    bcs   L0752
          tst   ,x
          beq   L0705
@@ -859,7 +873,7 @@
          ldd   <$1E,x
          std   <PD.FD+1,y
          lbsr  L0837
-         lbra  L06BE
+         bra   L06BE
 L0734    ldx   $08,s
          tsta
          bmi   L0741
@@ -1599,7 +1613,7 @@
          ldx   <$1E,y
          cmpd  $0E,x
 L0D51    puls  x,b,a
-         lbeq  L0CED
+         beq   L0CED
          comb
          ldb   #E$DIDC
          rts   
@@ -1634,7 +1648,7 @@
          bcs   L0DAA
          bsr   L0D72
          bcs   L0DAA
-         lbsr  L0D5B
+         bsr   L0D5B
          lbsr  L0CEB
          bcs   L0DAA
          lda   $0A,y