0
|
1 ********************************************************************
|
|
2 * SSCPAK - Tandy Speech/Sound Pak driver
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Ed. Comments Who YY/MM/DD
|
|
7 * ------------------------------------------------------------------
|
201
|
8 * 1 From Tandy OS-9 Level One VR 02.00.00
|
0
|
9
|
|
10 nam SSCPAK
|
|
11 ttl Tandy Speech/Sound Pak driver
|
|
12
|
|
13 * Disassembled 98/08/23 17:33:46 by Disasm v1.6 (C) 1988 by RML
|
|
14
|
|
15 ifp1
|
|
16 use defsfile
|
|
17 use scfdefs
|
|
18 endc
|
|
19
|
|
20 tylg set Drivr+Objct
|
|
21 atrv set ReEnt+rev
|
|
22 rev set $01
|
201
|
23 edition set 1
|
0
|
24
|
|
25 BusyBit equ %10000000 SSPak busy status bit (active low)
|
|
26 CRA equ $01 PIA CRA offset
|
|
27 CRB equ $03 PIA CRB offset
|
|
28 MUXBit equ %00001000 COCO sound MUX control/select bit position
|
|
29 SpeakBit equ %01000000 SSPak speech status bit (active low)
|
|
30 PIA0Addr equ PIA.U4 base address of COCO sound MUX select PIA
|
|
31 PIA1Addr equ PIA.U8 base address of COCO sound MUX enable PIA
|
|
32 SSPData equ $FF7E SSPak data register offset
|
|
33 SSPReset equ $FF7D SSPak reset register offset
|
|
34 SSPStat equ $FF7E SSPak status register offset
|
|
35
|
|
36 mod eom,name,tylg,atrv,start,size
|
|
37
|
|
38 rmb 29
|
|
39 size equ .
|
|
40
|
|
41 fcb READ.+WRITE. mode byte
|
|
42
|
|
43 name fcs /SSCPAK/
|
|
44 fcb edition
|
|
45
|
|
46 start lbra Init
|
|
47 lbra Read
|
|
48 lbra Write
|
|
49 lbra GetStat
|
|
50 lbra SetStat
|
|
51 lbra Term
|
|
52
|
|
53 Init pshs a
|
|
54 lda #$01
|
|
55 sta >SSPReset reset SSPak
|
|
56 clra
|
|
57 sta >SSPReset end SSPak reset
|
|
58 puls pc,a
|
|
59
|
|
60 Read ldb #E$BMode
|
|
61 bra ErrEx
|
|
62
|
|
63 GetStat
|
|
64 SetStat ldb #E$UnkSvc
|
|
65 ErrEx orcc #Carry
|
|
66 Term rts
|
|
67
|
|
68 Write ldy #SSPData
|
|
69 ldx #PIA0Addr
|
|
70 ldu #PIA1Addr
|
|
71 cmpa #C$LF linefeed?
|
|
72 beq WritEx ..yep, ignore it
|
|
73 cmpa #C$CR carriage return?
|
|
74 bne NormChar ..no
|
|
75 lda CRA,x get PIA0 CRA
|
|
76 ldb CRB,x get PIA0 CRB
|
|
77 pshs b,a save them
|
|
78 anda #^MUXBit clear PIA0 CA2 control LSBit
|
|
79 orb #MUXBit set PIA0 B@ control LSBit
|
|
80 sta CRA,x * set CoCo sound MUX to cartridge input
|
|
81 stb CRB,x *
|
|
82 lda CRB,u get PIA1 CRB
|
|
83 pshs a save it
|
|
84 ora #MUXBit set PIA1 CB2 control LSBit
|
|
85 sta CRB,u enable COCO sound MUX
|
|
86 lda #C$CR get carriage return
|
|
87 bsr ChkHW wait for SSPak to get ready
|
|
88 sta ,y store it in SSPak
|
|
89 bsr SpchWait wait until speech is active
|
|
90 bsr SSWait wait until speech is inactive
|
|
91 puls a get original PIA1 CRB
|
|
92 sta CRB,u disable COCO sound MUX
|
|
93 puls b,a get original PIA0 CRA/CRB
|
|
94 sta CRA,x restore original PIA0 CRA
|
|
95 stb CRB,x restore original PIA0 CRB
|
|
96 bra WritEx exit
|
|
97 NormChar bsr ChkHW wait for HW
|
|
98 sta ,y write char to HW
|
|
99 WritEx clrb
|
|
100 rts
|
|
101
|
|
102 * Check SSC hardware, loop until it's ready
|
|
103 ChkHW pshs a
|
|
104 ChkHWLp lda ,y get SSPak status
|
|
105 anda #BusyBit SSPak busy?
|
|
106 beq ChkHWLp yep, go check again
|
|
107 puls pc,a
|
|
108
|
|
109 * routine to loop until SSPak speech is inactive
|
|
110 SSWait pshs x,a
|
|
111 SSWait2 lda ,y get SSPak status
|
|
112 anda #SpeakBit SSPak speech active yet?
|
|
113 bne SSWaitEx yep, exit
|
|
114 ldx #$0001 sleep remainder of tick
|
|
115 os9 F$Sleep
|
|
116 bra SSWait2
|
|
117 SSWaitEx puls pc,x,a
|
|
118
|
|
119 * routine to loop until SSPak speech is active
|
|
120 SpchWait pshs a
|
|
121 SpchLoop lda ,y get SSPak status
|
|
122 anda #SpeakBit SSPak speech active yet?
|
|
123 bne SpchLoop no, go check again
|
|
124 puls pc,a return
|
|
125
|
|
126 emod
|
|
127 eom equ *
|
|
128 end
|
|
129
|