changeset 1909:323e7751c250

Updated
author boisy
date Wed, 09 Nov 2005 00:06:50 +0000
parents 695f74930c6f
children 28a1297dbeba
files 3rdparty/packages/coyota/bin_dec32.a 3rdparty/packages/coyota/coyota.a 3rdparty/packages/coyota/dashboard.a 3rdparty/packages/coyota/instrument.a 3rdparty/packages/coyota/makefile 3rdparty/vefs/girl.vef 3rdparty/vefs/scene.vef 3rdparty/vefs/toyota.vef
diffstat 8 files changed, 218 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/packages/coyota/bin_dec32.a	Wed Nov 09 00:06:50 2005 +0000
@@ -0,0 +1,115 @@
+************************************************ 
+*
+* Binary to decimal conversion (32 bit)
+
+* OTHER MODULES NEEDED: DECTAB$
+
+* ENTRY: X=buffer for ascii string
+*        Y=bits 31-16 of binary value to convert
+*        D=bits 15-0  of binary value to convert
+
+* EXIT: all registers (except cc) preserved
+
+
+ nam 32 bit Binary to Decimal Conversion
+ ttl Assembler Library Module
+
+
+ psect BIN_DEC32,0,0,0,0,0
+
+
+Base     fcb   $3B,$9A,$CA,$00       1,000,000,000
+         fcb   $05,$F5,$E1,$00         100,000,000
+         fcb   $00,$98,$96,$80		10,000,000
+         fcb   $00,$0F,$42,$40		 1,000,000
+         fcb   $00,$01,$86,$A0		   100,000
+         fcb   $00,$00,$27,$10		    10,000
+         fcb   $00,$00,$03,$E8		     1,000
+         fcb   $00,$00,$00,$64		       100
+         fcb   $00,$00,$00,$0A		        10
+         fcb   $00,$00,$00,$01		         1
+
+
+* Entry:
+* A = format flag (0 = write leading zeros, 1 = do not)
+* X = address of buffer to hold number
+* Y = address of 32 bit value
+* Exit:
+* X = address of buffer holding number
+BIN_DEC32:
+	     pshs  d,x,y,u
+         tfr   x,u
+		 tfr   y,x
+         ldb   #10		max number of numbers (10^9)
+         pshs  b		save count on stack
+         leay  <Base,pcr		point to base of numbers
+s@       lda   #$30		put #'0
+         sta   ,u		at U
+s1@      bsr   Sub32		,X=,X-,Y
+         inc   ,u
+         bcc   s1@		if X>0, continue
+         bsr   Add32		add back in
+         dec   ,u+
+         dec   ,s		decrement counter
+         beq   done@
+         lda   ,s
+         cmpa  #$09
+         beq   comma@
+         cmpa  #$06
+         beq   comma@
+         cmpa  #$03
+         bne   s2@
+comma@   ldb   #',
+         stb   ,u+
+s2@      leay  4,y		point to next
+         bra   s@
+done@    leas  1,s
+		 clr	,u		put nil byte at end
+* 1,234,567,890
+		tst		,s		format flag
+		beq		ex2@
+         ldb   #14		length of string with commas + 1
+         ldx   2,s		get pointer to buffer
+a@       decb
+         beq   ex@
+         lda   ,x+		get byte
+         cmpa  #'0
+         beq   a@
+         cmpa  #',
+         beq   a@
+ex@		leax	-1,x
+		stx	2,s
+ex2@	puls  d,x,y,u,pc
+
+* Entry:
+* X = address of 32 bit minuend
+* Y = address of 32 bit subtrahend
+* Exit:
+* X = address of 32 bit difference
+Sub32    ldd   2,x
+         subd  2,y
+         std   2,x
+         ldd   ,x
+         sbcb  1,y
+         sbca  ,y
+         std   ,x
+         rts
+
+
+* Entry:
+* X = address of 32 bit number
+* Y = address of 32 bit number
+* Exit:
+* X = address of 32 bit sum
+Add32    ldd   2,x
+         addd  2,y
+         std   2,x
+         ldd   ,x
+         adcb  1,y
+         adca  ,y
+         std   ,x
+         rts
+
+ endsect
+
+
--- a/3rdparty/packages/coyota/coyota.a	Tue Nov 08 05:19:03 2005 +0000
+++ b/3rdparty/packages/coyota/coyota.a	Wed Nov 09 00:06:50 2005 +0000
@@ -7,8 +7,13 @@
 		psect	coyota_a,$01,$81,1,200,coyota
 
 
