changeset 2618:e6507f116064

Atari port now boots
author Boisy Pitre <boisy.pitre@nuance.com>
date Wed, 22 Feb 2012 06:38:54 -0600
parents b1145d2cb659
children d888412d8118
files defs/atarivtio.d level1/atari/bootroms/makefile level1/atari/modules/makefile level1/atari/modules/sysgo.asm level1/atari/modules/vtio.asm level1/modules/kernel/krn.asm level1/modules/kernel/krnp2.asm
diffstat 7 files changed, 670 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/defs/atarivtio.d	Wed Feb 22 06:38:54 2012 -0600
@@ -0,0 +1,36 @@
+               IFNE      VTIODEFS-1
+VTIODEFS       SET       1
+
+********************************************************************
+* VTIODefs - Video Terminal I/O Definitions for Atari XE/XL
+*
+* $Id$
+*
+* Edt/Rev  YYYY/MM/DD  Modified by
+* Comment
+* ------------------------------------------------------------------
+*          2012/02/21  Boisy G. Pitre
+* Started
+
+               NAM       VTIODefs  
+               TTL       Video Terminal I/O Definitions for Atari XE/XL
+
+               USE       antic.d
+               
+********************
+* VTIO Definitions
+*
+ScrStart       EQU       $0500
+Cols           EQU       40
+Rows           EQU       24
+
+********************
+* VTIO Static Memory
+*
+               ORG       V.SCF
+V.CurRow       RMB       1
+V.CurCol       RMB       1
+               RMB       250-.
+V.Last         EQU       .
+
+               ENDC      
--- a/level1/atari/bootroms/makefile	Tue Feb 21 08:34:51 2012 -0600
+++ b/level1/atari/bootroms/makefile	Wed Feb 22 06:38:54 2012 -0600
@@ -9,7 +9,7 @@
 
 BOOTFILE_ROM	= $(MD)/krnp2 $(MD)/init \
 				$(MD)/ioman $(MD)/scf.mn $(MD)/vtio.dr $(MD)/term.dt \
-				$(MD)/sysgo_dd \
+				$(MD)/sysgo $(CD)/mfree \
 				$(MD)/krn
 
 BOOTFILE_ROM_OLD	= $(MD)/rominfo $(MD)/ioman \
@@ -28,6 +28,7 @@
 nos96809l1.rom: $(BOOTFILE_ROM) $(DEPENDS)
 	$(MERGE) $(BOOTFILE_ROM)>$@
 	$(PADROM) -b 10240 $@
+#	$(PADROM) -b 16384 $@
 	
 clean:
 	$(RM) $(ALLROMS)
\ No newline at end of file
--- a/level1/atari/modules/makefile	Tue Feb 21 08:34:51 2012 -0600
+++ b/level1/atari/modules/makefile	Wed Feb 22 06:38:54 2012 -0600
@@ -23,7 +23,7 @@
 
 BOOTERS		= 
 KERNEL		= krn krnp2
-SYSMODS		= ioman init sysgo_dd sysgo_h0
+SYSMODS		= ioman init sysgo
 CLOCKS      = clock_60hz clock_50hz
 
 RBF		= rbf.mn
@@ -47,11 +47,8 @@
 	$(CP) kernel/$@ .
 
 
-sysgo_dd: sysgo.asm
-	$(AS) $(AFLAGS) $(ASOUT)$@ $< -aDD=1
-
-sysgo_h0: sysgo.asm
-	$(AS) $(AFLAGS) $(ASOUT)$@ $<
+sysgo: sysgo.asm
+	$(AS) $(AFLAGS) $(ASOUT)$@ $< -aROM=1
 
 # Clocks
 clock_60hz: clock.asm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/level1/atari/modules/sysgo.asm	Wed Feb 22 06:38:54 2012 -0600
