annotate level1/modules/sscpak.asm @ 201:668388823050

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