-
Notifications
You must be signed in to change notification settings - Fork 22
/
ReadMe.txt
328 lines (264 loc) · 14.3 KB
/
ReadMe.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
========================================================================
DYNAMIC LINK LIBRARY : acia Project Overview
========================================================================
Acia.dll is a Vcc add-on that attempts to emulate the Deluxe RS232
program pack. It allows connection to windows serial ports and a
tcpip server. It also allows reading/writing windows files and
interaction with the Vcc console.
Issues
------
1) Baud rates are not very accurate.
2) No hardware flow control other than RxF and TxE signals
3) DLL does not exit if Vcc crashes. (Issue with all Vcc Dll's)
4) No detection of serial port "modem" events when reading:
Break, ring, CTS, DSR, RX and DX changes, etc.
Would be nice
-------------
1) Support for second sc6551 device
Acia Quick Start
----------------
To use acia.dll insert it in the cartridge slot or a MPI slot.
This will cause "Acia Config" to be added to the Cartridge menu.
Clicking on this menu item allows selection of one of the acia
modes: Console, File read, File write, TCPIP (client), and COMx.
The Name and Port fields are used to set parameters for modes
that require them. The text mode check box when checked causes
acia.dll to do CR <-> CRLF translations when using the file
read and write modes. The default mode is CONSOLE.
For a quick test leave the ACIA config mode set to console
and enter and run the following basic program. (You can cut
and paste using Vcc Edit -> Paste Basic Code)
10 POKE &HFF6A,1
20 IF (PEEK(&HFF69) AND 8)=0 THEN 20
30 PRINT CHR$(PEEK(&HFF68));
40 GOTO20
The Vcc console should come up. The console is a CMD type window
that is connected to the ACIA. Anything typed in the console
will be read and printed by the basic program. To close the
console POKE &FF6A,0 or press F5 from the Vcc window.
The following program does the opposite, characters typed in the
Vcc window are written to the console and CR writes CRLF:
10 POKE &HFF6A,1
20 K$=INKEY$: IF K$="" THEN 20
30 C=ASC(K$)
40 IF (PEEK(&HFF69) AND 16)=0 THEN 40
50 POKE &HFF68,C
60 IF C<>13 THEN 20
70 C=10: GOTO 40
Console mode is most useful when using Os9 which is described later.
Radio Shack Deluxe RS232 program Pak
-------------------------------------
If the file "rs232.rom" is in the Vcc execution directory it will
be automatically loaded when acia.dll is selected but not started.
To start it do "EXEC &HE010" from RSDOS command prompt. The rom
is a copy of the 4K rom from the Radio Shack Deluxe RS232 program
Pack. If a different ROM is used it must be 4096 bytes long. Note
that if acia.dll is in a MPI slot but not selected it can still be
used but the pack rom will not be accessible. To exec the rom
type EXEC&HE010 at the basic prompt. Note that the pak currently
has trouble with the "goto basic" function on Vcc which limits its
usefulness. Suggestions for a solution would be appreciated.
SC6551 Operation
----------------
The sc6551 emulation is controlled one of two blocks of port addresses,
0xFF68-0xFF6B or 0xFF68-0xFF6F, the block used is selected by a Acia
config dialog Radio button. The CPU controls the sc6551 by writing
to these addresses and gets status and data from the sc6551 by reading
them. A sc6551 datasheet will explain these in detail - what follows is
a brief explaination of the most important bits to acia.dll.
0xFF68 (0xFF6C) is the data register. A write to the address will transmit
a byte of data and a read will receive a byte of data.
0xFF69 (0xFF6D) is the status byte. The CPU reads this port to determine
the status of the sc6551. Bits 0, 1, and 2 of the status byte are
error indicators. Bit 3 indicates that a data byte is ready to read.
Bit 4 indicates that the sc6551 is ready to transmit a byte. Bits
5 and 6 are modem and data set ready bits, and Bit 7 indicates the
sc6551 has asserted and IRQ. Acia.dll does not set the error bits and
bits 5 and 6 are always clear to indicate mode and data ready states.
Data flow is controlled by status bit 3 (RxF) and bit 4 (TxE). When
the CPU wants to send data it first must verify bit 4 (TxE) is set before
writing to the data register, and when it wants to recieve data it must
first check that bit 3 (RxF) is set before reading the data register.
Acia.dll will assert an IRQ and set status bit 7 when data becomes ready
to read if Bit 1 of the command register (0xFF6A (0xFF6E)) is clear. The coco can
use the interrupt to reduce input polling.
0xFF6A (0xFF6E) is the command register. Bit 0 of the command register is the
DTR bit. This bit enables or disables the sc6551. If this bit is set
by the coco CPU then communications are active (open) and if it is
cleared communications are inactive (closed). Other command register
bits set IRQ behavior and parity. Refer to data sheet for details.
0xFF6B (0xFF6F) is the control register. Bits 0-3 of the control register set
the baud rate according to the following table. Datasheet rates that
are not supported by acia.dll have replaced by the next higher value.
Acia.dll uses screen sync signal to time the input speeds. These
are only approximate and if F8 is toggled (Screen refresh throttle)
the rates are invalid.
val rate val rate
0 MAX 8 1200
1 75 9 2400
2 75 10 2400
3 110 11 4800
4 300 12 4899
5 300 13 9600
6 300 14 9600
7 600 15 19200
Bits 5 and 6 of 0xFF6B (0xFF6F) set the data length and Bit 7 sets the number
of stop bits. B5-6: 00=8 01=7 10=6 11=5 len. B7 0=1, 1=2 stops.
Basic programs can enable acia by poking 1 to &HFF6A and disable it by
poking 0. They can then peek &HFF69 and test the result for RxF by
anding 8 or test for TxE by anding 16. Then peek &HFF68 to read data
and poke &HFF68 to write it.
To demonstrate here is a simple Basic program that will read data
from the emulated acia:
10 POKE &HFF6A,1
20 S=PEEK(&HFF69) AND 8
30 IF S=0 THEN 20
40 PRINT CHR$(PEEK(&HFF68));
50 GOTO20
To test it set the Acia Config dialog to read a text file from the PC.
(Filename is relative to user directory). When the program is run
Basic will print it's contents. If you press break and then continue
the program will resume printing where it left off. If you poke 0 to
&HFF6A acia will close the file and when the program is run again it
will reopen and start from the file's beginning.
Since the baud rate has not been set acia defaults to 0 which is max
speed. In this case the program's output is throttled by the PRINT
rate. If F8 is toggled it runs much faster.
This simple program does not check for end of file so you have to use
break to end it because acia.dll will endlessly send EOF and CR
sequences as basic attempts to read past the end of file.
More detail on file read mode can be found later in this document.
RS232.ROM
---------
If the file "rs232.rom" is in the Vcc execution directory it will
be automatically loaded when acia.dll is selected but not started.
(make sure Autostart Cart in Misc Config dialog is unchecked)
To start it do "EXEC &HE010" from RSDOS command prompt. The rom
is a copy of the 4K rom from the Radio Shack Deluxe RS232 program
Pack. The RS232 rom is only usefull if FF68 (RS-232 Pak) is selected
in the config dialog. If a different ROM is used it must be 4096
bytes long. Note that if acia.dll is in a MPI slot but not selected
it can still be used but the pack rom will not be accessible.
Communications Modes
--------------------
Communications modes are set using the Acia Interface config dialog
which can be reached from the Vcc Cartridge menu when the DLL is
loaded. The dialog has radio buttons for Console, File read,
File write, TCPIP, and COMx modes of operation. When activated
Console mode brings up the Vcc console window. File write mode
causes all data output to go to a file. File read mode does the
reverse; data is input from a file. TCPIP mode establishes a
client connection with a network server and Comx mode establishes
a connection with a windows serial port. When File read or Write
mode is selected the filename relative to user home directory
must be inserted into the Name field. When COMx mode is selected
the port name (eg: COM3) must be placed in the Name field with no
leading blanks. When TCPIP mode is selected the server address
must be in the Name field and the port number in the Port field.
Additional detail of these modes follows.
Console mode
------------
Console mode can be useful when using (Nitr)Os9 and the t2 device
and associated sc6551 driver. t2 and sc6551 must both be loaded at
boot (in the boot track) to work properly. The t2 device can also
be used for testing purposes, which is why it was originally created.
Note that the stock t2 driver assumes the Acia Address is FF68.
Caution: There can only be one console associated with Vcc. Conflicts
will occur is the console is used for other purposes, such as for
debug logging.
/t2 settings for Windows conso1le should be as follows:
xmode /t2
-upc -bsb bsl echo lf null=0 pause pag=32 bsp=08
del=18 eor=0D eof=1B reprint=09 dup=19 psc=17 abort=03
quit=05 bse=08 bell=07 type=80 baud=06 xon=11 xoff=13
Some of these settings are not honored by the sc6551 driver.
Xon, Xoff, and baud xmode settings seem to have no effect.
The console uses standard OS9 text window settings. Acia.dll
will translate many OS9 text screen control codes to do the
proper console functions. Colors default to white on black.
Only colors 0-7 are supported.
To launch a shell simply do: shell i=/t2 and the console
will come up. Typing "ex" in the console window causes the
console to close.
The console handles scrolling fairly well. The windows system
automatically moves the console window within the screen buffer
to keep the cursor visible. This causes text to appear to scroll
as long as the cursor is within the boundaries of the buffer.
By default the windows screen buffer is large but eventually it
becomes full. To handle this acia.dll deletes lines from the top of
the buffer when the cursor tries to move to a line below the bottom.
This affects full screen editors. They use cursor move sequences
to control positioning within the screen boundaries but must scroll
text when the cursor tries to move beyond the screen boundaries.
Vim (fixed tsedit) works pretty well. It takes care of deleting lines
from the top of the screen when the cursor nears the bottom and
replaces the lines when scrolling up. Vim seems to be hard coded to
24 lines so the screen must be at least 24 lines long. (changing
tspars or typing v to set the screen type does not work for me)
Scred assumes the terminal will delete lines from the top of the
screen when the cursor is at the bottom of the screen. (emphasis on
screen) This means screen length must match what scred thinks for
it to work properly. Since acia.dll console does the delete based
on buffer size it actually is that size that scred must be aware of.
Fix it to set the screen buffer to a reasonable size and use scred's
-l=<screen buffer len> argument. (500 lines still seems to work
but I don't use scred much). The size of the buffer can be changed
from the windows properties menu in the console title bar.
I did a brief check of uemacs. It seems to work okay except I find
the lack of support of arrow keys annoying and I am too used to
vi's use of hjkl for cursor position to adapt to emacs.
File Read and File Write Modes
------------------------------
File modes allow reading or writing to/from a windows file. After
selecting the appropriate radio button in the Acia Interface config
dialog the file name relative to user home directory should be
entered in the Name field. For example: "test\myfile.txt" in the
name field refers to %USERPROFILE%\test\myfile.txt
There are two file modes, File Read and File Write. Read mode
causes acia to receive characters from the file specified and
write mode sends charactes. Writes in read mode are ignored
and reads in write mode returns nulls.
It is sometimes best to turn off local echo and pause on the
os9 /t2 device to avoid I/O errors, eg: xmode /t2 -echo -pause
Text mode. When text mode is checked end of line translations
(CR <-> CRLF). This is recommended when using /t2 in os9 unless
attempting to write binary files to windows. Reading binary files
is difficult under os9 because the sc6551 driver does not report
end of file conditions. To avoid hangs acia.dll returns a <CR><ESC>
sequence when an attempt is made to read past the end of a file
regardless of text mode settings.
Sending command output to a file can be done with something like
'dir -e > /t2' If doing a long listing it is better to place the
output in a os9 file and copy that to /t2, for example:
dir -e -x > cmds.list
copy cmds.list /t2
When using other programs to read or write files it is important
to note that setting DTR opens the file and clearing DTR closes
it. The NitrOS9 driver takes care of this but many terminal
programs do not. DTR is controlled by bit 0 in 0xFF6A (0xFF6E).
TCPIP Mode
----------
TCPIP mode causes acia to do a client connection to a tcpip server.
After selecting TCPIP radio button on the Acia config dialog the
server hostname or IP address should be entered in the Name field
(default is localhost) and the server port in the Port field. Setting
bit 0 in 0xFF6A (0xFF6E) opens the connection and clearing it closes it.
Testing tcpip mode was done using netcat on Linux as a server.
On Linux ' nc -l -p 48000' 48000 is the port number I am using.
After launching a shell connected to /t2 on (Nitr)Os9 the Linux
session becomes a terminal connected to Os9.
Also Twilight Term (TWI-TERM.BIN) was used to test connection with
a telnet BBS on the internet. (Set the address on the BBS in the
acia interface config name field and 23 in the port field)
COMx Serial Port Mode
----------------------
After selecting COMx radio button the port name should be entered
in the Name field, for example "COM3". Leading blanks will not
work, port name must be left justified.
Valid baud rates are 110,300,600,1200,2400,4800,9600,19200
Testing of the COM port mode was done using a com0com port emulator
in windows along with putty. com0com is used to 'wire' two psuedo
port COM20 and COM21 together. I used acia.dll to connect to COM20
and PuTTy to connect to COM21. This allowed me to simulate connecting
with a terminal. Also tested with a USRobotics faxmodem via a Radio
Shack USB to serial adapter and the legacy USBSER driver.