@@ -0,0 +1,232 @@
+********************************************************************
+* SysGo - Kickstart program module
+*
+* $Id$
+*
+* Edt/Rev  YYYY/MM/DD  Modified by
+* Comment
+* ------------------------------------------------------------------
+*   5      1998/10/12  Boisy G. Pitre
+* Taken from OS-9 L2 Tandy distribution and modified banner for V3.
+*
+*   5r2    2003/01/08  Boisy G. Pitre
+* Fixed fork behavior so that if 'shell startup' fails, system doesn't
+* jmp to Crash, but tries AutoEx instead.  Also changed /DD back to /H0
+* for certain boot floppy cases.
+*
+*          2003/09/04  Boisy G. Pitre
+* Back-ported to OS-9 Level One.
+*
+*   5r3    2003/12/14  Boisy G. Pitre
+* Added SHIFT key check to prevent startup/autoex from starting if
+* held down.  Gene Heskett, this Bud's for you.
+
+         nam   SysGo
+         ttl   Kickstart program module
+
+         IFP1
+         use   defsfile
+         use   scfdefs
+         ENDC
+
+tylg     set   Prgrm+Objct
+atrv     set   ReEnt+rev
+rev      set   $03
+edition  set   $05
+
+         mod   eom,name,tylg,atrv,start,size
+
+
+         org   0
+InitAddr rmb   2
+         rmb   250
+size     equ   .
+
+name     fcs   /SysGo/
+         fcb  edition
+
+* Default process priority
+DefPrior set   128         
+
+Banner   equ   *
+         fcc   /(C) 2012 The NitrOS-9 Project/
+CrRtn    fcb   C$CR,C$LF
+         IFNE  NOS9DBG
+         fcc   "**   DEVELOPMENT BUILD   **"
+         fcb   C$CR,C$LF
+         fcc   "** NOT FOR DISTRIBUTION! **"
+         fcb   C$CR,C$LF
+         ENDC
+         dts   
+         fcb   C$CR,C$LF
+         fcc   !http://www.nitros9.org!
+         fcb   C$CR,C$LF
+         fcb   C$LF
+BannLen  equ   *-Banner
+
+         IFEQ  ROM
+DefDev   equ   *
+         IFNE  DD
+         fcc   "/DD"
+         ELSE
+         fcc   "/H0"
+         ENDC
+         fcb   C$CR
+HDDev    equ   *
+         IFNE  DD
+         fcc   "/DD/"
+         ELSE
+         fcc   "/H0/"
+         ENDC
+ExecDir  fcc   "CMDS"
+         fcb   C$CR
+         ENDC
+
+Shell    fcc   "Shell"
+         fcb   C$CR
+AutoEx   fcc   "mfree"
+         fcb   C$CR
+
+         IFEQ  ROM
+Startup  fcc   "startup -p"
+         fcb   C$CR
+StartupL equ  *-Startup
+         ENDC
+
+ShellPrm equ   *
+         IFGT  Level-1
+         fcc   "i=/1"
+         ENDC
+CRtn     fcb   C$CR
+ShellPL  equ   *-ShellPrm
+
+* Default time packet
+DefTime  dtb
+
+Init     fcs   /Init/
+
+* Entry: X = pointer to start of nul terminated string
+* Exit:  D = length of string
+strlen   pshs  x
+         ldd   #-1
+go@      addd  #$0001
+         tst   ,x+
+         bne   go@
+         puls  x,pc
+
+WriteCR  pshs  y
+         leax  CrRtn,pcr
+         ldy   #$0001
+         os9   I$WritLn
+         puls  y,pc
+         
+* SysGo Entry Point
+start
+         leax  >IcptRtn,pcr
+         os9   F$Icpt
+* Set priority of this process
+         os9   F$ID
+         ldb   #DefPrior
+         os9   F$SPrior
+
+* Write OS name and Machine name strings
+         leax  Init,pcr
+         clra
+         pshs  u
+         os9   F$Link
+         bcs   SignOn
+         stx   <InitAddr
+         ldd   OSName,u					point to OS name in INIT module
+         leax  d,u						point to install name in INIT module
+         bsr   strlen         
+         tfr   d,y
+         lda   #$01
+         os9   I$Write
+         bsr   WriteCR
+         ldd   InstallName,u
+         leax  d,u						point to install name in INIT module
+         bsr   strlen         
+         tfr   d,y
+         lda   #$01
+         os9   I$Write
+         bsr   WriteCR
+         
+* Show rest of banner
+SignOn
+         puls  u
+         leax  >Banner,pcr
+         ldy   #BannLen
+         lda   #$01                    standard output
+         os9   I$Write                 write out banner
+
+* Set default time
+         leax  >DefTime,pcr
+         os9   F$STime                 set time to default
+         IFEQ  ROM
+* Change EXEC and DATA dirs
+         leax  >ExecDir,pcr
+         lda   #EXEC.
+         os9   I$ChgDir                change exec. dir
+         leax  >DefDev,pcr
+* Made READ. so that no write occurs at boot (Boisy on Feb 5, 2012)
+*         lda   #READ.+WRITE.
+         lda   #READ.
+         os9   I$ChgDir                change data dir.
+         bcs   L0125
+         leax  >HDDev,pcr
+         lda   #EXEC.
+         os9   I$ChgDir                change exec. dir to HD
+         ENDC
+
+L0125    equ   *
+         pshs  u,y
+         IFEQ  ROM
+* Fork shell startup here
+* Added 12/14/03: If SHIFT is held down, startup is not run
+         lda   #$01			standard output
+         ldb   #SS.KySns
+         os9   I$GetStt
+         bcs   DoStartup
+         bita  #SHIFTBIT		SHIFT key down?
+         bne   L0186			Yes, don't to startup or autoex
+DoStartup leax  >Shell,pcr
+         leau  >Startup,pcr
+         ldd   #256
+         ldy   #StartupL
+         os9   F$Fork
+         bcs   DoAuto
+         os9   F$Wait
+         ENDC
+* Fork AutoEx here
+DoAuto   leax  >AutoEx,pcr
+         leau  >CRtn,pcr
+         ldd   #$0100
+         ldy   #$0001
+         os9   F$Fork
+         bcs   L0186
+         os9   F$Wait
+         bra   DoAuto
+L0186    equ   *
+         puls  u,y
+FrkShell leax  >ShellPrm,pcr
+         leay  ,u
+         ldb   #ShellPL
+L0190    lda   ,x+
+         sta   ,y+
+         decb
+         bne   L0190
+* Fork final shell here
+         leax  >Shell,pcr
+         lda   #$01		D = 256 (B already 0 from above)
+         ldy   #ShellPL
+         os9   F$Fork
+         bcs   DeadEnd
+         os9   F$Wait
+         bcc   FrkShell
+DeadEnd  bra   DeadEnd
+
+IcptRtn  rti
+
+         emod
+eom      equ   *
+         end
--- a/level1/atari/modules/vtio.asm	Tue Feb 21 08:34:51 2012 -0600
+++ b/level1/atari/modules/vtio.asm	Wed Feb 22 06:38:54 2012 -0600
@@ -15,7 +15,7 @@
          ifp1            
          use   defsfile  
          use   scfdefs   
