forked from MEGA65/mega65-user-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappendix-petsciicodes.tex
420 lines (344 loc) · 12.9 KB
/
appendix-petsciicodes.tex
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
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
\chapter{Special Keyboard Controls and Sequences}
\section{PETSCII Codes and CHR\$}
\label{appendix:asciicodes}
You can use the \screentext{PRINT CHR\$(X)} statement to print a character.
Below is the full table of PETSCII codes you can print by index. For example, by
using index 65 from the table below as: \screentext{PRINT CHR\$(65)} you will
print the letter \screentext{A}.
You can also do the reverse with the ASC statement. For example:
\screentext{PRINT ASC("A")} will output \screentext{65}, which matches with the
code in the table.
\begin{adjustwidth}{}{-2cm}
\begin{multicols}{4}
\begin{description}[align=left,labelwidth=0.2cm]
\item [0]
\item [1]
\item [2] \small{UNDERLINE ON}
\item [3]
\item [4]
\item [5] \small{WHITE}
\item [6]
\item [7] \small{BELL}
\item [8]
\item [9]
\item [10] \small{LINEFEED}
% \item [11] \footnotesize{DISABLE \specialkey{SHIFT}\megasymbolkey}
\item [11] DISABLE \\ \specialkey{SHIFT}\megasymbolkey
% \item [12] \footnotesize{ENABLE \specialkey{SHIFT}\megasymbolkey}
\item [12] ENABLE \\ \specialkey{SHIFT}\megasymbolkey
\item [11]
\item [12]
\item [13] \megakey{RETURN}
\item [14] \small{LOWER CASE}
\item [15] \small{BLINK ON}
\item [16]
\item [17] \megakey{$\downarrow$}
\item [18] \specialkey{RVS ON}
\item [19] \specialkey{CLR HOME}
\item [20] \specialkey{INST DEL}
\item [21]
\item [22]
\item [23]
\item [24]
\item [25]
\item [26]
\item [27] \small{ESCAPE}
\item [28] \small{RED}
\item [29] \megakey{$\rightarrow$}
\item [30] \small{GREEN}
\item [31] \small{BLUE}
\item [32] \megakey{SPACE}
\item [33] !
\item [34] "
\item [35] \#
\item [36] \$
\item [37] \%
\item [38] \&
\item [39] '
\item [40] (
\item [41] )
\item [42] *
\item [43] +
\item [44] ,
\item [45] -
\item [46] .
\item [47] /
\item [48] 0
\item [49] 1
\item [50] 2
\item [51] 3
\item [52] 4
\item [53] 5
\item [54] 6
\item [55] 7
\item [56] 8
\item [57] 9
\item [58] :
\item [59] ;
\item [60] <
\item [61] =
\item [62] >
\item [63] ?
\item [64] @
\item [65] A
\item [66] B
\item [67] C
\item [68] D
\item [69] E
\item [70] F
\item [71] G
\item [72] H
\item [73] I
\item [74] J
\item [75] K
\item [76] L
\item [77] M
\item [78] N
\item [79] O
\item [80] P
\item [81] Q
\item [82] R
\item [83] S
\item [84] T
\item [85] U
\item [86] V
\item [87] W
\item [88] X
\item [89] Y
\item [90] Z
\item [91] [
\item [92] \pounds
\item [93] ]
\item [94] $\uparrow$
\item [95] $\leftarrow$
\item [96] \graphicsymbol{C}
\item [97] \graphicsymbol{A}
\item [98] \graphicsymbol{B}
\item [99] \graphicsymbol{C}
\item [100] \graphicsymbol{D}
\item [101] \graphicsymbol{E}
\item [102] \graphicsymbol{F}
\item [103] \graphicsymbol{G}
\item [104] \graphicsymbol{H}
\item [105] \graphicsymbol{I}
\item [106] \graphicsymbol{J}
\item [107] \graphicsymbol{K}
\item [108] \graphicsymbol{L}
\item [109] \graphicsymbol{M}
\item [110] \graphicsymbol{N}
\item [111] \graphicsymbol{O}
\item [112] \graphicsymbol{P}
\item [113] \graphicsymbol{Q}
\item [114] \graphicsymbol{R}
\item [115] \graphicsymbol{S}
\item [116] \graphicsymbol{T}
\item [117] \graphicsymbol{U}
\item [118] \graphicsymbol{V}
\item [119] \graphicsymbol{W}
\item [120] \graphicsymbol{X}
\item [121] \graphicsymbol{Y}
\item [122] \graphicsymbol{Z}
\item [123] \graphicsymbol{+}
\item [124] \graphicsymbol{-}
\item [125] \graphicsymbol{B}
\item [126] \graphicsymbol{\textbackslash}
\item [127] \graphicsymbol{]}
\item [128]
\item [129] \small{ORANGE}
\item [130] \small{UNDERLINE OFF}
\item [131]
\item [132]
\item [133] F1
\item [134] F3
\item [135] F5
\item [136] F7
\item [137] F2
\item [138] F4
\item [139] F6
\item [140] F8
\item [141] \specialkey{SHIFT}\megakey{RETURN}
\item [142] \small{UPPERCASE}
\item [143] \small{BLINK OFF}
\item [144] \small{BLACK}
\item [145] \megakey{$\uparrow$}
\item [146] \specialkey{RVS OFF}
\item [147] \specialkey{CLR HOME}
\item [148] \specialkey{INST DEL}
\item [149] \small{BROWN}
\item [150] \small{LT. RED}
\item [151] \small{DK. GRAY}
\item [152] \small{GRAY}
\item [153] \small{LT. GREEN}
\item [154] \small{LT. BLUE}
\item [155] \small{LT. GRAY}
\item [156] \small{PURPLE}
\item [157] \megakey{$\leftarrow$}
\item [158] \small{YELLOW}
\item [159] \small{CYAN}
\item [160] \megakey{SPACE}
\item [161] \graphicsymbol{k}
\item [162] \graphicsymbol{i}
\item [163] \graphicsymbol{t}
\item [164] \graphicsymbol{[}
\item [165] \graphicsymbol{g}
\item [166] \graphicsymbol{=}
\item [167] \graphicsymbol{m}
\item [168] \graphicsymbol{/}
\item [169] \graphicsymbol{?}
\item [170] \graphicsymbol{v}
\item [171] \graphicsymbol{q}
\item [172] \graphicsymbol{d}
\item [173] \graphicsymbol{z}
\item [174] \graphicsymbol{s}
\item [175] \graphicsymbol{n}
\item [176] \graphicsymbol{a}
\item [177] \graphicsymbol{e}
\item [178] \graphicsymbol{r}
\item [179] \graphicsymbol{w}
\item [180] \graphicsymbol{h}
\item [181] \graphicsymbol{j}
\item [182] \graphicsymbol{l}
\item [183] \graphicsymbol{y}
\item [184] \graphicsymbol{u}
\item [185] \graphicsymbol{p}
\item [186] \graphicsymbol{\{}
\item [187] \graphicsymbol{f}
\item [188] \graphicsymbol{c}
\item [189] \graphicsymbol{x}
\item [190] \graphicsymbol{v}
\item [191] \graphicsymbol{b}
\end{description}
\end{multicols}
\end{adjustwidth}
NOTE: Codes for 192 to 223 are the equal to 96-127. Codes 224 to 254 equal to 160-190 and code 255 equal to 126.
\newpage
\section{Control codes}
\label{appendix:controlcodes}
\begin{center}
\setlength{\def\arraystretch{1.5}\tabcolsep}{6pt}
\begin{longtable}{c|L{5.5cm}}
\textbf{Keyboard Control} & \textbf{Function}\\
\hline
\endhead
\megakey{CTRL} + \megakey{1} to \megakey{8} &
Choose from the first range of colours.\\
\megakey{CTRL} + \megakey{T} &
Backspace the character immediately to the left and to shift all rightmost characters one position to the left. This is the same function as the Backspace key.\\
\megakey{CTRL} + \megakey{Z} &
Tabs the cursor to the left.\\
\megakey{CTRL} + \megakey{E} &
Restores the colour of the cursor back to the default white.\\
\megakey{CTRL} + \megakey{Q} &
moves the cursor down one line at a time. This is the same function produced by the Cursor Down key.\\
\megakey{CTRL} + \megakey{G} &
produces a bell tone.\\
\megakey{CTRL} + \megakey{J} &
is a line feed and moves the cursor down one row. This is the same function produced by the \megakey{$\downarrow$} key.\\
\megakey{CTRL} + \megakey{U} &
backs up to the start of the previous word, or unbroken string of characters. If there are no characters between the current cursor position and the start of the line, the cursor will move to the first column of the current line.\\
\megakey{CTRL} + \megakey{W} &
advances forward to the start of the next word, or unbroken string of characters. If there are no characters between the current cursor position and the end of the line, the cursor will move to the first column of the next line.\\
\megakey{CTRL} + \megakey{B} &
turns on underline text mode. Turn off underline mode by pressing \megakey{ESC} then \megakey{O}.\\
\megakey{CTRL} + \megakey{N} &
changes the text case mode from uppercase to lowercase.\\
\megakey{CTRL} + \megakey{M} &
is the carriage return. This is the same function as the \megakey{Return} key.\\
\megakey{CTRL} + \megakey{]} &
is the same function as \megakey{$\rightarrow$}.\\
\megakey{CTRL} + \megakey{I} &
tabs forward to the right.\\
\megakey{CTRL} + \megakey{X} &
sets or clears the current screen column as a tab position.
\megakey{CTRL} + \megakey{I} or \megakey{Z} will jump to all positions set with \megakey{X}. When there are no more tab positions, the cursor will stay at the end of the line with \megakey{CTRL} and \megakey{I}, or move to the start of the line in the case of \megakey{CTRL} and \megakey{Z}.\\
\megakey{CTRL} + \megakey{K} &
locks the uppercase/lowercase mode switch usually performed with \megasymbolkey and \megakey{Shift} keys.\\
\megakey{CTRL} + \megakey{L} &
enables the uppercase/lowercase mode switch that is performed with the \megasymbolkey and \megakey{Shift} keys.\\
\megakey{CTRL} + \megakey{[} &
is the same as pressing the \megakey{ESC} key.\\
\megakey{CTRL} + \megakey{*} &
enters the Matrix Mode Debugger.\\
\end{longtable}
\end{center}
\newpage
\section{Shifted codes}
\label{appendix:shiftedcodes}
\begin{center}
\setlength{\def\arraystretch{1.5}\tabcolsep}{6pt}
\begin{longtable}{c|L{5.5cm}}
\textbf{Keyboard Control} & \textbf{Function}\\
\hline
\endhead
\megakey{Shift} + \specialkey{INST DEL} &
Insert a character in the current cursor position and move all characters to the right by one position.\\
\megakey{Shift} + \specialkey{HOME} &
Clear home, clear the entire screen and move the cursor to the home position.\\
\end{longtable}
\end{center}
\newpage
\section{Escape Sequences}
\label{appendix:escapesequences}
To perform an Escape Sequence, press and release the \megakey{ESC} key. Then press one of the following keys to perform the sequence:
\begin{center}
\setlength{\def\arraystretch{1.5}\tabcolsep}{6pt}
\begin{longtable}{C{2cm}|L{5.5cm}}
\textbf{Key} & \textbf{Sequence}\\
\hline
\endhead
\megakey{X} &
Clears the screen and toggles between 40 and 80 column modes.\\
\megakey{@} &
Clears the screen starting from the cursor to the end of the screen.\\
\megakey{A} &
Enables the auto-insert mode. Any keys pressed will insert before other characters.\\
\megakey{B} &
Sets the bottom-right window area of the screen at the cursor position. All typed characters and screen activity will be restricted to the area. Also see \megakey{ESC} then \megakey{T}.\\
\megakey{C} &
Disables auto-insert mode, going back to overwrite mode.\\
\megakey{D} &
Deletes the current line and moves other lines up one position.\\
\megakey{E} &
Sets the cursor to non-flashing mode.\\
\megakey{F} &
Sets the cursor to regular flashing mode.\\
\megakey{G} &
Enables the bell which can be sounded using \megakey{CTRL} and \megakey{G}.\\
\megakey{H} &
Disable the bell so that pressing \megakey{CTRL} and \megakey{G} will have no effect.\\
\megakey{I} &
Inserts an empty line in the current cursor position and moves all subsequent lines down one position.\\
\megakey{J} &
Moves the cursor to start of current line.\\
\megakey{K} &
Move to end of the last non-white-space character on the current line.\\
\megakey{L} &
Enables scrolling when the cursor down key is pressed at the bottom of the screen.\\
\megakey{M} &
Disables scrolling. When pressing the cursor down key at the bottom on the screen, the cursor will move to the top of the screen. The cursor is restricted at the top of the screen with the Cursor up key.\\
\megakey{O} &
Cancels the quote, reverse, underline and flash modes.\\
\megakey{P} &
Erases all characters from the cursor to the start of current line.\\
\megakey{Q} &
Erases all characters from the cursor to the end of current line.\\
\megakey{S} &
Switches the VIC-IV to colour range 16-31. These colours can be accessed with \megakey{CTRL} and keys \megakey{1} to \megakey{8} or \megasymbolkey and keys \megakey{1} to \megakey{8}.\\
\megakey{T} &
Set top-left window area of the screen at the cursor position. All typed characters and screen activity will be restricted to the area. Also see \megakey{ESC} then \megakey{B}.\\
\megakey{U} &
Switches the VIC-IV to colour range 0-15. These colours can be accessed with \megakey{CTRL} and keys \megakey{1} to \megakey{8} or \megasymbolkey and keys \megakey{1} to \megakey{8}.\\
\megakey{V} &
Scrolls the entire screen up one line.\\
\megakey{W} &
Scrolls the entire screen down one line.\\
\megakey{X} &
Toggles the 40/80 column display. The screen will also clear home.\\
\megakey{Y} &
Set the default tab stops (every 8 spaces) for the entire screen.\\
\megakey{Z} &
Clears all the tab stops. Any tabbing with \megakey{CTRL} and \megakey{I} will move the cursor to the end of the line.\\
\megakey{1} to \megakey{8} &
Choose from the second range of colours.\\
\end{longtable}
\end{center}