changeset 1908:695f74930c6f

Start of Coyota software
author boisy
date Tue, 08 Nov 2005 05:19:03 +0000
parents 638ffc04bbd0
children 323e7751c250
files 3rdparty/packages/coyota/coyota.a 3rdparty/packages/coyota/dashboard.a 3rdparty/packages/coyota/instrument.a 3rdparty/packages/coyota/makefile
diffstat 4 files changed, 428 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/packages/coyota/coyota.a	Tue Nov 08 05:19:03 2005 +0000
@@ -0,0 +1,106 @@
+****************************************************************************
+*
+* coyota.a - main coyota application
+*
+*
+
+		psect	coyota_a,$01,$81,1,200,coyota
+
+
+* Sleep Duration
+NAPTIME	equ		60
+
+
+* byte stream to send to window to make a 320x192 16 color gfx screen
+type6	fdb		WDWEnd
+		fdb		WDWSet
+		fcb		$08,$00,$00,$28,$18,$00,$02,$02
+		fdb		WSelect
+		fdb		WCurOff
+selfnt	fdb		WFont
+		fcb		$c8,$02			select 6x8 stdfont
+type6L	equ		*-type6
+selfntL	equ		*-selfnt
+
+curon	fdb		WCurOn
+		fcb		$00
+		
+stdfonts
+		fcc		"SYS/stdfonts"
+		fcb		C$CR
+		
+		vsect
+readbuf	rmb		$2000
+		endsect
+
+* Intercept routine
+exit
+		leax	<curon,pcr
+		lbsr	PUTS
+		clrb
+		os9		F$Exit
+		
+intercept
+		cmpb	#S$Abort
+		beq		exit
+		rti
+
+
+* main entry point
+coyota:
+* install intercept routine
+		leax	<intercept,pcr
+		os9		F$Icpt
+		
+* make type 6 (320x192 16 color) graphics screen and select font
+Scrn	leax	<type6,pcr
+		ldy		#type6L
+		lda		#1
+		os9		I$Write
+		bcc		next
+
+* error occurred... merge stdfonts
+		leax	<stdfonts,pcr
+		lda		#READ.
+		os9		I$Open
+		bcs		Scrn
+		leax	readbuf,u
+		pshs	a					save path num to stack
+rl		ldy		#2048
+		os9		I$Read
+		bcs		close		
+		lda		#$01
+		os9		I$Write
+		lda		,s
+		bra		rl	
+close	lda		,s+
+		os9		I$Close
+		leax	<selfnt,pcr
+		ldy		#selfntL
+		lda		#$01
+		os9		I$Write
+
+next	lbsr	dashboard			draw the dashboard
+
+* Main processing loop:
+*  - get values from various instruments
+*  - display them on the appropriate section of the screen
+*  - sleep a while
+*  - go back and do it again!
+main	lbsr	speed					update speedometer
+		lbsr	odometer				update odometer
+		lbsr	engtemp					update engine temperature
+		lbsr	fuelgauge				update fuel gauge
+		lbsr	systime					update system time
+		ldx		#NAPTIME				sleep for a bit
+		os9		F$Sleep
+		bra		main
+
+
+
+* ENTRY: X=buffer for ascii string
+*        D=binary value to convert
+
+* EXIT: all registers (except cc) preserved
+
+		endsect
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/packages/coyota/dashboard.a	Tue Nov 08 05:19:03 2005 +0000
@@ -0,0 +1,260 @@
+****************************************************************************
+*
+* dashboard.a - draw the dashboard
+*
+*
+
+		psect	dashboard_a,0,0,0,200,0
+
+		vsect
+numbuf	rmb		16
+		endsect
+		
+
+white	equ		$00
+blue	equ		$01
+black	equ		$02
+green	equ		$03
+red		equ		$04
+yellow	equ		$05
+magenta	equ		$06
+cyan	equ		$07
+
+
+inshlgt	equ		blue
+insfill	equ		cyan
+txtclr	equ		$03						green
+
+* byte stream to send to window to make dashboard
+dash
+		fdb		WScaleSw
+		fcb		$01						turn on scaling
+
+***** TITLE *****
+		fdb		WFont
+		fdb		$C801
+		fcb		WPosCur,$20+17,$20+1
+		fdb		WFColor
+		fcb		red
+		fdb		WBoldSw
+		fcb		$01
+		fcc		/COYOTA!/
+		fdb		WFont
+		fdb		$C802
+		fdb		WBoldSw
+		fcb		$00
+
+		fdb		WFColor
+		fcb		inshlgt
+
+***** SPEEDOMETER *****
+		fdb		WSetDPtr
+		fdb		320,96
+		fdb		WCircle
+		fdb		120
+		fdb		WCircle
+		fdb		128
+		fdb		WCircle
+		fdb		32
+		fdb		WCircle
+		fdb		38
+		fdb		WFColor
+		fcb		insfill
+		fdb		WRSetDPtr
+		fdb		0,-17
+		fdb		WFFill
+		fdb		WRSetDPtr
+		fdb		0,-46
+		fdb		WFFill
+
+* draw 0MPH marker
+		fdb		WFColor
+		fcb		insfill
+		fdb		WSetDPtr
+		fdb		227,132
+		fdb		WRLine					draw the tick mark
+		fdb		5,-4
+		fcb		WPosCur,$20+20,$20+15
+		fdb		WFColor
+		fcb		txtclr
+		fcc		/0/
+
+* draw 60MPH marker
+		fdb		WFColor
+		fcb		insfill
+		fdb		WSetDPtr
+		fdb		320,36
+		fdb		WRLine					draw the mid-speed tick mark
+		fdb		0,6
+		fcb		WPosCur,$20+26,$20+6
+		fdb		WFColor
+		fcb		txtclr
+		fcc		/60/
+		fdb		WFColor
+		fcb		insfill
+		
+* draw 120MPH marker
+		fdb		WSetDPtr
+		fdb		413,132
+		fdb		WRLine					draw the tick mark
+		fdb		-5,-4
+		fcb		WPosCur,$20+31,$20+15
+		fdb		WFColor
+		fcb		txtclr
+		fcc		/120/
+		fdb		WFColor
+		fcb		inshlgt
+
+***** ENGINE TEMPERATURE (UPPER LEFT) *****
+		fdb		WSetDPtr
+		fdb		104,52
+		fdb		WCircle
+		fdb		66
+		fdb		WCircle
+		fdb		72
+		fdb		WRSetDPtr
+		fdb		0,-34
+		fdb		WFColor
+		fcb		insfill
+		fdb		WFFill
+
+***** FUEL GAUGE (UPPER RIGHT) *****
+		fdb		WFColor
+		fcb		inshlgt
+		fdb		WSetDPtr
+		fdb		536,52
+		fdb		WCircle
+		fdb		66
+		fdb		WCircle
+		fdb		72
+		fdb		WRSetDPtr
+		fdb		0,-34
+		fdb		WFColor
+		fcb		insfill
+		fdb		WFFill
+
+***** DATE/TIME (LOWER LEFT) *****
+		fdb		WFColor
+		fcb		inshlgt
+		fdb		WSetDPtr
+		fdb		104,192-52
+		fdb		WCircle
+		fdb		66
+		fdb		WCircle
+		fdb		72
+		fdb		WRSetDPtr
+		fdb		0,-34
+		fdb		WFColor
+		fcb		insfill
+		fdb		WFFill
+
+***** ???? (LOWER LEFT) *****
+		fdb		WFColor
+		fcb		inshlgt
+		fdb		WSetDPtr
+		fdb		536,192-52
+		fdb		WCircle
+		fdb		66
+		fdb		WCircle
+		fdb		72
+		fdb		WRSetDPtr
+		fdb		0,-34
+		fdb		WFColor
+		fcb		insfill
+		fdb		WFFill
+
+* finally, draw text color from now now
+		fdb		WFColor
+		fcb		txtclr					set text draw color
+
+dashL	equ		*-dash
+
+* entry point
+dashboard:
+* draw the dashboard
+Scrn	leax	dash,pcr
+		ldy		#dashL
+		lda		#1
+		os9		I$Write
+		rts
+		
+speedtag
+		fcb		WPosCur,$20+26,$20+11
+		fdb		WFColor
+		fcb		yellow
+		fcb		$00
+			
+speedtag2
+		fcb		WPosCur,$20+25,$20+12
+		fcc		/MPH./
+		fdb		WFColor
+		fcb		txtclr
+		fcb		$00
+
+
+* Show Speed
+speed:
+		leax	<speedtag,pcr
+		lbsr	PUTS
+		lbsr	getspeed				get speed in D
+		leax	numbuf,u
+		lbsr	BIN_DEC
+		lbsr	PUTS
+		leax	<speedtag2,pcr
+		lbsr	PUTS
+		rts
+		
+
+odomtag	fcb		WPosCur,$20+0,$20+2
+		fcb		$00
+
+odometer:
+		leax	<odomtag,pcr
+		lbsr	PUTS
+		lbsr	getmileage					get odometer in D,X
+		pshs	x
+		leax	numbuf,u
+		lbsr	BIN_DEC
+		lbsr	PUTS
+		puls	d
+		leax	numbuf,u
+		lbsr	BIN_DEC
+		lbsr	PUTS
+		rts
+		
+etemptag	fcb	WPosCur,$20+7,$20+8
+			fcb	$00
+
+engtemp:
+		leax	<etemptag,pcr
+		lbsr	PUTS
+		lbsr	getengtemp					get engine temperature in D
+		leax	numbuf,u
+		lbsr	BIN_DEC
+		lbsr	PUTS
+		rts
+		
+fueltag	fcb		WPosCur,$20+44,$20+8
+		fcb 	$00
+		
+fuelgauge:
+		leax	<fueltag,pcr
+		lbsr	PUTS
+		lbsr	getfuel						get fuel in D
+		leax	numbuf,u
+		lbsr	BIN_DEC
+		lbsr	PUTS
+		rts
+		
+timetag	fcb		WPosCur,$20+18,$20+23
+		fcb		$00
+
+systime:
+		leax	<timetag,pcr
+		lbsr	PUTS
+		leax	numbuf,u
+		lbsr	STIMESTR					get fuel in D
+		lbsr	PUTS
+		rts
+		
+		endsect
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/packages/coyota/instrument.a	Tue Nov 08 05:19:03 2005 +0000
@@ -0,0 +1,52 @@
+****************************************************************************
+*
+* instrument.a - acquires all needed data values from various instruments
+*
+*
+
+		psect	instrument_a,0,0,3,0,0
+
+
+* Get the current speed
+*
+* Entry: None
+*
+* Exit:  D = speed value in miles per hour
+getspeed:
+		ldd		#55			55 mph
+		rts
+
+
+* Get the odometer value
+*
+* Entry: None
+*
+* Exit:  D = bits 23-16 of odometer
+*        X = bits 15-0  of odometer
+getmileage:
+		ldd		#2			
+		ldx		#0000		2*65536 miles
+		rts
+
+		
+* Get the current engine temperature
+*
+* Entry: None
+*
+* Exit:  D = engine temperature value in Farenheit
+getengtemp:
+		ldd		#200		200 degrees Farenheit
+		rts
+
+		
+* Get the current fuel amount
+*
+* Entry: None
+*
+* Exit:  D = fuel amount in 16ths
+getfuel:
+		ldd		#8			half a tank
+		rts
+
+		
+		endsect
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/packages/coyota/makefile	Tue Nov 08 05:19:03 2005 +0000
@@ -0,0 +1,10 @@
+include $(NITROS9DIR)/rules.mak
+
+TARGET	= coyota
+LFLAGS	+= -y -l=$(HOME)/Projects/c3/lib/rmalib/alib.l
+RFILES	= coyota.r instrument.r dashboard.r
+
+$(TARGET): $(RFILES)
+
+clean:
+	$(RM)	$(RFILES) $(TARGET)
\ No newline at end of file