-         use   vtiodefs  
+         use   atarivtio.d
          endc            
                          
 tylg     set   Drivr+Objct
@@ -39,6 +39,8 @@
          lbra  SetStat   
          lbra  Term      
                          
+
+
 * Init
 *
 * Entry:
@@ -49,38 +51,56 @@
 *    CC = carry set on error
 *    B  = error code
 *
-Init                     
-***********************************
- clrb
-cleario
- ldx   #$D000
- clr   b,x
- ldx   #$D200
- clr   b,x
- ldx   #$D300
- clr   b,x
- ldx   #$D400
- clr   b,x
- decb
- bne   cleario
- lda   #3
- sta   $D20F ; set Pokey to active
+Init      
+		pshs	u
+
+* setup static vars
+		clra
+		clrb
+		std	V.CurRow,u
+
+* Screen memory starts at $0500
+* Clear with As
+          ldy  #ScrStart+Cols*Rows
+          pshs y
+          ldy  #ScrStart
+          ldd  #$0000
+clearLoop@
+     	std	,y++
+     	cmpy	,s
+     	bne	clearLoop@
+     	puls	y
+* tell the ANTIC where the dlist is
+		ldd	#$00FF		byte swapped (address is $FF00, currently in krn)
+		std	DLISTL
 
-delay
- lda   #$E4
- sta   $D01A  ; set screen color
-* lda   #$A0
-* sta   $D200
-* lda   #$A1
-* sta   $D202  ; set audf1 and audf2
-* lda   #$A8
-* sta   $D201
-* sta   $D203  ; set audc1 and audc2
-wait
- jmp   wait
-***********************************
+* tell the ANTIC where the character set is (page aligned, currently in krn)		
+		lda	#$F8
+		sta	CHBASE
+		
+* set background color
+		lda	#$00
+ 		sta	COLBK
 
