Compute!s Second Book of Commodore 64
Compute!s Second Book of Commodore 64
’s
7 [Cvelaalovymo]ele)|(e
ola
e] SauliliiieomivielielSaelate lalfolsaateliela
7" for users of the Commodore 64° home computer,
ror elKole slate AWielcerm(enel(q\elilare foley s4liale Ke|xo]o)alexy
the best from COMPUTE! Publications.
BOOK
COMMODORE
O4
10987654321
COMPUTE! Publications, Inc., Post Office Box 5406, Greensboro, NC 27403, (919)
275-9809, is one of the ABC Publishing Companies, and is not associated with any
manufacturer of personal computers. Commodore 64 is a registered trademark of
Commodore Electronics Limited.
Contents
Foreword * 54 2s czech
est, Sr ee eal V
SpeedScript
Charles Brannon
3
1 Recreations and Applications
4
Recreations and Applications 1
Resume typing:
Now is the time for all good men to
come to the aid of they're country.
6
Recreations and Applications 1
end of the document. You can add text to the end of your
document, but you cannot move past it, since there’s nothing
there. Very rarely, you may see some text past the end of file,
but you can’t move to it, so ignore it.
Many of the other keys behave predictably. The CLR/
HOME key in the unSHIFTed position moves the cursor to the
top of the screen. If you press it twice, it brings you to the top
of your document (in case the document is longer than one
screen). The insert key (SHIFT-INST/DEL) inserts a space at
the cursor position. You can press it as many times as nec-
essary to make space for inserting a word. You can also go
into insert mode, where every letter you type is automatically
inserted. In insert mode, it is not possible to overstrike. You
enter or leave insert mode by pressing CTRL-I.
Normally when you type a key, that letter or symbol
appears. Certain keys, such as CLR/HOME, however, perform
a function. SpeedScript extends this idea and places all the
command keys in an easy-to-remember order. For example,
insert mode is turned on or off by pressing CTRL-I. (To use a
control key, hold down CTRL while you type the other key.)
When you enter insert mode, the command window
changes color to remind you. If you press CTRL-I again,
you're back in normal overstrike mode, and the command
window reverts to its usual color.
CTRL-Z moves you to the bottom of your document (end
of file). It’s useful for adding text to the end. If you want to
check how much memory you have left for typing, press
CTRL and the equals (=) key. You have about 45K of text
memory on the 64. SpeedScript takes advantage of all the
available RAM on the 64.
To accommodate personal taste and video clarity, you can
change the screen and text colors to any combination you
want. CTRL-B (think “background”) changes the screen color.
You can keep pressing it until a color you like comes up.
CTRL-L (“letters”) changes the text color. If you have a color
monitor, you can get some really interesting combinations.
The RUN/STOP key is like a TAB key. It inserts five
spaces at the cursor position. You can use it for indenting, or
to add indentation to a paragraph previously typed.
If you want to change the case of a letter or word, po-
sition the cursor on the letter and press CTRL-A. It will switch
from lower- to uppercase or vice versa. CTRL-A moves the
1 Recreations and Applications
Text Deletion
With a typewriter, if you don’t like what you've typed, you
can tear the paper out, crumple it up, and dunk it into “file
13.” With a word processor, this satisfying act is accomplished
with but a few keystrokes.
With the DEL key, you can erase the last letter typed. If
you're in the middle of text and press it, you'll notice that the
character the cursor is sitting on is pulled on top of the pre-
vious character, and the rest of the text follows along. It
sounds a little confusing, but it’s easy:
The quick brown fox juunmped over
Cursor is moved to error:
The quick brown fox juun{iped over
DEL is struck twice, deleting the erroneous characters:
The quick brown fox juufped over
The quick brown fox jufped over
If you don’t want the text to be pulled back, you can
press the back-arrow key. It will just backspace and blank out
the previous character without pulling the adjacent characters
backward. Another way to delete is with CTRL-back-arrow.
The cursor does not move, but the following text is “sucked
into” the cursor. It is like a tiny black hole.
If you want to strike out a whole word, sentence, or para-
graph, it’s time for a more drastic command: CTRL-E. When
you press CTRL-E, the command window turns red (to instill
fear and awe). You see the message:
Erase (€5,W,P3; to exit
Each time you press one of the three keys, a sentence,
word, or paragraph is pulled toward the cursor and deleted.
You can keep pressing S, W, or P until all the text you want to
Recreations and Applications 1
10
Recreations and Applications 1
Enter the name you want to use for the document. Follow
the standard Commodore filename rules, such as keeping the
name to 16 characters or less. Press RETURN, then press ei-
ther T or D, answering the prompt TAPE OR DISK?
After the Save is completed, you'll see NO ERRORS
(hopefully). If there was an error during the save, such as no
disk in the drive, or a disk full error, SpeedScript will read the
error channel and display the error message. You'll get the
error ‘file exists” if you try to save using a name that’s al-
ready on the disk. If you want to replace the file, prefix the
name with the characters “@:’’, such as “@:Document’’. This
is called “Save with Replace.” You can also press CTRL- ff (up
arrow, explained below) and scratch the file before you save.
Press f7 to load a file. You may want to use SHIFT-CLR/
HOME to erase the current text first. The Load feature will ap-
pend text starting wherever the cursor is positioned. This lets
you merge several files from tape or disk into memory. If the
cursor is not at the top of the file, the command window will
change color to warn you that you are performing an append.
You should add text only to the end of the file, as the end-of-
file marker is put wherever the load stops. Also, beware that
you can crash SpeedScript if you try to load a file and don’t
have enough room (a file longer than available memory). You
can use CTRL-= (equals sign) to check the available memory
space before merging files to avoid a crash.
You can use CTRL-V to Verify a saved file. Verify works
like Load, but compares the file with what’s in memory. It’s
most useful with tape, but you can use it with disk files, too.
11
1 Recreations and Applications
2
Recreations and Applications 1
13
1 Recreations and Applications
Hiss ebinishse<
To set off these format commands, I'll show here that
they are in reverse video by enclosing them in brackets. You'll
enter them with CTRL-English pound sign.
[s] Spacing, default 2. Line spacing. This is set to 2 to des-
ignate double spacing. For single spacing, enter 1, for triple
spacing, enter 3, and so on.
[l] Left margin, default 5. The left margin is the number of
spaces to indent for each line.
[r] Right margin, default 75. This must be a number less
than 80, which is the number of characters that can fit on a
line. Add the line length you want to the left margin to get
the right margin.
[t] Top margin, default 5. How many blank lines to skip
from the top of the page to the first line of printing. Should be
at least 5.
[b] Bottom margin, default 58. A number less than 66,
which is the number of lines on an 8¥2 inch x 11 inch sheet of
paper or pinfeed paper. Do not use a bottom margin more
than 59.
[h] Define header. The header is printed at the top of each
page, if you specify one. To define the header, begin a line
with [h], enter the header text, then press RETURN. Example:
faccounting Procedurest
You can embed a format [c] after the [h] to center the
header, a format [e] to block the header edge right, and a
format [#] any place you want a page number to appear.
Examples:
A centered page number with a dash on each side:
¥ePage ~-i-¢
The header used when this article was written:
Tabrannon/s'5peedscript/@e
[f] Define footer. Just like header, but appears at the bot-
tom of each page. A centered page number within parentheses:
cha
[n] Next page. This command forces the printer to skip to
the next page, regardless of the position on the current page.
Recreations and Applications 1
Other Commands
These commands do not change printer variables, so they are
usually embedded within a line.
[u] Underline—place on each side of a word or phrase to
underline. It works by backspacing and overstriking an under-
line symbol on top of each character. Some printers, including
the VIC 1525, do not support the backspace command, so
underlining will not work on these printers.
[c] Center—place this at the start of a line you wish to
center. Remember to end the line with RETURN.
[e] Edge right—like center, but will block the line to the
edge of the right margin.
[#] Page number—When SpeedScript encounters this
symbol, it prints the current page number.
User-Definable Codes
Many printers use special so-called escape sequences to con-
trol printer functions such as automatic underlining, boldface,
italics, super/subscripting, elongated, condensed, etc. These
codes are either ASCII numbers less than 32 (control codes) or
are triggered by an ESCape character, CHR$(27), followed by
a letter or symbol. For example, for the Epson MX-80 with
Graftrax, italics is turned on with ESC 4. You should study
your manuals to learn how to use these codes. Since most of
the control codes and the escape character are not available
from the keyboard, SpeedScript lets you define the format
commands 1-9.
If you enter [1]=65, then every time the reverse video [1]
is encountered during printing, that character (65 is the letter
A in ASCII) is sent to the printer. For example, SpeedScript
uses the back-arrow for a carriage return mark, so you can’t
directly cause a back-arrow to print on the printer. Instead,
you can look up the ASCII value of the back-arrow, which is
95. You would enter [1]=95, say, at the top of your document.
Then, any place you want to print a back-arrow, just embed a
[1] in your text. Refer to Appendix F, “ASCII Codes”, for the
ASCII values of the 64’s characters and graphics symbols. The
first four numbers are predefined so that you don’t have to set
them, but you can change their definition:
[1]=27 (escape), [2]=14 (elongated, most printers),
[3]=15 (elongated off), [4]=18 (condensed).
A fascinating possibility is to trigger the bit graphics
15
yuaumno0q
ydeisereg JO PU eSIIA JIA d
sadeds
IojoD Jojo),
eT aouajuag nse dyisiQ —-Suzzayja‘]— punoi8ypeg ( Se aeaiostan OL 05) IO ‘1aM0T ¢ Hesuy
cae snorAalg OL, 05 eIdeIeg puq a8ueys ee P: za OL aaaan . hay
on M ue
*LIIHS/M soury) {pueurw05)
wysTy 39U9}UIG 1X9N siayeIeYD jonuo>
pOsthS) ‘:peLAIHSuUN esodsues], 1aj}uq OL
*?PeLAIHSUN umog PIOH
1 Recreations and Applications
16
dey
pseoghoy *[
e1ns17
Recreations and Applications 1
Printer Compatibility
SpeedScript works best, of course, with a standard Com-
modore printer. However, we have used it with several other
printers such as the Epson MX-80, an Okidata Microline 82A,
and the Leading Edge Prowriter (NEC 8023), via an appro-
priate interface. The interfaces I’ve used are the Cardco Card/
Print and the Tymac Connection. Any interface that works
through the Commodore serial port should be fine.
SpeedScript will probably not work with an RS-232 printer
attached to the modem/user port. SpeedScript may operate
with some interfaces which emulate a Centronics port on the
user port via software, as long as the software does not con-
flict with SpeedScript. If you can get your printer to work fine
with CTRL-P, skip the next few paragraphs to avoid confusion.
The Commodore printers and most interfaces use a device
number of 4. (Other device numbers are 1 for the tape drive
and 8 for the disk drive). If you have more than one printer
attached with different device numbers, you can enter this
number by holding down SHIFT while you press CTRL-P.
You'll be asked to enter the device number and the secondary
address. Incidentally, you can get a rough idea of page breaks
before printing by using a device number of 3, which causes
output to go to the screen.
The secondary address is a command number for the
printer. For Commodore printers or interfaces which emulate
the Commodore printer, the secondary address should be 7,
which signifies lowercase mode. The default device number, 4,
and the default secondary address, 7, are automatic when you
press CTRL-P without holding down SHIFT.
If your interface cannot even partially emulate a Com-
modore printer, you will have a few problems. First of all, the
numbers Commodore uses to describe characters, called
17
1 Recreations and Applications
SpeedScript
2049 :811,908,919,908,158,058, 238
2055 :048,054,049,808, 080,800,158
2061 :832,1983,009,876,193,809,179
2067 :165,251,141,851,988,165,832
2073 :252,141,952,008,165, 253,128
2079 :141,954,008,165, 254,141,026
2085 :055,908,166,181, 248,032,207
18
Recreations and Applications 1
2091 :169,800,141,195,026,168,222
2697 2900,185,914,939,153,813,197
21983 2039, 200, 204,195,826, 208,159
2189 :244,238,052,008, 238,955,128
2115 2808, 224,008, 240,987, 202,236
2121 ?208,224,165,180, 268,222,800
2027 :996,165,181,178,005,188,188
2:11.33 :208,001,8096,924,138,101,141
239) 2252,141,123,988,165, 251,887
2145 2141,122,008,924,138,191,119
Paalyoy 2254,141,126,908,165, 253,826
257 2141,125,008,232,164,188,191
2163 2208, 904, 248,013,168,255,227
2169 :185,080,028,153,981,8028,984
2275 2136,192, 255, 2808, 245, 206, 989
2181 :123,908,206,126,908, 202,838
2187 2208, 234,096,169,048,133,251
2193 2195,133,020,169,904,133,931
299 311 96)5:169;,216, 1337,02i%,, 17/3 7,,035
2265 319170267, 133,055), 173), 92,003
22 :026,133,156,162,901,173,946
2219 :194,026,133,912,173, 284,143
2223 2@26,141,032, 208,168,880, 2308
2229) :173,203,026,145,820,177,157
2235 155,153, 205,826, 208,841,199
2241 2127,201,031,248,819,192,235
2247 2940, 208, 235,136,177,155,126
2253 2@41,127,201,032,240,9005,983
2259 2136, 208, 245,160,939, 298,175
2265 :132,167,136,185,2805,826,044
2:145,195,136,016, 248,164,193
2167,024,152,191,155,1337,,193
2155,165,156,105,000,133, 181
:156,152,157,960,083,192,193
2940, 240,008, 169,032,145,113
2195,200,076, 246,008,024, 234
2:165,195,195,840,133,195,968
2133,020,144,004,230,196,224
22308,021, 232,224,625, 246,219
:903,076,179,008,165,155,995
:141,201,026,165,156,141,989
:202,026,096,169,008,133,147
:155,141,191,026,1417, 197,122
:926,133,938,169,929,133,961
:156,141,192,926,141,198,137
2926,133,039,169,932,162,196
2179,,160,255,, 198,156), 145),,1:32
2155, 290, 239,156,145,155,886
2208, 208, 251,230,156, 282,842
:208,246,145,155,996,133,848
19
1 Recreations and Applications
2391 :167,132,168,168,968,177,123
2397 2167,248,006,932,2198,255,235
2463 :200,208,246,996,169,912, 086
2499 :141,204,926,169,938,133,9848
2415 :@01,169,811,141, 283,626,150
2421 2932,036,909,169,8900,141,248
2427 :194,826,832,115,815,169,162
2433 2255,141,138,002,832,245,174
2439 :@12,032,158,889,169,169,164
2445 :169,025,032,086,099,238,179
2451 :193,026,996,932,166,009,157
2457 :169,898,168,025,032,886, 283
2463 :8@89,169,009,141,193,926,185
2469 :996,162,039,169,932,157,052
2475 2880 ,004,262,016,250,169,644
2481 :919,076,210,255,072,941,882
2487 2128,074,133,167,194,641,862
2493 :863,905,167,096,160,908,168
2499 :177,838,133,8002,168,008,193
2585 :177,038,073,128,145,638,832
25 2032,142,008,9032,228, 255,136
2517 :208,013,165,162,041,016,9059
2523 2248,245,169,900,133,162,144
2529 :876,199,909,170,160,900,071
2539 2165,9802,145,8038, 224,695,132
2541 :208,9812,032,160,911,169,961
2547 :932,160,0900,145,9038,876,182
2553 :193,089,173,193,826,248,959
2559 :007,138,8072,832,158,009,151
2565 :194,178,138,201,013,208,871
2572 20@02,162,895,138,041,127,964
PAU :201,032,144,078,224,160, 680
2583 :208,002,162,032,138,072,125
2589 :173,194,926,240,0903,032,185
2595 2149,914,194,932,181,889, 983
2681 :160,009,145,038,832,142,946
2687 :0@08,956,165,9038, 237,197, 236
2613 2026,133,167,165,939, 237,852
2619 :198,826,005,167,144,914,191
2625 :165,038,195,008,141,197,199
2631 :926,165,939,195,000,141,035
2637 :198,826, 238,938, 208,902,811
2643 2238,039,032,231,018,076,189
2649 2193,009,138,174,125,918,226
2655 2221,125,0108, 248,686, 262,131
2661 2208,248,076,193,009, 282,813
2667 :138,910,178,169,80809,972,163
2673 :169,192,8972,189,162,919,139
2679 :072,189,161,819,872,896, 207
2685 :935,829,157,137,133,802,196
20
Recreations and Applications 1
2691 2912,138,134,920,148,084,875
2697 2819, 889,147,135,139,985,979
2783 2136,149,022,145,817,159,258
2769 2818,924,826,816,028,030,935
215 :086,881,811,988, 031,083,215
2721 2159,011,159,911,178,@11,161
2727 :227,811,054,812,966,912,037
2733 2080,012,179,812,231,813,188
21359 :139,814,914,814, 983,014, 281
2745 :201,814,225,814,253,014,138
2751 :@24,815,185,815,222,817,157
2757 :205,016,843,8018,088,912,959
2763 :179,@12,111,918,118,919,148
2769 2823 ,028,8028,912,198,829,164
2/75 :186,917,112,023,002,014,957
2781 2839,028,244,012,215,923,906
2787 2057,8@25,122,814,832,071,936
293 2011,056,165,8038, 237,191,163
2799 :826,133,167,165,839, 237,238
2895 2192,026,905,167,176,030,873
2811 :@56,173,191,826, 233,000,162
2817 :133,167,173,192,926, 233,157
2823 2829,985,167,249,813,165,114
2829 2938,141,191,926,165,939,191
2835 :141,192,026,032,142,088,948
2841 2956,173,201,026, 229,038,236
2847 :133,155,173,202,926,229,181
2853 2039,133,156,005,155, 248,253
2859 :@02,176,024,824,173,191,121
2865 :926,199,861,903,141,191,968
2871 :@26,173,192,8926,195,8900,965
2877 2141,192,8026,932,142,008,990
2883 :076,825,011,996,956,173,248
2889 :197,026,233,008,133,167,961
2895 :173,198,826, 233, 287,805,153
2961 :167,144,018,169,908,141, 204
2967 :197,826,169, 207,141,198,995
2913 2026 ,956,165,8038, 233,008,193
2919 2133, 167,165,839, 233,929,191
2925 :805,167,176,909,169,909,123
2932 :133,038,169,929,133,039,144
2937 2096 ,056,165,938, 237,197,142
2943 :826,133,167,165,839,237,126
2949 :198,926,905,167,176,901,194
2955. :996,173,197,826,133,938,034
2961 :173,198,926,133,039,8996,842
2967 :238,8938, 208,002, 230,039,130
2973 :076,231,918,165,938, 208,117
2979 :802,198,039,198,038,976, 262
21
1 Recreations and Applications
2985 :231,010,165,038,133,155,133
29 On: :165,939,133,156,198,156, 254
2997 2160,255,177,155,2801,932,137
3683 2240,004, 201,831,208, 803,1986
3669 2136, 298,243,177,155, 201,833
3815 :@32,240,008, 201,031,248,183
3821 2@04,136, 208, 243,8996,132,8808
3827 :167,0956,165,155,181,167, 254
3833 2133,038,165,156,195,008,946
3839 2133,039,076,231,910,160,184
3645 :900,177,038,201,032,248,149
3851 2888, 201,031,240,004, 208,151
3657 2208,243,096,290,240,025,229
3963 2177,038, 201,032,249, 247,158
3869 :201,031,248,243,024,152,120
3875 :181,938,133,938,165,939, 695
3881 2105,900,133,8039,076,231,981
3887 :010,173,197,926,133,638,989
3893 2173,198,626,133,039,076,154
3699 :@13,012,169,000,141,191,941
3185 2826,173,198,026,956, 233,233
splot :@84,201,8029,176,982,169,198
3117 2029,141,192,826,932,142,995
3123 :088,076,016,012, 238, 204,993
3129 2926,173,204,8026,041,815,030
3135 2141, 2904,026,9096, 238, 203, 283
3141 :826,173,203,026,941,015,941
3147 2141,203,026,076,142,008,159
3153 2165,038,133,155,165,939,868
B59 2133,156,198,156,160, 255,121
3165 2177,155,201,946, 240,812,156
SyilgAl :201,933,240,008, 201,063,877
SLT. :240,004,201,031,208,904,8025
3183 2136, 208,235,996,177,155,994
3189 :201,046, 240,026, 201,833,996
395 2240,9022, 201,063, 240,018,139
3281 2201,031,240,914,136,208,191
3267 :235,198,156,165,156, 201,222
3213 2008,176,227,076,169,812,833
3219 :132,167,198,167, 200,248,227
3225 218,177,155, 281,032, 248, 208
3231 :247,136,076,219,811,164,235
3237 2167,8076,115,812,169,009,192
3243 2133,038,169,029,133,039, 200
3249 2976,231,018,160,009,177,963
3259 2838, 201,946, 248,829, 201,178
3261 2033,249,025,201,9063, 248,223
3267 2@21,281,031,248,817, 208,137
3273 2208,235,238,839,165,8639,093
3279 2205,198,826,249,226,144,222
22
Recreations and Applications 1
23
1 Recreations and Applications
3585 2828,096,032,151,9811,032,995
3591 2@15,013,032,168,811,076,958
3597 3@42,013,032,245,012,169,914
3683 2@62,133,012,032,166,009,117
3689 :169,156,160,025,032,886,141
3615 2009,032,228,255, 249,251,922
3621 2072,032,150,089,104,041,189
3627 2191, 201,023, 208,809,032,195
3633 :915,013,032,171,011,976,111
3639 :842,913,201,919, 208,009,835
3645 20@32,015,8913,032,9081,812,246
3651 2876,942,813, 201,016, 288,111
3657 2089,032,015,013,032,825,199
3663 2815,976,942,013,996,056,121
3669 2165,938,237,191,026,133,107
3675 2167,165,039,237,192,026,149
3681 :005,167,248,011,173,191,116
3687 :826,133,938,173,192,026,179
3693 2133,939,996,169,988,133,167
3699 2@38,169,829,133,0939,876,687
3785 :231,9010,160,905,140,985, 240
3711 2928,032,140,014,172,885,886
3717 :028,136,208,244,076,228,929
3723 :011,924,165,638,133, 251,249
3729 :105,981,133,253,165,939,973
3735 2133,252,105,900,133, 254,904
3741 2956,173,197,826,229,253,067
3747 :133,188,173,198,826,229,878
3753 :254,133,181,201,255, 208,121
3759 :986,169,001,133,188, 239,126
3765 2181,932,988,908,169,900,130
3771 2169,032,145,938, 238,197,238
3777 2026,208,003,238,198,026,124
3783 :076,9813,012,173,194,826,181
3789 :073,@14,141,194,026,996, 237
3795 :169,171,168,825,032,986,886
3801 :009,0932,228,255,240,251,288
3807 :201,989,896,169,002,133,145
3813 :912,932,166,909,169,194,943
3819 :169,925,832,886,009,932,067
3825 :211,014,240,903,076,158,167
3831 :889,162,255,154,076,813,148
3837 :998,160,009,177,838,281,869
3843 :031,248,015, 200, 208,247,176
3849 :230,839,165,839,205,198,117
3855 2:026,144,238,076,016,812,015
3861 :200,876,001,012,165,938,801
3867 2133,155,165,839,133,156,0498
3873 2198,156,160,255,177,155,119
24
Recreations and Applications 1
3879 :201,031,248,016,136,192,887
3885 2255,2808,245,198,156,165, 248
3891 2156, 201,029,176,237,976,158
3897 2169,012,056,152,191,155,198
3983 :133,155,169,8890,181,156,899
3989 :133,156,056,165,155,229,195
3915 :838,133,167,165,156,229,195
3921 2039,005,167,288,918,132,138
3927 :167,024,165,155,229,167,226
3933 2133,155,165,156,233,908,167
3939 2133,156,976,043,915,165,175
3945 :155,133,038,165,156,133,117
3951 2839,876,231,818,120,169,244
3957 :127,141,013,228,169,927,846
3963 :141,817,208,169,146,141,177
3969 :820,083,169,815,141,021,242
3975 :963,169,001,141,926,298,171
3981 :141,818,268,988,896,169,993
3987 :@58,164,812, 295,018, 208,044
3993 2208,905,169,901,172,204,144
3999 2826,148,833, 288,141,818, 213
4965 :208,281,801,240,9898,169,224
4911 :@@1,141,9025, 208,076, 188,942
4817 :254,169,981,141,8025, 2088, 207
4923 :076,849,234,173,141,902, 699
4629 :841,081,2808,003,032,245,207
4935 :@12,032,166,889,169, 289,824
4941 :168,025,032,0986,0609,160,161
4647 :908,177,838,9073,128,145,980
4653 2938 ,032,142,988,169,908,081
4959 :177,038,8073,128,145,838,8508
4865 :169,992,133,012,832,228,933
4071 2255,248,251,089,864, 201,227
4077 :987,288,809,032,822,016,999
4983 :032,228,011,8976,937,916,131
4689 :281,883,288,009,032,022,036
4695 :016,932,189,812,976,937,096
4161 :816,291,988,288,989,8032,039
4187 :022,816,032,254,814,8976,169
4113 :037,816,976,158,009,165,214
4119 :938,133,253,141,054,827,157
4125 2165 ,039,133,254,141,055,948
4131 :027,996,056,165,938,133,938
4137 :251,237,054,8027,141,963,046
4143 :028,165,939,133, 252,237,133
4149 :055,027,141,864,828,032,144
4155 2965,013,173,054,827,133,912
4161 :038,173,955,927,133,839,9818
4167 :932,142,0988,876, 296,815,838
4173 :169,938,229,211,141,199,949
25
1 Recreations and Applications
4179 2626,169,900,141,988,928,923
4185 2160,990,169,156,032,219,948
4191 :255,169,918,932,219,255,010
4197 :169,032,9032,210,255,169, 280
4283 2157,032,210,255,148,28998,9077
4269 2026,832,228,255, 240,251,121
4215 2172, 208,026,133,167,169,218
4221 2146,932,210,255,169,932,201
4227 :@32,218,255,169,157,032, 218
4233 2219,255,169,155,032,210,144
4239 2255,165,167, 281,913,240, 160
4245 2846,281,028,208,8015,136,987
4251 2816,004, 200,076,091 ,816,846
4257 :169,157,032,210,255,076,836
4263 :991,016,9041,127, 201,032,163
4269 2144,172,204,199,826, 240,134
4275 :167,165,167,153, 245,926,978
4281 :032,2180,255,169,899,133,216
4287 2212, 2908,876,091,916,932,9050
4293 :218,255,169,008,153,245, 205
4299 :@26,152,696,032,166,989,172
4305 :169,246,168,925,032,086,159
4311 :0@89,032,051,817,176,931,9819
4317 2169,900,133,155,169,929,168
4323 :133,156,174,197,026,172,961
4329 :198,826,169,155,832,216,005
4335 :255,176,910,032,183, 255,126
4341 :041,191,208,003,976,8028,024
4347 2018, 240,039,173,059,9017,8208
4353 :201,9608,144,006,032,174,9054
4359 2823,076,028,617,173,958,118
4365 2917,201,001,240,249,832,241
4371 :166,009,169,252,160,825,9632
4377 2632,886,009,932,115,915,858
4383 2169,001,141,193,926,996,145
4389 2932,166,909,169,007,168,868
4395 2826,032,8086,089,076,928,044
4491 2817,008,032,9077,8016,248,183
4497 2024,169,038,160,026,032,248
4413 2986 ,999,032,228,255,249,143
4419 2251,162,008, 201,968,248, 229
4425 2012,162,001,201,084,248,005
4431 2986,032,158,009,184,184,228
4437 :996,142,058,917,169,901,948
4443 :169,000,032,186,255,168,116
4449 2980 ,224,001,240,042,185,9021
4455 :245,026, 201,064, 208,007,886
4461 2185,246,026,201,058, 248,841
4467 :028,169,048,141,029,927,045
4473 :169,958,141,030,8027,185,219
26
Recreations and Applications 1
2245,026,153,9031,027, 200,041
2204,200,026,144,244, 249,167
2242, 200,876,156,917,185,247
2245 ,026,153,029,8027, 200,957
2284,200,026, 208, 244,149,149
2953,027,032,166,969,169,181
:245,1608,8926,832,886,8989, 209
:173,053,827,162,829,160,065
2027,8032,189,255,169,813,992
:032,218,255,076,886,618, 090
:@32,166,089,169, 241,160,196
2825,032,8986,069,032,228,093
2255,248, 251,032,181,0809,143
:909,128,8972,173,194,026,039
2240 ,6063,032,140,014,932,1608
2158,009,1894,076,9841,8010,095
256,165,838, 233,008,133,889
2167,165,939,233,8029,005,899
:167,240,084,169,005,133,185
2012,032,166,009,169,058,175
:160,026,032,886,009,032,8808
2951,017,165,912,281,005,192
248,003 ,8932,036,009,169,236
:090,166,838,164,039,8032,192
:213,255,144,003,076, 252,190
:916,142,197,826,149,198,228
2@26,032,231,255,8032,166,981
:009,169,928,160,826,832,281
:886,809,8976,928,8017,832,831
:166,8909,169,964,169,026,127
:832,086,089,8032,051,817,022
:169,001,162,000,168,829,066
2832, 213, 255,032,183, 255,999
:941,191,240,211,032,166,182
2909,169,015,160,826,032, 230
7986 ,089,0976,928,817,128,161
:169,900,141,826, 208,141,904
2033, 208,169,849,141,928, 201
:@03,169,234,141,021,993,158
:169,255,141,013,220,888,223
:996,169,147,832,218, 255,252
:169,8913,032,218,255,932,860
:886,018,032,162,918,169,996
2013,032,210,255,169,972,112
2160 ,8926,032,886,009,032,224
3228,255, 201,013,208, 249,015
2@32,115,815,8976,158,089,032
2032,204,255,169,961,032,078
2195,255,896,032, 231,255,199
:169,001,162,908,168,0900,153
27
1 Recreations and Applications
59879 :@88,808,824,173,961,828,677
5885 :133,188,199,197,026,141,239
5691 :197,826,173,962,028,133,978
5897 :181,189,198,026,141,198,962
5193 2026, 165,838,133, 253,165,251
5169 :839,133,254,169,008,133,205
5 E15 3251,169, 208,133, 252,169,153
5121 :8@00,141,026,208,169,932,665
5127 3133,901,032,019,0908,169,113
5133 2038,133,0801,169,001,141, 240
5139 2826, 208,976,231,019,1608,218
5145 2:900,177,838,178,200,177,819
5151 :038,136,145,038, 200,138,214
5USa 2145,038,996,160,009,177,141
5163 :038,041,063,240,0190,201,124
5169 :027,176,906,177,8038,073,934
DE75 :@64,145,038,976,151,9011,928
5181 2133,167,041,964-919,005,225
5187 :167,841,191,133,167,841,9839
5193 2032,073,032,018,995,167,136
D199 2896,885,875,866,885,858,128
5205 2002 ,001,027,255,6015,918,147
5211 2000 ,900,000,000,000,832,123
52 :166,999,169,141,160,926, 980
5223 2876,086,8009,976,129,021,244
5229 :169,0984,141,989,928,168,188
5235 :@87,173,141,002,041,001,224
5241 2246 ,054,032,166,099,169,023
5247 :116,168,926,032,886,009,8044
D203 2032,228,255,249,251,056,171
5259 :233,048,201,003,144,217,217
5265 2201 ,088,176,213,141,089,285
5271 2828,932,166,009,169,125,168
5277 :160,026,032,086,989,032,246
5283 2228,255, 248,251,056, 233,146
5289 2048 ,948,198,201,810,176,974
5295 :186,168,169,001,174,889,194
5361 2028,032,186,255,169,900,9883
5307 :@32,189,255,632,996,8920,843
5313 2032,192,255,162,901,032,9899
5319 :201,255,144,083,076,129,239
5325 :@21,169,900,133,155,169,984
5331 :829,133,156,162,000,142,965
5337 :070,028,142,069,028,142,184
5343 2998 ,8928,142,891,028,142, 232
5349 2983 ,028,189,980,020,157,818
5355 075,928, 232,224,087, 208,241
5361 2245,169,255,141,984,028,139
5367 :160,908,177,155,816,8983,246
5373 2876 ,068,022,201,831,248,123
29
1 Recreations and Applications
30
Recreations and Applications 1
5679 :896,172,080,028,024,152,887
5685 2199,084,028,141,984,928,015
5691 2169,013,932,219, 255,136,196
5697 :208,250,096,141,087,028,107
5763 2@41,127,8032,061,920,201,041
5769 2:849,144,007,201,958,176, 208
57E5 2@03,076,089,023,174,158,985
Son: 2022,221,158,822, 240,012,252
52 2202, 208,248, 206,082,8028,945
5733 :173,987,028,076,900,021,230
i: :2802,138,910,170,140,985,884
5745 :6@28,169,6022,072,169,128,189
Siow: 2072,189,170,922,072,189,965
af SS4/ :169,022,072,096,956,173,281
5763 :@85,028,101,155,133,155,02¢
5769 :165,156,105,099,133,156,984
Sia :076,247,820, 200,177,155,250
5ISE 2201 ,031,249,001,136,149,130
5787 2085,828,096,010,087,965,014
57.93 2076,882,084,066,983,9078,118
SUES) 20@72,078,188,9022,197,9022,226
5885 2205 ,022,215,022,225,022,116
5811 2235,022,245,922, 255,022,212
5817 2014,023,051,023,169,080, 289
5823 :141,9081,028,200,076,146,995
5829 2022,169,001,141,090,028,136
5835 :076,146,822,200,032,022,189
5841 :019,141,075,028,076,146,182
5847 2822, 200,032,022,819,141,139
5853 :976,928,076,146,8022,200,001
5859 :032,022,019,141,8978,928,935
5865 2976,146,022,200,6032,922,219
5871 :819,141,979,028,076,146,216
ei) 7/ 2022,200,932,022,019,141,169
5883 2:989,028,076,146,922,149,231
5889 :986,928,032,148,021,172,232
5895 :886,828,140,885,828,976,194
5981 :146,022,056,152,181,155,133
5987 :141,971,8028,165,156,1985,173
5913 :0@00,141,072,028,032,843,985
5919 :823,056,152,237,985,028,190
5925 :141,969,928,8976,146,922; 907
5931 : 208,177,155, 201,831,288, 247
5937, :249,136,996,956,152,191,871
5943 2155,141,073,8028,165,156,80085
5949 2105,000,141,074,028,032,185
5955 2943,023,056,152,237,085,151
5961 :028,141,0708,028,976,146,950
5967 2922, 200,177,155, 201,961,127
5973 2249 ,004,136,076,191,922,152
31
1 Recreations and Applications
32
Recreations and Applications 1
33
1 Recreations and Applications
6543 :8@00,194,085,876,970,969,119
6549 :082,032,198,085,976,876,186
6555 :@00,196,869,876,069,984,137
6561 2869,032,040,211,0944,215,904
6567 2844, 208,041,900 ,958,932,838
6573 :193,982,969,032,089,879,205
6579 2985,032,083,985,982,969,183
6585 2963 ,032,940,217,847,206,822
6591 2@41,958,008,197, 219,193,122
6597 :211,197,932,193,204,204,214
6693 :@32,212,197,216, 212,888,848
6689 2197,082,065,983,869,032,225
6615 2@40,211,044,215,944, 288, 209
6621 2041 ,958,032,018,219,197,889
6627 :212,213,218,206,146,032,222
6633 2984 ,9079,032,069,988,973,146
6639 2084,000, 203 ,969,089,058, 236
6645 :@09,211,065,8986,969,958,222
6651 2800, 212,8065,988,869,032,197
6657 2197,219,210,207,210,000,811
6663 :211,984,979,088,080,069,9898
6669 2868 ,000,214,969,082,073,907
6675 2070 ,089,032,197,082,982,959
6681 2079,982,900,286,879,032,247
6687 :869,882,082,079,082,983,252
6693 :000,147,032,018,212,146,989
6699 :965,988,869,032,8079,082,194
6785 2932,018,196,146,973,083,985
6711 :875,863,008,204,079,8965,029
6717 :068,058,000,214,969,082,8408
6723 :873,9708,089,058,8088, 208,853
6729 2982,069,083,083,832,018,184
6735 2210,197, 212,213,219, 206,947
6741 2146 ,900,036,848, 206,079,988
6747 2832,218,979,079,877,000,856
6753 :206,079,032,084,069,088,143
6759 :084,8032,073,078,032,8966,212
6765 :885,078,070,069,982,046,819
6771 :800,196,869,986,073,067,894
6777 2969,032,8035,900,211,8069,8625
6783 :867,079,878,068,846,932,241
6789 2193,868,968,082,046,032,119
6795 :035,0080,208,082,073,978,193
6891 2084,073,078,071,000,206,145
6887 2969 ,988,984,032,083,072,967
34
Recreations and Applications 1
6813 :069,869,084,944,032,018,217
6819 2210, 197), 212, 2137, 210, 206,131
6825 :146,000,200,085,978,084,250
6831 :032,970,079,8082,058,800,240
6837 :206,8079,084,032,198,079,091
6843 :085,078,0968,0900,0990,9029,191
6849 7900 ,000,0904,194,005,6029,879
6855 :@36,013,192,032,011,012,239
35
a8we
»
*
Table 1. Clip-Out Quick Reference Card—Editing
Commands
37
cd saterieth
pot‘aot
nts
¥SAGA.
ea
‘.
a
s
2.)
OP
t
J
4*
.
+
i
‘
";
-,
H
2
a 5
ay
:
+f
,
*
*
‘
:%
:
3
;:
oe
ae
A
Be
eA
Oe
1
1
1
'
‘
‘
1
'
'
1
‘
'
i
‘
1
1
J
'
'
i
1
i
1
1
1
‘
1
1
‘
1
'
'
'
J
a
'
'
i}
i}
iy
Le
sans]
°*7 NCE-dyD UOWIUNY
Avy AejiaaC ‘ s
t ste tsven
ta Qiu ne Ola
: eee
oe pee
an aeydan aictodns leaeinewca
at coadna |
t 1 H tha)
' i] '
‘ ry r
| | LaIHS
H PON i a5! stax jAHPLovvsb
A
| SPE EPL eRe |EPSsTS
iS
Commands
: pi0mM H STSy"ogv! FeGsea.
1S
eae a ey! reas yvSQa ey Bish
| snotaaig
WN ' ES: PSSSR
KU gmh2s
Z|
| PIOM sg} soe yen esse iS|Sbas
:
wees!8 Base
lig t . a
ON H a 6D om
;
' 30
Ppa nee 4 2 o.
ap 7)
3
| snolAalg t =e :
! aouajuag : 2} i
: H ' H
yeN { Ss!
: ydeiseieg
i os! N 292
:
inline
[77.
‘
| snotAalg 1 vues is
|
: ydesereg HH % 1
‘ :
1t U 1
rT
LCCC
TTrrrrrrrrereetete
eCLLLCLL
LLL
LLL!
'Ct
6 T Pp '
; *
H i
‘ dArsg H
' ‘
= °
Table 2. Clip-Out Quick Reference Card—Format
39
aig secirnne res na Rea
' ae ‘aut *
nearneoe tigi ~ ‘
mises WE res
ae
3 $
vi =
4 *.
-=
-_ -3
6 “63 ;
Pea CASK USE
*
eA, set |
ee ‘eiaoet extivetms i
pas fhe)
‘ 7
ie id Ll
? :
$
teinsr oat
a +S my i
gray oe send z 4
~
a
piewieansmnatedn
¥ wamitinn wuininninwenomanale ere<< mn latin wien a — rs
* ‘
4
ote nye
Faye oe . ~4
as _
+E
oe
Seuss
somes
an
eee
aioe
Recreations and Applications 1
SPIKE
Eric Brandon
Playing Spike
The recommended way to travel on the Power Grid is with a
joystick in port two. The joystick may seem a bit awkward at
first: Since the Grid is tilted 45 degrees, the four cardinal
directions (up, down, left, right) are likewise tilted. To better
orient yourself, it may help to turn the joystick base to the
same angle.
When “Spike” first starts, you will have to make some
decisions. You must decide the speed of the game and
whether you want the Easy or Hard option. Pressing the RE-
TURN key or the joystick button automatically chooses the
Hard option and a speed of 5. If you want some other option,
press the number of the speed you want (1 to 9) and the E key
for an Easy game.
Another handy feature of Spike is the pause option.
Pressing a SHIFT key pauses the action. Pressing SHIFT/
LOCK freezes the game until SHIFT/LOCK is released.
You start each game with five lives. An indicator at the
top of the screen, labeled STAMINA, keeps track of your
remaining lives, not counting the one currently in play.
Another indicator, SONAR, shows your proximity to your
invisible goal, the hidden Commodore 64 computer. The
shorter the line, the closer you are to the 64.
The LEVEL indicator displays flags to show how many
times you've found the 64 and advanced to a more difficult
power grid.
When you start a new game, the Grid is patrolled by two
power spikes. Another spike joins them on each succeeding
level, up to a maxmium of seven spikes.
To develop a winning strategy, it’s vital to understand
how the scoring works. The screen is divided into 112 grid
nodes (diamond-shaped blocks). Your goal, the Commodore
64, is hidden in one of them, leaving 111 empty nodes. You
gain survival points for traversing the Grid—ten points for
each new side of a node you cross. If you box in a node by
leaving your trail along all four of its sides, the node is colored
blue. You'll want to box in as few nodes as possible, because
it costs you bonus points later.
When you find the Commodore 64 by locating it with
your sonar and encircling its node, you win bonus points and
advance to the next level. The bonus is figured by multiplying
the number of unboxed nodes times the bonus value for the
42
Recreations and Applications 1
current level. The bonus value starts at 40 for level one and
increases by five for each additional level. For instance, if you
find the 64 on level three after boxing in 11 nodes, you would
win 5000 bonus points (100 unboxed nodes x bonus value of
50 = 5000). This would be added to the survival points you
gained while searching the Grid.
A HIGH SCORE indicator keeps track of the best game
played during the current sitting.
Typing Spike
Unavoidably, Spike is a long program—more than 4K of pure
machine language. Normally, it is very difficult to type in such
a program without making a mistake. Also, in the past, a ma-
chine language monitor was necessary to enter such a program
from a published listing in a book or magazine.
However, to make the typing as easy and as foolproof as
possible, ‘“MLX,” a machine language entry program, was
written by Program Editor Charles Brannon to greatly simplify
the task of typing ML programs from listings. It includes an
instant checksum feature which does not let you continue un-
til you’ve typed a line correctly. It also automatically types
commas and lets you break up the job into several sittings.
Please read the directions in Appendix I for using MLX.
And be sure to save MLX, because it will be needed for other
machine language programs in this book.
You'll need to type in a POKE statement in direct mode
(without a line number) before you begin entering Spike. This
line will move down the top of memory to below the Spike
program so that BASIC will not write over Spike as you type
it in.
POKE 52,128:POKE 56,128:CLR
You'll use this statement only while you enter Spike using
MLX. You don’t need it when you enter other machine lan-
guage programs.
This line must be entered before you load and run MLX.
Then you can begin typing in the Spike program. If you enter
Spike in several sessions, turning the computer off in between,
you must type in the above POKE statement each time you
begin entering Spike’s data.
Here is the information you'll need to enter Spike with
MLx:
43
1 Recreations and Applications
Starting address—32768
Ending address—37295
Once Spike is saved on disk or tape, a special procedure
is required to load the program.
For disk, enter:
LOAD”’SPIKE’’,8,1
For tape, enter:
LOADGI5U1
When the program is loaded, run it by entering SYS
32768.
Spike
32768 :169,065,141,198, 207,169,113
32774 :972,141,189,207,9632,919,145
32780 :144,169,907,141,201, 207,113
32786 :169,949,141,200, 207,169,176
32792 :912,141,199,207,169,998, 240
32798 :141,039,208,162,924,157,249
32804 :900,212,202,224,255, 208,113
32819 :248,169,979,141, 254,207,197
32816 :169,120,141, 253, 207,169,983
32822 :255,141,915,212,141,182,232
32828 :207,169,128,141,918, 212,167
32834 :169,964,141,136,902,169,235
32848 :001,141,246, 207,169,919, 987
32846 :932,219,255,169,900,141,117
32852 :932,208,173,014,220,941,984
32858 :254,141,9014,229,165,981,117
32864 :941,251,133,901,160,999,178
32878 :185,889,208,153,900,980, 216
32876 :185,999,2809,153,9089,981,224
32882 :185,900,219,153,9899,982,232
32888 :185,909,211,153,909,983,240
32894 :185,900, 212,153,909, 984,248
32988 :185,900,213,153,9008,985,900
32986 :185,889,214,153,909,086,988
32912 :185,009,215,153,000,987,916
32918 :200,208,205,165,001,909,170
32924 :904,133,961,173,814,220,189
32938 :899,901,141,014, 220,169, 294
32936 :198,141,000,221,169,998,137
32942 :141,924,208,032,183,128,122
32948 :876,219,128,120,169,127,251
32954 :141,913,229,169,001,141,1983
32968 :926,208,169,900,141,018,242
44
Recreations and Applications 1
45
1 Recreations and Applications
33260 2169,007,141,621,288,173,187
33266 2930,208,976,212,149,173,857
33272 2900, 220,141,252, 267,041,885
33278 2981, 208,843,032,038,139,195
33284 :240,0903,932,186,138,173,988
33299 2253,2807,201,8030, 208,903,144
33296 :076,173,138,173,254, 207,985
33382 :201,158,298,8003,076,173,965
33368 2130, 238,254, 2807, 206, 253,936
33314 :207,173,252, 207,141, 249, 239
33326 :207,976,173,130,173,252,927
33326 :207,041,9062, 208,937,932,961
33332 2930,139,249,903,832,186,170
33338 3138,173,253,207, 201,209, 286
33344 2240,107,173,254, 207,201,222
33350 2000, 249,109, 238, 253,207,084
33356 2206, 254, 207,173,252, 207,095
33362 2141, 249,287,976,173,130,934
33368 2173,252,207,041,904, 298, 285
33374 3:937,032,950,139, 249,083,983
33389 :932,186,138,173,253,207,965
33386 : 201,030, 249,963,173, 254,943
333.92 :207,201,090,248,956, 206,254
33398 :254,207, 206, 253, 207,173,138
33464 3252,207,141,249, 207,976, 232
33416 :173,130,173,252,207,041,9082
33416 2008, 208,934,932,958,139,095
33422 3249,003,032,186,138,173,146
33428 2253,207,201,208, 249,019,244
33434 2173,254, 207,201,158, 249,999
33449 :912,238, 254, 207, 238, 253,882
33446 2207,173,252, 207,141, 249,115
33452 2207,032,155,139,162, 255,998
33458 :169,008, 200, 208, 253,232, 207
33464 2208, 258,932,8024,136,832,H98
33476 2144,136,032,036,137,932,195
33476 :829,135,832,030,139,208,001
33482 ?908,032,058,139, 208,903,130
33488 2032,181,133,932, 217,130,165
33494 2:076,247,129,173,038, 208,953
33566 :041,001,208,901,096, 206,985
33506 :199,207,194,184,932, 200,948
33512 2143,174,199, 207, 232,169,976
33518 3032,157,849,964,876,212,051
33524 :148,173,241,207,0190,141,132
33530 :287,207,176,988,169,988, 249
33536 2141, 296, 207,976,011,131,904
33542 :169,001,141,206,297,173,135
33548 :207,207,824,105,913,141,197
46
Recreations and Applications 1
47
1 Recreations and Applications
33848 3207,248,929,144,818,162,9879
33854 2253,168, 808, 209, 208, 253,112
33869 2232, 208, 250,162,911,032,195
33866 2935,134,8976,934,132, 234,287
33872 2169,988,141,021, 208,169,928
33878 :996,133,252,169,932,133,133
33884 2254,160,000,133, 251,133,255
33899 2253,177,253,145,251, 299,997
33896 $208, 249,238, 252,230,254, 247
33982 2166, 252,224,127, 208,239,046
33988 3177,253,145, 251, 200,192,854
33914 2964, 208, 247,169,997,141,199
33928 2046, 208,173,254,867,141, 249
33926 2255,967,162,039,169,032,990
33932 2157,120,964, 262, 224,907,146
33938 2208, 248,168,906,185, 216,145
33944 2132,153,955,138,185, 223,814
33958 2132,153,962,138,136,192, 293
33956 2255, 208, 239,032,145,143,162
33962 2173,205,207,956,042,141, 226
33968 3921, 208,032,166,135,169,139
33974 :@00,174, 201, 2867,157,988, 233
33986 2964, 238,201, 207,8076, 212,162
33986 2146,159,019, 917,9017,017,651
33992 229,929,929 ,929,929,829,118
33998 :829,8029,829,918,866,979, 280
34994 :978,985,983,932,019,838,918
34819 2849, 968, 888,119,138,040,166
34616 :880,178,950,890,148,160,146
34822 :142,217,207,1498, 216,287,879
34828 :206,032,055,134, 201,983,993
34934 2 249,093, 232,032,955,134,884
34949 :201,9062, 208,085,202, 202,124
34846 2932,955,134, 201,0082,2908,118
349852 :976,173,216, 207,824,105,937
34858 :@19,168,932,955,134, 281,197
34964 2962, 208,962, 232,232,932,816
34978 :955,134, 201,982, 208,953,163
34876 2173, 217, 207,824,195,969, 251
34682 2178,173,216,207,024,105,161
34988 :909,168,032,055,134, 201,127
34994 £062, 208,032, 200,290,832, 208
34196 :955,134, 291,002, 208,823,163
34196 2173,217,287,8656, 233,969,185
34112 2178,032,055,134, 201,902,146
34118 :208,009,136,136,832,955,134
34124 3134,201,002, 240,001,096, 238
34136 3174, 217, 207,172,216, 2807, 251
34136 2236, 241,207, 208,012,152,128
48
Recreations and Applications 1
49
1 Recreations and Applications
34436 3252,8976,122,134,104,941,993
34442 :9@03,178,169,192,141, 247,836
34448 :207,202,224,255, 240,989,901
34454 3@78,247,287,8078, 247,207,198
34460 :976,145,134, 200,173, 247,197
34466 :207,049,251,141,221, 207,214
34472 2173, 247, 207,041,001, 208,021
34478 $915,978, 247,207,978, 247,022
34484 :207,978,221,2807,878, 221,168
3449 :207,076,168,134,194,179,921
34496 :104,168,173,221,207,996,137
345982 :169,000,141, 220, 207,169,088
34568 2255,141, 219,207,174, 220,148
34514 2207, 232,236,219, 207,249,815
34526 261,173,220, 207,924,199, 242
34526 3219, 207,196,141, 218, 297,840
34532 2141, 245,207,141, 244, 207,133
34538 2@32,252,135,173, 242,287,251
34544 2956,237,222,2807,141,221,944
34556 2207,173,243, 207,237, 223,980
34556 :207,013,221,287,249,826,142
34562 :144,909,173,218, 207,141,126
34568 :219,207,976,208,134,173,001
34574 3218, 207,141,229, 207,076,859
34580 :208,134,173,228, 207,141,979
34586 3218,207,096,173,241,207,144
34592 :9@56,237,254, 207,144,903,165
34598 :876,048,135,173, 254, 287,163
34694 2956,237, 241,207,141, 245,147
34619 :207,141,244,287,032,252,1989
34616 2135,173, 242,207,141, 236,166
34622 :207,173,243,207,141,237,246
34628 :207,173,248,207,056, 237,164
34634 2253,207,144,993,976,988,077
34648 2135,173,253,287,956, 237,117
34646 2249,207,141,245, 207,141,243
34652 2244,207,032,252,135,173,111
34658 2242,207,024,189, 236,287,899
34664 2141, 222,207,173, 243,207,917
34670 2189, 237,207,141, 223,207,219
34676 :932,198,134,173, 218,207,954
34682 2974,074,974,170,168,169,983
34688 :160,157,127,964, 202,224,838
34694 2255,208, 248,173,218, 207,163
34780 :841,007,178,189,158,135,972
34766 2153,128,964,169,032,153,877
34712 2129,964,153,130,864,996,8020
34718 2101,116,117,997, 246,234,945
34724 2231,160,173,827, 212,041,240
50
Recreations and Applications 1
51
1 Recreations and Applications
52
Recreations and Applications 1
53
1 Recreations and Applications
54
Recreations and Applications 1
35986 :041,003,170,169,863,141,141
35912 2247,207,165,982,010,918, 281
35918 2910,918,9180,619, 202, 224,832
35924 2255,248,912,074,074,056,627
35938 2118,247,287,118, 247,207,194
35936 2976,082,148,298,8972,173,971
35942 3247,207,849,251,145,251,228
35948 :164,017,251,145,251,194, 212
35954 :170,104,168,194,996,173,161
35968 2@25,208,141,925, 208,941, 808
35966 :881,249,8977,169,9012,168,917
3507 2 2959,162,024,142,022, 268, 237
35978 2141,033,2808,149,917, 208,117
35984 2141,024, 208,173,918, 298,148
35998 :201,081,144,916,169,00%, 249
35996 2141,918,208,173,017,208,153
36882 :@41,127,141,917, 288,076,994
36988 :206,149,169,900,141,933,989
36814 : 208,169, 200,141,922, 208,998
36920 :169,027,141,817, 208,169,143
36826 :004,141,024,268,169,081,845
368632 2141,918,298,173,817,298,189
36838 :@41,127,141,917, 288,076,840
36844 2949, 234,104,168,104,178,989
36850 :184,964,169,970,141, 254,244
36856 :207,169,129,141,253, 287,933
36862 :162,039,169,032,157,129,133
36968 2964, 202,224,007, 208,248,157
36874 :@32,155,139,032,929,135,244
36880 :173,199,207, 261,807,248, 243
36886 :957,032,248,141,932,024,9812
36692 :136,032,144,136,032,936, 900
36998 3137,162,255,168,900, 200,148
36164 2208, 253,232,208, 250,162,841
36116 2249,169,098, 2600, 208, 253,860
36116 2232,208, 250,173,980, 228,879
36122 :@41,916, 208, 229,162,013,174
36128 :169,932,157,948,964, 232,214
36134 :224,039, 208, 248,173,038,192
36146 :288,976,247,129,162,939,137
36146 :169,913,157,848, 216, 202,879
36152 2224,255, 208, 248,160,908,127
36158 :162,900,189,941,964,157,163
36164 2940, 964, 232,224,837, 208,1085
36179 2245,185,937,142,141,977,133
36176 2:964,152,80972,169,09009,162,178
36182 2908, 209, 208, 253, 232, 208,163
36188 :250,194,168,173,908, 2208, 239
36194 :841,816, 249,819, 200,192,929
55
1 Recreations and Applications
56
Recreations and Applications 1
57
1 Recreations and Applications
58
Recreations and Applications 1
37882 2829,0932,0932,032,032,932,151
37988 2932,032,8017,157,157,157,988
37894 :157,157,157,157,632,211,9877
37189 :208, 201, 203,197,932,146,199
37186 :832,045,8032,995,032,194,978
37112 2889, 032,197,982,973,967,8208
37118 3832,194,982,965,878,968, 995
37124 :8979,878,013,929,8929,929,905
37138 :829,829,829,8029,159,918, 847
37136 :932,032,932,932,932,032,288
37142 :032,813,013,8013,913,813,119
37148 :829,929,629,9829,029,929, 282
37154 2158,211,988,969,969,968,177
37166 :832,948,849,845,957,941,948
37166 :863,032,159,008,813,013,979
eli? :8913,029,9629,829,829,029,2198
37178 :929,158,197,865,983,989,167
37184 2047 ,209,965,982,968, 963,977
37196 :032,159,990,126,173,013,055
37196 2226,009,129,141,813, 220,949
37262 :169,000,141,026, 288,169,627
37268 :234,141,021,993,169,949,193
37214 :141,029,0083,988,169,921,924
37228 :141,924,288,169,927,141,942
37226 2817, 208,169,199,141,909,8072
37232 2221,169,004,141,136,982,9817
37238 :169,088,141,621, 208,032,177
37244 2019,144,169,964,141,136,929
37258 :862,169,198,141,899, 221,893
37256 2169,998,141,924, 208,169,987
37262 :216,133,252,169,999,132,011
37268 :251,169,006,145, 251, 208,146
37274 :208,251,238, 252,166, 252, 233
37289 2224,220, 298, 243,932,183, 246
37286 :128,169,255,141,182,207,224
37292 2996,000,255,913,813,813,958
59
1 Recreations and Applications
Martian Prisoner
Alan Poole
60
Recreations and Applications 1
61
1 Recreations and Applications
Martian Prisoner
For mistake-proof program entry, be sure to use “Automatic Proofreader,” Appendix J.
62
Recreations and Applications 1
63
1 Recreations and Applications
64
Recreations and Applications 1
6096 DATAN,E,S,W,GO,GET,
DRO, INV, REA, OPE, WEA, EAT, KI
L,HIT z:rem 217
6619 DATAGD,9,9,9,6,9,3,9,2,4,9,09,9,9,9,3,9,9,9,2,7
,9,2,9,6,8,6,9,9,9,9,7 srem 193
6626 DATAFORCE FIELD, FOR, 1,GUARDS,GUA,6,SIGN,SIG,4
,GEIGER COUNTER, COU,5,UNIFORM s:rem 13
6930 DATA UNI,5, PLANT, PLA,8,LOCKED DOOR,DOO, 2,MAGN
ETIC KEY,KEY, 3 srem 151
65
1 Recreations and Applications
64 Mailing List
Joseph J. Shaughnessy
66
Recreations and Applications 1
67
1 Recreations and Applications
68
Recreations and Applications 1
64 Mailing List
For mistake-proof program entry, be sure to use “Automatic Proofreader,” Appendix J.
160 C=53280:REM 64 MAILING LIST PROGRAM-—DISK VERSI
ON srem 1190
118 POKEC, 5: POKEC+1,5:READRS,
R: FORI=1TOR: READOS (I)
:NEXT:DATA"64{2 SPACES}MAILING{2 SPACES}LIST
srem 222
129 DATA8, "NAME(LAST NAME FIRST)", "STREET ADDRESS"
PiCGETY. OSTATE 7 he CODE. :rem 9
130 DATA"HOME PHONE NO.", "COMPANY NAME", "WORK PHON
ENO. srem @
149 PRINT" {CLR} {BLK}{9 RIGHT} KAJ **¥**RRRKKKKKKKKKE
**RSJ"sPRINT"{9 SPACES}B "RS" -" ~srem 144
PRINT"{9 RIGHT } £29 HHKKKKKREKKEKEKEREKEE XS
150
srem 244
69
1 Recreations and Applications
70
Recreations and Applications 1
71
1 Recreations and Applications
64 Spreadsheet
Michael Tinglof
72
Recreations and Applications 1
73
1 Recreations and Applications
74
Recreations and Applications 1
7 NAME C2=YIELD,5
8 NAME C3=NET,6
9 NAME C4=EARN,6
76
Recreations and Applications 1
Reference Guide
The following is a list of the instructions and a brief descrip-
tion for each.
Change Value. Allows you to change the value of any
element of the screen. Uses the standard row/column designa-
tion to indicate the desired element.
Redraw Screen. Clears the screen and recalculates every
value based on the DEFINE statements.
Save Worksheet. Saves the worksheet, including all en-
tered data and the instructions set in program mode.
Load Worksheet. Loads a worksheet saved by the above
command.
Exit. Exits the program to BASIC.
Program Mode. Enters the program mode for which the
following commands are used:
e Insert—inserts a line(s) into the instruction list starting
at the line you select.
e List—lists a specified part of the program. Accepts a
line number, clears the screen, and lists from the given line to
the given line plus 20.
e Change—accepts a line number and allows you to
reenter that program line.
WL
1 Recreations and Applications
64 Spreadsheet
For mistake-proof program entry, be sure to use “Automatic Proofreader,” Appendix J.
1@ REM COMMODRE 64 SPREADSHEET srem 61
29 REM srem 79
38 DIMPC%(118),PC$(118),WK(28,9),RN$(28),CNS$(9),CW
(9),CP(9) srem 43
48 X=6:SL=0:LL=0:L=0 :CC=0:CR=0 srem 14
45 R$(1)="DEFINE":RS$(2)="NAME":R$(3)="END":PC$(1)=
3 srem 219
58 S$="{39 SPACES}" zrem 93
78
Recreations and Applications 1
79
1 Recreations and Applications
80
Recreations and Applications 1
81
1 Recreations and Applications
82
Recreations and Applications 1
83
‘eg eepeer te Va
Sein we
2
Kid Stuff—
|
Seibre-taleyet-l merheslec
Kid Stuff—Educational Games 2
Educational
Games:
A Kid’s View
87
2 Kid Stuff—Educational Games
88
Kid Stuff—Educational Games 2
200, and so on. Only very, very smart people should play on
level 100.
Ways to Change BLAM!
You can raise the possible skill levels by changing the 100’s in
lines 5 and 6. You can vary the number of stories in the build-
ing by changing the 70 in line 131 to the number of stories
you want multiplied by ten, plus ten. For example, to make a
four-story building, change the 70 to 50.
Blam!
For mistake-proof program entry, be sure to use “Automatic Proofreader,” Appendix J.
38 POKED,4:POKEC,
65 srem 129
49 JS=PEEK(56329) :JS=15-(JSAND15):JS=JS+1:REM READ
JOYSTK srem 173
41 KD=C:ONJSGOTO51,42,43,51,44,45,46,51,47,48,49
srem 87
42 POKEKD, 32:C=C-—4@:D=D-49:GOTO51:REM NORTH:rem 85
43 POKEKD, 32:C=C+4@:D=D+48:GOTO51:REM SOUTH:srem 98
44 POKEKD, 32:C=C-1:D=D-1:GOTO51:REM WEST :rem 169
45 POKEKD, 32:C=C—-41 :D=D—41:GOTO51:REM NW :rem 116
46 POKEKD, 32:C=C+39 :D=D+39:GOTO51:REM SW :rem 132
47 POKEKD, 32:C=C+1:D=D+1:GOTO51:REM EAST :s:rem 146
48 POKEKD, 32:C=C-39:D=D-39:GOTO51:REM NE :rem 115
49 POKEKD, 32:C=C+41:D=D+41:GOTO51:REM SE :rem 1983
5@ POKEKD, 32:C=C-49:D=D-49:REM NORTH srem 123
51 DV=DV+1 : IFDV=19THENPOKEW+4,
129: POKEW+4, 128:DV=0
srem 55
52 IFPEEK(C)=68THENC=C-16@:D=D-169 srem 211
53 IF C<1964 THEN C=C+4@:D=D+4¢d srem 89
54 IFPEEK(C)=66THEN9 srem 194
55 TS=RIGHTS(TIS,3):PRINT"{HOME}{15 RIGHT}";TS;"
{18 RIGHT}"-;I srem 219
56 IFTS>"500"THEN20@ srem 74
68 GOTO38 srem 19
88 POKEC, 67:FORT=199TOILSTEP—2:
POKEW+1,T: POKEW+4,12
9:POKED, 2 srem 179
81 POKED,5:NEXTT:FORTT=1T0O50:NEXTTT
: PRINT" { HOME }
{RVS}{2 RIGHT}CORRECT{OFF} BLAM! {RVS} NO.=";I-J
:NN=NN+1 srem 213
82 POKEW+4,128:IFNN=3THEN209 srem 172
83 FORT=1T04909:NEXTT:
PRINT" {HOME}{31 SPACES}"
srem 102
84 M=M+1:IFM=HTHEN11@4 srem 251
85 FORN=1919T02915: POKEN, 32:NEXTN:GOTO37 srem 1
119 PRINT"{CLR}{DOWN}{14 RIGHT}GOOD WORK! !":M=0
srem 63
119 ER=28 srem 217
120 FORU=8TO3 : POKEW+1, ER*U: POKEW, 49: POKEW+4,17:FOR
T=1TO19000:NEXT:NEXT srem 181
130 POKEW+4, 16:H=H+19 srem 159
131 IFH=79THEN600 s:rem 213
132 PRINT"{6 DOWN}{3 RIGHT}YOU GOT ALL THE BOMBS O
UT OF THAT" srem 246
133 PRINT"STORY, BUT THE TERRORISTS PUT EVEN MORE"
srem 124
135 PRINT"IN THE NEXT.":PRINT"{4 DOWN}{13 RIGHT}SE
E YA AGAIN!" srem 15
139 ER=28 srem 219
148 FORU=0TO3: POKEW+1, ER*U: POKEW, 49: POKEW+4,17:FOR
T=1TO1990:NEXT:NEXT srem 183
145 POKEW+4,16 s:rem 18
90
Kid Stuff—Educational Games 2
91
2 Kid Stuff—Educational Games
Wordspell
Richard Herrmann
92
Kid Stuff—Educational Games 2
@ PRINT" {CLR}":PRINTCHRS
(14) : POKE53289,7:POKE53281
1:GOSUB61 srem 282
2d PRINT" {CLR} {BLK}{4 DOWN}{3 RIGHT}{3 SPACES}CREA
TE NEW LIST":INPUT"{2 DOWN}{4 RIGHT}{2 SPACES}(
Y OR N)";RS: IFRS="Y"THEN5G srem 1983
IFRS <>"N"THEN21 srem 7
DIMAS(19),WS(19) zrem 194
FORP=@TO19:READAS(P) :NEXT srem 237
FORP=6TO19 srem 25
PRINT" {CLR}" srem 205
PRINT"{9 DOWN}" srem 212
PRINTTAB( INT (4@-LEN(AS(P)))/2) srem 132
GOSUB35 srem 75
GOSUB4@ srem 72
NEXT srem 164
GOTO71 srem 7
REM PRINT OUT WORDS :rem 95
FORX=1TOLEN(AS(P)) :rem 238
PRINTMIDS(AS(P),X,1); srem 103
FORT=1TO30@0 : NEXT srem 194
NEXT :rem 174
RETURN srem 76
PRINT" {CLR}":PRINT"{9 DOWN}" srem 188
PRINTTAB( (INT (49-LEN(AS(P)))/2)-2)
: INPUTAS
srem 93
IFAS=AS (P)THENPRINT"{CLR}":PRINTSPC(
215)"
{5 DOWN}CORRECT !":GOSUB9@:GOTO46 :rem 18
ws (P)="W":GOSUB81 srem 126
PRINT" {CLR}":PRINT"{4 DOWN}"SPC(17);"WRONG !":P
RINT"{2 DOWN}"SPC(9)" CORRECT{ SHIFT-SPACE }SPELL
ING{SHIFT-SPACE}IS:" :rem 78
PRINT: PRINT: PRINT: PRINTTAB( INT (48-LEN(AS(P)))/2
)AS (P) :K=K+1 srem 70
FORT=1TO2900 :NEXT srem 241
POKE 53289,7 z:rem 255
RETURN :rem 76
REM CREATE WORD DATA :rem 91
PRINT" {CLR}":DIMBS$(19) srem 254
FORI=9TO19: PRINT"WORD";I+1l1;:INPUTBS(I):NEXT
:rem 181
PRINT"{CLR}{2 DOWN} {WHT}" srem 242
FORI=98TO1L9YOSTEP4 z:rem 130
93
2 Kid Stuff—Educational Games
54 PRINT1+I;"DA"CHRS (34)BS$(1I)CHRS$(34);","CHRS$(34)B
$(I+1)CHRS (34); srem 69
55 PRINT", "CHRS$ (34) BS$(I+2)CHRS$(34);","CHRS(34)BS(I
+3) :NEXT srem 113
56 PRINT"GOTO1": PRINT" {HOME }" srem 196
57, POKE198,1@ srem 202
58 FORI=9TO5 : POKE631+1,13:NEXT srem 98
59 END srem 69
60 REM INSTRUCTIONS srem 255
61 PRINT" {BLK}{3 DOWN}{6 SPACES}USE THIS PROGRAM F
OR SPELLING":PRINT" PRACTICE.{2 SPACES }WHEN";
trem 119
62 PRINT" REQUESTED, ENTER THE":PRINT" SPELLING WO
RDS AND {RVS}PRESS RETURN{OFF}.{2 SPACES }WHEN"
:rem 59
63 PRINT" ALL (2@) OF THE WORDS HAVE BEEN": PRINT"
{SPACE}ENTERED, THEY WILL BE PLACED"; srem 36
64 PRINT" INTO THE":PRINT" PROGRAM AS DATA STATEME
NTS.{2 SPACES }RE-SAVE-" srem 253
65 PRINT" ING THE PROGRAM AT THE END OF THE":PRINT
" SESSION WILL SAVE THE"; srem 136
PRINT" ENTERED":PRINT" WORDS FOR USE AT THE NEX
T PRACTICE." srem 224
PRINT"{5 DOWN}{12 RIGHT}{RVS}PRESS RETURN{OFF}"
srem ©
GETRS : IFRS=""THEN68 srem 33
IFRS=CHR$ (13) THENRETURN srem 118
GOTO68 srem 14
PRINT: PRINT" {CLR}{RVS}MISSPELLED WORDS: {OFF}":P
RINT:REM PRINT OUT MISSPELLED WORDS,SCORE:rem 5
FORP=8T0O19: 1FWS(P)="W"THENPRINTTAB(4)AS$(P)
srem 245
NEXT s:rem 169
PRINT" {HOME}{19 DOWN}{RVS}SCORE ="100-K*5
srem 69
PRINT: PRINT"{3 SPACES}AGAIN ? (Y OR N) srem 154
GETRS : IFRS=""THENGOTO76 srem 88
IFRS="Y"THENRUNL :rem 162
IFRS <>"N"THEN76 :rem 28
POKE36869, 248: POKEV, @: POKES ,@ srem 164
GOTO59 srem 15
PRINT" {CLR}": POKE5328@, 2:S=54272:FORE=STOS+28:P
OKEE, 9: NEXT zrem 104
POKE54296, 15 :POKE54277, 18 :POKE54278, 242
srem 116
POKE 54276, 33 :POKE 54273, 4 :POKE54272, 48
srem 9
87 FORT=1TO 300 :NEXT:POKE54276, 32:FORT=1TO 400 :
NEXT srem 92
94
2 Kid Stuff—Educational Games
95
2 Kid Stuff—Educational Games
Munchmath
Gerald R. Anderson
96
Kid Stuff—Educational Games 2
Program Description
Here’s a breakdown of the program:
Lines 100-170: Initialization and delay subroutines.
Lines 190-240: Answer-checking.
Lines 260-270: Print titles computer-style.
Lines 290-460: Generate problem and print it in proper
format.
Lines 480-540: Ghost catches Munchie. Generate sound
effects, subtract 50 points, and reduce difficulty level.
Lines 560-690: Munchie reaches the power prize and
chases the ghost. Bonus of 100 points, advance to next level.
Lines 700-730: Move Munchie and ghost.
Lines 740-780: Print level and score. Clear old answer
from screen.
Lines 800-880: Print scoreboard at end of game. Restart or
end program.
Lines 900-910: Special characters created.
Lines 930-1070: Titles
Lines 1080-1280: Get player’s name, choice, and level.
Lines 1300-1410: DATA statements for custom characters.
Munchmath
For mistake-proof entry, be sure to use “Automatic Proofreader,” Appendix J.
10@ POKE56,48:CLR:
PRINT" {CLR}":SM=1973 :CM=55345:L=
1:BC=3 srem 142
118 FORI=9TO27 : POKE54272+1,0:NEXT: POKE54296,15:POK
E54277,18:POKE54278,165 srem 56
120 SS="{HOME}{21 DOWN}":SF=54272:WV=54276 :rem 67
138 JS$="9999999999999999999999":
P=3 : GOTOIGD
srem 11ll
148 : :rem 297
150 FORT=1TO300:NEXT:
RETURN srem 8
160 FORT=1T04@
:NEXT: RETURN :rem 218
179 FORT=1T0O990:NEXT:
RETURN srem 224
188 3: s:rem 211
198 D=VAL(ANS):IFASC(ANS )=81ANDPR>1THEN8@@:rem 247
200 IFINT(D)<>INT(C)THEN23@ srem 94
218 P=P+1:R=R+1:M=M+1:SC=SC+19:
POKESF, 223: POKESF+1
,29:POKEWV,17 srem 67
220 FORT=1T0O5:NEXT:
POKEWV, 16:GOTO799 srem 65
230 M=M+1:W=W+l:PRINTLEFTS (S$,198)SPC(28-LEN(CS$))"
{RVS}{RED}"cS"{5 SPACES}" srem 46
240 POKESF+1,8:POKESF,
199: POKEWV, 33:GOSUB159: POKEW
V,32:GOTO729 srem 136
258 : srem 299
97
2 Kid Stuff—Educational Games
98
Kid Stuff—Educational Games 2
619 POKESF+1,14:
POKEWV, 129: POKECM+9, 3: POKESM+1,58
srem 252
626 GOSUB169: POKEWV, 128: POKESM+1, 32:NEXT :rem 19
639 FORI=1T05: PRINT" {HOME} {RVS}{DOWN}{RED}"TAB(15)
"kk 198 **": POKESF+1,15:POKEWV,33 :rem 15
646 GOSUB15@: POKEWV, 32 srem 87
656 PRINT" {HOME} {DOWN} {RVS}"TAB(15)"{9 SPACES}":GO
SUB15@ :NEXT:L=L+1 :rem 168
669 SC=SC+190: P=3 :M=9 : BC=BC+1 : IFBC> 31THENBC=7
:rem 164
6768 REM SETUP :rem 18
689 POKE5328@, BC: POKE53281,1:PRINT"
{CLR} {BLU}":PRI
NTLEFTS (S$,3)SPC(9)JS$ :rem 33
696 POKE53272, 28: PRINT" {HOME }"SPC(13)"{DOWN} {PUR}?
2222222222? 2?2?{RVS}{RED}S" srem 132
78@ POKESM+P~1 , 32: POKECM+P, 5: POKESM+P, 59:GOSUBL5@:
POKESM+P,58 srem 48
719 IFSM+P=SM+18THEN56@ :rem 125
728 POKESM+M-1 , 32: POKECM+M, 2: POKESM+M, 61 :GOSUB15@:
POKECM+M, 6: POKESM+M, 6 zrem 232
73 IFPEEK(SM+M)=PEEK(SM+P ) THEN48@ :rem 80
746 PRINTLEFTS(S$,16)SPC(16)"{RVS}{CYN}LEVEL: "L"
{BLU}" srem 198
756 PRINTLEFTS(S$,17)SPC(9)J$ srem 178
760 PRINTLEFTS(SS,19)"{RVS}"SPC(12)NS"'S SCORE: "SC
srem 67
778 PRINTLEFTS(SS$,7)SPC(17)"{4 SPACES}":PRINTSPC(1
7)"{4 SPACES }":PRINTSPC(13)"{DOWN}{8 SPACES}"
:rem 233
78 GOTO296 srem 115
¢ srem 218
809 POKE53272, 21: POKE53280,6:POKE53281,7 srem 245
819 PRINT" {CLR} {DOWN} {RVS}"SPC(13-LEN(NS$)/2)NS"'S
{SPACE }SCOREBOARD" srem 255
820 PRINTSPC(14)"{2 DOWN}PROBLEMS: "PR-1 :rem 199
830 PRINTSPC(12)"{2 DOWN}{GRN}RIGHT ANSWERS: "R:PRI
NTSPC(12)"{2 DOWN}{RED}WRONG ANSWERS:"W
s:rem 151
835 RP=PR-1:QQ=ABS(R/RP*19G):Ql=INT(QQ+.5) :zrem 2
849 PRINTSPC(14)"{2 DOWN}{BLK}GRADE:"Q1"%" :rem 67
859 PRINTSPC(12)"{2 DOWN}PLAY AGAIN (Y/N)?":POKE19
8,B s:rem 141
860 GETAS : IFAS<>"Y"ANDAS <> "N"THEN86@ srem 57
876 IFAS="Y"THENPR=0: R=0 :W=0:SC=@:GOTO119@ :rem 29
889 END s:rem 119
898 $ :rem 219
989 FORF=55T0O63 : FORI=9TO7 : READA: POKEF*8+1+12288,A:
NEXT:NEXT s:rem 213
918 FORI=@TO7 : POKE32*8+1+12288,9:NEXT s:rem 186
99
2 Kid Stuff—Educational Games
100
Kid Stuff—Educational Games 2
101
Nleyetatel
Sound 3
yno
[o13U09
ul yno yno
[ozU0D yeusis 1a3311y
‘NdD ddOTSANA
WADONLL
133311}
ul jeuSts
aysulg ad1nOg [eusig
OIdNV
Tit)Id
OUI NV
WaT
WHXTIA T-O.L-€
BuUIssad0Ig
&
SUsaIIGOW
SaOUNOS
JINsLJ
*[
LNdLNO
106
BINS
*7 SuUIssad0Ig
VoIY_T, BdINOg s[eUBIC
SHOUNOS
‘Nao
ddOTHANA
SULT
WAOORLL
LAdLNO
WAX
T-OL-€
OIGNV
107
Sound 3
NV Td Wald
3 Sound
108
Sound 3
109
Wad NV
OIGNV
WHOORLL WAXIW T-OL-€
LNdLNO
s[eusis
ur
3 Sound SHOUNOS
110
VOA oY} Buise¢) :¢ eansiy
Sound 3
sound will be heard after the attack and decay phases have
ended.
The envelope generator puts out an electrical signal which
tells the amplifier when to turn up the volume and how long
it should take, as well as how high to set the volume, and
when to turn it all the way off again. This is why the amplifier
module in the diagramsis called ‘“VCA.” This stands for Volt-
age Controlled Amplifier and means that the amplifier can be
controlled by an incoming variable voltage, such as the one
supplied by the envelope generator.
ADSR Values
On the SID chip, each voice has its own envelope generator.
Within the group of seven registers (0-6) that control the three
oscillators, register 5 contains the attack and decay values in
high-low nybble format, and register 6 contains the sustain/
release values. All values are four-bit numbers (nybbles). The
attack value determines how long the amplifier should take to
reach peak amplitude (maximum volume).
The decay value determines how long the amplifier
should take to go from peak amplitude to the level specified
by the sustain value. The release value is the time the am-
plifier will use to return to the lowest amplitude level (‘off’)
from the sustain level.
Remember, though, that on the analog synthesizer as well
as on the SID chip, the envelope will not go into effect until it
is “triggered.” The lowest order bit (bit 0), the gate bit, trig-
gers each envelope on the SID chip. On the analog syn-
thesizer, triggering of the envelope is accomplished through
the use of an attached keyboard module. When a key is
pushed down (and as long as it is held down), the attack,
decay, and sustain values will go into effect in order. When
the key is released, the release phase is triggered, and the
VCA will close down the volume of the signal it is operating
on over the length of time specified by the release value.
Program 2 demonstrates the effect of the various ADSR
values:
111
3 Sound
In line 130, the attack value is all the way on, and the decay
value is all the way off. In line 140, the sustain value is all the
way on, and the release value is off. Each value is a four-bit
number, 0 to 15. With the attack and sustain setting, the actual
POKE value is shifted to the high nybble; thus, 240 is actually
the attack value equal to 15 (for slowest attack) multiplied by
16. The sound generated is a random noise that gradually gets
louder and then suddenly stops. It stops suddenly because we
have set the release value to 0, allowing no time for a gradual
decrease in volume.
Change the value 240 in line 140 to 255 and run the pro-
gram again. The sound should slowly fade away. The high
nybble of 54278 (sustain) is now 240 and the low nybble (re-
lease) 15, making a total of 255, the value we just POKEd into
54278. Try lowering the sustain value by two or three (2*16 or
3*16); that is, POKE 54278 with either 223 or 207 and see
what happens. The sound should build up as before but
should then fall off markedly. Change the decay value from 0
in line 130 to about 8 (POKE 54277,248) and hear how the
drop-off is now smoothed out. Similarly, shorten the attack
time to vary the start of the sound the same way the sustain
value was altered. The results should be vastly different from
those we started with, and we’ve been working with only two
registers!
Look now at line 170. Notice that we subtracted one from
the value we originally POKEd into 54276 in line 150. This
zeros the gate bit in 54276, and it is the same as taking your
finger off the keyboard on the analog synthesizer: the release
cycle gets triggered. Of course, it works only if the VCA sus-
tain level has been previously raised high enough to hear the
tone. The delay loop in line 180 is also necessary to allow the
release cycle to reach its lowest level.
VEZ:
Sound 3
113
WadTd NV
OIGNV
COT
TTT)
WHOOMLL WHXIW T-OL-€
LAdLNO
eusis
ur
3 Sound
JL sseq-ysrpy & Suisc) +p oINsL]
114
Sound 3
To hear the effect of the filter, we will sweep the value of the
cutoff frequency in line 260 from low to high. This will allow
less and less of the available sound spectrum to be passed by
the filter. Listen carefully to the richness of the tone as it is
diminished. Switch the wave form to noise in line 253 by
POKEing 129, instead of 33, into 54276 to hear a different
version of the effect. Many effects are possible using filters.
Frequency Modulation
Figure 5 introduces another technique called frequency
modulation. Notice now that the signal from VCO1 is entering
the control input of VCO2, and that the signal from VCO2 is
going through the VCA and on to the mixer. The frequency of
VCO2 is now being controlled automatically by the output
voltage of VCO1 instead of manually by the pot. This is an-
other example of voltage control. The envelope generator con-
trolled the VCA before and an oscillator now controls a VCO
(Voltage Controlled Oscillator).
Frequency Modulation (FM), along with filtering and en-
velope control, is one of the most significant techniques of
sound synthesis. Using one signal source to alter the sound
quality of another provides incredibly powerful and varied
tools for sound manipulation. Program 4 is one simple ex-
ample of the FM technique.
Program 4. Siren
300 FORI=0TO24: POKE54272+1,8:NEXT s:rem 239
395 POKE 54278,249:REM FULL SUSTAIN/FASTEST RELEAS
E RATE :rem 129
318 POKE54276,33:REM SAWTOTH WAVE OSCl srem 238
328 POKE54286,3:REM CONTROL FREQ. OSC3 srem 223
338 POKE54299,16:REM TRIANGLE WAVE OSC3 srem 27
348 POKE54296,175:REM FULL VOL. & SELECT BAND-PASS
& DISC. OSC3 FROM AUDIO s:rem 157
35@ POKE54295,1:REM NO RES'NCE & CHOOSE OSCl FOR F
ILTER s:rem 121
36@ POKE54293,255:POKE54294,78:REM CUTOFF FREQ.
srem 228
115
al oinBi4
:¢ Aouenbel4 uoypinpow
‘Oo
SHOUNOS SUsaIIGOW
[orju05
3 Sound
yno
Ud
sjeusis
133311}
WAXIA T-O.L-€
IndLno
Id
NV
OIGNV
Wald
Sound 3
Synthesized 64
The techniques of sound manipulation described above, as
used with an analog synthesizer, have perhaps given you a
better picture of the working of the SID chip. As you learn
more about the internal registers which control other func-
tions, you'll discover others just as interesting as those
discussed here.
117
3 Sound
118
Sound 3
Sound
Editor 64
Daniel L. Riegal
119
3 Sound
Duration
Duration, another parameter used with the SID chip registers,
is the amount of time between turning the voice gate on and
resetting it to 0. The values for duration used by Sound Editor
64 are intervals of 60 per second. Thus a value of 60 is 1 sec-
ond and a value of 6 is .1 second (or 100 milliseconds). As
you can see, the envelope is closely related to time. Each
phase takes an amount of time as specified for each parameter.
The duration time must be long enough to allow attack and
decay to complete before the voice gate is reset. Otherwise
sound distortions may occur. For this reason, very short
sounds usually require ADSR values of attack 0, decay 0, sus-
tain 15, release 0, as well as a small duration.
The SID chip can produce eight octaves (0-7) of tones.
Sound Editor 64 dynamically generates and stores the tone
settings of octave 7 using the highest note, B, as a base. The
octave is divided into 12 tones, where each tone’s frequency is
2 (1/12) lower than the next higher tone (A#=B/2 f!(1/12)).
The frequency of a tone is also half that of the same note in
the next higher octave (octave 6=octave 7/2). Therefore, the
program can generate the scale for any octave N (where N is
0-7) by using the formula OCTAVE N=OCTAVE 7/2 ft (7-N).
This saves memory by eliminating the need for an array of 96
120
Sound 3
121
3 Sound
122
Sound 3
*NA=Not Applicable
Sound Editor 64
For mistake-proof program entry, be sure to use “Automatic Proofreader,” Appendix J.
1906 REM SOUND EDITOR :rem 197
118 PRINT"{CLR}", "SOUND EDITOR{3 DOWN}" :rem 233
115 DIMF(11):F(11)=64814:FORF=10TOSSTEP-1:F(F)=INT
(1/2+F(F+1)/2T(1/12)):NEXT zrem 37
12@ SD=54272:V=SD+24: FORI=SDTOV: POKEL, 9: NEXT: POKEV
Aas) :rem 111
130 DIMNS(11):NS(@)="C ":NS(1)="C#":NS(2)="D ":NS(
3)="D#e"sNS(4)="E “"2NS(5)=S"F °°” srem 149
140 NS(6)="F#":NS(7)="G “:NS(8)="G#":NS(9)="A ":NS
(10)="A#":NS(11)="B ":GOTO20G srem 246
159 PRINT" {HOME}{2 DOWN}ENTER OPTION [F1] BASIC
{2 SPACES}[F3] CHANGE" srem 91
152 PRINTTAB(13)"[F5] SCALE{2 SPACES}[F7] QUIT"
srem 8
153 GETOPS:IFOPS=""THEN153 :rem 17
155 IFOPS="{F7}"THENPRINT"{CLR}"; :POKEV,@:END
srem 248
160 IFOPS="{F3}"THEN200 :rem 177
165 IFOPS="{F1}"THEN59@ :rem 184
168 IFOPS="{F5}"THEN49G :rem 188
178 GOTO1L5S srem 103
123
3 Sound
124
Sound 3
125
3 Sound
SYS Sound
Michael Steed
126
Sound 3
SYSing Sounds
To use SYS Sound, all you need to do is type SYS 49152, fol-
lowed by any of several possible parameters. The parameters
must be separated by commas. The number 49152 could (and
probably should) be defined as a variable, such as S or
SOUND. You can then call SYS Sound directly from your own
program, as long as it’s still in memory. Once you've turned
the computer off, however, SYS Sound disappears. You’d have
to load it again to use it.
The parameters used in SYS Sound, and their meanings
are:
@ Vx, where x is the voice number used for the note (1, 2,
or 3). More than one voice may be used at the same time (see
Program 2).
@ Ax, where x is the attack rate of the note. This is the
time it takes the sound to reach its highest volume. The larger
the number, the longer it takes. (See the figure for a graphic
description of attack, decay, sustain, and release.)
e Dx, where x is the decay rate of the note. This is the
time it takes the sound to soften to the sustain volume.
e@ Sx, where x is the sustain level of the note. The sound
remains at this volume until the release starts.
@ Rx, where x is the release rate of the note. The release
rate is the time it takes the sound to drop from the sustain
volume to silence.
e@ Wx{[y], where x is the letter representing the waveform
used for the sound. This can be N (noise), S (sawtooth), T (tri-
angle), or P (pulse). If the chosen waveform is pulse, then a
pulse rate (0 to 4095) must be entered after the waveform let-
ter, such as WP2048 for a square wave.
e Fx, where x is the frequency of the note (0 to 65535).
Higher frequencies produce higher notes.
e@ Lx, where x is the volume (loudness) of the note (0 to
15). Note that this is the overall volume, so all the voices will
be affected by it.
e C clears the sound chip. This is equivalent to the
following in BASIC:
1@ S=54272:FOR I=@ TO 24:POKE S+I,@:NEXT
127
3 Sound
ADSR Envelope
leattackdbeDecaydeSustain—ple Release—y
|
3
eS
a
E
<
Once certain parameters have been set, they need not be en-
tered the next time the routine is used. For example, if all your
sound effects were going to be done with voice 1, at volume
15, with the sawtooth waveform, attack 0, decay 9, and sus-
tain and release 0, you could set all these at the beginning of
your program by:
18 S=49152:SYS S,C,V1,L15,WS,D9
128
Sound 3
129
3 Sound
130
Sound 3
131
3 Sound
when the screen and border are black and the cursor blue dur-
ing the game. You may, of course, specify any screen/border
combination by substituting the appropriate number for the 0
in the POKE statement on line 185 for the background and the
value in the POKE V+32 statement in line 5 for the border
color. You can even change the background color for the title
screen by altering the POKE V+33 statement in lines 5 and
325. (See Appendix E for possible combinations).
The variables R and W, respectively, are the number of
right and wrong answers. The string variable N$(2,24) is a
string array containing the note names and the POKE values
for the sound registers.
The Note Name Game
For mistake-proof program entry, be sure to use “Automatic Proofreader,” Appendix J.
5 PRINT" {CLR}":V=53248:SD=54272: POKE646, 14: POKEV+3
2,0:POKEV+33,7:DIM NS$(2,24) :SC=0 :rem 78
6 NO%$=25:POKEV+21,0 :rem 69
8 FORI=SDTOSD+28:POKEI,@:NEXTI srem 219
10 FOR I=@TO24:READNS(@,1):NEXTI :rem 135
15 FOR I=@TO24:READNS(1,1):NEXTI s:rem 141
28 FOR I=0@TO24:READNS(2,1):NEXTI :rem 138
25 :::REM READ SPRITE DATA srem 6
38 FOR I=OTO62: READQ: POKE832+1I,Q: NEXTI :rem 138
35 FOR I=OTO62: READQ: POKE896+1,Q: NEXTI :rem 153
49 FOR I=OTO62: READQ: POKE969+1I,Q: NEXTI :rem 141
45 :::REM TELL COMPUTER WHERE SPRITE IS srem 137
5@ POKE2@42,13:POKE2043,14:POKE2044,15 s:rem 116
55 :::REM POSITION SPRITE ON SCREEN srem 165
69 POKEV+4, 160: POKEV+5, 7 srem 191
65 POKEV+6,158: POKEV+7,119 srem 250
7G POKEV+8,158:POKEV+9,171 :rem 1
75 :::REM COLOR SPRITES :rem 167
78 POKEV+41,1:POKEV+42,1:POKEV+43,1 srem 60
88 :::REM EXPAND SPRITES srem 228
85 POKEV+29, 28: POKEV+23,28 s:rem 3
98 :::REM SET SOUND PARAMETERS srem 102
95 POKESD+24,15:POKESD+5, 4: POKESD+6, 179: POKESD+2,9
: POKESD+3, 9: POKESD+12, 2 srem 164
96 POKESD+13,243:POKESD+19,@:POKESD+29,245:rem 206
198 PRINT" {CLR}{2 DOWN}";TAB(11);"{RVS}THE NOTE NA
ME GAME{OFF}" srem 81
195 PRINT"{5 DOWN}{6 RIGHT}I WILL PLAY A NOTE FOR
{SPACE}YOU AND" srem 79
119 PRINT"{DOWN}{3 RIGHT}THEN SHOW YOU A NOTE ON A
STAFF." s:rem 47
133
3 Sound
134
Sound 3
365 IFR+W<>OTHENSC=INT((R/(R+W)
)*190+.5) sNEXT
srem 156
316 POKEV+21,0:PRINT"{CLR}" srem 161
315 PRINT"{7 DOWN}{9 RIGHT}YOUR SCORE WAS";SC;"
{LEFT }3" srem 174
318 POKE198,9 srem 2901
328 PRINT"{5 DOWN}{4 RIGHT}WOULD YOU LIKE TO PLAY
{ SPACE }AGAIN"; : INPUTYS srem 151
325 IFLEFTS (Y$,1)="Y"THENR=9 :W=0:SC=0:POKE V+33,7:
GOTO19G srem 93
336 SYS2048:REM END OF PROGRAM zrem 5
400 :::REM CORRECT srem 56
419 POKESD+11,129 :rem 176
420 FORI=536TO9094STEP256:PRINT"{3 DOWN} {RIGHT}
{WHT}{RVS} CORRECT {OFF} {WHT}"sHI=INT(1/256):L
O=I-HI* 256 srem 71
436 PRINT" {UP}{2 SPACES}CORRECT {4 UP}&7]3":POKES
D+8,HI:POKESD+7, LO:NEXTI z:rem 244
446 FORT=1T01@:NEXT: POKESD+11,128:FORT=1TO900:NEXT
:R=R+1: RETURN srem 59
588 :::REM INCORRECT srem 208
5@5 POKESD+18,33:POKESD+16,@:POKESD+15,6 :rem 193
516 PRINT" {DOWN}SORRY, THAT'S":PRINT"
{DOWN} INCORRE
Cre srem 225
515 PRINT" {DOWN}IT WAS: ";:NS$(@,RN3) zrem 94
520 FORT=1T0O1009 : NEXT: POKESD+18, 32: FORT=1T0O98@ : NEX
T:W=W+1: RETURN :rem 117
756 FORX=1T05 srem 33
diap PRINT TAB(16);:FORI=1T024:PRINT CHRS(99);:NEXT
srem 24
768 PRINT"{16 RIGHT}{24 SPACES}"; sNEXTX:RETURN
srem 100
786 PRINT"THE NOTE WAS:";NS$(@,RN3) zrem 283
785 W=W+1:RETURN :rem 5
1899 :::REM TELL COMPUTER WHERE SPRITE IS :rem 225
185 POKE2042,13: POKE2043,14:POKE2044,15 :s:rem 213
1819 :::REM POSITION SPRITE ON SCREEN srem 253
1615 POKEV+4, 160: POKEV+5, 72 srem 32
18208 POKEV+6, 158: POKEV+7,119 :rem 82
1825 POKEV+8, 158: POKEV+9,171 srem 98
1839 :::REM COLOR SPRITES srem 255
1635 POKEV+41,1: POKEV+42, 1: POKEV+43,1 s:rem 159
1846 :::REM EXPAND SPRITES IN BOTH DIRECTIONS
srem 249
1845 POKEV+29, 28: POKEV+23, 28 :rem 96
1659 :::REM TURN ON SPRITES zrem 1064
1855 POKEV+21, 28 srem 116
1999 END :rem 179
28608 PRINT:GOSUB 4979 srem 221
135
Sound 3
136
4
Oe) Leyacy
Olttelars eyelets
AY,Cosatore!
Colors, Characters, and Motion 4
Introduction to
Custom Characters
for the 64
Tom R. Halfhill
139
4 Colors, Characters, and Motion
140
Colors, Characters, and Motion 4
141
4 Colors, Characters, and Motion
142
Colors, Characters, and Motion 4
on. The bit next to it, to the left, represents a value of 2 when
it is on. This pattern continues, each bit to the left represent-
ing a value double that of the previous bit. Look at Figure 2 for
a moment to see this pattern.
143
4 Colors, Characters, and Motion
144
Colors, Characters, and Motion 4
| | 24 (16+8)
126 (64+32+16+8+4+2)
219 (128+ 64+16+8+2+4+1)
the list of numbers spelling out the patterns for the standard
character set is in RAM, it can be changed to use your own
numbers with POKE statements.
Specific Details
Up to now, this article has been fairly general in its explana-
tions. The basic technique for customizing characters is the
same for almost any computer on which the character set can
be relocated and redefined. But the specific details vary for
each computer: the character set’s memory address in ROM,
how to safely copy it to RAM, the memory address of the
character set pointer, the order of characters within the charac-
ter set, and so on.
For these details, as well as example programs and util-
ities, turn to the next article ““How to Make Custom Characters
on the 64.”
145
4 Colors, Characters, and Motion
How to Make
Custom Characters
on the 64
Gary Davis
146
Colors, Characters, and Motion 4
147
4 Colors, Characters, and Motion
148
Colors, Characters, and Motion 4
disk before you run it. If you have made a typing error, it is
possible that the computer will “crash” and you'll have to
type it all over again if you haven’t saved a copy.
When you run Chred 64, the program first copies the res-
ident character set from ROM to RAM and resets the character
base to point to the RAM character set. The program then ex-
pands the current character being edited to eight times its nor-
mal size.
To edit the current character being displayed, you may
use the cursor control keys, the asterisk, and the space bar.
To turn on a pixel, position the cursor and press the as-
terisk. To turn off a pixel, press the space bar. To clear the
entire character, press CLR.
To edit a different character, press f1. You will be asked
to supply a row and column. This refers to the block of
characters displayed on the lower right corner of the screen.
Just type a row number followed by the column number or
letter. The character you selected will now be displayed, ready
for you to edit.
More Editing Features
An interesting feature of the 64 is that, unlike the Commodore
PET, the reverse-field (inverse video) characters are stored as
part of the character set. This allows 256 redefined characters.
To edit a character not being displayed, press f3. This will se-
lect and display the next block of 64 characters. Rest assured
that you may mix characters from any of the blocks; only 64
characters are shown at a time for the purpose of editing.
Sometimes you may wish to edit more than one character
at a time to make a larger shape. This can be easily accom-
plished by pressing f5. Instead of a single character, you will
be able to edit a block of four characters. To go back to single
character mode, just press f5 again.
After you have redefined several characters, the text on
the screen may become unreadable as your new characters re-
place the existing ones. To restore the character set to normal,
without destroying your new character set, press f7. To return
to your new character set, press f7 again.
When you are done working with a character set, you can
restore the font to the normal character set by pressing R. You
will be asked ‘Are you sure?” Now is your last chance to save
your character set. If you are really done, press Y; otherwise,
press N.
149
4 Colors, Characters, and Motion
Program 2. Chred 64
198 REM "CHRED 64" srem 137
128 POKE53280,11:POKE53281,@:PRINT"£59" srem 189
130 V=53248:SC=1024:CB=2948 :CC=SC+490*21+9 srem 222
148 SZ=7:FP=0:FO=0:TP=0:TY=9:SL=0:RS="0"sCcS="G"
srem 199
150
Colors, Characters, and Motion 4
151
4 Colors, Characters, and Motion
152
Colors, Characters, and Motion 4
153
4 Colors, Characters, and Motion
1380 IFSZ=15THENPOKECC+1,
FP+FO+1 : POKECC+4@, FP+FO+2
: POKECC+41 , FP+FO+3 srem 125
1316 X= 3 Y=0 : CX=0 : CY=9 srem 15
1320 GOSUB13908 srem 19
1330 IFSZ<>15THEN138@ srem 222
1346 X=8 : Y=0: FP=FP+1 :GOSUB1390 srem 27
1356 X=6 : Y=8 : FP=FP+1 : GOSUB1399 srem 28
1360 X=8: Y=8 : FP=FP+1 :GOSUB13994 srem 37
1376 FP=FP-3 srem 148
1386 RETURN srem 172
1398 TP=FP :TX=CX: TY=CY: IFTX> 7ANDTY <8THENTP=TP+1
: TX
=TX-8 srem 228
1496 IFTX<8ANDTY > 7THENTP=TP+2:TY=TY-8 srem 176
1416 IFTY> 7ANDTX> 7THENTP=TP+3
: TY=TY-8 : TX=TX-8
srem 231
1420 TE=8* (FO+TP)+CB:REM CHAR. POINTER srem 239
1436 POKE251,TE-INT(TE/256)*256 srem 233
1440 POKE252, INT(TE/256) srem 94
1458 TE=FNA(@)+X+40*Y:REM SCREEN LOC. srem 117
1460 POKE253, TE-INT(TE/256) *256 srem 238
1478 POKE254, INT (TE/256) srem 99
1489 SYS49299 srem 212
149 RETURN srem 174
1580 FORL=49152T049319 srem 232
1518 READD: POKEL, D: NEXT srem 197
1526 RETURN srem 168
1530 REM FONT COPIER ROUTINE srem 294
1546 DATA12@,169,51,133,1,169,1,141,13,220,169,9,1
33,251,133,253,169, 208,133 srem 189
1556 DATA252,169,8,133,254,169,0,177, 251,145, 253,2
30,251,230, 253,208, 246, 230 srem 205
1569 DATA252, 230, 254,165,252, 201,225,208, 236,169,1
29,141,13,220,169,55,133,1 srem 205
1576 DATA88, 96 srem 242
1588 REM CHAR EXPAND AND DISPLAY srem 121
1596 DATA169,9,162,9,169,128,133,259,177, 251,37, 25
9,208,4,169,32,208,2,169,42 srem 3
1606 DATA145, 253, 24,102,250, 249,8, 239, 253, 2098,2,23
@,254, 208, 229, 239,251,298,2 srem 2390
1616 DATA239, 252,165, 253, 24,195,33,133, 253,165,254
,195,0,133,254, 232,224,8, 208 srem 33
1626 DATA2@1,96 srem 17
1630 REM SAVE AND LOAD ROUTINES srem 73
1646 DATA169,128,133,157,169,1,162,1,169,1,32,186,
255,165, 253,162, 208,160,192 srem 11
1650 DATA32,189,255,96,169,8,133,251,169,8,133,252
,169,251,162,16,160,25 rem 33
1669 DATA32, 216, 255,96 srem 116
1676 DATA169,9,162,0,160,8,32,213,255,96 :srem 226
154
Colors, Characters, and Motion 4
SuperBASIC Sprite
Editor
Martin C. Kees
Sprites, those graphics blocks that you can sculpt into any
shape you want, are a powerful feature on the Commodore
64. They’re very useful when you're designing games, for they
move quickly and smoothly. It’s even quite easy to create
animation using sprites. However, drawing sprite patterns on
graph paper and then calculating the DATA statements to
place in your program can be tiresome, especially when you
have several sprite patterns to create.
That’s where a sprite editor comes in handy. A good edi-
tor should make it easy and fun to design sprites. It should
allow you to change colors at will, create multicolored or sin-
gle colored sprites, show the sprites’ final shape, and create
the DATA values you'll need later. If it’s even more powerful,
it should let you move the sprites on the screen, animate
them, and store and load them to and from tape or disk.
“SuperBASIC Sprite Editor’ gives you all these functions,
and more. It’s easy to use, fast in its execution, and includes a
variety of commands.
Sprite Creation
Maybe you've already designed your own sprites. In that case,
155
4 Colors, Characters, and Motion
156
Colors, Characters, and Motion 4
158
Colors, Characters, and Motion 4
both. The last two parameters ask for the starting X and Y co-
ordinates of the sprite. Refer to the Commodore 64 Pro-
grammer’s Reference Guide for the coordinates which will show
on the screen.
D Using this command key, you can see the DATA statements
you would include in your own program. The program will
ask for the block to be displayed, and the beginning line num-
ber of the DATA statement. The computer will calculate the
values you would need to create that sprite pattern. You will,
however, have to type these values into your own programs
yourself. SuperBASIC Sprite Editor does not allow you to
merge sprite DATA files with your own programs.
Drawing Sprites
The best way to discover how to use SuperBASIC Sprite Edi-
tor is to simply experiment. Use it to create as many sprites as
you need, and then use the D command key to display the
DATA statement values. This eliminates much of the work
you would have to do with paper and pencil; all that remains
for you to do is to enter those lines within your own game or
program.
When you first use this program, you'll probably find that
there are sprite patterns already in each block. Use the U com-
mand key to call a block, type 1 and RETURN. You’re in
Block 1 now. If it’s filled, use SHIFT CLR/HOME to erase the
sprite pattern. You’ve now got an empty pattern to work with.
If you switch from the sprite pattern display to the menu
(by pressing the M command key), and then back again to the
display (by pressing any key from the menu screen), you'll no-
tice that your single-colored sprite has changed colors. To get
back to the original color, just hit the C toggle key twice.
You'll find SuperBASIC Sprite Editor a valuable addition
to your programming library. It’s a utility you'll often use as
you discover the power of sprites on the 64. Moreover, it
makes creating sprites fun, instead of the chore it once was.
159
4 Colors, Characters, and Motion
160
Colors, Characters, and Motion 4
161
4 Colors, Characters, and Motion
162
Colors, Characters, and Motion 4
[VS1K1@:[FCOL12:[BKG4@0,1,12,11:PRINT"{CLR}
{RVS}SPRITE{ SHIFT-SPACE }EDITOR{ SHIFT-SPACE }ME
NU{OFF} " srem 91
PRINT" FKEJ BACKGROUND COLOR " zrem 110
PRINT" FKRJ BORDER COLOR " srem 73
PRINT" FKW3 SPRITE MULTI 9" srem 160
PRINT" FKHJ TEXT COLOR " :rem 212
PRINT" FKJI3J SPRITE COLOR" srem 194
PRINT" FRY} SPRITE MULTI 1" zrem 168
PRINT" KE} £RI KwI{2 SPACES}SETS PIXEL
{SPACE }ON" srem 13
PRINT" SPACE CLEARS PIXEL" srem 194
PRINT" CURSOR{SHIFT-SPACE}KEYS MOVE EDIT CURS
OR" srem 148
PRINT" CLR/HOME CLEARS DISPLAY" :rem 41
PRINT" R HORIZONTAL SHIFT" srem 245
PRINT" V VERTICAL SHIFT" srem 74
PRINT" L LATERAL FLIP" zrem 144
PRINT" F VERTICAL FLIP" srem 224
PRINT" C SINGLE/MULTICOLOR TOGGLE" srem 26
PRINT" S STORE EDIT SPRITE" zrem 243
PRINT" U RECALL STORED SPRITE" srem 199
PRINT" P PREVIEW STORED SPRITES" srem 133
PRINT" O STORE SPRITES IN FILE" :rem 214
PRINT" I LOAD SPRITE FILE" srem 122
PRINT" M DISPLAY MENU" :rem 179
PRINT" A ANIMATE MODE" srem 129
PRINT" D DATA LIST" srem 187
GETAS : IFAS=""THEN219@ srem 187
RETURN zrem 164
[VS1K1@:[FCOL12:[BKG4@,11,11,15 :rem 63
GETAS : IFAS=""THEN2519 srem 179
[VS1K11:[BKG4B,M@,SK,Ml:[FCOLTC:
GOTO50G
srem 255
FORJ=@T03:[KSPRJ :NEXT srem 2907
ZZ=53265 sWV=128:[VS1K9:
PRINT" {CLR}";:INPUT"ST
ART BLOCK":;BL srem 22
INPUT"END BLOCK":BE srem 168
INPUT"HORIZ SHIFT";HS zrem 129
INPUT"VERTICAL SHIFT";VS srem 85
INPUT"TIME DELAY"; TD :rem 11
INPUT"X EXPAND @/1";XE :rem 27
INPUT"Y EXPAND @/1";YE srem 39
INPUT"X POSITION";XP :rem 77
INPUT"Y POSITION"; YP :rem 8
PRINT" {CLR}" :rem 47
FORJ=0T03:{[KSPRJ:NEXT :rem 220
FORJ=BLTOBE:WAITZZ,WV:[DSPRO,J,XE,YE,XP,YP,MC
»SK,MO,M1 srem 119
163
4 Colors, Characters, and Motion
164
Colors, Characters, and Motion 4
165
4 Colors, Characters, and Motion
166
Colors, Characters, and Motion 4
Sprite Creation
Gregg Keizer
Drawing Sprites
Creating a sprite is much like creating a custom character—it
must be drawn. The 64 does not do this for you; you have to
place the data information within a program for the computer
to look at, and then draw the sprite on the screen.
A sprite is much larger than a custom character, consisting
of a graphics block 24 pixels wide by 21 pixels high. A custom
character is only an 8-by-8 pixel block. The information to
draw a sprite uses more memory than a custom character be-
cause of its size, so fewer sprites can be displayed at a time.
Eight sprites are available to you on the Commodore 64.
Just as when you create custom characters, you can use
graph paper to design your sprites. Take a piece of graph pa-
per and outline an area 24 blocks wide by 21 high. Simply fill
in the blocks in the pattern to create a sprite. Figure 1 shows a
sample sprite drawn in this way.
0
sf alGale
2
ae
rs fied
5 Oea
Ch A
7 ee
3 eSa aa)
ie Es
1 | a ES
3b Fa Lal
re
613 Res
2S elfn ala]
15. (a).|3
16 | | | |
17 Fie}
Agnes ay
WC es
170
Colors, Characters, and Motion 4
171
4 Colors, Characters, and Motion
BitBit#
Values
a aE
+ ttt
cae scat oeameee
The first row has none of its pixels on, so the bit value for
all three bytes is 0. Row 2, however, has six bits in the Block B
byte turned on. These bits, numbers 1 through 6, have a total
bit value of 126 (2+4+8+16+32-+ 64). The other two bytes,
represented by Blocks A and C, are 0, since neither has any
bits on.
Each byte is calculated in this same way. Remember that
each row of a sprite consists of three bytes, and that each
172
Colors, Characters, and Motion 4
173
4 Colors, Characters, and Motion
174
Colors, Characters, and Motion 4
Program 2. Butterfly
10 READ SB: IF SB<@ THEN 189: REM READ SPRITE DATA
srem 297
LO= SB*64: FOR I= @ TO 62 srem 69
READ SD: POKE LO+I,SD: NEXT I srem 19
GOTO 10 srem 254
DATA 13: REM SPRITE DATA BLOCK 13 srem 193
DATAY W4yer3 25. Ones > ol 28 Oe OS. 2 780, 6 OS), So
7 @ srem 235
DABAML Zip ee Wiig Colm eodpm eu One OS ee ideals
{SPACE}63, 254, 9 :rem 111
80 DATA GS ieee D 2h Sek leO Ge Oise Dea Ono oven 2
4, @ srem 31
96 DATA S15,0 O25 Ol ele Oly Oink OCsO uO Oly Og ae,
srem 230
1986 DATA, 0i,,-0i,- 9, On. Oe GO, Or, OO, Or Or, CO, Oe
@ srem 227
118 DATA 14: REM SPRITE DATA BLOCK 14 srem 249
129 DATA 8, 8, 8, BO, BO, BO, OB, OB, BD, B, 58, DWsrem 6
130 Dy Wy ayajar bed. alate. waley/, key 5 esi
aikenba yale sasisy,
825571 230 srem 48
146 DATA 255 pnecD
4) lO shee Di paEL D2 ae pO DE Oy ae
Te PAG MG) srem 41
156 DATA=63),,0224 7,5 Opn ids, LOZ pO O25Oign Og ale, Oi
@ srem 189
168 DATA 9, 9, 8, ©, BO, GB, GB, BG, GG GD, OG, OG, BG, DB,
4) srem 233
176 DATA -l: REM END OF DATA srem 180
189 PRINT" {CLR}": POKE 53281,1: REM WHITE SCREEN
srem 37
198 X=@: Y=@: REM STARTING POSITION srem 94
206 POKE 1,54: REM TURN ON SPRITE BASIC srem 196
216 VERIFY @, 13, 11, @: REM DEFINE SPRITE:rem 178
220 WAIT ©, X, Ys: REM PUT SPRITE 8 ON SCREEN
s:rem 125
236 FOR T = 9 TO 19@: NEXT T: REM DELAY LOOP:rem 5
246 VERIFY @, 14, 11, @: REM REDEFINE SPRITE
:rem 77
256 FOR T = @ TO 1900: NEXT T: REM DELAY LOOP:rem 7
260 X=X+3: Y=Y+ 3*(INT(RND(1)*3)-1) srem 66
276 IF X>345 THEN X=@ srem 78
286 IF (Y<39) OR (Y>250) THEN Y=159 srem 237
296 GOTO 210 srem 1983
175
4 Colors, Characters, and Motion
176
5
Inside Your 64
Inside Your 64 5
179
5 Inside Your 64
19 GET N
29 IF N=0 THEN 19
180
Inside Your 64 5
181
5 Inside Your 64
This will give you a ?SYNTAX ERROR, but it seems to read all
right in English. It’s just that the computer requires you to
repeat the variable for each symbol such as <>, <,>, or =.
If you've tried some of the examples, you'll find that GET
only changes the value of the variable. It does not print the
key on the screen. This is also handy; you don’t want a bunch
of keys printed out just to move your spaceship using the key-
board. To make a simple ‘video typewriter,” try this (remem-
ber the semicolon on line 20):
19 GET X$:IF XS="""THEN 10
28 PRINT X$;:GOTO 194
On to Great Frontiers
We're nearly ready to use the function keys. Try this: press the
quote (SHIFT-2) and then press the function keys (SHIFT to
get the even-numbered keys). What magic is this? Each key
now seems to print some cryptic symbol! The computer can
read the function keys just like any other key, but PRINTing
them won’t display anything unless you are in quote mode
(where you can program cursor controls into PRINT state-
ments). But you can take advantage of the symbols to easily
interpret the function keys. You use GET to read them, of
course. Try this program:
18 GET FS:IF FS="" THEN 10
20 IF FS="{F1}" THEN PRINT"FUNCTION ONE"
30 IF FS="{F2}" THEN PRINT"FUNCTION TWO"
4@ IF FS="{F3}" THEN PRINT"FUNCTION THREE"
50 IF FS="{F4}" THEN PRINT"fFUNCTION FOUR"
60 IF FS="{F5}" THEN PRINT"FUNCTION FIVE"
70 IF FS="{F6}" THEN PRINT"FUNCTION SIX"
80 IF FS="{F7}" THEN PRINT"FUNCTION SEVEN"
99 IF FS="{F8}" THEN PRINT"FUNCTION EIGHT"
182
Inside Your 64 5
The {F1}, {F2}, and so on, mean for you to press the
appropriate function key inside the quotes. You'll get the
aforementioned symbols. See Appendix B for the symbols
printed on the screen when you press each function key.
What will you do with the function keys? It’s really up to
you. For example, to restart a game, you might do something
like this:
538 PRINT"PRESS Fl TO PLAY AGAIN"
548 GET A$:IF A$<>"{F1l}" THEN 549
You could also organize a bunch of subroutines, one for each
key, that does something associated with the key (maybe eight
sound effects):
16 GET RQ$:IF RQS="" THEN 19
28 IF RQ$="{F1}" THEN GOSUB 598
96 IF RQS="{F8}" THEN GOSUB 1000
Each function key also has a corresponding ASCII num-
ber. Try this program. It prints out the ASCII (ordered) value
for any key pressed:
18 GET AS:IF AS="" THEN 19
20 PRINT CHRS$(34);A$;CHRS$(34),ASC(AS)
38 GOTO 19
The CHR$(34) puts the computer in quote mode so that if
you press CLR/HOME or something, you'll see its symbol
instead of the screen clearing.
Here is a summary of the ASCII values for the function
keys:
PISS3. E2ss137
f3:134 f4: 138
£5: 135... | £63,139
f7:136 £8: 140
They’re in order from f1-f7, and f2-f8, separately. So you
could use a statement like this to check for f6:
342 IF FS=CHR$(139) THEN PRINT "FUNCTION SIX"
659 IF ASC(F$)=139 THEN GOSUB 4153
183
5 Inside Your 64
184
Inside Your 64 5
185
5 Inside Your 64
186
Inside Your 64 5
187
5 Inside Your 64
PAVAVAW AWA
oof
| DIMX(S)
Row 0 X(2,0)
ee Ca
Row 2 X(1,2)
Row 3 X(2,3)
188
Inside Your 64 5
189
5 Inside Your 64
190
Inside Your 64 5
191
5 Inside Your 64
192
Inside Your 64 5
193
5 Inside Your 64
Adding New
Keywords to
BASIC
Sheldon Leemon
194
Inside Your 64 5
strange and their use requires you to know the address of each
routine.
Wedges?
On the old Commodore PET machines, there was a way to
add new commands to BASIC using what was called a
“wedge.” This is a routine that intercepts the part of the
BASIC interpreter program that reads the program text. The
wedge routine is designed to read the text before BASIC does,
and compare that text to a list of new commands (like the
short disk commands of the DOS support program). If one of
these commands is spotted, the wedge executes the new rou-
tine. If not, control is handed over to the normal BASIC
routines.
There are a couple of problems with this technique, how-
ever. The most important one is execution speed. Since the
BASIC routine which the wedge diverts has to read every sin-
gle character of the program being executed, the time that the
wedge takes to check for each character for new commands
can drastically slow down your program. The more commands
added, the greater this slowdown. To counteract this effect,
wedge commands are often set up to execute only in direct
mode (that’s why you can’t call the DOS wedge from a pro-
gram while it’s running). Even so, a wedge as efficient as the
DOS support program still slows down program execution a
little. Another problem is that adding new commands with a
wedge is hard to do in a way so they can be used simulta-
neously with DOS support and other wedge programs.
Fortunately, the 64 isn’t limited to the wedge method of
adding new commands. The 64 was designed to allow the
addition of new commands which function exactly like regular
BASIC commands, and which do not slow program execution.
To explain how this is possible, however, first requires an
explanation of how Commodore's Microsoft BASIC operates.
Microsoft BASIC
When you enter a line of BASIC program text, a tokenization
routine scans the line to see if any of the words match its list
of command keywords. When it finds such a word (like
PRINT, for example) the routine replaces the ASCII characters
of the keyword with a single character, called a token. Each
token has a value of 128 or higher, and represents a single
BASIC command. These tokens are interpreted by BASIC
195
5 Inside Your 64
196
Inside Your 64 5
197
5 Inside Your 64
198
Inside Your 64 5
199
5 Inside Your 64
FORPNT $49
JMPER $54 ;JMP TO FUNCTION
FACHO $62 ;FLOATING PT. ACC.
FBUFPT $71 ;TEMP SAVE AREA
CHRGET $73 ;BASIC READS TEXT
CHRGOT $79 ;READ TEXT AGAIN
TXTPTR $7A ;PNTR TO CURRENT TEXT
TIME $A@ ;SOFTWARE CLOCK (MSB)
LDTB1 |1 $D9
| ;LINE LINK TABLE
200
Inside Your 64 5
* = $COBD
e
’
IVECS
eWORD TOKNIZ
eWORD PRTOK
eWORD EXEST
«WORD EXEFUN
FUNTOK = FUNVEC-STVEC/2+NEWTOK
201
5 Inside Your 64
TOKNIZ
JSR CRNCH ;TOKENIZE AS USUAL
CRUNCH ;DO 2ND TOKENIZATION
LDX #$80 ;SET READ INDEX
LDY #$94 7SET WRITE INDEX
STY GARBFL ;CLEAR 'DATA' FLAG
CRN1
LDA BUF,X ;GET NEXT CHARACTER
7BMI MOVE ;WRITE IF A TOKEN
CRN2
STA ENDCHR ;FOR END QUOTE TEST
CMP #$22 7IS THIS A QUOTE?
BEQ SKQUOT ;YES, SKIP TO NEXT "
BIT GARBFL ;IF IN "DATA STATEMENT
BVS MOVE ;WRITE THE CHARACTER
CMP #'A' ;< THE LETTER 'A?
BCC MOVE 7;YES, WRITE IT
CMP #S5B 7> THE LETTER 'Z
BCS MOVE 7YES, PASS IT THROUGH
STY FBUFPT ;SAVE WRITE INDEX
LDY #NEWTOK-$8@ ;# OF 1ST TOKEN
STY COUNT ;SET TOKEN COUNTER
LDY #SFF
STX TXTPTR ;SAVE READ INDEX
DEX 7TO OFF?SET THE INX
CRN3
INY ADVANCE WRITE INDEX
INX 7;ADVANCE READ INDEX
CRN4
LDA BUF,X ;GET BUFFERED CHAR
SEC
SBC KEYTXT,Y ;= NEXT TABLE CHAR?
BEQ CRN3 ;YES, KEEP GOIN'
CMP #$80 ;LAST KEYWORD CHAR?
BNE NEXTKW ;NOPE, TRY NEXT WORD
ORA COUNT ;YEP, GET TOKEN NO.
CRN5
LDY FBUFPT ;RESTORE WRITE INDEX
MOVE
INX ;ADVANCE READ INDEX
INY ;ADVANCE WRITE INDEX
STA BUF-5,Y ;WRITE CHARACTER
LDA BUF-5,Y ; TO TEST FOR EOL
BEQ EXIT ;A ZERO ENDS THE LINE
SEC
SBC #':' ; sSTATEMENT TERMINATOR?
BEQ MOVE] ;YEP, CLEAR 'DATA FLAG
CMP #DATTOK ;TOKEN FOR 'DATA?
202
Inside Your 64 5
203
5 Inside Your 64
PRLOOP
INY 7;GET NEXT LETTER...
LDA KEYTXT,Y ;IN KEYWORD
BMI PRINT2 7END OF KEYWORD?
JSR OUTDO 7NO, PRINT CHAR...
BNE PRLOOP 7;AND REPEAT
PRINT1
JMP PLOOP ;PRINT ONE CHARACTER
PRINT2
JMP PRIT4 ;PRINT LAST CHARACTER
OLDPR
JMP QPLOP ;USE OLD ROUTINE
°
4
EXEST
JSR CHRGET ;GET NEXT CHARACTER
CMP #NEWTOK ;IS IT A NEW TOKEN?
BCC OLDEXE ;NO, USE OLD ROUTINE
JSR EXE1 ; EXECUTE STATEMENT
JMP NEWSTT ;AND START OVER
204
Inside Your 64 5
OLDEXE
JSR CHRGOT ;GET CHARACTER AGAIN
JMP GONE+3 ;AND USE OLD ROUTINE
EXEFUN
LDA #$86
STA VALTYP ;SET TO NON-STRING
JSR CHRGET ;GET EVAL. CHAR.
CMP #SFF ;IS IT PI?
BEQ OLDFUN ;YES, DO OLD EVAL.
CMP #FUNTOK ;IS IT A NEW FN?
BCC OLDFUN ;NO, DO OLD EVAL.
;GET TOKEN #
SEC
SBC #FUNTOK
ASL A ;USE AS INDEX
PHA ;SAVE ON STACK
JSR CHRGET ;GET EVAL. CHAR.
JSR PARCHK ;GET EXPRESSION IN ()
PLA ;GET INDEX BACK
TAY
LDA FUNVEC,Y
STA JMPER+1
LDA FUNVEC+1
STA JMPER+2 ;FORM POINTER
JSR JMPER ;EVALUATE FN
JMP CHKNUM ;CHECK VAR. TYPE & RTS
OLDFUN
JSR CHRGOT
JMP EVAL+7 ;OLD ROUTINE
205
5 Inside Your 64
LOOK ;
LDA LINNUM+1
PHA
LDA LINNUM
PHA ;SAVE LINNUM ON STACK
JSR GETADR ;INTEGER IN 14/15=ARG
LDY #$006 ;SET INDEX
LDA (LINNUM),Y ;GET LOW BYTE
STA FACHO+1
INY
LDA (LINNUM),Y ;GET HIGH BYTE
STA FACHO
PLA
STA LINNUM
PLA
STA LINNUM+1 ;RESTORE LINNUM
LDX #$99 ;SET EXPONENT
SEC
JSR FLOATC ;CONVERT INT TO FP
RTS
°
v
KILL
LDX #$87 ;NUMBER OF VECTORS
KILL1
LDA VECSAV,X ;GET SAVED VECTORS
STA ICRNCH,X ;RESTORE THEM
DEX
BPL KILL1 ; DONE?
RTS
°
’
FILL
JSR GETNUM ;GET ADDR, INT IN X
LDA LINNUM+1 ;CHAR >255?
BNE CHRERR ;YES, ERROR
STA FACHO ;CLEAR POINTER
CPX #MAXCOL+1 COL > U5?
BCS COLERR ;YES, ERROR
TXA ;SAVE COLOR
PHA
LDA LDTB1+23 ;FORM POINTER..
AND #63 DOM TOR ctex.
ORA HIBASE 7;OF SCREEN
STA FACHO+1
LDA LINNUM ;GET FILL CHAR
206
Inside Your 64 5
JSR FILL1
PLA ;GET COLOR
7FILL LOOP
FILL1
LDX #$83 ;DO 3 PAGES
LDY #SE7 ;AND MOST OF 4TH
FILL2
STA (FACHO),Y ;FILL 'ER UP
DEY ;NEXT BYTE
BNE FILL2
STA (FACHO),Y ;DON'T FORGET ZERO
DEC FACHO+1 7;NEXT PAGE
DEX
BPL FILL2 DONE YET?
RTS
°
a
CHRERR
LDA #$0@ ;CHARACTER ERROR NO.
-BYT $2C ;SKIP NEXT INSTRUCTION
COLERR
LDA #$01 ;COLOR ERROR NO.
ASL A ;ERROR NO. * 2
TAX 71S USED AS AN INDEX
LDA ERRVEC,X ;TO VECTOR TABLE
STA INDEX ;SET UP TEXT POINTER
LDA ERRVEC+1,X
STA INDEX+1
JMP ERROR+16 ;PRINT ERROR MSG
ERRVEC
-WORD ERMSG@
eWORD ERMSG1
ERMSG@
-BYT 'NOT A VALID CHARACTE',S$D2
ERMSG1
-BYT 'NOT A VALID COLO',$D2
e
,
207
5 Inside Your 64
:;WITH COLOR X
FCOL
JSR FRMNUM ;GET COLOR #
JSR GETADR ;CONVERT FP TO INT
CMP #80 ;COLOR>255?
BNE COLERR ;YES, ERROR
STA FACHO
CPY #MAXCOL+1 7 COLOR>15?
BCS COLERR ;YES, ERROR
TYA ;COLOR TO .A
JMP FCOL1
°
‘
PAUSE
JSR FRMNUM ;GET # OF JIFFIES
JSR GETADR ;CONVERT FP TO INT
TAX ;HIGH BYTE IN .X, LOW IN .Y
PAUSE1
CPY #$0@ ;LOW BYTE DONE?
BEQ PAUSE4 ;YES, TRY HIGH BYTE
PAUSE2
DEY
LDA TIME+2 ;SOFTWARE CLOCK...
PAUSE3
CMP TIME+2 ;ON THE SAME JIFFY?
BEQ PAUSE3 ;YES, TRY AGAIN
BNE PAUSE1 ;NO, ONE JIFFY DOWN
PAUSE4
CPX #$80 =e HIGH BYTE DONE?
BEQ PAUSE5 ;YES, EXIT
DEX 7NO, COUNT DOWN HIGH BYTE
JMP PAUSE2 ;AND DO NEXT LOW BYTE
PAUSE5
RTS
°
‘
- END
Program 1. 64 Keywords
For mistake-proof program entry, be sure to use “Automatic Proofreader,” Appendix J.
1@ B=@:FOR I=49152 TO 49685:READA: POKEIL,A:B=B+A:NE
XT
20 IF B<>64356 THEN PRINT"CHECKSUM ERROR--CHECK YO
UR TYPING":END
208
Inside Your 64 5
209
5 Inside Your 64
210
Inside Your 64 5
211
Piast
Malis
fog hietage
a hee ss
‘bakg” bs
-: » 7
LOfilttetss
Utilities 6
SuperBASIC 64
Martin C. Kees
215
6 Utilities
216
Utilities 6
217
6 Utilities
0 turns the mode off and a value of 1 turns the mode on.
Only multicolor and bitmap work in conjunction with each
other to form a combined mode. When extended color and
bitmap are both on, the screen will appear blank. This effect
might be useful for temporarily hiding the screen.
[MXGR [KMXG [CMXV. These commands set up a sim-
ple interrupt routine that allows mixed modes to appear in
two sections of the screen. [MXGR will change the contents of
one VIC register (reg) or part of the contents (the bits OFF in
mask) each time the raster counter equals one of the two ras-
ter select values (rastl and rast2). The values in vall or val2
will be stored into the selected VIC register. You must deter-
mine the appropriate value for the particular register. For
example, [MXGR 33,240,152,6,252,1 will cause screen lines 49
to 151 to be displayed with background white (color=1) and
lines 152 to 250 with background blue.
The visible portion of the screen extends from raster 49 to
raster 250 (Commodore documentation says 51-251). [KMXG
will kill the interrupt and leave the selected register in an un-
known state. [CMXV (Change Mixed-mode Values) allows
changing vall and val2 while mixed mode is in force. By set-
ting them equal, a known state will be in effect after [KMXG.
You should not attempt tape or disk I/O while [MXGR is in
force. [|MXGR mode shouldn’t be used in bank 3 VIC mapping
if hi-res graphics commands are to be used.
It’s possible to set up a text window at the bottom of a hi-
res screen using [MXGR. The difficulty is that [MXGR only can
change one VIC register. Thus the character base pointer can’t
be changed as well as the bitmap select bit by [MXGR. This
can be solved by locating the character set within the hi-res
screen, and putting a text window over the top of the charac-
ter set.
A six line text window at the bottom of the hi-res screen
can easily be created using this technique. In bank 0, using the
upper 8K hi-res block, you would first use [CB2K 7 to select
both the upper 8K hi-res block and the seventh 2K character
set block. Then clear the hi-res screen with [FBMS 0 and
download a character set to starting location 7*2048. [MXGR
17,223,0,32,201,0 will complete the setup.
[SIZE [XYSC. These commands help use the smooth
scroll registers of the VIC-II chip. [SIZE selects 40 or 38 col-
umns for the text display chosen by setting colsel to 1 or 0
220
Utilities 6
221
6 Utilities
222
Utilities 6
223
6 Utilities
Type 64
Using these two programs, you can turn your 64 into a 64-
column display. No hardware adjustment is necessary; the
programs create a new character set that is smaller than the
one usually seen on the 64. The letters are still easy to read,
and actually look quite nice, especially when you change the
background color so that it contrasts with the new set.
224
Utilities 6
225
6 Utilities
226
Utilities 6
[MCPL x,y,sel
[DRAW x1,y1,x2,y2
[UNDR x1,y1,x2,y2
[FLLN x1,y1,x2,y2
[DRW2 x2,y2
snip xy?
[HRCS address
[CHAR char,x,y
[CHRX char,x,y
[CODE str$
[LOOK address,variable
[STUF address,byte
[HRAM <SuperBASIC mnemonic> <parameter list>
Program 1. SuperBASIC 64
2649 :811,008,008,0090,158,058, 228
2055 2848 ,8956,948,009,900,900,159
2861 : 900,060,000 ,900,899,899,813
2867 2900 ,000,000,0900,900,800,919
2873 2009 ,000,009,009,080,809,9825
2879 :900,169,039,133,901,169,830
2285 :890,133,020,133,878,169,058
2091 :8899,133,021,169,192,133,188
2097 :979,162,012,160,990,177,127
2183 2920,145,078, 200, 208,249,187
2189 2230,021,230,8979, 202,208,007
25 3242,160,988,169,104,9032,914
2020. :830,171,169,013,141,119, 204
2127 :002,141,120,902,169,982,9083
2133 2133,198,169,133,141,001,992
21539 :908,169,020,141,902,908,183
2145 :076,128,088,080,808,009,845
2151 2960 ,031,147,017,017,048,107
2S) :@17,157,982,085,878,819,835
2163 2900 ,9080,0909,89008,800,169,828
2169 :969,133,0929,169,169,133,224
2175 :921,162,032,168,000,177,167
2181 :020,145,8020,136, 208, 249,143
2187 3230,021,202,208,244,162,182
2193 :900,168,003,185,224,169,199
2199 2157,224,160, 232, 200,224,968
2265 2199, 208, 244,169,983,141,888
Zonal :161,168,169,192,141,162,132
PAPI | :168,169,074,141,219,166,973
VAP APNE 2169,193,141,211,166,141,172
2229 :837,168,169,884,141,036,8049
6 Utilities
228
Utilities 6
2529 2145,078,032,828,193,165,998
2535 :928,133,902,160,904,145,183
2541 2878,932,037,193,169,815,249
2547 2141,024,212,996,032,800, 236
2553 2192,165,029,8941,003,179,8072
2559 3189), 188), 192),833),Olio. LOLs
2565 :212,133,879,165,021,133, 236
2571 :902,169,988,168,984,145,235
250i, 2078,%932,037,193,165,082,812
2583 :168,984,145,978,996,169,163
2589 :800,168,004,145,878,976, 236
2595 :800,192,8032,8900,192,165,164
2681 :@21,169,001,145,078,165,999
2607 38@20,136,145,978,165,9092,981
2613 :201,965, 208,816,932, 090, 863
2619 :192,165,621,041,015,160,141
2625 :903,145,978,165,929,136,1980
2631 2145,878,996,173,141,992,194
2637 :208,251,8976,044,168,976,132
2643 2929,168, 248,251 ,932,003,938
2649 2192,032,019,166,056,165, 207
2655 2995,233,801,164,996,176,892
2661 :901,136,133,965,132,966,122
2667 :996,032,008,192,160,808,975
2673 :177,028,133,002,032,115,880
2679 :890,032,048,175,164,902, 820
2685 :169,960,932,145,179,166,048
2691 :@71,164,072,932,215,187,194
2697 :896,032,000,192,165,820,139
2763 2133,078,165,921,133,979, 2408
2789 :832,000,192,165,928,160, 296
275ES :980,145,978,996,173,014,149
2724 2220,041,254,141,014, 220,027
2727 2165,901,941,253,133,881,249
2733 :169,193,972,169,184,972,988
2739 2:0@32,115,8000,8976,809,195,985
2745 2:165,001,909,902,133,801, 240
275 2173,814,220,009,9001,141,237
20D, 2@14,228,8996,165,181,133,158
2763 :254,194,133,802,198,254,124
2769 2208,005,165,002,976, 239,136
2075 :167,032,8909,192,032,121,247
2781 2960, 201,944, 248, 237,996,815
2787 :032,121,808,201,137,208,158
2793 2:083,076,055,169, 201,141,119
2/99 2249, 249,076,8050,169,932,831
2865 2115,000,076,245,196,849,158
2811 :0@00,060,129,800,900,077,201
2817 :879,8086,969,993,192,868,976
229
6 Utilities
2823 :983,988,882,1801,196,083,120
2829 :083,8978,068,191,192,889,193
2835 2076,965,889, 246,192,966, 241
2841 :875,071,968,956,195,969,847
2847 2988 ,984,967,965,195,975,993
2853 :983,988,082,974,195,869,198
2859 2983 ,088,982,984,195,966,121
2865 :083,088,880,992,195,983,158
2871 :984,985,070,137,193,969,181
2877 :967,071,082,125,195,8077,166
2883 :967,971,082,159,195,866,186
2889 :977,871,8082,175,195,083, 244
2895 :973,098,869,187,195,988,813
2981 :@89,083,867,211,195,967,929
29087 265,984,965, 258,195,066, 048
2913 :965,978,975,053,196,986,138
2919 2983 ,049,975,113,196,967,174
2925 :866,959,875,151,196,968, 283
2931 :976,067,983,172,196,977,818
2937 :888,071,882,965,197,975,187
2943 :077,9088,071,180,197,967,939
2949 :877,988,986, 208,197,879, 083
2955 :867,979,876,217,197,888,987
2961 :976,079,984,130,198,979,014
2967 :076,073,080,122,198,967,255
2973 :076,088,888,138,198,977,046
2979 :967,088,876,148,198,979,934
2985 :083,967,082,197,198,979, 898
2991 266,977,083, 232,198,968,131
2997 :@82,965,887,023,203,072,201
3903 :082,967,983,968,201,8967,235
3989 :872,965,082,134, 202,967,047
3015 :972,082,088,142, 292,967,884
3021 :079,068,869,159, 202,976,681
3027 2079,079,875,197,193,866,042
3833 :875,071,052,195,195,8072,919
3039 2982,965,077,158,193,879,180
3045 :976,076,078,029, 203,985,255
3051 :978,068,982,047, 283,868,813
3057 :982,987,950,078, 203,083,848
3963 2969,084,980,187,203,255,821
3269 2255,255,255,162,9890,134,934
3075 :992,160,9000,177,122,221,173
3681 :0@09,194, 298,626, 232,298,101
3987 3192,004,208,243,189,001,9884
3893 :194,972,189,900,194,072,230
3099 :165,122,024,195,993,133,967
3185 2122,144,902, 230,123,996, 238
3111 2165,902,024,105,8996,133,218
230
Utilities 6
:221,104,024,106,196,196, 238
2133,928,173,136,902,041,082
:963,005, 020,141,136, 002, 206
:096,173,136,902,924,185,125
:093,141,022,192,876,818, 939
:192,032,000,192,165,828, 202
:041,863,919,010,133,928,140
:173,136,002,041,192,005,162
:920,141,136,902,165,028,193
:018,819,133,020,173,924,251
:208,941,015,985,928,141,961
2024, 208,096,173,824, 208,114
:941,241,133,882,932,900,092
:192,165,829,041,007,019,084
2985 , 802,141,824, 208,096,131
:173,814, 226,041, 254,141,248
:014,220,165,901,941,251,183
:133,0881,032,800,192,165,196
:020,0841,003,162,808, 201,114
: 002, 288,002,162,816,168, 235
:208, 201,001, 208,002,160,215
:216,132,079,160,800,132,1608
:978,134,002,932,000,192,141
:166, 882,168, 800,177,078,036
:145,020, 200,208, 249, 230,255
2021, 238,879, 202, 208, 242,191
:165,981,009, 004,133,001, 040
2173,814, 220, 809,081,141,935
2014, 228,096,920, 998,154,223
: 000, 826, 252,009,906, 089,009
2033, 240,234, 234,173,006,159
:197,873,983,141,996,197,118
:178,189,258,193,141,964, 902
:197,172,087,197,185, 009,015
2298, 045 ,008,197,829,002, 008
:197,153,809,208,173,917,817
:208,041,127,829,901,197,134
:141,817, 208,189, 888,197,833
:141,818,208,169,001,141,221
2025, 208,076,129, 234,128,085
:169,000,141,814, 220,032,131
:200,192,165,920,141, 007,986
:197,032,000,192,165,820,173
:141,008,197,932,0828,192,143
:165,920,141,903,197,165,914
:021,841,001,248,002,169,959
:128,141,004,197,032,000,993
:192,165,020,141,902,197,0858
:032,908,192,165,828,141,153
Utilities 6
3785 :900,197,165,921,941,901,934
sigue :240,002,169,128,141,981,840
3717 :197,032,000,192,165,026, 227
3723 2141,905,197,173,017,208,112
B29 :941,127,8013,004,197,141,156
3735 2917,208,173,903,197,141,122
3741 :@18,208,169,903,141,906,199
3747 2197,169,241,141,926,298,121
17/58) :169,811,141,929,993,169,170
S/S) :197,141,921,0803,088,896, 209
3765 :120,169,949,141,929,003,171
3771 2169, 234,141,921,003,169,156
S714 2249,141,926, 288,988,976, 284
3783 :244,193,032,900,192,165,901
3789 2920,141,002,197,032,0800,085
3795 2192,165,920,141,905,197,163
3861 2996,832,9060,192,165,029, 219
3807 2941,015,162,098,157,988, 886
3813 :216,157,908,217,157,8608, 208
3819 :218,157,008,219,232,208,245
3825 ?241,141,134,002,996,932,119
3837 2900,192,165,820,041,907,160
3837 :133,902,165,8020,041, 248,094
3843 TUBS 291 PLOS JO2 pls, 22 plow:
3849 2032,008,192,165,8929,133,939
3855 :078,8041,248,133,9290,133,156
3861 3253,169,009,133,254,024,986
3867 2906, 253,038,254, 996,253,869
3873 2838,254,165,020,101, 253,996
3879 2133,253,144,002, 239,254,031
3885 2024,6006, 253,038, 254,906,114
3891 2253,938,254,996, 253,938,125
3897 :254,165,078,041,9087,905,995
3983 3253,133, 253,924,165, 251,118
3989 2101,253,133, 251,165,252, 200
S915 2191,254,133,/252,173;,136,7100
so20 :@62,041,192,0805,252,133,194
S227 2252,173,024,208,941,988,925
3933 219,019,005, 252,133, 252,243
3939 :166,902,189,107,198,168,153
3945 :909,096,128,964,932,816,185
3951 :908,964,002,901,192,948,118
3957 :@12,003,000,885,179, 255,130
3963 2032,246,197,981,251,145,9851
3969 2251,096,032, 246,197,817, 22808
3975 2251,145,251,996,932, 246,132
3981 2197,973,255,8049,251,145,887
3987 2251,896,032,000,192,165,115
3993 2920,941,093,024,185,068,998
233
6 Utilities
2133,962,906,028,838,921,123
2@32,255,197,133,982,032,9848
:980,192,165,020,041,803,980
:170,189,119,198,837,902,124
2133,820,165,062,073,255,963
:160,0909,949,251,005,920,162
2145, 251,096,932,900,192,143
:173,136,002,133,252,169,942
:900,133,251,168,162,983,156
2165,029,145,251, 299,288,178
2251,238,252,202, 208,246,972
2145, 251,209,192, 232,288,173
2249,096,8932,9809,192,173,295
2136,002,041,192,133,252,225
2173,024,208,841,888,918,195
2910,005, 252,133, 252,169,046
:900,133,251,162,932,168,225
:609,165,09208,145, 251,209,918
2208, 251,238,252, 282,208,982
2246,096,032,121,909, 208, 298
:901,096,1904,104,976,978,218
:192,169,000,141,176,902,197
2141,178,002,141,179,002,166
2173,167,902,9013,168,962,854
2298,982,056,996,162,024,083
2846,176,002,946,177,902, 246
2946,178,902,946,179,962,989
:056,173,178,982,237,167,118
:902,168,173,179,982,237,864
3168,902,144,9086,140,178, 2983
2002,141,179,802,202, 208,949
2219,8946,176,002,046,177,243
2962 ,024,8996,832,900,192,185
2165,920,141,193,002,165,9819
2921,141,194,902,932,000,241
:192,165,020,141,197,902,962
:932,900,192,165,020,141,157
:195,002,165,021,141,196,077
2902 ,032,000,192,165,928,939
2141,198,802,169,900,141,020
:202,002,956,173,198,8082, 9088
:237,197,082,141,199,902,159
:176,014,169,255,141, 202,888
:082,077,199,002,141,199,813
2082, 238,199,802,169,908,909
2141, 203,002,056,173,195,175
3082, 237,193,062,141,208,186
2962,173,196,082, 237,194,221
28@02,141,201,962,176,927,228
Utilities 6
2169,255,141, 203,982,077,820
:200,002,141,200,002,169,149
2255,077, 201,082,141, 201,962
:802,238,28080,8002,2808,0083,190
:238,281,002,169,900,141, 204
2204,982,173,199,882,205, 244
:200,002,169,8000, 237,201,818
:@82,176,076,173,199,002,999
:208,005,141, 205,002, 248,022
2:105,141,177,902,173,200,025
3:0@02,141,167,062,173,201,175
:902,141,168,002,169, 255,232
2141,205,002,032,038,199,119
:144,983,9076,058,201,173,162
3176,002,013,177,9802, 208,991
3@20,169,255,141,176,002,626
:141,177,002,169,866,141,155
:298,9862,169,025,141,289,829
:862,2808,049,169,909,141,196
:208,962,141,209,902,240,989
:839,169,255,141, 204,902,193
2173, 200,002,8024,189, 281,008
:962,248,171,173,199,982,092
2141,167,902,169,900,141,187
:168,092,173,209,962,141,9983
:177,962,169,255,141,205,016
:0@02,876,816, 200,238, 208,9061
:062,238,199,002,173,193,142
:8@82,041,007,133,962,173,211
2193,002,041,248,133,251,215
2173,194,002,133,252,173,924
:197,002,032,014,198,017,875
2251,145,251,173,284,0802,135
:208,895,173,283,0982,248,036
:816,056,173,193,982,233,958
:901,141,193,982,176,913,165
:206,194,002,144,908, 238,181
2193,882,208,083,238,194, 233
:862,056,173,200,062,233,067
2901,141,200,002,176,9003,186
2206, 201,0902,024,173, 280,219
2902,189,281,802, 248,128,993
2173,205,002,248,165,024,234
2173,176,802,1809, 208,902,181
:141,208,082,173,177,002,140
2199,299,062,141,209,902,115
7144,144,173, 202,902,248, 998
20906, 286,197,902,076,197,949
:200,238,197,082,876,197,825
235
6 Utilities
2200,173,2802,002,240,8096,934
:206,197,8002,076, 259,208,148
3238,197,082,206,199,802,867
2249,958,173,205,082, 246,147
2940,024,173,176,002,199,015
:208,002,141,208,982,173,231
:177,982,199,209,8902,141,143
2289,002,144,019,173,283,083
3@02,246,817,956,173,193,196
:@02,233,001,141,193,982,093
:176,903,206,194,002,076,184
:107,209, 238,193,902, 208,225
2248, 238,194,802, 208, 243,160
:896,198,122,8096,932,889,9089
2192,165,920,141,975,201,989
2165,021,141,976, 201,996,001
:143,183,000,169,000,141,199
:193,062,141,196,9092,932,135
:900,192,165,920,141,197,034
3002,0932,000,192,169,956,932
:197,020,169,001,229,821,224
2176,905,169,255,141,193,820
2002,165,8920,041,007,133,223
:962,165,0920,941, 248,133,214
2251,165,921,133, 252,932,209
:808,192,169,192,197,829,131
2176,965,169,255,141,196,953
:@62,165,820,041,007,141,905
2194,002,141,195,982,165,978
:820,032,014,198,165, 251,965
2941, 248,133,251,173,197,178
:002,133,920,169,000,133,1190
2021 ,086,620,938,821,906,027
2620,038,021,086,09209,938,064
2921,924,173,975,201,191,010
:@20,133,020,165,021,109,145
2976, 201,133,021,024,165,947
2251,105,008,141,177,902,117
2165,252,195,000,141,178,024
:@02,165,021,041, 208,201,083
:208,288,007,128,165,981,169
2841,251,133,801,169,009,052
:141,176,992,166,902, 240,199
:005,056,106, 202, 208,251,041
2141,179,062,172,176,902,147
:177,920,166,002, 240,004,990
2074, 202,288,252,932,077,9876
2202, 208, 238,944,193,8902,124
2948,956,856,169,908, 229,965
Utilities 6
237
6 Utilities
5175 :914,141,130,200,169,198,139
5181 :141,131,200,996,032,014,163
5187 :198,973,255,996,173,195,933
5193 :002,141,193,0902,173,196,812
5199 :902,141,194,992,173,198,9821
5285 :902,141,197,002,173,132,229
5211 :200,291,949,208,999,932,922
5217 :@37,203,032,119,199,076,251
5223 :054,203,076,119,199,832,818
5229 :008,192,165,9298,141,195,954
5235 :002,165,9021,041,901,141,230
5241 :196,902,032,009,192,165,196
5247 :820,141,198,002,8996,989,8072
5253 :163,929,019,909,153,034,001
5259 :154,147,983,985,880,069,245
5265 :982,966,865,083,973,967,969
5271 :8@32,986,951,932,848,9849,193
5277 :849,948,856,052,034,000,140
5283 :187,820,015,8000,153,034,968
5289 :866,089,032,977,965,882,068
5295 :984,973,878,8932,967,932,829
5381 :075,969,869,983,034,089,255
5307 2:208,920,020,8009,153,034,119
5313 :891,967,965,984,965,934,087
5319 :858,144,967,865,984,065,179
5325 :8@58,162,0909,008,909,013,182
Program
2. Moiré Pattern
For mistake-proof program entry, be sure to use “Automatic Proofreader,” Appendix J.
1 REM MOIRE TITLE PAGE DEMO :rem 85
5 [EXTc@ srem 244
19 [CB2K4:[BMGR1:[FBMS9 :[FSCRI1 srem 193
15 FORJ=@ TO318 STEP2 :rem 177
26 [DRAWJ,198,168,190 :NEXT srem 252
22 FORJ=@ TO318 STEP2 srem 175
23 [DRAWJ,%,160,100 :NEXT zrem 141
24 FORJ=@ TO198 STEP2 :rem 183
25 [DRAW160,190,318,J{3 SPACES}:NEXT srem 251
26 FORJ=@ TO198 STEP2 :rem 185
27 [DRAW161,190,9,3{3 SPACES}:NEXT zrem 146
29 [EXTC4 srem 46
30 MS="SUPERBASIC": [HRCS53248:MS=MS+"" srem 217
48 X=120:Y=80: GOSUB5@ srem 227
45 MS="{RVS}BY MCSOFT":MS=MS+"":X=124:Y=12@:GOSUB5
4) srem 132
47 [CHRX54,152,89:[CHRX52,169,89 srem 86
48 FORJ=1TO8@@:NEXT zrem 191
49 [FSCR16:{5 SPACES}GOTO10@ srem 97
Utilities6
Program 3. Stars
1 REM STAR DEMO srem 116
10 PI=2*T srem 146
28 INPUT" {CLR}STAR POINTS WANTED (@ TO END)";PW
srem 128
21 IFPW=9THENEND srem 12
22 INPUT"SKIP TRY VALUE CLOSE TO HALF # POINTS)";S
K srem 33
INPUT"RADIUS <198 "sR :rem 91
P=P1/PW srem 95
[BMGR1:[CB2K4:[FBMS#:[FSCR1 srem 197
X=169:Y=109-R:TL=0 s:rem 185
FORJ=1TOPW srem 89
TH=TL+SK s:rem 179
TL=TH : TH=TH*P-(PI/4) :rem 133
X2=COS (TH) *R+160 srem 194
Y2=SIN(TH) *R+1909 srem 105
[DRAWX,Y,X2,Y2 srem 192
X=INT (X2) :Y=INT(Y2):NEXT srem 255
GETAS : IFAS=""THEN14@ :rem 77
15 [BMGR@ : [CB2K2: PRINT" {CLR}":GOTO29 :rem 133
Program 4. Circles
5 REM CIRCLE DEMO srem 244
19 INPUT"CENTER X,Y";A,B srem 189
20 INPUT"RADIUS";R srem 139
49 CFSCR1:[CB2K4:[BMGR1:[FBMS@ z:rem 196
52 PH=9 :Y1=0:X1=R srem 237
68 PY=PH+Y1+Y1+1 srem 170
70 PX=PY-X1-X1+1 s:rem 189
8 [PLOT A+X1,B+Y1 srem 26
96 [PLOT A-X1,B+Y1l :rem 29
188 [ PLOTA+X1 , B-Y1 s:rem 69
1198 [PLOTA-X1,B-Y1l srem 72
129 { PLOTA+Y1,B+X1 srem 69
1398 [ PLOTA-Y1,B+X1l srem 72
148 [ PLOTA+Y1,B-X1 :rem 73
158 [ PLOTA-Y1,B-X1 s:rem 76
169 PH=PY:Y1=Y1+1 srem 252
179 IFABS ( PX) <ABS ( PY ) THENPH=PX :X1=X1-1 :rem 149
239
6 Utilities
240
Utilities 6
241
6Utilities
Program 8. Type 64
2 IFA=@THENA=1:LOAD"64SET",8,1 srem 2
3 PRINT" {CLR}USE Fl TO END PROGRAM":PRINT"HIT ANY
{SPACE}KEY TO BEGIN" :rem 86
4 GETAS: IFAS=""THEN4 srem 139
5 POKE56,128:POKE55,8:CLR srem 224
1@ [BMGR1:[CB2K4:[FBMS@:[FSCR1 srem 193
20 [HRCS32768 srem 247
25 X=0:Y=@0:W=5:RV=0 srem 126
38 BL=9 srem 94
35 FORJ=1T030:GETKS : IFKS=""THENNEXT srem 189
49 IFJ=31ANDBL=@THEN[ CHRX169,X,Y:BL=1:GOTO35
srem 28
42 IFJ=31THEN[CHRX16@,X,Y:GOTO3@ srem 21
44 J=31:NEXT: IFBL=1THENBL=@ : [CHRX160,X,Y s:rem 37
50 IFKS="{CLR}"THEN[ FBMS8:GOTO25 srem 51
55 IFKS=CHRS(13)THENX=0: Y=Y+8:GOTO14@ srem 227
60 IFKS="{HOME}"THEN25 srem 142
65 IFKS="{RVS}"THENRV=128:GOTO3@ srem 129
66 IFKS="{OFF}"THENRV=9 : GOTO32 srem 151
78 IFKS=" { DOWN} "THENY=Y+8 : Y=-Y* (Y<193)
:J=31:GOTO49
srem 119
88 IFKS="{ UP} "THENY=Y-8 : Y=-Y* (Y>=@) :J=31:GOTO4@
srem 204
96 IFKS="{ RIGHT } "THENX=X+W: X=-X* (X<316) sJ=31:GOTO4
4) srem 156
106 IFKS="{ LEFT } "THENX=X-W: X=-X* (X>=0) :J=31: GOTO4
4) srem 27
195 IFKS="{F1}"THEN280 srem 91
106 IFKS=" "THEN[CHAR32+RV,X,Y:GOTO120 srem 5
11@ [CODEKS$ :CR=ASC(K$):[CHRX CR+RV,X,Y :rem 85
120 X=X+W: X=-xX* (X>=@ANDX< 316) : I1FX=OTHENY=Y+8
srem 228
148 Y=-Y*(Y<193) :rem 94
158 GOTO39 srem 5@
208 [BMGR®@:[CB2K2:PRINT"{CLR}" srem 172
Program 9. 64Set
32768 :000,224,176,916,208, 298,964
327 74 2112,0908,096,249,144, 249,079
32788 :144,144,144,000, 224,144,944
327, 86 :144,224,144,144, 224,800,130
327 92 :996,144,128,128,128,144,924
3277 98 :896,000,192,160,144,144,254
328 O04 :144,160,192,900, 240,128,132
328 16 :128,224,128,128, 240,900,122
328 16 :248,128,128,224,128,128,908
328 22 :128,000,096,144,128,176,214
242
Utilities 6
243
6 Utilities
244
Utilities 6
33416 2:896,144,144,144,144,096,136
33422 :848,008,224,144,144, 224,158
33428 :144,144,144,900,096,144,952
33434 :128,996,816,144,8696,900,122
33440 :240,064,964,964,064, 964, 298
33446 :964,000,144,144,144,144,838
33452 2144,144,8096,900,144,144,076
33458 2:144,144,144,996,996, 809,834
33464 :144,144,144,144, 240, 240,216
334708 :144,0900,144,144,896,896, 946
33476 :240,144,144,000,144,144, 244
33482 2144, 248,096,896,996, 008,186
33488 2249,016,932,964,128,128,948
33494 2249,008,192,128,128,128, 086
335986 :128,128,192, 990,224,112, 236
33586 2964, 248,964,112, 224,909,162
33512 :948,016,916,916,016,916,1904
33518 2948,009, 000,896,096, 248, 286
33524 :996,996,996,996,016,832,164
33530 2964, 249,964,032,816,900,154
33536 2900, 000,900,000, 000, G00, BOO
33542 :989,008,032,032,8032,832,134
33548 :932,000,932,900,000,144, 220
33554 2144,900,000,090,000,000,162
33568 :112,096,996, 248,996,896, 248
33566 2224,008,8032,096,144,192, 206
33572 2948,144,996,032,128,144,116
33578 2:032,0964,144,816,000, 080,942
33584 :224,160,192,160,144,144,948
33596 :112,908,996,192,128,0890,976
33596 :800,8900,0900,000,996,192,892
33662 :128,128,128,192,996,909, 226
33668 :192,096,048,948, 848,996,888
33614 :192,009,000,144,996, 248, 238
33628 :996,144,008,800,800,964,132
33626 2964,224,964,864, 808,009, 250
33632 2900 ,900,9000,900,000,896,192
33638 :896,192,8980,8000, 009,249,118
33644 2900 ,900, 000, 900,800, 900,108
33650 2080 ,000,000,896,996, 900,858
33656 2900, 960,0908,816,032,964, 248
33662 :128,008,8096,144,176,144, 046
33668 :208,144,996,900,096,932,196
33674 :032,032,032,032,112,9800,122
33689 :9@96,144,916,932,064,128,112
33686 2248, 009,096,144, 816,096, 239
33692 :916,144,996,000,932,168,992
33698 :169,168, 240,032,032,9009,8018
33764 2249,128,128,224,916,144,924
245
6 Utilities
246
Utilities 6
34904 :120,120,008,248,956,120,116
34919 2120,120,120,120,056, 248, 234
34816 :024,136,184,008,184,136,128
34822 2024,248, 200, 232, 232,232,118
34928 :232,232, 200,248, 248,152,012
34634 2152,008,152,152,152,152,242
34040 :232,216,184,908,184, 216,988
34946 2232, 248, 248, 248, 248, 248,190
34652 2248, 248, 248, 248, 216,216,148
34658 2216, 216,216, 248, 216, 248, 690
34964 2248,104,164, 248, 248, 248,192
34076 2248, 248,136,152,152,888,198
34076 2152,152,024, 248, 216,152,204
34882 :104,056,200,184,152,216,998
34088 :120,104, 216,184,104, 232,232
34994 2248, 248,024,888, 056,988, 939
341908 :104,104,136,248,152,056,984
34166 2129, 248, 248, 248, 248, 248,138
34112 2152,056,120,120,128,956,176
34118 2152,248,056,152, 208,290,954
34124 :200,152,956, 248, 248,194, G69
34130 2152,008,152,104, 248,248, 226
34136 :248,184,184,924,184,184,072
34142 2248, 248, 248, 248, 248, 248, 046
34148 :248,152,152,956, 248, 248,186
34154 248,008,248, 248, 248, 248,974
34169 2248, 248, 248, 248, 248,152,224
34166 2152,248, 248, 248, 248, 232,214
34172 2216,184,128, 248,152,104,124
34178 :072,1804,048,104,152, 248,882
34184 2152,216, 216,216, 216, 216,888
34190 2136, 248,152,104, 232,216, 206
34196 2184,120,008,248,152,104,196
34262 :232,152,232,194,152,248, 258
34268 :216,088,988,988,988, 216,896
34214 2216, 248,908,120,129,024,134
342208 2232,104,152,248,152,120,156
34226 :120,024,104,104,152,248,162
34232 2008, 232,232,216, 216,216,824
34238 :216,248,152,194,104,152,142
34244 3104,184,152,248,152,104,936
34258 2104,136,232,232,152,248,826
34256 2248, 248,152,248, 248,152,224
34262 2248, 248,248, 248,152,248,878
34268 2248,152,152,056,232,216, 252
34274 :184,120,184, 216, 232,248,130
34289 2248, 248,908, 248,998, 248, 216
34286 2248, 248,120,184, 216,232, 286
34292 :216,184,128,248,152,194,244
247
6 Utilities
248
Utilities 6
249
6 Utilities
Copyfile
Gregor Larson
250
Utilities 6
MLX, RUN it. It will ask you for the beginning and ending
addresses of Copyfile. They are:
Beginning address: 2049
Ending address: 2300
You can then begin to type in the numbers you see in the
Copyfile listing at the end of this article. Once you’ve finished,
SAVE it to disk or tape using the MLX program. Now you're
ready to make copies of any file.
To use Copyfile, simply LOAD it and type RUN. With the
proper disk in the drive, enter the name of the file to be
copied. The filename should be in the form:
filename for PRG (program) file
filename, S for SEQ (sequential) file
filename, U for USR (user) file
You don’t need to place the filename within quotation marks,
as when you load a BASIC program. If you don’t specify the
type of file using a comma and appropriate letter, Copyfile by
default will create it as a program file.
If there is any kind of error in reading the file into mem-
ory, an error message will display and the program will stop.
If there is no error, the file will read into the computer. When
the drive stops, remove the source disk and place the destina-
tion disk into the drive. Press the C key. The file then writes
to the destination disk, using the original name of the file. An
error at this point will show on the screen, and the program
will wait for another press of the C key to try to read the file
again, or a press of the RUN/STOP key to quit the program.
If all’s gone well, you’ve now got a copy of your original,
ready to use.
You can even make multiple copies of the same program
to different disks, simply by pressing the C key again (once
another destination disk has been placed in the drive). Using
this function, you can make as many copies of a file as you
want. Pressing the RUN/STOP key at any time stops the pro-
cess and lets you begin copying another file. Just type RUN,
and you're ready to start again.
Copyfile
2849 :829,0908,919,900,158,958, 990
2055 :948,055,957,8058,949,867,976
2061 :941,8032,949,957,956,951,643
251
6 Utilities
2067 :832,967,879,077,889,985,183
2873 2984 ,969,933,00809,900,000,211
2879 2169,954,133,001,160,009,836
2085 2@32,207,255,281,013,2408, 217
2991 :@66,153,880,902, 200, 208,190
2097 2243,132,963,832,210,255, 216
2193 2160,002,632,179,908,032,212
2109 :207,908, 208,965,162,962,201
2115 2032,198,255,169,909,032, 232
2021 2183,255,941,964, 298,912,068
2127 :932,228, 255,145,251, 208,166
2133 2208,902,238,252,208, 237,198
2139 :132,961,165,252,133,062,128
2145 :164,963,169,944,153,800,178
2151 2862, 208,169,087,153,088, 282
2157 2802,2980,132,063,032, 207,233
2163 :908,032,249,008,032,228,151
2169 2255,2801,967,240,014, 201,875
2175 2893, 208, 245,832,249,088,995
2181 :169,955,133,901,1898,902,989
2187 :160,168,001,032,179,9008,167
2193 2932,287,8008, 208, 219,162,213
2199 :082,032, 201, 255,160,000, 633
2205 2177, 251,932,218, 255, 200,982
2211 2208,902, 238, 252,196, 961,988
2247 3208, 242,165,962,197,252,815
2223 2208, 236, 249,199,169, 002,196
2229 2162,988,032,186, 255,165,221
2235 :963,162,000,169,002,032,994
2241 2189, 255,932,192, 255,169,985
2247 2249,133,251,169,908,133,118
2253 3252,096,169,908,932,188,174
2259 :255,169,111,032,158, 255,159
2265 :@32,165,255,201,048, 240,134
2271 2815, 298,903,032,165, 255,133
2277 2972,032,219,255,104, 201,079
2283 3013, 208, 244,168,996,169,109
2289 :902,032,195,255,932,231,220
2295 :255,996,013,013,913,013,138
252
Utilities 6
Merging Programs
on the 64
John A. Winnie
253
6 Utilities
254
Utilities 6
255
6 Utilities
64 Program
Lifesaver
‘““UNNEW’”’ Rescues Lost
Programs
Vern Buis
60 CLR:SAVE’UNNEW”,1,1
After typing the listing, do not RUN it. Instead, save it on
disk or tape with a filename such as ‘“LIFESAVER/BASIC” or
“UNNEW/BASIC”. Do not use the filename ‘““UNNEW”. This
filename must be reserved.
Now enter RUN. The BASIC loader creates the machine
language program and automatically saves it on disk or tape
under the filename “UNNEW”. This is what you'll actually
use to rescue lost programs; the BASIC loader can be set aside
as a backup in case you need to create another copy.
Using the Lifesaver
OK, let’s say you've just typed NEW and wiped out hours of
valuable labor. (To test the Lifesaver, you can load a BASIC
program and erase it with NEW.) Recovering it is easy.
To load the Lifesaver from tape, enter:
LOAD” UNNEW”,1,1
To load the Lifesaver from disk, enter:
LOAD’ UNNEW”,8,1
Either way, it loads pretty fast, because the program is
short. Now, to activate the Lifesaver, enter:
SYS 525 [RETURN]
CLR [RETURN]
(Incidentally, CLR means to type the keyword CLR, not to
press the CLR/HOME key.)
That’s all there is to it. When you enter LIST, the BASIC
program you thought was forever lost is back, safe and sound.
The Lifesaver itself also remains in memory, but probably
not for long. It’s tucked away in memory which is unprotected
(locations used by the input buffer and BASIC interpreter), so
you'll have to load it again each time you want to use it. But
unless you're either very unlucky or (shall we say) prone to
inadvertent actions, the Lifesaver isn’t something you should
be needing often.
Why It Works
Instead of erasing the program in memory when you type
NEW, the 64 simply resets two key pointers in such a way
that the operating system doesn’t “see’’ that the program is
still there. These pointers keep track of where in memory a
257
6 Utilities
258
Appendices
Appendix A
A Beginner’s Guide to
Typing in Programs
What Is a Program?
A computer cannot perform any task by itself. Like a car with-
out gas, a computer has potential, but without a program, it
isn’t going anywhere. Most of the programs published in this
book are written in a computer language called BASIC. BASIC
is easy to learn and is built into all Commodore 64s.
BASIC Programs
Computers can be picky. Unlike the English language, which
is full of ambiguities, BASIC usually has only one right way of
stating something. Every letter, character, or number is signifi-
cant. A common mistake is substituting a letter such as O for
the numeral 0, a lowercase | for the numeral 1, or an upper-
case B for the numeral 8. Also, you must enter all punctuation
such as colons and commas just as they appear in the book.
Spacing can be important. To be safe, type in the listings
exactly as they appear.
Braces and Special Characters
The exception to this typing rule is when you see the braces,
such as {DOWN}. Anything within a set of braces is a special
character or characters that cannot easily be listed on a printer.
When you come across such a special statement, refer to
Appendix B, ‘“How to Type In Programs.”
About DATA Statements
Some programs contain a section or sections of DATA state-
ments. These lines provide information needed by the pro-
gram. Some DATA statements contain actual programs (called
machine language); others contain graphics codes. These lines
are especially sensitive to errors.
If a single number in any one DATA statement is mistyped,
your machine could lock up, or crash. The keyboard and
STOP key may seem dead, and the screen may go blank.
Don’t panic — no damage is done. To regain control, you
have to turn off your computer, then turn it back on. This will
261
Appendix A
262
Appendix B
263
Appendix B
only editing key that isn’t programmable is the DEL key; you
can still use DEL to back up and edit the line. Once you type
another quote, you are out of quote mode.
You also go into quote mode when you INSerT spaces into a
line. In any case, the easiest way to get out of quote mode is
to just press RETURN. You'll then be out of quote mode and
you can cursor up to the mistyped line and fix it.
Use the following table when entering cursor and color control
keys:
When You When You
Read: Press: See: Read: Press: See:
{CLR} EL £13 COMMODOR
{HOME} ey £23 COMMODOR
Fa
{uP} [sur ] k33 COMMODOR
ei
{DOWN } i £43 COMMODOR
ach
(LEFT} | | £53 COMMODOR ES
{RIGHT} | bed COMMODOR Bi
EIEIEIE
PI a
E73 COMMODOR 7 ait
tas) [om] [> ]
i £83 COMMODOR pile
eae. [> |
oe GC] wy
{PUR}
coma] re]
mR
CTRL aE {F7)}
ts
{BLU}
ve) fo]
264
Appendix C
Column
265
Appendix D
55976 Bai
56016FEEEEEEEEEEE CEES
0 5 10 15 20 25 30 Ls he aS
Column
266
Appendix E
Bit or
Mode* bit-pair Location Color value
Regular text 0 53281 Low nybble
1 Color memory Low nybble
Multicolor 00 53281 Low nybble
text 01 53282 Low nybble
10 53283 Low nybble
11 Color memory Select multicolor
Extended 00 53281 Low nybble
color text t 01 53282 Low nybble
10 53283 Low nybble
1} 53284 Low nybble
Bitmapped 0 Screen memory Low nybble [}]
1 Screen memory High nybble [+]
267
Appendix E
268
Appendix F
ASCII Codes
ASCII CHARACTER ASCII CHARACTER
5 WHITE 50 2
8 DISABLE 51 3
SHIFT COMMODORE 52 4
9 ENABLE 53 5
SHIFT COMMODORE 54 6
2B RETURN 55 7
14 LOWERCASE pews 8
17 ~+CURSOR DOWN 57 9
18 REVERSE VIDEO ON 58
19 HOME - 59
20 DELETE 60 ,
28 RED 61 -
29 CURSOR RIGHT 62 >
30 GREEN 63 ?
31 BLUE 64 @
32 SPACE 65 A
33 66 B
34 : 67 G
35 # 68 D
36 $ 69 E
37 % 70 F
38 & 71 S
39 72 H
40 ( 73 I
41 ) 74 J
42 * 75 K
43 Fe 76 LE
44 77 M
45 = 78 N
O
a NX ee)Oo P
Q
> \o a ee}NO R
269
Appendix F
270
Appendix F
ASCII CHARACTER
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255 ASG
ODO
OSes)
OS
oF
0-4, 6, 7, 10-12, 15, 16, 21-27, 128
130-132, and 143 are not used.
272
Appendix G
Screen Codes
0 @ @ 31 — Ber:
1 A a 32 -space-
Zz B b 3 ! !
8) Cc e 34 s i
4 D d 35 # #
5 E e 36 $ $
6 Is f oY % %
7 G g 38 & &
8 H h 33 f c
9 I i 40 ( (
10 j 41 ) )
i K k 42 : %
12 LE | 43 a +
43 M m Jt ; ;
14 N n 45 - -
15 O oO 46
16 P p 47 / /
17 Q q 48 0 0
18 R r 49 1 if
12 5 S 50 Bs 2
20 a t Si 3 3
21 U u 52 4 4
Pub V Vv 53 ie) 5
23 W Ww 54 6 6
24 X x 55 7 7
25 ¥ y 56 8 8
26 ra Zz oY. 9 9
27 [ 58
28 £ £ 59 : :
29 ] ] 60 < <
30 t t 61 - :
273
Appendix G
274
Appendix H
Commodore 64 Keycodes
e < Keycode A Keycode
+O00nnNa®
mi
CLR/HOME
INST/DEL
=
+>
*®
_
RETURN
SPACE
RUN/STOP
NO KEY
MIND 16 PRESSED
OPRWNPNKXXS<CHHDDAOVOZZOKMA-=LO
The keycode is the number found at location 197 for the current
key being pressed. Try this one-line program:
10 PRINT PEEK (197): GOTO 10
275
Appendix I
than three digits, you can press either the comma, space bar,
or RETURN key to advance to the next number. The
checksum will automatically appear in inverse video; don’t
worry—it’s high lighted for emphasis.
When testing it, I’ve found MLX to be an extremely easy
way to enter long listings. With the audio cues provided, you
don’t even have to look at the screen if you’re a touch-typist.
Done at Last!
When you get through typing, assuming you type your ma-
chine language program all in one session, you can then save
the completed and bug-free program to tape or disk. Follow
the instructions displayed on the screen. If you get any error
messages while saving, you probably have a bad disk, or the
disk was full, or you made a typo when entering the MLX
program. (Sorry, MLX can’t check itself!)
Command Control
What if you don’t want to enter the whole program in one sit-
ting? MLX lets you enter as much as you want, save the com-
pleted portion, and then reload your work from tape or disk
when you want to continue. MLX recognizes these few
commands:
SHIFT-S:Save
SHIFT-L:Load
SHIFT-N:New Address
SHIFT-D:Display
Hold down SHIFT while you press the appropriate key.
You'll jump out of the line you’ve been typing, so I recom-
mend you do it at a prompt. Use the Save command to store
what you've been working on. It will write the tape or disk
file as if you've finished. Note the address you stopped on.
The next time you RUN MLX (don’t forget to first enter the
POKE statement if it’s required), answer all the prompts as
you did before, then insert the disk or tape containing the
stored file. When you get the entry prompt press SHIFT-L to
reload the file into memory. You'll then use the New Address
command (SHIFT-N) to resume typing.
New Address and Display
After you press SHIFT-N, enter the address where you pre-
viously stopped. The prompt will change, and you can then
278
Appendix I
279
Appendix I
280
Appendix I
281
Appendix I
282
Appendix J
283
Appendix J
Hidden Perils
The proofreader’s home in the 64 is not a very safe haven.
Since the cassette buffer is wiped out during tape operations,
you need to disable the Proofreader with RUN/STOP—
RESTORE before you SAVE your program. This applies only
to tape use. Disk users have nothing to worry about.
Not so for 64 owners with tape drives. What if you type
in a program in several sittings? The next day, you come to
your computer, LOAD and RUN the Proofreader, then try to
LOAD the partially completed program so you can add to it.
But since the Proofreader is trying to hide in the cassette
buffer, it is wiped out!
284
Appendix J
Automatic Proofreader
160 PRINT"{CLR}PLEASE WAIT...":FORI=886T01918:READ
A:CK=CK+A: POKEL,A:NEXT
11@ IF CK<>17539 THEN PRINT"{DOWN}YOU MADE AN ERRO
R":PRINT"IN DATA STATEMENTS. ":END
128 SYS886:PRINT"{CLR}{2 DOWN}PROOFREADER ACTIVATE
D.":NEW
886 DATA 173,836,003, 201,158,298
892 DATA @01,996,141,151,903,173
898 DATA 037,993,141,152,903,169
285
Appendix J
286
Index
287
KMXG command (SuperBASIC) 220 SETP command (SuperBASIC) 221-22
KSPR command (SuperBASIC) 218 SID chip 105, 119-20
listing conventions 273-74 patch program for 108, 126
LOOK command (SuperBASIC) 223 “Simple PET Emulator” program
low-pass filter 113 (SuperBASIC) 241
“Machine Language Editor.’” See MLX “Siren’’ program 115-17
“Martian Prisoner’ 60-65 “64 Keywords” program 198-211
MCGR command (SuperBASIC) 219 “64 Mailing List’ 66-71
MCPL command (SuperBASIC) 221 “64 Merger” program 253-55
merging programs 253-55 “64 Program Lifesaver” 256-58
Microsoft BASIC 185, 195-96 “64set’’ program (SuperBASIC) 242-49
“MLX” 276-82 “64 Spreadsheet” 72-83
MOBs. See sprites SIZE command (SuperBASIC) 220-21
modifying BASIC 167-69 skill levels, importance of in games 88
“Moire Pattern” program (SuperBASIC) “Sound Editor 64” program 119-25
238-39 Sound Interface Device. See SID chir
MOVE command (SuperBASIC) 218 source signal 105
MOVE keyword (Sprite BASIC) 167, 168 “SpeedScript’” 3-39
Movable Object Blocks. See sprites command charts 37-39
multicolor mode 157 editing features 7-10
“Munchmath” 96-101 keyboard chart 16
musical instruments program 18-35
table of sound values for 123 “Spike” 41-59
MXGR command (SuperBASIC) 220 spreadsheet analysis, concepts 72-73
NEW command, undoing 256-58 spreadsheet model 73-76
“Note Name Game, The” 132-36 “Sprite Animation” program
NOT operator 181 (SuperBASIC) 241
octave 120 “Sprite BASIC”
OFF keyword (Sprite BASIC) 168 discussion 167-69
OR operator 181 enabling 167
patch 105-9 new keywords 167-68
patch cord 105 program 173-74
pixel 146 sprite creation 170-73
PLAY command (SuperBASIC) 218 bit computation 172-73
PLOT command (SuperBASIC) 221 SPRITE keyword (Sprite BASIC) 167, 168
POKE command sprite pattern block 158
inconvenient in sound programming sprites 155-176
126 custom characters and 170
inconvenient in sprite programming sprite seam 166, 169
166 sprite worksheet 171
pot (potentiometer) 108-9 SSND command (SuperBASIC) 218
digitizing 109-11 “Stars” program (SuperBASIC) 239
pulse width 121 STUF command (SuperBASIC) 223
quote mode 182-83, 263-64 subscript 185, 191
CHR$(34) and 183 “SuperBASIC 64” 156, 215-49
RAM (Random Access Memory) 141, command format 216
142, 144, 145, 147, 166-67, 196 command summary 226-27
release 109, 119-20 syntax errors and 223
ROM (Read Only Memory) 140, 142, “SuperBASIC Sprite Editor” program
144, 145, 147, 166-67, 196 155-65
screen codes sustain 109, 119-20
table 273-74 “SYS Sound” program 126-31
screen color codes 267-68 text adventures 60
screen color memory table 266 text color 157
screen location table 265 “Tie Fighter’ program (Sprite BASIC)
176
288
tokenization 195-96, 196-97 voices, on SID chip 119
tone 120 volume 119-20
two-dimensional arrays 187-91 VS1K command (SuperBASIC) 219
“Type 64” program 224-25, 242 waveform 121
typing in programs 263-64 wedge vector 215
UNDR command (SuperBASIC) 221-22 wedges, limitations of 195
VAL command 181 word processing concepts 3-4
VIC II chip (Video Interface Controller) “Wordspell” program 92-95
166 XYSC command (SuperBASIC) 220-221
289
2)A a pte
|
Pe a)
. oo |
Coie
ck
|
», eK
P.oeaaes.
:
ie ; < Pam eelyts)
oye * oF; ;
jay
ok ionl, as
“J s at
ti
COMPUTE!’s
NY=Yoro)
gfe fmsole) @reo) MmOre)palaglole(e)g-Mey-'
ISBN 0-942386-44-2