changeset 2653:40d55004f686

o krn.asm: Conditionalized out code in kernel to check for top of RAM o vtio.asm: Fixed some issues with the cursor o startup: modified for Atari port
author Boisy Pitre <boisy.pitre@nuance.com>
date Tue, 03 Apr 2012 21:13:12 -0500
parents 32908c617568
children 4036f8e844a7
files level1/atari/bootfiles/makefile level1/atari/makefile level1/atari/modules/vtio.asm level1/atari/startup level1/modules/kernel/krn.asm
diffstat 5 files changed, 36 insertions(+), 93 deletions(-) [+]
line wrap: on
line diff
--- a/level1/atari/bootfiles/makefile	Mon Apr 02 21:54:25 2012 -0500
+++ b/level1/atari/bootfiles/makefile	Tue Apr 03 21:13:12 2012 -0500
@@ -16,7 +16,7 @@
 
 BOOTFILE_P2 = $(MD)/scf.mn $(MD)/vtio.dr $(MD)/term.dt \
 		$(MD)/rbf.mn $(MD)/rbdw3.dr \
-		$(MD)/x0.dd $(MD)/x1.dd \
+		$(MD)/ddx0.dd $(MD)/x1.dd \
 		$(MD)/scdwp.dr $(MD)/p_scdwp.dd \
 		$(CD)/shell_21
 
--- a/level1/atari/makefile	Mon Apr 02 21:54:25 2012 -0500
+++ b/level1/atari/makefile	Tue Apr 03 21:13:12 2012 -0500
@@ -68,7 +68,7 @@
 	$(foreach file, $(SYS), $(OS9ATTR_TEXT) $@,SYS/$(file);)
 	$(CD) defs; $(CPL) $(DEFS) ../$@,DEFS
 	$(foreach file, $(DEFS), $(OS9ATTR_TEXT) $@,DEFS/$(file);)
-	$(CPL) $(STARTUP_DW) $@,startup
+	$(CPL) $(STARTUP) $@,startup
 	$(OS9ATTR_TEXT) $@,startup
 
 $(DSK_DEMO):
--- a/level1/atari/modules/vtio.asm	Mon Apr 02 21:54:25 2012 -0500
+++ b/level1/atari/modules/vtio.asm	Tue Apr 03 21:13:12 2012 -0500
@@ -109,24 +109,22 @@
 *		sta	CHBASE
 		
 * set background color
-		lda	#$00
+		clra
  		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
+*		lda	#$22
+* 		sta	DMACTL
 
 * tell ANTIC to enable character set 2
-		lda	#$02
- 		sta	CHACTL
+*		lda	#$02
+* 		sta	CHACTL
 
 * install keyboard ISR
 		ldd	#IRQST				POKEY IRQ status address
@@ -228,12 +226,11 @@
 *
 Write
 		bsr		hidecursor		
+		ldx		V.EscVect,u
+		jsr		,x
+		bra		drawcursor
 
-		ldx		V.EscVect,u
-		jmp		,x
-
-ChkSpc
-		cmpa		#C$SPAC			space or greater?
+ChkSpc    cmpa		#C$SPAC			space or greater?
 		bcs		ChkESC			branch if not
 		
 wchar	suba		#$20
@@ -274,9 +271,9 @@
 * clear line
 clrline	std		V.CurRow,u
 		bsr		DelLine
-		bra		drawcursor
+		rts
 ok		std		V.CurRow,u
-		bra		drawcursor
+ret		rts
 		
 * calculates the cursor location in screen memory
 * Exit: X = address of cursor
@@ -311,7 +308,7 @@
 		cmpa	#$1B			ESC?
 		lbeq	EscHandler
 		cmpa  #$0D		$0D?
-		bhi   drawcursor	branch if higher than
+		bhi   ret			branch if higher than
 		leax  <DCodeTbl,pcr	deal with screen codes
 		lsla  			adjust for table entry size
 		ldd   a,x		get address in D
@@ -354,7 +351,7 @@
 ErEOLine
 Do05
 CurRght
-		bra		drawcursor
+		rts
 
 CurLeft
 		ldd		V.CurRow,u
@@ -374,32 +371,21 @@
 		ldx		#G.ScrStart
 		leax		d,x
 		clr		1,x
-		
-leave	ldd		V.CurRow,u
-		lbra		drawcursor
+leave	rts
 
 CurDown
 		ldd		V.CurRow,u
 		lbra		incrow
 
 Retrn
-		lda		V.CurRow,u
-		ldb		#G.Cols
-		mul
-		addb		V.CurCol,u
-		adca		#0
-		ldx		#G.ScrStart
-		leax		d,x
-		lda		#C$SPAC-$20
-		sta		,x
 		clr		V.CurCol,u