-                         
+* set text color
+		lda	#$0F
+ 		sta	COLPF0
+ 		sta	COLPF1
+ 		sta	COLPF3
+		lda	#$94
+ 		sta	COLPF2
+ 		
+* tell ANTIC to start DMA
+		lda	#$22
+ 		sta	DMACTL
+
+* tell ANTIC to enable characters
+		lda	#$01
+ 		sta	CHACTL
+ 		
+		clrb
+		puls	u,pc
+  
 * Term
 *
 * Entry:
@@ -90,8 +110,9 @@
 *    CC = carry set on error
 *    B  = error code
 *
-Term     pshs  cc        
-         puls  pc,cc     
+Term		
+		clrb
+		rts
                          
 * Read
 *
@@ -105,7 +126,8 @@
 *    B  = error code
 *
 Read                     
-L00A3    rts             
+		clrb
+		rts             
                          
 
 * Write
@@ -120,8 +142,41 @@
 *    B  = error code
 *
 Write
-
-         rts             
+		cmpa		#C$CR
+		bne		checklf
+		clr		V.CurCol,u
+		clrb
+		rts
+		
+checklf	cmpa		#C$LF
+		bne		wchar
+		ldd		V.CurRow,u
+		bra		incrow
+wchar		
+		suba		#$20
+		pshs		a
+		lda		V.CurRow,u
+		ldb		#Cols
+		mul
+		addb		V.CurCol,u
+		adca		#0
+		ldx		#ScrStart
+		leax		d,x
+		puls		a
+		sta		,x
+		ldd		V.CurRow,u
+		incb
+		cmpb		#40
+		blt		ok
+		clrb
+incrow
+		inca
+		cmpa		#24
+		blt		ok
+		clra
+ok		std		V.CurRow,u		
+		clrb
+		rts             
                          
 * GetStat
 *
@@ -135,8 +190,8 @@
 *    B  = error code
 *
 GetStat
-         clrb            
-         rts             
+		clrb            
+		rts             
                                                  
 * SetStat
 *
@@ -150,8 +205,10 @@
 *    B  = error code
 *
 SetStat
-L055C    rts             
-                         
-         emod            
-eom      equ   *         
-         end             
+		clrb
+		rts             
+
+	
+		emod            
+eom		equ	*
+		end             
--- a/level1/modules/kernel/krn.asm	Tue Feb 21 08:34:51 2012 -0600
+++ b/level1/modules/kernel/krn.asm	Wed Feb 22 06:38:54 2012 -0600
@@ -33,6 +33,14 @@
 *  $0400-$04FF  |           System Stack           |
 *               |                                  |
 *     $0500---->|==================================|
+*               |                                  |
+*               |                                  |
+*               |                                  |
+*  $0500-$08FF  |    Screen Memory (Atari Only)    |
+*               |                                  |
+*               |                                  |
+*               |                                  |
+*     $0900---->|==================================|
 *
 * Edt/Rev  YYYY/MM/DD  Modified by
 * Comment
@@ -63,6 +71,9 @@
          ifp1
          use   defsfile
          use   scfdefs
+         IFNE	atari
+         use   atarivtio.d
+         ENDC
          endc
 
 tylg     set   Systm+Objct
@@ -144,6 +155,30 @@
 * OS-9 Genesis!
 
 OS9Cold  equ   *
+
+         IFNE  atari
+* Currently NitrOS-9 is in ROM on the Atari.
+* Since the Liber809 is coming here directly from reset,
+* we will be good and get the hardware initialized properly.
+         orcc  #IntMasks
+* Clear I/O devices
+         clrb
+cleario
+         ldx   #$D000
+         clr   b,x
+         ldx   #$D200
+         clr   b,x
+         ldx   #$D300
+         clr   b,x
+         ldx   #$D400
+         clr   b,x
+         decb
+         bne   cleario         
+* set POKEY to active
+         lda   #3
+         sta   $D20F
+         ENDC
+         
 * clear out system globals from $0000-$0400
 *         ldx   #D.FMBM
          ldx   #$0000
