]> git.sur5r.net Git - cc65/blob - asminc/telestrat.inc
Fix comments and TELEMON uppercase
[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 TR0             := $0C
36 TR1             := $0D
37 TR2             := $0E
38 TR3             := $0F
39 TR4             := $10
40 TR5             := $11
41 TR6             := $12
42 TR7             := $13
43
44 PTR_READ_DEST   := $2C           ; Used for XFREAD and XWRITE only in TELEMON 3.x
45
46 HRSX            := $46
47 HRSY            := $47
48
49 HRS1            := $4D
50 HRS2            := $4F
51 HRS3            := $51
52 HRS4            := $53
53 HRS5            := $55
54
55 HRSFB           := $57
56
57 ; RS232T
58 ; b0-b3 : speed 
59 ;         1111 => 19200 bps  (please note that telestrat can't handle this speed without stopping all IRQ except ACIA's one)
60 ;         1100 =>  9600 bps  (default from TELEMON)
61 ;         1110 =>  4800 bps 
62 ;         1010 =>  2400 bps 
63 ;         1000 =>  1200 bps 
64 ;         0111 =>   600 bps 
65 ;         0110 =>   300 bps 
66 ;         0101 =>   150 bps 
67 ;         0010 =>    75 bps 
68
69 ; b4    : 0 external clock, 1 internal clock
70 ; b6-b5 : 00 8 bits
71 ;         01 7 bits
72 ;         10 6 bits
73 ;         11 5 bits
74 ; b7    : 0  a stop  
75
76 RS232T          := $59
77
78 ; RS232C 
79 ; b0-b3 : 0
80 ; b4    : 1 if echo
81 ; b5    : 1 if parity
82 ; b7-b6 : 00 in/out parity odd
83 ;       : 01 on/out parity even
84 ;       : 10 parity sent, answer not tested
85 ;       : 11 SPACE SENT, reception not tested
86
87 RS232C          := $5A
88
89 ; ---------------------------------------------------------------------------
90 ; Low memory
91 IRQVec          := $02FB        ; "fast" interrupt vector
92
93 ; ---------------------------------------------------------------------------
94 ; I/O locations
95
96 ; 6522
97 .struct VIA                     ; Versatile Interface Adapter
98         .res    $0300
99 PRB     .byte                   ; Port Register B
100 PRA     .byte                   ; Port Register A
101 DDRB    .byte                   ; Data Direction Register B
102 DDRA    .byte                   ; Data Direction Register A
103 T1      .word                   ; Timer 1
104 T1L     .word                   ; Timer 1 Latch
105 T2      .word                   ; Timer 2
106 SR      .byte                   ; Shift Register
107 ACR     .byte                   ; Auxiliary Control Register
108 PCR     .byte                   ; Peripheral Control Register
109 IFR     .byte                   ; Interrupt Flags Register
110 IER     .byte                   ; Interrupt Enable Register
111 PRA2    .byte                   ; Port Register A without handshaking
112 .endstruct
113
114
115 .struct VIA2                    ; Versatile Interface Adapter
116         .res    $0320
117 PRB     .byte                   ; Port Register B
118 PRA     .byte                   ; Port Register A
119 DDRB    .byte                   ; Data Direction Register B
120 DDRA    .byte                   ; Data Direction Register A
121 T1      .word                   ; Timer 1
122 T1L     .word                   ; Timer 1 Latch
123 T2      .word                   ; Timer 2
124 SR      .byte                   ; Shift Register
125 ACR     .byte                   ; Auxiliary Control Register
126 PCR     .byte                   ; Peripheral Control Register
127 IFR     .byte                   ; Interrupt Flags Register
128 IER     .byte                   ; Interrupt Enable Register
129 PRA2    .byte                   ; Port Register A without handshaking
130 .endstruct
131
132 ; 6551
133 .struct ACIA                    ; Asynchronous Communications Interface Adapter
134         .res    $031C
135 DATA    .byte
136 STATUS  .byte
137 CMD     .byte                   ; Command register
138 CTRL    .byte                   ; Control register
139 .endstruct
140
141 SCREEN          := $BB80
142
143
144 ; ---------------------------------------------------------------------------
145 ; ROM entries
146
147 ; TELEMON primitives (2.4 & 3.x)
148
149 ; all values are used to call bank 7 of telestrat cardridge. It works with 'brk value' 
150 XRD0             = $08
151 XRDW0            = $0C
152 XWR0             = $10 
153 XWSTR0           = $14          ; Write a string in text mode
154 XTEXT            = $19
155 XHIRES           = $1A
156 XFILLM           = $1C
157 XMINMA           = $1F
158 XVARS            = $24          ; Only in TELEMON 3.x, in TELEMON 2.4, it's XNOMFI ($24)
159 XCRLF            = $25          ; Jump a line and return to the beginning of the line
160 XFREAD           = $27          ; Only in TELEMON 3.x (bank 7 of Orix)
161 XOPEN            = $30          ; Only in TELEMON 3.x (bank 7 of Orix)
162 XCOSCR           = $34          ; Switch off cursor
163 XCSSCR           = $35          ; Switch on cursor
164 XCLOSE           = $3A          ; Only in TELEMON 3.x close file (bank 7 of Orix)
165 XFWRITE          = $3B          ; Only in TELEMON 3.x write file (bank 7 of Orix)
166 XSONPS           = $40
167 XOUPS            = $42          ; Send Oups sound into PSG
168 XPLAY            = $43
169 XSOUND           = $44 
170 XMUSIC           = $45 
171 XZAP             = $46
172 XSHOOT           = $47
173 XMKDIR           = $4B          ; Create a folder. Only available in TELEMON 3.x (bank 7 of Orix)
174 XRM              = $4D          ; Remove a folder or a file. Only available in TELEMON 3.x (bank 7 of Orix)
175 XMALLOC          = $5B          ; Only in TELEMON 3.x (bank 7 of Orix)
176 XFREE            = $62          ; Only in TELEMON 3.x (bank 7 of Orix)
177 XSOUT            = $67          ; Send accumulator value (A) to RS232, available in TELEMON 2.4 & 3.x : if RS232 buffer is full, the Oric Telestrat freezes
178 XHRSSE           = $8C          ; Set hires position cursor
179 XDRAWA           = $8D          ; Draw a line 
180 XDRAWR           = $8E          ; Draw a line 
181 XCIRCL           = $8F
182 XCURSE           = $90
183 XCURMO           = $91
184 XPAPER           = $92
185 XINK             = $93
186 XBOX             = $94
187 XABOX            = $95
188 XFILL            = $96
189 XCHAR            = $97
190 XSCHAR           = $98          ; Draw a string in hires
191 XEXPLO           = $9C 
192 XPING            = $9D
193
194 ; ---------------------------------------------------------------------------
195 ; ROM entries variables
196
197 PWD_PTR          = $00
198
199 ; ---------------------------------------------------------------------------
200 ; Page $200
201 SCRX             := $220
202 SCRY             := $224
203 ADSCRL           := $218
204 ADSCRH           := $21C
205 HRSPAT           := $2AA        ; Hires pattern : it's used to draw pattern for a line or a circle
206 IRQVECTOR        := $2FA
207
208
209 ; ---------------------------------------------------------------------------
210 ; Page $500
211
212 BUFNOM           := $517
213 BUFEDT           := $590
214
215 MAX_BUFEDT_LENGTH=110
216
217 ; ---------------------------------------------------------------------------
218 ; Hardware
219 CH376_DATA       := $340
220 CH376_COMMAND    := $341
221
222 ; ---------------------------------------------------------------------------
223 ; MACRO 
224
225 .macro  BRK_TELEMON   value
226         .byte $00,value
227 .endmacro