-		lbra		drawcursor
+		rts
 
 EscHandler
 		leax		EscHandler2,pcr
 eschandlerout
 		stx		V.EscVect,u
-		lbra		drawcursor
+		rts
 
 EscHandler2
 		sta		V.EscCh1,u
--- a/level1/atari/startup	Mon Apr 02 21:54:25 2012 -0500
+++ b/level1/atari/startup	Tue Apr 03 21:13:12 2012 -0500
@@ -1,6 +1,6 @@
 * Echo welcome message
 echo * Welcome to NitrOS-9 Level 1 *
-echo *    on the Color Computer    *
+echo *     on the Atari XL/XE      *
 * Start system time from keyboard
 setime </term
 date -t
--- a/level1/modules/kernel/krn.asm	Mon Apr 02 21:54:25 2012 -0500
+++ b/level1/modules/kernel/krn.asm	Tue Apr 03 21:13:12 2012 -0500
@@ -91,15 +91,6 @@
 * OS-9 Genesis!
 
 OS9Cold  equ   *
-         IFNE  atari
-         IFNE	ROM
-* For when 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.
-		lds #$1000
-		lbsr	InitAtari
-         ENDC
-         ENDC
          
 * clear out system globals from $0000-$0400
 *         ldx   #D.FMBM
@@ -139,6 +130,12 @@
          stx   <D.ModDir+2             X = $400 = mod dir end
          leas  >$0100,x                S = $500 (system stack?)
 
+* NOTE: This routine checks for RAM by writing a pattern at an address
+* then reading it back for validation.  On the CoCo, we pretty much know
+* that we are in all-RAM mode at this point, and the same goes for the
+* other supported platforms.  So I am taking this code out for the time being.
+
+         IFNE  CHECK_FOR_VALID_RAM
 * Check for valid RAM starting at $400
 ChkRAM   leay  ,x
          ldd   ,y                      store org contents in D
@@ -153,11 +150,7 @@
          std   ,y                      else restore org contents
          leax  >$0100,y                check top of next 256 block
          IFNE  atari
-         IFNE  ROM
-         cmpx  #$C000                  stop short of ROM starting at $C000
-         ELSE
          cmpx  #$8000                  stop short of ROM starting at $8000
-         ENDC
          ELSE
          cmpx  #Bt.Start               stop short of boot track mem
          ENDC
@@ -165,10 +158,19 @@
          leay  ,x
 * Here, Y = end of RAM
 L00C2    leax  ,y                      X = end of RAM
+         
+         ELSE
+         
+         IFNE  atari
+         ldx   #$8000
+         ELSE
+         ldx   #Bt.Start         
+         ENDC
+         ENDC
          stx   <D.MLIM                 save off memory limit
 
 * Copy vector code over to address $100
-         pshs  y,x
+         pshs  x
          IFNE  H6309
          leax  >VectCode,pcr
          ldy   #D.XSWI3
@@ -183,13 +185,12 @@
          decb
          bne   L00D2
          ENDC
-         puls  y,x
+         puls  x
 
          IFNE  atari
          ldy   #$D000
 
          inc   <D.Boot
-         stx   <D.MLIM
          stx   <D.BTLO
          ldx	#$FFFF
          stx   <D.BTHI
@@ -874,28 +875,6 @@
 L05E5    ldb   #E$IForkP
 L05E7    puls  pc,u,x
 
-		IFNE	ROM
-***********************************************************************
-* Atari initialization code goes here since we have to pad the area due
-* to 1K alignment of character set above
-InitAtari
-         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         
-		rts
-		ENDC
-
 		use   fsrqmem.asm
          
 		use   fallbit.asm
@@ -923,28 +902,6 @@
 valret	puls  y,pc
 
 		
-
-*VectCode bra   SWI3Jmp		$0100
-*         nop
-*         bra   SWI2Jmp		$0103
-*         nop
-*         bra   FIRQJmp		$0106
-*         nop
-*         bra   IRQJmp		$0109
-*         nop
-*         bra   SWIJmp		$010C
-*         nop
-*         bra   NMIJmp		$010F
-
-*SWI3Jmp  jmp   [>D.SWI3]
-*SWI2Jmp  jmp   [>D.SWI2]
-*FIRQJmp  jmp   [>D.FIRQ]
-*IRQJmp   jmp   [>D.IRQ]
-*SWIJmp   jmp   [>D.SWI]
-*NMIJmp   jmp   [>D.NMI]
-*VectCSz  equ   *-VectCode
-
-
 VectCode bra   SWI3Jmp		$0100
          nop
          bra   SWI2Jmp		$0103