@@ -298,8 +333,17 @@
          bcc   L0158
          std   <D.MLIM
 L0158    ldx   <D.FMBM
-         ldb   #$F8
+		IFNE	atari
+* In the Atari, memory $0000-$08FF is used by the system
+         ldb   #%11111111
          stb   ,x
+         ldb   #%10000000
+         stb   1,x
+		ELSE
+* In the CoCo, memory $0000-$04FF is used by the system
+         ldb   #%11111000
+         stb   ,x
+         	ENDC
          clra
          ldb   <D.MLIM
          negb
@@ -905,9 +949,257 @@
          use   fcmpnam.asm
 
          use   fssvc.asm
-          
-         emod
-eom      equ   *
+
+* Character Set -- must be aligned on a 1K boundary!
+CharSet
+		fcb	$00,$00,$00,$00,$00,$00,$00,$00	;$00 - space
+		fcb	$00,$18,$18,$18,$18,$00,$18,$00	;$01 - !
+		fcb	$00,$66,$66,$66,$00,$00,$00,$00	;$02 - "
+		fcb	$00,$66,$FF,$66,$66,$FF,$66,$00	;$03 - #
+		fcb	$18,$3E,$60,$3C,$06,$7C,$18,$00	;$04 - $
+		fcb	$00,$66,$6C,$18,$30,$66,$46,$00	;$05 - %
+		fcb	$1C,$36,$1C,$38,$6F,$66,$3B,$00	;$06 - &
+		fcb	$00,$18,$18,$18,$00,$00,$00,$00	;$07 - '
+		fcb	$00,$0E,$1C,$18,$18,$1C,$0E,$00	;$08 - (
+		fcb	$00,$70,$38,$18,$18,$38,$70,$00	;$09 - )
+		fcb	$00,$66,$3C,$FF,$3C,$66,$00,$00	;$0A - asterisk
+		fcb	$00,$18,$18,$7E,$18,$18,$00,$00	;$0B - plus
+		fcb	$00,$00,$00,$00,$00,$18,$18,$30	;$0C - comma
+		fcb	$00,$00,$00,$7E,$00,$00,$00,$00	;$0D - minus
+		fcb	$00,$00,$00,$00,$00,$18,$18,$00	;$0E - period
+		fcb	$00,$06,$0C,$18,$30,$60,$40,$00	;$0F - /
+		
+		fcb	$00,$3C,$66,$6E,$76,$66,$3C,$00	;$10 - 0
+		fcb	$00,$18,$38,$18,$18,$18,$7E,$00	;$11 - 1
+		fcb	$00,$3C,$66,$0C,$18,$30,$7E,$00	;$12 - 2
+		fcb	$00,$7E,$0C,$18,$0C,$66,$3C,$00	;$13 - 3
+		fcb	$00,$0C,$1C,$3C,$6C,$7E,$0C,$00	;$14 - 4
+		fcb	$00,$7E,$60,$7C,$06,$66,$3C,$00	;$15 - 5
+		fcb	$00,$3C,$60,$7C,$66,$66,$3C,$00	;$16 - 6
+		fcb	$00,$7E,$06,$0C,$18,$30,$30,$00	;$17 - 7
+		fcb	$00,$3C,$66,$3C,$66,$66,$3C,$00	;$18 - 8
+		fcb	$00,$3C,$66,$3E,$06,$0C,$38,$00	;$19 - 9
+		fcb	$00,$00,$18,$18,$00,$18,$18,$00	;$1A - colon
+		fcb	$00,$00,$18,$18,$00,$18,$18,$30	;$1B - semicolon
+		fcb	$06,$0C,$18,$30,$18,$0C,$06,$00	;$1C - <
+		fcb	$00,$00,$7E,$00,$00,$7E,$00,$00	;$1D - =
+		fcb	$60,$30,$18,$0C,$18,$30,$60,$00	;$1E - >
+		fcb	$00,$3C,$66,$0C,$18,$00,$18,$00	;$1F - ?
+		
+		fcb	$00,$3C,$66,$6E,$6E,$60,$3E,$00	;$20 - @
+		fcb	$00,$18,$3C,$66,$66,$7E,$66,$00	;$21 - A
+		fcb	$00,$7C,$66,$7C,$66,$66,$7C,$00	;$22 - B
+		fcb	$00,$3C,$66,$60,$60,$66,$3C,$00	;$23 - C
+		fcb	$00,$78,$6C,$66,$66,$6C,$78,$00	;$24 - D
+		fcb	$00,$7E,$60,$7C,$60,$60,$7E,$00	;$25 - E
+		fcb	$00,$7E,$60,$7C,$60,$60,$60,$00	;$26 - F
+		fcb	$00,$3E,$60,$60,$6E,$66,$3E,$00	;$27 - G
+		fcb	$00,$66,$66,$7E,$66,$66,$66,$00	;$28 - H
+		fcb	$00,$7E,$18,$18,$18,$18,$7E,$00	;$29 - I
+		fcb	$00,$06,$06,$06,$06,$66,$3C,$00	;$2A - J
+		fcb	$00,$66,$6C,$78,$78,$6C,$66,$00	;$2B - K
+		fcb	$00,$60,$60,$60,$60,$60,$7E,$00	;$2C - L
+		fcb	$00,$63,$77,$7F,$6B,$63,$63,$00	;$2D - M
+		fcb	$00,$66,$76,$7E,$7E,$6E,$66,$00	;$2E - N
+		fcb	$00,$3C,$66,$66,$66,$66,$3C,$00	;$2F - O
+		
+		fcb	$00,$7C,$66,$66,$7C,$60,$60,$00	;$30 - P
+		fcb	$00,$3C,$66,$66,$66,$6C,$36,$00	;$31 - Q
+		fcb	$00,$7C,$66,$66,$7C,$6C,$66,$00	;$32 - R
+		fcb	$00,$3C,$60,$3C,$06,$06,$3C,$00	;$33 - S
+		fcb	$00,$7E,$18,$18,$18,$18,$18,$00	;$34 - T
+		fcb	$00,$66,$66,$66,$66,$66,$7E,$00	;$35 - U
+		fcb	$00,$66,$66,$66,$66,$3C,$18,$00	;$36 - V
+		fcb	$00,$63,$63,$6B,$7F,$77,$63,$00	;$37 - W
+		fcb	$00,$66,$66,$3C,$3C,$66,$66,$00	;$38 - X
+		fcb	$00,$66,$66,$3C,$18,$18,$18,$00	;$39 - Y
+		fcb	$00,$7E,$0C,$18,$30,$60,$7E,$00	;$3A - Z
+		fcb	$00,$1E,$18,$18,$18,$18,$1E,$00	;$3B - [
+		fcb	$00,$40,$60,$30,$18,$0C,$06,$00	;$3C - \
+		fcb	$00,$78,$18,$18,$18,$18,$78,$00	;$3D - ]
+		fcb	$00,$08,$1C,$36,$63,$00,$00,$00	;$3E - ^
+		fcb	$00,$00,$00,$00,$00,$00,$FF,$00	;$3F - underline
+		
+		fcb	$00,$18,$3C,$7E,$7E,$3C,$18,$00	;$60 - diamond card
+		fcb	$00,$00,$3C,$06,$3E,$66,$3E,$00	;$61 - a
+		fcb	$00,$60,$60,$7C,$66,$66,$7C,$00	;$62 - b
+		fcb	$00,$00,$3C,$60,$60,$60,$3C,$00	;$63 - c
+		fcb	$00,$06,$06,$3E,$66,$66,$3E,$00	;$64 - d
+		fcb	$00,$00,$3C,$66,$7E,$60,$3C,$00	;$65 - e
+		fcb	$00,$0E,$18,$3E,$18,$18,$18,$00	;$66 - f
+		fcb	$00,$00,$3E,$66,$66,$3E,$06,$7C	;$67 - g
+		fcb	$00,$60,$60,$7C,$66,$66,$66,$00	;$68 - h
+		fcb	$00,$18,$00,$38,$18,$18,$3C,$00	;$69 - i
+		fcb	$00,$06,$00,$06,$06,$06,$06,$3C	;$6A - j
+		fcb	$00,$60,$60,$6C,$78,$6C,$66,$00	;$6B - k
+		fcb	$00,$38,$18,$18,$18,$18,$3C,$00	;$6C - l
+		fcb	$00,$00,$66,$7F,$7F,$6B,$63,$00	;$6D - m
+		fcb	$00,$00,$7C,$66,$66,$66,$66,$00	;$6E - n
+		fcb	$00,$00,$3C,$66,$66,$66,$3C,$00	;$6F - o
+		
+		fcb	$00,$00,$7C,$66,$66,$7C,$60,$60	;$70 - p
+		fcb	$00,$00,$3E,$66,$66,$3E,$06,$06	;$71 - q
+		fcb	$00,$00,$7C,$66,$60,$60,$60,$00	;$72 - r
+		fcb	$00,$00,$3E,$60,$3C,$06,$7C,$00	;$73 - s
+		fcb	$00,$18,$7E,$18,$18,$18,$0E,$00	;$74 - t
+		fcb	$00,$00,$66,$66,$66,$66,$3E,$00	;$75 - u
+		fcb	$00,$00,$66,$66,$66,$3C,$18,$00	;$76 - v
+		fcb	$00,$00,$63,$6B,$7F,$3E,$36,$00	;$77 - w
+		fcb	$00,$00,$66,$3C,$18,$3C,$66,$00	;$78 - x
+		fcb	$00,$00,$66,$66,$66,$3E,$0C,$78	;$79 - y
+		fcb	$00,$00,$7E,$0C,$18,$30,$7E,$00	;$7A - z
+		fcb	$00,$18,$3C,$7E,$7E,$18,$3C,$00	;$7B - spade card
+		fcb	$18,$18,$18,$18,$18,$18,$18,$18	;$7C - |
+		fcb	$00,$7E,$78,$7C,$6E,$66,$06,$00	;$7D - display clear
+		fcb	$08,$18,$38,$78,$38,$18,$08,$00	;$7E - display backspace
+		fcb	$10,$18,$1C,$1E,$1C,$18,$10,$00	;$7F - display tab
+
+		fcb	$00,$36,$7F,$7F,$3E,$1C,$08,$00	;$40 - heart card
+		fcb	$18,$18,$18,$1F,$1F,$18,$18,$18	;$41 - mid left window
+		fcb	$03,$03,$03,$03,$03,$03,$03,$03	;$42 - right box
+		fcb	$18,$18,$18,$F8,$F8,$00,$00,$00	;$43 - low right window
+		fcb	$18,$18,$18,$F8,$F8,$18,$18,$18	;$44 - mid right window
+		fcb	$00,$00,$00,$F8,$F8,$18,$18,$18	;$45 - up right window
+		fcb	$03,$07,$0E,$1C,$38,$70,$E0,$C0	;$46 - right slant box
+		fcb	$C0,$E0,$70,$38,$1C,$0E,$07,$03	;$47 - left slant box
+		fcb	$01,$03,$07,$0F,$1F,$3F,$7F,$FF	;$48 - right slant solid
+		fcb	$00,$00,$00,$00,$0F,$0F,$0F,$0F	;$49 - low right solid
+		fcb	$80,$C0,$E0,$F0,$F8,$FC,$FE,$FF	;$4A - left slant solid
+		fcb	$0F,$0F,$0F,$0F,$00,$00,$00,$00	;$4B - up right solid
+		fcb	$F0,$F0,$F0,$F0,$00,$00,$00,$00	;$4C - up left solid
+		fcb	$FF,$FF,$00,$00,$00,$00,$00,$00	;$4D - top box
+		fcb	$00,$00,$00,$00,$00,$00,$FF,$FF	;$4E - bottom box
+		fcb	$00,$00,$00,$00,$F0,$F0,$F0,$F0	;$4F - low left solid
+		
+		fcb	$00,$1C,$1C,$77,$77,$08,$1C,$00	;$50 - club card
+		fcb	$00,$00,$00,$1F,$1F,$18,$18,$18	;$51 - up left window
+		fcb	$00,$00,$00,$FF,$FF,$00,$00,$00	;$52 - mid box
+		fcb	$18,$18,$18,$FF,$FF,$18,$18,$18	;$53 - mid window
+		fcb	$00,$00,$3C,$7E,$7E,$7E,$3C,$00	;$54 - solid circle
+		fcb	$00,$00,$00,$00,$FF,$FF,$FF,$FF	;$55 - bottom solid
+		fcb	$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0	;$56 - left box
+		fcb	$00,$00,$00,$FF,$FF,$18,$18,$18	;$57 - up mid window
+		fcb	$18,$18,$18,$FF,$FF,$00,$00,$00	;$58 - low mid window
+		fcb	$F0,$F0,$F0,$F0,$F0,$F0,$F0,$F0	;$59 - left solid
+		fcb	$18,$18,$18,$1F,$1F,$00,$00,$00	;$5A - low left window
+		fcb	$78,$60,$78,$60,$7E,$18,$1E,$00	;$5B - display escape
+		fcb	$00,$18,$3C,$7E,$18,$18,$18,$00	;$5C - up arrow
+		fcb	$00,$18,$18,$18,$7E,$3C,$18,$00	;$5D - down arrow
+		fcb	$00,$18,$30,$7E,$30,$18,$00,$00	;$5E - left arrow
+		fcb	$00,$18,$0C,$7E,$0C,$18,$00,$00	;$5F - right arrow
+		
+ use atarivtio.d
+dump
+ pshs d,x
+ leax hextable,pcr
+ ldb ,s
+ andb #$F0
+ lsrb
+ lsrb
+ lsrb
+ lsrb
+ lda b,x
+ sta ScrStart+0
+ ldb ,s
+ andb #$0F
+ lda b,x
+ sta ScrStart+1
+
+ ldb 1,s
+ andb #$F0
+ lsrb
+ lsrb
+ lsrb
+ lsrb
+ lda b,x
+ sta ScrStart+2
+ ldb 1,s
+ andb #$0F
+ lda b,x
+ sta ScrStart+3
+m jmp m
+
+hextable	fcb $30-$20,$31-$20,$32-$20,$33-$20,$34-$20,$35-$20,$36-$20,$37-$20
+		fcb $38-$20,$39-$20,$41-$20,$42-$20,$43-$20,$44-$20,$45-$20,$46-$20
+
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39
+* The display list sets up the ANTIC chip to display the main screen. 
+* It cannot cross a 1K boundary.
+dlist
+		fcb	$70,$70,$70	3 * 8 blank scanlines
+		fcb	$42			Mode 2 with LMS (Load Memory Scan).  Mode 2 = 40 column hires text, next 2 bytes L/H determine screen origin
+		fdbs	ScrStart		screen origin.  Usually put at top of available RAM.  Screen data will wrap around 4K boundary unless another LMS is used
+* default with Atari OS in >= 48K system is $9C40 for a 40*24 screen
+		fcb	2,2,2,2,2,2,2,2,2,2
+		fcb	2,2,2,2,2,2,2,2,2,2
+		fcb	2,2,2
+* 23 extra mode 2 lines for total of 24.  240 scanlines can be used for display area, but a hires line can't be on scanline 240 due to an Antic bug
+		fcb	$41			this is the end of Display List command JVB (Jump and wait for Vertical Blank)
+          IFP2
+         	fdbs $10000-eomem+dlist
+         	ELSE
+         	fdb  $0000
+         	ENDC
+
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+          fcb  $39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39,$39
+*          fcb  $39,$39,$39
+
+		emod
+eom      	equ	*
 
          fdb   Clock
 Vectors  fdb   SWI3                    SWI3 
--- a/level1/modules/kernel/krnp2.asm	Tue Feb 21 08:34:51 2012 -0600
+++ b/level1/modules/kernel/krnp2.asm	Wed Feb 22 06:38:54 2012 -0600
@@ -739,5 +739,5 @@
          bcs   ValBoot
 JmpBtEr  puls  pc,u
 
-         emod
+		emod
 eom      equ   *