+		vsect
+orgopt	rmb		32
+curopt	rmb		32
+		endsect
+		
 * Sleep Duration
-NAPTIME	equ		60
+NAPTIME	equ		6
 
 
 * byte stream to send to window to make a 320x192 16 color gfx screen
@@ -30,11 +35,17 @@
 		fcb		C$CR
 		
 		vsect
+ch		rmb		1
 readbuf	rmb		$2000
 		endsect
 
 * Intercept routine
 exit
+		clra
+		clrb
+		leax	orgopt,u
+		os9		I$SetStt
+
 		leax	<curon,pcr
 		lbsr	PUTS
 		clrb
@@ -51,6 +62,20 @@
 * install intercept routine
 		leax	<intercept,pcr
 		os9		F$Icpt
+
+* get path options
+		lda		#$01
+		clrb
+		leax	orgopt,u
+		os9		I$GetStt
+		leax	curopt,u
+		os9		I$GetStt
+		
+		clr		PD.EKO-PD.OPT,x
+		os9		I$SetStt
+		
+* initialize instrumentation hardware
+		lbsr	insinit
 		
 * make type 6 (320x192 16 color) graphics screen and select font
 Scrn	leax	<type6,pcr
@@ -93,7 +118,19 @@
 		lbsr	fuelgauge				update fuel gauge
 		lbsr	systime					update system time
 		ldx		#NAPTIME				sleep for a bit
-		os9		F$Sleep
+
+*		os9		F$Sleep
+		ldd		#SS.Ready
+		os9		I$GetStt
+		bcs		main
+		leax	ch,u
+		ldy		#$0001
+		os9		I$Read
+		lda		,x
+		cmpa	#'x
+		bne		main
+		lbsr	speedplus
+		
 		bra		main
 
 
--- a/3rdparty/packages/coyota/dashboard.a	Tue Nov 08 05:19:03 2005 +0000
+++ b/3rdparty/packages/coyota/dashboard.a	Wed Nov 09 00:06:50 2005 +0000
@@ -7,7 +7,7 @@
 		psect	dashboard_a,0,0,0,200,0
 
 		vsect
-numbuf	rmb		16
+numbuf	rmb		24
 		endsect
 		
 
@@ -51,9 +51,9 @@
 		fdb		WSetDPtr
 		fdb		320,96
 		fdb		WCircle
-		fdb		120
+		fdb		128
 		fdb		WCircle
-		fdb		128
+		fdb		136
 		fdb		WCircle
 		fdb		32
 		fdb		WCircle
@@ -64,7 +64,7 @@
 		fdb		0,-17
 		fdb		WFFill
 		fdb		WRSetDPtr
-		fdb		0,-46
+		fdb		0,-50
 		fdb		WFFill
 
 * draw 0MPH marker
@@ -83,10 +83,10 @@
 		fdb		WFColor
 		fcb		insfill
 		fdb		WSetDPtr
-		fdb		320,36
+		fdb		320,32
 		fdb		WRLine					draw the mid-speed tick mark
-		fdb		0,6
-		fcb		WPosCur,$20+26,$20+6
+		fdb		0,5
+		fcb		WPosCur,$20+26,$20+5
 		fdb		WFColor
 		fcb		txtclr
 		fcc		/60/
@@ -179,7 +179,7 @@
 		rts
 		
 speedtag
-		fcb		WPosCur,$20+26,$20+11
+		fcb		WPosCur,$20+25,$20+11
 		fdb		WFColor
 		fcb		yellow
 		fcb		$00
