c64-programmers_reference_guide-00-toc_introduction.pdf

(1468 KB) Pobierz
(It
commodore
==-
COMPUTER
FIRST EDITION
THIRD PRINTING-1983
Copyright @ 1982 by Commodore Business Machines,
All rights reserved.
Inc.
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, eledronic, mechanical, photocopying, recording, or otherwise, without the prior
written permission of COMMODORE BUSINESS MACHINES, Inc.
ii
TABLE OF CONTENTS
INTRODUCTION.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
What's
Included?
....................................
ix
x
xi
.
.
.
How
to
Use
This
Reference
Guide. . . . . . . . . . . . . . . . . . . . "
Commodore
64
ApplicationsGuide. . . . . . . . . . . . . . . . . . . ..
xii
xvii
Commodore Information Network. . . . . . . . . . . . . . . . . . . . . ..
1. BASIC PROGRAMMING RULES
.
1
2
Introduction
. Screen
Display
Codes (BASIC Character
Set)
.............
.
The Operating System(OS)
Programming Numbers and Variables
Integer, Floating-Point and String Constants.. . . . . . . . . .
Integer, Floating-Point and String Variables. . . . . . . . . . .
Integer,
Floating-Point
and String Arrays
2
2
4
4
7
8
9
10
10
. Expressionsnd Operators. . . . . . . . . . . . . . . . . . . . . . . . . . . .
a
Arithmetic Expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Arithmetic Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Relational
Logical
Operators
12
~3
15
Operators
.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
Hierarchy of Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Stri ng Operations
16
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
17
.
String
Expressions
Programming
Techniques
18
18
Data Conversions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the INPUT Statement
18
22
Using the GET Statement. . . . . . . . . . . . . . . . . . . . . . . . . ..
How to Crunch BASIC Programs
24
29
2.
BASIC
LANGUAGE
.
.
VOCABULARY...
. . . . . . . . . . . . . ..
Introduction
30
.
BASIC Keywords, Abbreviations, and
Function
Types
Description
of BASIC Keywords (Alphabetical)
31
35
. The Commodore 64 Keyboard and Features
. Screen Editor.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
93
94
iii
3.
PROGRAMMING GRAPHICS ON THE
COMMODORE64
·
...
99
100
Graphics Overview
Character
Display
Modes
. . . . . . . . . . . . . . . . . . . . . . . . . ..
Bit Map Modes
Sprites
100
100
100
· GraphicsLocations
101
101
102
103
VideoBankSelection.. . . . . . .. ... . . ... . .. . . ... . .. ..
Screen Memory
ColorMemory
.1.. . . .. . . .. . . .. 103
107
.
Character Memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
Standard Character Mode. . . . . . . . . . . . . . . . . . . . . . . . . . ..
Character Definitions
Programmable Characters
Multi-Color Mode Graphics
Multi-Color Mode Bit
Extended Background Color Mode
. BitMapped
Graphics. . ... . ... ... . . . .. . . ... . '" . ...
..
Standard High-Resolution Bit Map Mode. . ... . ... .
·
.
.
107
108
115
115
120
121
122
122
127
.
HowIt Works.
. . .. . . ... ... . ... . . .. . . . . . . ... . ..
Multi-Color itMap Mode. . .. . .. . . . . . . . . . . .. . . .. . . ...
B
. Smooth
Scrolling
. Sprites
128
131
Defining a Sprite
131
Sprite Poi nters
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
133
Turning Sprites On
134
Turning Sprites Off
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
135
Colors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
135
Multi-Color Mode
135
Setting a Sprite to Multi-Color Mode. . . . . . .. . . ... . ...
Expanded
Sprites
Sprite Positioning
Sprite PositioningSummary. . . . . . . . . . . . . . . . . . . . . . . ..
SpriteDisplay
Priorities.. . . . . . . . . . . . . . . . . . . . . . . . . ..
.
Collision
Other
Detects
Features
136
136
137
143
144
144
150
150
150
151
Graphics
Screen Blanking
Raster Reg ister
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
Color Combinations...
Interrupt Status Register. . . . . . . . . . . . . . . . . . . . . . . . . . ..
Suggested
Screen and Character
iv
152
Zgłoś jeśli naruszono regulamin