-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbastext.1
270 lines (270 loc) · 6.31 KB
/
bastext.1
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
.TH BASTEXT 1 "2023-11-21" "Softwolves Software" ""
.SH NAME
bastext \- convert Commodore BASIC to text
.SH SYNOPSIS
.PD 0
.B bastext
\-i [\-t] [\-a] [\-s] [\-d filename]
filename(s)
.PP
.B bastext
\-o
[\-t] [\-2|\-3|\-5|\-7|\-1]
filename(s)
.PP
.B bastext
\-h
.PD
.SH DESCRIPTION
.B BasText
is a program that is used to convert between binary (tokenized)
BASIC files from the Commodore C64 and C128 to a clean ASCII text
format that is human and machine readable, as well as transportable
via electronic mail.
This program is designed to be compatible with
.BR tok64 ,
while extending the support for Commodore BASIC extensions and
dialects.
.PP
The following Commodore BASIC versions and extensions are supported
by
.BR BasText :
.RS
.PP
.I Commodore BASIC 2.0 (VIC20/C64)
.PD 0
.PP
.I Commodore BASIC 3.5 (C16/+4)
.PP
.I Commodore BASIC 4.0 (PET)
.PP
.I Commodore BASIC 7.0 (C128)
.PP
.I Software Unlimited's Graphics52 for Commodore 64
.PP
.I Riska BV's The Final Cartridge III for Commodore 64
.PP
.I Rick Simon's BASIC 7.1 for Commodore 128
.PP
.I VIC Super Extender for VIC-20
.PP
.I Turtle BASIC 1.0 for VIC-20
.PP
.I SpeechBASIC 2.7 for Commodore 64
.PP
.I AtBasic for Commodore 64
.PP
.I Simon's BASIC for Commodore 64
.RE
.PD
.PP
.B BasText
tries to autodetect the Commodore BASIC dialect used in the file
it is processing.
At the moment, this is done by checking the starting address of the
file.
These starting addresses are recognized, and interpreted (addresses
written in hexadecimal):
.TP
0401
.I VIC-20 BASIC 2.0 (3K RAM expansion)
.TP
0801
.I Commodore 64 BASIC 2.0
.TP
1001
.I VIC-20 BASIC 2.0 (unexpanded VIC)
.TP
1201
.I VIC-20 BASIC 2.0 (8K RAM expansion)
132D
.IR "Commodore 128 BASIC 7.1 extension by Rick Simon" .
This file is a combined file, with both the BASIC 7.1
extension binary, and the BASIC source in one file (saved
with BASIC 7.1's
.B ESAVE
command).
The preamble will be ignored, and the file will be
interpreted as BASIC 7.1.
1C01
.I Commodore 128 BASIC 7.0
.TP
4001
.I Commodore 128 BASIC 7.0
saved with graphics mode enabled.
.SH OPTIONS
One of the three mode selectors must be given:
.TP
.I \-i
Set input mode (converting from binary Commodore tokenized BASIC to
text).
.TP
.I \-o
Set output mode (converting from text to binary Commodore tokenized
BASIC).
.TP
.I \-h
Shows a brief help screen, with an overview of the available options.
.SS "GENERAL MODIFIERS"
.PP
These general modifiers (works in both input and output modes)
are available:
.TP
.I \-t
Enable T64 (Commodore 64 emulator tape archive) mode.
When in input mode, this means that instead of the specified file
names being binary Commodore BASIC files, they are T64 archives.
When in output mode, this means that instead of writing the
binary Commodore BASIC files to files in the current directory,
they will be written to a T64 archive named
.B bastext.t64
in the current directory.
If the archive already exists, it will be appended to.
The default directory size for the
.B bastext.t64
file is 30 entries.
If you try to add more files to it, the program will abort with
an error message.
The default directory size is controlled in the
.I t64.h
file.
.SS "INPUT MODE MODIFIERS"
.PP
These modifiers are available only when in input mode:
.TP
.I \-a
Convert all input files, not only those that have a \"recognized\"
starting address.
.TP
.I \-s
Maintain strict compatibility with
.BR tok64 .
This means that
.BR BasText \'s
"extended" escape codes for charactes 92 (British pound),
95 (left arrow), 160\-192 (shift space to shift asterisk),
219\-221 (shift plus, commodore minus and shift minus), and 223
(commodore asterisk), will be printed as three-digit numeric
escape codes, not as textual escapes.
The "strict" mode will not, however, undo the problems with
.BR tok64 's
"uppercase in quoted strings"-bug (see under
.BR BUGS ).
.TP
.I \-d filename
Selects the filename to write the output to.
If the filename is not given, or is given as "-", the listings
will be output on the standard output device (normally the
console).
.SS "OUTPUT MODE MODIFIERS"
.PP
These modifiers are available only when in output mode:
.TP
.I \-2
Force
.I Commodore BASIC 2.0
interpretation of
.I all
programs.
.TP
.I \-3
Force
.I Commodore 64 The Final Cartridge III BASIC extension
interpretation of
.I all
programs.
(See also
.BR BUGS ).
.TP
.I \-5
Force
.I Commodore 64 Graphics52 BASIC extension
interpretation of
.I all
programs.
.TP
.I \-7
Force
.I Commodore 128 BASIC 7.0
interpretation of
.I all
programs.
.TP
.I \-1
Force
.I Commodore 128 BASIC 7.1 extension
interpretation of
.I all
programs.
.PP
Please note that the MS-DOS and OS/2 versions (EMX compiled)
uses
.B /
(slash) as parameter character.
.SH EXAMPLES
.TP
.B bastext \-i sample.prg
Converts
.I sample.prg
to text, and displays it on the standard output.
.TP
.B bastext \-i \-s \-d programs.txt *.prg
Converts all Commodore BASIC binary files with a
.I .prg
extension to text, writing it to
.I programs.txt
in the current directory, while maintaining
.B tok64
compatibility.
.TP
.B bastext \-it *.t64 | more
Converts all files in all T64 archives (with filename suffix
.IR .t64 )
in the current directory into listings, displaying them
one page at a time.
.TP
.B bastext \-o7 programs.txt
Converts all programs in the
.I programs.txt
text file into Commodore BASIC 7.0 programs.
.SH "SEE ALSO"
.PD 0
.PP
.I http://cbm.6502.org/
.PP
.I http://www.baltissen.org/newhtm/project64.htm
.PD
.SH BUGS
.B tok64
seems to parse uppercase characters in quoted strings
incorrectly.
It converts them into characters in the range of 97-122,
whereas a Commodore computer (and
.BR BasText )
usually uses the "shadow" range of 193-208.
This will not look any different when used on a Commodore
computer, but it will make the binaries differ, and could
make a difference if the program needs the correct PETSCII
values.
The problem will appear when you convert the program in
one direction with
.B BasText
and in the other with
.BR tok64 ,
not when using the same program in both directions.
.PP
.B BasText
does not yet support the "bare" format that tok64 normally
outputs (without the
.I start tok64
header).
.SH VERSION\ INFORMATION
This documentation covers version 1.1 of
.BR BasText .
.SH AUTHOR
BASTEXT was written by Peter Krefting.
If you have bug-reports or questions, mail them to peter@softwolves.pp.se
.PP
A Softwolves Software (tm) Release in 2023.
.PP
This program is released under the GNU Public License.