1908
|
1 ****************************************************************************
|
|
2 *
|
|
3 * coyota.a - main coyota application
|
|
4 *
|
|
5 *
|
|
6
|
|
7 psect coyota_a,$01,$81,1,200,coyota
|
|
8
|
|
9
|
1909
|
10 vsect
|
|
11 orgopt rmb 32
|
|
12 curopt rmb 32
|
|
13 endsect
|
|
14
|
1908
|
15 * Sleep Duration
|
1909
|
16 NAPTIME equ 6
|
1908
|
17
|
|
18
|
|
19 * byte stream to send to window to make a 320x192 16 color gfx screen
|
|
20 type6 fdb WDWEnd
|
|
21 fdb WDWSet
|
|
22 fcb $08,$00,$00,$28,$18,$00,$02,$02
|
|
23 fdb WSelect
|
|
24 fdb WCurOff
|
|
25 selfnt fdb WFont
|
|
26 fcb $c8,$02 select 6x8 stdfont
|
|
27 type6L equ *-type6
|
|
28 selfntL equ *-selfnt
|
|
29
|
|
30 curon fdb WCurOn
|
|
31 fcb $00
|
|
32
|
|
33 stdfonts
|
|
34 fcc "SYS/stdfonts"
|
|
35 fcb C$CR
|
|
36
|
|
37 vsect
|
1909
|
38 ch rmb 1
|
1908
|
39 readbuf rmb $2000
|
|
40 endsect
|
|
41
|
|
42 * Intercept routine
|
|
43 exit
|
1909
|
44 clra
|
|
45 clrb
|
|
46 leax orgopt,u
|
|
47 os9 I$SetStt
|
|
48
|
1908
|
49 leax <curon,pcr
|
|
50 lbsr PUTS
|
|
51 clrb
|
|
52 os9 F$Exit
|
|
53
|
|
54 intercept
|
|
55 cmpb #S$Abort
|
|
56 beq exit
|
|
57 rti
|
|
58
|
|
59
|
|
60 * main entry point
|
|
61 coyota:
|
|
62 * install intercept routine
|
|
63 leax <intercept,pcr
|
|
64 os9 F$Icpt
|
1909
|
65
|
|
66 * get path options
|
|
67 lda #$01
|
|
68 clrb
|
|
69 leax orgopt,u
|
|
70 os9 I$GetStt
|
|
71 leax curopt,u
|
|
72 os9 I$GetStt
|
|
73
|
|
74 clr PD.EKO-PD.OPT,x
|
|
75 os9 I$SetStt
|
|
76
|
|
77 * initialize instrumentation hardware
|
|
78 lbsr insinit
|
1908
|
79
|
|
80 * make type 6 (320x192 16 color) graphics screen and select font
|
|
81 Scrn leax <type6,pcr
|
|
82 ldy #type6L
|
|
83 lda #1
|
|
84 os9 I$Write
|
|
85 bcc next
|
|
86
|
|
87 * error occurred... merge stdfonts
|
|
88 leax <stdfonts,pcr
|
|
89 lda #READ.
|
|
90 os9 I$Open
|
|
91 bcs Scrn
|
|
92 leax readbuf,u
|
|
93 pshs a save path num to stack
|
|
94 rl ldy #2048
|
|
95 os9 I$Read
|
|
96 bcs close
|
|
97 lda #$01
|
|
98 os9 I$Write
|
|
99 lda ,s
|
|
100 bra rl
|
|
101 close lda ,s+
|
|
102 os9 I$Close
|
|
103 leax <selfnt,pcr
|
|
104 ldy #selfntL
|
|
105 lda #$01
|
|
106 os9 I$Write
|
|
107
|
|
108 next lbsr dashboard draw the dashboard
|
|
109
|
|
110 * Main processing loop:
|
|
111 * - get values from various instruments
|
|
112 * - display them on the appropriate section of the screen
|
|
113 * - sleep a while
|
|
114 * - go back and do it again!
|
|
115 main lbsr speed update speedometer
|
|
116 lbsr odometer update odometer
|
|
117 lbsr engtemp update engine temperature
|
|
118 lbsr fuelgauge update fuel gauge
|
|
119 lbsr systime update system time
|
|
120 ldx #NAPTIME sleep for a bit
|
1909
|
121
|
|
122 * os9 F$Sleep
|
|
123 ldd #SS.Ready
|
|
124 os9 I$GetStt
|
|
125 bcs main
|
|
126 leax ch,u
|
|
127 ldy #$0001
|
|
128 os9 I$Read
|
|
129 lda ,x
|
|
130 cmpa #'x
|
|
131 bne main
|
|
132 lbsr speedplus
|
|
133
|
1908
|
134 bra main
|
|
135
|
|
136
|
|
137
|
|
138 * ENTRY: X=buffer for ascii string
|
|
139 * D=binary value to convert
|
|
140
|
|
141 * EXIT: all registers (except cc) preserved
|
|
142
|
|
143 endsect
|