annotate level1/modules/sspak.asm @ 2224:22b75f9788a5

Removed redundant targets
author boisy
date Wed, 18 Mar 2009 11:33:16 +0000
parents 6cd590fc076f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1321
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
1 ********************************************************************
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
2 * SSPak - Speech-Sound Pak Text-To-Speech Driver
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
3 *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
4 * $Id$
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
5 *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
6 * by Bruce Isted (CIS 76625,2273)
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
7 * released to the Public Domain 87/05/03
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
8 *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
9 * This driver supports only the Speech-Sound Pak's text-to-speech mode.
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
10 * Bit 7 is cleared and control codes are filtered to ensure that only carriage
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
11 * returns and characters in the range of $20-$7F (inclusive) are passed. A
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
12 * character count and automatic buffer flush is used, which should prevent
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
13 * buffer overflow in the Speech-Sound Pak.
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
14 *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
15 * Due to way the COCO's sound select circuitry is tied in with other sound
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
16 * sources and the joysticks, only one will function at a time. This means
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
17 * that while the Speech-Sound Pak is active other sound sources and/or the
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
18 * joysticks cannot be used. Speech output is enabled only when a carriage
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
19 * return is received, or when the buffer is flushed. Speech output is
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
20 * disabled as soon as the Speech-Sound Pak is finished speaking the string
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
21 * received before the carriage return or buffer flush.
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
22 *
1499
6cd590fc076f Fixed comments
boisy
parents: 1321
diff changeset
23 * Edt/Rev YYYY/MM/DD Modified by
6cd590fc076f Fixed comments
boisy
parents: 1321
diff changeset
24 * Comment
1321
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
25 * ------------------------------------------------------------------
1499
6cd590fc076f Fixed comments
boisy
parents: 1321
diff changeset
26 * 1 1987/05/03 Bruce Isted
6cd590fc076f Fixed comments
boisy
parents: 1321
diff changeset
27 * Created.
1321
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
28
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
29 nam SSPak
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
30 ttl Speech-Sound Pak Text-To-Speech Driver
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
31
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
32 ifp1
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
33 use defsfile
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
34 endc
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
35
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
36 BuffCnt equ 200 character count before flushing buffer (0-255)
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
37 BusyBit equ %10000000 SSPak busy status bit (active low)
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
38 CharMask equ %01111111 printable ASCII character mask
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
39 CRA equ $01 PIA CRA offset
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
40 CRB equ $03 PIA CRB offset
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
41 MUXBit equ %00001000 COCO sound MUX control/select bit position
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
42 SpeakBit equ %01000000 SSPak speech status bit (active low)
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
43 SSPData equ $01 SSPak data register offset
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
44 SSPReset equ $00 SSPak reset register offset
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
45 SSPStat equ $01 SSPak status register offset
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
46
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
47 rev equ $00
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
48 edition set 1
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
49
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
50 mod SEnd,SNam,Drivr+Objct,ReEnt+rev,SEntry,SMem
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
51
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
52 org V.SCF SCF manager data area
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
53 Count rmb 1 character counter
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
54 SMem equ .
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
55
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
56 fcb SHARE.+PWRIT.+WRITE. device capabilities
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
57
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
58 SNam fcs "SSPak"
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
59 fcb edition
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
60
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
61 SEntry lbra SInit
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
62 lbra SRead
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
63 lbra SWrite
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
64 lbra SGetStat
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
65 lbra SSetStat
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
66 lbra STerm
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
67
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
68 SInit equ *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
69 STerm equ *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
70 ldx V.PORT,u
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
71 ldb #$01
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
72 stb SSPReset,x reset SSPak
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
73 clrb
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
74 stb SSPReset,x end SSPak reset
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
75 rts
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
76
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
77 SRead comb
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
78 ldb #E$BMode
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
79 rts
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
80
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
81 SWrite anda #CharMask strip MSBit of character
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
82 cmpa #C$CR carriage return?
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
83 beq SpkOut yes, go enable SSPak speech output
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
84 inc Count,u increment character counter
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
85 cmpa #C$SPAC higher than space?
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
86 bhi WritChar yes, go write character to SSPak
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
87 lda #C$SPAC only space allowed through here
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
88 ldb Count,u get current character count
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
89 cmpb #BuffCnt time to flush buffer?
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
90 blo WritChar no, go write space to SSPak
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
91 SpkOut clr Count,u reset character count
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
92 ldy #PIA0Base
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
93 lda CRA,y get PIA0 CRA
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
94 ldb CRB,y get PIA0 CRB
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
95 pshs d save them
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
96 anda #^MUXBit clear PIA0 CA2 control LSBit
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
97 orb #MUXBit set PIA0 CB2 control LSBit
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
98 sta CRA,y * set COCO sound MUX to cartridge input
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
99 stb CRB,y *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
100 ldy #PIA1Base
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
101 ldb CRB,y get PIA1 CRB
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
102 pshs b save it
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
103 orb #MUXBit set PIA1 CB2 control LSBit
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
104 stb CRB,y enable COCO sound MUX
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
105 lda #C$CR load execute speech character
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
106 bsr WritChar go write command character to SSPak
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
107 bsr SSWait go wait until SSPak has finished
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
108 puls b recover original PIA1 CRB
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
109 stb CRB,y disable COCO sound MUX
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
110 puls d recover original PIA0 CRA & CRB
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
111 ldy #PIA0Base
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
112 sta CRA,y *restore COCO sound MUX to previous setting
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
113 stb CRB,y *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
114 clrb
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
115 rts
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
116 WritChar bsr BusyWait go check if SSPak is busy
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
117 sta SSPData,x write character to SSPak
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
118 clrb
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
119 rts
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
120
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
121 SGetStat equ *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
122 SSetStat equ *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
123 comb
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
124 ldb #E$UnkSvc
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
125 rts
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
126
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
127 BusyWait ldx V.PORT,u
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
128 ldb SSPStat,x get SSPak status
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
129 andb #BusyBit SSPak busy?
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
130 beq BusyWait yes, go check again
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
131 ldb SSPStat,x *allow for slow busy bit
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
132 andb #BusyBit *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
133 beq BusyWait *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
134 ldb SSPStat,x *allow for very slow busy bit
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
135 andb #BusyBit *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
136 beq BusyWait *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
137 rts
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
138
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
139 SSWait ldx V.PORT,u
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
140 ldb SSPStat,x get SSPak status
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
141 andb #SpeakBit SSPak speech active yet?
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
142 bne SSWait no, go check again
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
143 SSWait0 ldx #$0001 sleep remainder of tick
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
144 os9 F$Sleep
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
145 ldx V.PORT,u
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
146 ldb SSPStat,x get SSPak status
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
147 andb #SpeakBit SSPak speech still active?
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
148 beq SSWait0 yes, go sleep some more
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
149 rts
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
150
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
151 emod
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
152 SEnd equ *
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
153 end
acc63d0452bd SSPAK and SPP ported from OS-9 Level Two
boisy
parents:
diff changeset
154