2 ; Oric TELEMON definition
3 ; TELEMON 2.4 & TELEMON 3.x
4 ; For TELEMON 3.x check http://orix.oric.org
7 ; ---------------------------------------------------------------------------
10 SCREEN_XSIZE = 40 ; Screen columns
11 SCREEN_YSIZE = 28 ; Screen rows
15 FNAME_LEN = 11 ; Maximum length of file-name
17 ; ---------------------------------------------------------------------------
19 ; Theses identifers are used for channel management
25 XRSS = $90 ; RS232 out
27 ; ---------------------------------------------------------------------------
30 ; ---------------------------------------------------------------------------
51 IRQSVA := $21 ; Used to save A when a BRK call occurs
52 IRQSVX := $22 ; Used to save X when a BRK call occurs
53 IRQSVY := $23 ; Used to save Y when a BRK call occurs
54 IRQSVP := $24 ; Used to save P when a BRK call occurs
57 SCRNB := $28 ; id of the current window
59 ADKBD := $2A ; Address ASCII conversion table
62 PTR_READ_DEST := $2C ; Used for XFREAD and XWRITE only in TELEMON 3.x
64 ADCLK := $40 ; Address for clock display
72 XLPRBI := $48 ; Printer flag (b7)
77 ADHRS := $4B ; hires screen address (word)
91 ; 1111 => 19200 bps (please note that telestrat can't handle this speed without stopping all IRQ except ACIA's one)
92 ; 1100 => 9600 bps (default from TELEMON)
101 ; b4 : 0 external clock, 1 internal clock
114 ; b7-b6 : 00 in/out parity odd
115 ; : 01 on/out parity even
116 ; : 10 parity sent, answer not tested
117 ; : 11 SPACE SENT, reception not tested
136 ; ---------------------------------------------------------------------------
138 IRQVec := $02FB ; "fast" interrupt vector
140 ; ---------------------------------------------------------------------------
144 .struct VIA ; Versatile Interface Adapter
146 PRB .byte ; Port Register B
147 PRA .byte ; Port Register A
148 DDRB .byte ; Data Direction Register B
149 DDRA .byte ; Data Direction Register A
151 T1L .word ; Timer 1 Latch
153 SR .byte ; Shift Register
154 ACR .byte ; Auxiliary Control Register
155 PCR .byte ; Peripheral Control Register
156 IFR .byte ; Interrupt Flags Register
157 IER .byte ; Interrupt Enable Register
158 PRA2 .byte ; Port Register A without handshaking
162 .struct VIA2 ; Versatile Interface Adapter
164 PRB .byte ; Port Register B
165 PRA .byte ; Port Register A
166 DDRB .byte ; Data Direction Register B
167 DDRA .byte ; Data Direction Register A
169 T1L .word ; Timer 1 Latch
171 SR .byte ; Shift Register
172 ACR .byte ; Auxiliary Control Register
173 PCR .byte ; Peripheral Control Register
174 IFR .byte ; Interrupt Flags Register
175 IER .byte ; Interrupt Enable Register
176 PRA2 .byte ; Port Register A without handshaking
180 .struct ACIA ; Asynchronous Communications Interface Adapter
184 CMD .byte ; Command register
185 CTRL .byte ; Control register
191 ; ---------------------------------------------------------------------------
194 ; TELEMON primitives (2.4 & 3.x)
196 ; all values are used to call bank 7 of telestrat cardridge. It works with 'brk value'
197 XOP0 = $00 ; Open device on channel 0
198 XOP1 = $01 ; Open device on channel 1
199 XOP2 = $02 ; Open device on channel 2
200 XOP3 = $03 ; Open device on channel 3
202 XCL0 = $04 ; Close channel 0
203 XCL1 = $05 ; Close channel 1
204 XCL2 = $06 ; Close channel 2
205 XCL3 = $07 ; Close channel 3
210 XWR0 = $10 ; Write a char in channel 0
211 XWR1 = $11 ; Write a char in channel 1
212 XWR2 = $12 ; Write a char in channel 2
213 XWR3 = $13 ; Write a char in channel 3
215 XWSTR0 = $14 ; Write a string in text mode channel 0
216 XWSTR1 = $15 ; Write a string in text mode channel 1
217 XWSTR2 = $16 ; Write a string in text mode channel 2
218 XWSTR3 = $17 ; Write a string in text mode channel 3
224 XEFFHI = $1B ; Clear hires screen
227 XVARS = $24 ; Only in TELEMON 3.x, in TELEMON 2.4, it's XNOMFI ($24)
228 XCRLF = $25 ; Jump a line and return to the beginning of the line
230 XFREAD = $27 ; Only in TELEMON 3.x (bank 7 of Orix)
231 XBINDX = $28 ; Convert a number into hex and displays on channel 0
233 XHEXA = $2A ; Convert a number into hex
235 XEDT = $2D ; Launch editor
238 XSCELG = $2F ; Search a line in editor mode
239 XOPEN = $30 ; Only in TELEMON 3.x (bank 7 of Orix)
240 XECRPR = $33 ; Displays prompt
241 XCOSCR = $34 ; Switch off cursor
242 XCSSCR = $35 ; Switch on cursor
244 XSCRNE = $39 ; Load charset from rom to ram
245 XCLOSE = $3A ; Only in TELEMON 3.x close file (bank 7 of Orix)
246 XFWRITE = $3B ; Only in TELEMON 3.x write file (bank 7 of Orix)
249 XRECLK = $3C ; Reset clock
250 XCLCL = $3D ; Close clock
251 XWRCLK = $3E ; Displays clock in the adress in A & Y registers
253 XSONPS = $40 ; Send data to PSG register (14 values)
254 XOUPS = $42 ; Send Oups sound into PSG
255 XPLAY = $43 ; Play a sound
258 XZAP = $46 ; Send Zap sound to PSG
260 XMKDIR = $4B ; Create a folder. Only available in TELEMON 3.x (bank 7 of Orix)
261 XRM = $4D ; Remove a folder or a file. Only available in TELEMON 3.x (bank 7 of Orix)
265 XECRBU = $54 ; Write A or AY in the buffer
266 XLISBU = $55 ; Read A or AY in the buffer
268 XVIDBU = $57 ; Flush the buffer
269 XINIBU = $58 ; Initialize the buffer X
270 XDEFBU = $59 ; Reset all value of the buffer
271 XBUSY = $5A ; Test if the buffer is empty
273 XMALLOC = $5B ; Only in TELEMON 3.x (bank 7 of Orix)
274 XFREE = $62 ; Only in TELEMON 3.x (bank 7 of Orix)
275 XSOUT = $67 ; Send accumulator value (A) to RS232, available in TELEMON 2.4 & 3.x : if RS232 buffer is full, the Oric Telestrat freezes
276 XHRSSE = $8C ; Set hires position cursor
277 XDRAWA = $8D ; Draw a line absolute
278 XDRAWR = $8E ; Draw a line (relative)
279 XCIRCL = $8F ; Draw a circle
280 XCURSE = $90 ; Plot a pixel
281 XCURMO = $91 ; Move to x,y pos in Hires
284 XBOX = $94 ; Draw a box
287 XCHAR = $97 ; Display a char on the screen in Hires
288 XSCHAR = $98 ; Draw a string in hires
289 XEXPLO = $9C ; Send Explode sound to PSG
290 XPING = $9D ; Send Ping sound to PSG
292 ; ---------------------------------------------------------------------------
293 ; ROM entries variables
297 ; ---------------------------------------------------------------------------
302 ; ---------------------------------------------------------------------------
304 BNKST := $200 ; Used to store signature of 8 bank (length : 8 bytes)
309 KOROM := $20E ; Used to compute the size of all rom bank. The result is store here. The value is in KB
310 KORAM := $20F ; Used to compute the size of all ram bank. The result is store here. The value is in KB
318 FLGCUR := $216 ; cursor management flag
319 ; screens position managements
321 FLGCUR_STATE := $217 ; cursor state flag
339 HARD_COPY_HIRES := $250 ; Hard copy vector
343 SCRTRA := $262 ; 6 bytes lenfth
345 ; Keyboard management
346 KBDCOL := $268 ; 8 bytes length
347 KBDFLG_KEY := $270 ; 0 if no key pressed
363 ; Joysticks management
370 HRSPAT := $2AA ; Hires pattern : it's used to draw pattern for a line or a circle
377 ADIOB := $2BE ; 48 bytes length
381 ADIODB_VECTOR := $2f7 ; 3 bytes length
386 ; ---------------------------------------------------------------------------
392 ; ---------------------------------------------------------------------------
401 FTYPE := $52C ; File type
405 EXTDEF := $55D ; Default extension. At the start of telemon, it's set to ".COM"
406 BUFEDT := $590 ; Buffer edition
408 MAX_BUFEDT_LENGTH=110
410 ; ---------------------------------------------------------------------------
413 CH376_COMMAND := $341
415 ; RAM overlays buffer
418 ; ---------------------------------------------------------------------------
420 ; Stratsed is the main OS for Telestrat
426 XOPENS := $FF1A ; XOPEN from Stratsed
427 XCLOSES := $FF1D ; XCLOSE from Stratsed
471 ; ---------------------------------------------------------------------------
473 ; Stratsed is the main OS for Telestrat
479 XOPENS := $FF1A ; XOPEN from Stratsed
480 XCLOSES := $FF1D ; XCLOSE from Stratsed
524 ; ---------------------------------------------------------------------------
527 .macro BRK_TELEMON value