C64-Users Guide-00-Toc Introduction
C64-Users Guide-00-Toc Introduction
C64-Users Guide-00-Toc Introduction
-
c= commodore
. . CO~/\PUTER ....
USER'S MANUAL STATEMENT
"This equipment generates and uses radio frequency energy and if not
installed and used properly, that is, in strict accordance with the
manufacturer's instructions, may cause interference to radio and
television reception. It has been type tested and found to comply with
the limits for a Class B computing device in accordance with the
specifications in Subpart J of Part 15 of FCCrules, which are designed
to provide reasonable protection against such interference in a
residential installation. However, there is no guarantee that
interference will not occur in a particular installation. If this equipment
does cause interference to radio or television reception, which can be
determined by turning the equipment off and on, the user is
encouraged to try to correct the interference by one or more of the
following measures:
reorient the receiving antenna
relocate the computer with respect to the receiver
move the computer away from the receiver
plug the computer into a different outlet so that computer and
receiver are on different branch circuits.
"If "necessary,the user should consult the dealer or an experienced
radio/television technician for additional suggestions. The user may
find the following booklet prepared by the Federal Communications
Commission helpful: 'How to Identify and Resolve Radio-TV
Interference Problems.' This booklet is available from the U.S.
Government Printing Office, Washington, D.C.20402, Stock No,
004-000-00345-4," .
-
,
FIRSTEDITION
SECOND PRINTlNG-1982
This manual is copyrighted and contains proprietary information. No part of this publica-
tion may be reproduced, stored in a retrieval system, or transmitted in any form or by any
means, electronic, mechanical, photocopying, recording or otherwise, without the prior
written permission of COMMODORE BUSINESS MACHINES, Inc.
ii
TABLE OF CONTENTS
INTRODUCTION .. vii
1. SETUP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
. Unpacking and Connecting the Commodore 64 . . . . . . . . . . 2
. Installation 3
. Optional Connections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
. Operation 8
. ColorAdjustment 11
2. GETIING STARTED.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 13
. Keyboard 14
. Backto Normal 17
. Loadingand SavingPrograms.. . . . . . . . . . . . . . . . . . . . . .. 18
. PRINTand Calculations. . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 22
. Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 27
. Combining Things. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 28
4. ADVANCEDBASiC 41
. Introduction 42
. SimpleAnimation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 43
Nested Loops 44
. INPUT 45
. GET 47
. RandomNumbersand Other Functions.. . . . . . . . . . . . . . .. 48
. Guessing Game 50
. YourRoll 52
iii
" """-/
-
. Random Graphics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
CHR$ and ASC Functions .......................... 53
7. CREATINGSOUND.. .. .. .. .. .. .. .. .. . .. .. .. . .. .. .. . 79
. Using Sound if You're Not a
Computer Programmer ............................ 80
. Structure of a Sound Program ........................ 80
. Sample Sound Program. ............................. 80
. Making Music on Your Commodore 64 ................. 81
. Important Sound Settings ............................ 83
. Playing a Song on the Commodore 64 .. . .. ... .. ... ... . 88
. CreatingSoundEffects.............................. 89
. Sample Sound Effects To Try ......................... 90
8. ADVANCEDDATA HANDLING...................... 91
. READ and DATA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
. Averages. ......................................... 94
. Subscripted Variables ............................... 95
One-DimensionalArrays ........................... 96
Averages Revisited. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
. DIMENSiON........................................ 98
. Simulated Dice Roll With Arrays. . . . . . . . . . . . . . . . . . . . . . . 99
100
. T~o-Dimensional Arrays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
iv
"
APPENDICES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 105
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 106
A: COMMODORE 64 ACCESSORIESAND SOFTWARE 107
B: ADVANCEDCASSETTEOPERATION 110
C: COMMODORE 64 BASIC . . . . . . . . . . . . . . . . . . . . . . . . . . .. 112
v
production, the COMMODORE64 allows you to connect your audio out-
put to almost any high-quality amplification system.
While we're on the subject of connecting the COMMODORE 64 to
other pieces of equipment. . . your system can be expanded by adding
accessories, known as peripherals, as your computing needs grow.
Some of your options include items like a DATASSETTE*recorder or as
many as 5, VIC 1541 disk drive storage units for the programs you make
and/or play. If you already have a VIC 1540 disk drive your dealer can
update it for use with the COMMODORE64. You can add a VIC dot
matrix printer to give you printed copies of your programs, letters, in-
voices, etc. . . If you want to connect up with larger computers and their
massive data bases then just plug in a VICMODEM cartridge, and get
the services of hundreds of specialists and a variety of information net-
works through your home or business telephone. Finally if you're one of
those people interested in the wide variety of applications software
available in CP/M**, the COMMODORE64 can be fitted with a plug-in
Z-SO microprocessor.
Just as important as all the available hardware is the fact that this
USER'S GUIDE will help you develop your understanding of computers.
It won't tell you everything there is to know about computers, but it will
refer you to a wide variety of publications for more detailed information
about the topics presented. Commodore wants you to really enjoy your
new COMMODORE64. And to have fun, remember: programming is
not the kind of thing you can learn in a day. Be patient with yourself as
you go through the USER'S GUIDE. But before you start, take a few
minutes to fill out and mail in the owner/registration card that came with
your computer. It will ensure that your COMMODORE64 is properly
registered with Commodore Headquarters and that you receive the most
up-to-date information regarding future enhancements for your ma-
chine. Welcome to a whole new world of fun!!
NOTE:
Many programs are under development while this manual is being
produced. Please check with your local Commodore dealer and with
Commodore User's Magazines and Clubs, which will keep you up to
date on the wealth of applications programs being written for the
Commodore 64, worldwide.
viii
INTRODUCTION
Congratulations, on your purchase of one of the best computers in the
world. You are now the proud owner of the COMMODORE64. Com-
modore is known as The Friendly Computer company, and part of
being friendly is giving you easy to read, easy to use and easy to
understand instruction manuals. The COMMODORE64 USER'SGUIDE is
designed to give you all the information you need to properly set up your
equipment, get acquainted with operating the COMMODORE64, and
give you a simple, fun start at learning to make your own programs.
For those of you who don't want to bother learning how to program,
we've put all the information you need to use Commodore programs or
other prepackaged programs and/or game cartridges (third party
software) right up front. This means you don't have to hunt through the
entire book to get started.
Now let's look at some of the exciting features that are just waiting for
you inside your COMMODORE 64. First, when it comes to graphics
you've got the most advanced picture maker in the microcomputer in-
dustry. We call it SPRITEGRAPHICS, and it allows you to design your
own pictures in 4 different colors, just like the ones you see on arcade
type video games. Not only that, the SPRITEEDITORlet's you animate as
many as 8 different picture levels at one time. The SPRITEEDITORwill
soon be available as a software program that you can load directly into
your COMMODORE64. You can move your creations anywhere on the
screen, even pass one image in front of or behind another. Your COM-
MODORE64 even provides automatic collision detection which instructs
the computer to take the action you want when the sprites hit each
other.
Next, the COMMODORE64 has built-in music and sound effects that
rival many well known music synthesizers. This part of your computer
gives you 3 independent voices, each with a full 9 octave "piano-type"
range. In addition you get 4 different waveforms (sawtooth, triangle,
variable pulse, and noise), a programmable ADSR (attack, decay, sus-
tain, release) envelope generator and a programmable high, low, and
bandpass filter for the voices, and variable resonance and volume con-
trols. If you want your music to play back with professional sound re-
vii