]> git.sur5r.net Git - cc65/blob - asminc/telestrat.inc
0296f5cb87959acf96a461258186c3f8fef4f20e
[cc65] / asminc / telestrat.inc
1 ;
2 ; Oric TELEMON definition
3 ; TELEMON 2.4 & TELEMON 3.x
4 ; For TELEMON 3.x check http://orix.oric.org
5 ;
6
7 ; ---------------------------------------------------------------------------
8 ; Constants
9
10 SCREEN_XSIZE    = 40            ; Screen columns
11 SCREEN_YSIZE    = 28            ; Screen rows
12
13 FUNCTKEY        = $A5
14
15 FNAME_LEN       = 11            ; Maximum length of file-name
16
17 ; ---------------------------------------------------------------------------
18 ; I/O Identifier
19 ; Theses identifers are used for channel management
20
21
22 XKBD            = $80           ; Keyboard
23 XRSE            = $83           ; RS232 in
24 XSCR            = $88           ; Screen
25 XRSS            = $90           ; RS232 out
26
27 ; ---------------------------------------------------------------------------
28 ; Zero page
29
30 ; ---------------------------------------------------------------------------
31 ; Page 00
32 RES             := $00
33 RESB            := $02
34
35 DECDEB          := $04
36 DECFIN          := $06
37 DECCIB          := $08
38 DECTRV          := $0A
39
40 TR0             := $0C
41 TR1             := $0D
42 TR2             := $0E
43 TR3             := $0F
44 TR4             := $10
45 TR5             := $11
46 TR6             := $12
47 TR7             := $13
48
49 DEFAFF          := $14
50 ADSCR           := $26
51
52 PTR_READ_DEST   := $2C           ; Used for XFREAD and XWRITE only in TELEMON 3.x
53
54 HRSX            := $46
55 HRSY            := $47
56
57 HRS1            := $4D
58 HRS2            := $4F
59 HRS3            := $51
60 HRS4            := $53
61 HRS5            := $55
62
63 HRSFB           := $57
64
65 ; RS232T
66 ; b0-b3 : speed 
67 ;         1111 => 19200 bps  (please note that telestrat can't handle this speed without stopping all IRQ except ACIA's one)
68 ;         1100 =>  9600 bps  (default from TELEMON)
69 ;         1110 =>  4800 bps 
70 ;         1010 =>  2400 bps 
71 ;         1000 =>  1200 bps 
72 ;         0111 =>   600 bps 
73 ;         0110 =>   300 bps 
74 ;         0101 =>   150 bps 
75 ;         0010 =>    75 bps 
76
77 ; b4    : 0 external clock, 1 internal clock
78 ; b6-b5 : 00 8 bits
79 ;         01 7 bits
80 ;         10 6 bits
81 ;         11 5 bits
82 ; b7    : 0  a stop  
83
84 RS232T          := $59
85
86 ; RS232C 
87 ; b0-b3 : 0
88 ; b4    : 1 if echo
89 ; b5    : 1 if parity
90 ; b7-b6 : 00 in/out parity odd
91 ;       : 01 on/out parity even
92 ;       : 10 parity sent, answer not tested
93 ;       : 11 SPACE SENT, reception not tested
94
95 RS232C          := $5A
96
97 VARLNG          := $8C
98 VARAPL          := $D0
99
100 ; ---------------------------------------------------------------------------
101 ; Low memory
102 IRQVec          := $02FB        ; "fast" interrupt vector
103
104 ; ---------------------------------------------------------------------------
105 ; I/O locations
106
107 ; 6522
108 .struct VIA                     ; Versatile Interface Adapter
109         .res    $0300
110 PRB     .byte                   ; Port Register B
111 PRA     .byte                   ; Port Register A
112 DDRB    .byte                   ; Data Direction Register B
113 DDRA    .byte                   ; Data Direction Register A
114 T1      .word                   ; Timer 1
115 T1L     .word                   ; Timer 1 Latch
116 T2      .word                   ; Timer 2
117 SR      .byte                   ; Shift Register
118 ACR     .byte                   ; Auxiliary Control Register
119 PCR     .byte                   ; Peripheral Control Register
120 IFR     .byte                   ; Interrupt Flags Register
121 IER     .byte                   ; Interrupt Enable Register
122 PRA2    .byte                   ; Port Register A without handshaking
123 .endstruct
124
125
126 .struct VIA2                    ; Versatile Interface Adapter
127         .res    $0320
128 PRB     .byte                   ; Port Register B
129 PRA     .byte                   ; Port Register A
130 DDRB    .byte                   ; Data Direction Register B
131 DDRA    .byte                   ; Data Direction Register A
132 T1      .word                   ; Timer 1
133 T1L     .word                   ; Timer 1 Latch
134 T2      .word                   ; Timer 2
135 SR      .byte                   ; Shift Register
136 ACR     .byte                   ; Auxiliary Control Register
137 PCR     .byte                   ; Peripheral Control Register
138 IFR     .byte                   ; Interrupt Flags Register
139 IER     .byte                   ; Interrupt Enable Register
140 PRA2    .byte                   ; Port Register A without handshaking
141 .endstruct
142
143 ; 6551
144 .struct ACIA                    ; Asynchronous Communications Interface Adapter
145         .res    $031C
146 DATA    .byte
147 STATUS  .byte
148 CMD     .byte                   ; Command register
149 CTRL    .byte                   ; Control register
150 .endstruct
151
152 SCREEN          := $BB80
153
154
155 ; ---------------------------------------------------------------------------
156 ; ROM entries
157
158 ; TELEMON primitives (2.4 & 3.x)
159
160 ; all values are used to call bank 7 of telestrat cardridge. It works with 'brk value' 
161 XOP0             = $00          ; Open device on channel 0
162 XOP1             = $01          ; Open device on channel 1
163 XOP2             = $02          ; Open device on channel 2
164 XOP3             = $03          ; Open device on channel 3
165
166 XCL0             = $04          ; Close channel 0
167 XCL1             = $05          ; Close channel 1
168 XCL2             = $06          ; Close channel 2
169 XCL3             = $07          ; Close channel 3
170
171 XRD0             = $08
172 XRDW0            = $0C
173
174 XWR0             = $10          ; Write a char in channel 0
175 XWR1             = $11          ; Write a char in channel 1
176 XWR2             = $12          ; Write a char in channel 2
177 XWR3             = $13          ; Write a char in channel 3
178
179 XWSTR0           = $14          ; Write a string in text mode channel 0
180 XWSTR1           = $15          ; Write a string in text mode channel 1
181 XWSTR2           = $16          ; Write a string in text mode channel 2
182 XWSTR3           = $17          ; Write a string in text mode channel 3
183
184 XDECAL           = $18
185
186 XTEXT            = $19
187 XHIRES           = $1A
188 XFILLM           = $1C
189 XMINMA           = $1F
190 XVARS            = $24          ; Only in TELEMON 3.x, in TELEMON 2.4, it's XNOMFI ($24)
191 XCRLF            = $25          ; Jump a line and return to the beginning of the line
192 XFREAD           = $27          ; Only in TELEMON 3.x (bank 7 of Orix)
193 XHEXA            = $2A          ; Convert a number into hex
194 XBINDX           = $28          ; Convert a number into hex and displays on channel 0
195 XOPEN            = $30          ; Only in TELEMON 3.x (bank 7 of Orix)
196 XCOSCR           = $34          ; Switch off cursor
197 XCSSCR           = $35          ; Switch on cursor
198 XSCRSE           = $36
199 XCLOSE           = $3A          ; Only in TELEMON 3.x close file (bank 7 of Orix)
200 XFWRITE          = $3B          ; Only in TELEMON 3.x write file (bank 7 of Orix)
201 XSONPS           = $40          ; Send data to PSG register (14 values)
202 XOUPS            = $42          ; Send Oups sound into PSG
203 XPLAY            = $43          ; Play a sound
204 XSOUND           = $44 
205 XMUSIC           = $45 
206 XZAP             = $46          ; Send Zap sound to PSG
207 XSHOOT           = $47
208 XMKDIR           = $4B          ; Create a folder. Only available in TELEMON 3.x (bank 7 of Orix)
209 XRM              = $4D          ; Remove a folder or a file. Only available in TELEMON 3.x (bank 7 of Orix)
210 XGOKBD           = $52 
211 XMALLOC          = $5B          ; Only in TELEMON 3.x (bank 7 of Orix)
212 XFREE            = $62          ; Only in TELEMON 3.x (bank 7 of Orix)
213 XSOUT            = $67          ; Send accumulator value (A) to RS232, available in TELEMON 2.4 & 3.x : if RS232 buffer is full, the Oric Telestrat freezes
214 XHRSSE           = $8C          ; Set hires position cursor
215 XDRAWA           = $8D          ; Draw a line 
216 XDRAWR           = $8E          ; Draw a line (relative)
217 XCIRCL           = $8F          ; Draw a circle
218 XCURSE           = $90          ; Plot a pixel 
219 XCURMO           = $91          ; Move to x,y pos in Hires
220 XPAPER           = $92
221 XINK             = $93
222 XBOX             = $94          ; Draw a box
223 XABOX            = $95
224 XFILL            = $96
225 XCHAR            = $97          ; Display a char on the screen in Hires
226 XSCHAR           = $98          ; Draw a string in hires
227 XEXPLO           = $9C          ; Send Explode sound to PSG
228 XPING            = $9D          ; Send Ping sound to PSG
229
230 ; ---------------------------------------------------------------------------
231 ; ROM entries variables
232
233 PWD_PTR          = $00
234
235 ; ---------------------------------------------------------------------------
236
237 BUFTRV          := $100         
238
239
240 ; ---------------------------------------------------------------------------
241 ; Page $200
242 SCRX             := $220
243 SCRY             := $224
244 ADSCRL           := $218
245 ADSCRH           := $21C
246 HRSPAT           := $2AA        ; Hires pattern : it's used to draw pattern for a line or a circle
247 IRQVECTOR        := $2FA
248
249
250 ; ---------------------------------------------------------------------------
251 ; Page $500
252
253 BUFNOM           := $517
254 BUFEDT           := $590
255
256 MAX_BUFEDT_LENGTH=110
257
258 ; ---------------------------------------------------------------------------
259 ; Hardware
260 CH376_DATA       := $340
261 CH376_COMMAND    := $341
262
263 ; ---------------------------------------------------------------------------
264 ; MACRO 
265
266 .macro  BRK_TELEMON   value
267         .byte $00,value
268 .endmacro