@@ -205,21 +205,31 @@
 		rts
 		
 
-odomtag	fcb		WPosCur,$20+0,$20+2
+odomtag	fcb		WPosCur,$20+23,$20+18
+		fdb		WBColor
+		fcb		red
 		fcb		$00
+odomtag2
+		fdb		WBColor
+		fcb		black
+		fcb		$00
+odomtag2l equ	*-odomtag2
 
 odometer:
 		leax	<odomtag,pcr
 		lbsr	PUTS
 		lbsr	getmileage					get odometer in D,X
-		pshs	x
+		pshs	d,x
 		leax	numbuf,u
-		lbsr	BIN_DEC
+		leay	,s
+		lda		#$01
+		lbsr	BIN_DEC32
 		lbsr	PUTS
-		puls	d
-		leax	numbuf,u
-		lbsr	BIN_DEC
-		lbsr	PUTS
+		leas	4,s
+		leax	<odomtag2,pcr
+		ldy		#odomtag2l
+		lda		#$01
+		os9		I$Write
 		rts
 		
 etemptag	fcb	WPosCur,$20+7,$20+8
--- a/3rdparty/packages/coyota/instrument.a	Tue Nov 08 05:19:03 2005 +0000
+++ b/3rdparty/packages/coyota/instrument.a	Wed Nov 09 00:06:50 2005 +0000
@@ -6,6 +6,34 @@
 
 		psect	instrument_a,0,0,3,0,0
 
+		vsect
+speed	rmb		2
+mileage	rmb		4
+engtemp	rmb		2
+fuelamt	rmb		2
+		endsect
+		
+* initialize hardware
+*
+* Entry: None
+*
+* Exit:  D = speed value in miles per hour
+insinit:
+		ldd		#55
+		std		speed,u
+
+		ldd		#(171556/65536)
+		std		mileage,u
+		ldd		#40439
+		std		mileage+2,u
+
+		ldd		#200
+		std		engtemp,u
+		
+		ldd		#9
+		std		fuelamt,u
+		
+		rts
 
 * Get the current speed
 *
@@ -13,9 +41,14 @@
 *
 * Exit:  D = speed value in miles per hour
 getspeed:
-		ldd		#55			55 mph
+		ldd		speed,u			55 mph
 		rts
 
+speedplus:
+		ldd		speed,u
+		addd	#$0001
+		std		speed,u
+		rts
 
 * Get the odometer value
 *
@@ -24,8 +57,8 @@
 * Exit:  D = bits 23-16 of odometer
 *        X = bits 15-0  of odometer
 getmileage:
-		ldd		#2			
-		ldx		#0000		2*65536 miles
+		ldd		mileage,u
+		ldx		mileage+2,u
 		rts
 
 		
@@ -35,7 +68,7 @@
 *
 * Exit:  D = engine temperature value in Farenheit
 getengtemp:
-		ldd		#200		200 degrees Farenheit
+		ldd		engtemp,u
 		rts
 
 		
@@ -45,7 +78,7 @@
 *
 * Exit:  D = fuel amount in 16ths
 getfuel:
-		ldd		#8			half a tank
+		ldd		fuelamt,u
 		rts
 
 		
--- a/3rdparty/packages/coyota/makefile	Tue Nov 08 05:19:03 2005 +0000
+++ b/3rdparty/packages/coyota/makefile	Wed Nov 09 00:06:50 2005 +0000
@@ -2,7 +2,7 @@
 
 TARGET	= coyota
 LFLAGS	+= -y -l=$(HOME)/Projects/c3/lib/rmalib/alib.l
-RFILES	= coyota.r instrument.r dashboard.r
+RFILES	= coyota.r instrument.r dashboard.r bin_dec32.r
 
 $(TARGET): $(RFILES)
 
Binary file 3rdparty/vefs/girl.vef has changed
Binary file 3rdparty/vefs/scene.vef has changed
Binary file 3rdparty/vefs/toyota.vef has changed