Herunterladen Inhalt Inhalt Diese Seite drucken

2, . 1 D I R E K T D A R S T E L L U N G Von Zeichen A U F Dem B I L D S C H I R M - Commodore Computer Volkscomputer Vc-20 Programmierhandbuch

Inhaltsverzeichnis
B e i s p i e l 3:
Die S t e u e r z e i c h e n k e t t e i n Z e i l e 10 w i r d beim Eingeben des Programms
i n
Form von i n v e r s e n Zeichen auf dem
Z e i l e 30 w i r d aus diesem S t r i n g w a h l f r e i e i n S t e u e r z e i c h e n ausge-
w a e h l t , das mit der PRINT-Anweisung i n Z e i l e 20 d i e Farbe bestimmt,
i n der das A a b g e b i l d e t w i r d .
2.6.2.1 D i r e k t d a r s t e l l u n g von Zeichen auf dem B i l d s c h i r m
E i n e andere M o e g l i c h k e i t , Z e i c h e n auf dem
b e s t e h t d a r i n , S i e mit einem POKE-Befehl d i r e k t i n Z e l l e n des
s c h i r m s p e i c h e r s ( V i d e o m a t r i x ) a b z u l e g e n . Der B i l d s c h i r m s p e i c h e r be-
g i n n t b e i der Adresse
z e l l e n .
Der
Code, der
werden muss, kann aus dem
dem
ASCII-Code mit e i n e r Ausnahme e n t s p r i c h t :
Dem
ASCII-Code f u e r k l e i n e Buchstaben e n t s p r e c h e n beim CBM-Code d i e
G r a f i k - S y m b o l e .
Bit-Code i s t , den zugehoerigen
B i t
6,
a l s o
das
werden und durch B i t 7 e r s e t z t werden, f a l l s d i e s e s g e s e t z t i s t .
Wenn a l s o X% das D e z i m a l a e q u i v a l e n t des CBM-Codes i s t , der
B i l d s c h i r m c o d e umgewandelt werden s o l l , so kann das mit VC20-BASIC
folgendermassen
In
Z e i l e
10 w i r d das
g e s e t z t , f a l l s
v a r i a b l e n X% der
Zeichen
i n v e r s d a r z u s t e l l e n , muss zu
werden.
Der B i l d s c h i r m c o d e f u e r den Buchstaben A i s t 1. Durch d i e Anweisung
w i r d
a l s o
i n der
HOME-Position,
s o l a n g e n i c h t der Cursor ueber dem
machen, muss i n e i n e r R e f e r e n z - S p e i c h e r z e l l e e i n e
g e s p e i c h e r t werden. J e d e r B i l d s c h i r m s p e i c h e r z e l l e i s t n a e m l i c h e i n e
F a r b z e l l e zugeordnet,
kann. Die
506
3 8 4 0 0 ) . Wenn a l s o e i n r o t e s A i n der HOME-Position des B i l d s c h i r m s
a b g e b i l d e t werden s o l l , so muss der B e f e h l :
10 C$="<CTRL 1 X C T R L 2><CTRL 3 X C T R L 4>
<CTRL 5 X C T R L 6><CTRL 7><CTRL 8>"
20 C=INT(RND(1)*8)+1
30 PRINT MID$(C$,C,1)"A";
40 GOTO 20
$1E00 ( d e z . 7680) und
z u r Abbildung d i e s e r
CBM-Zeichencode h e r g e l e i t e t
Um
j e t z t aus einem gegebenen CBM-Code, der
z w e i t h o e c h s t e
f o r m u l i e r t werden:
10 \ti%=X\ AND
20 I F X'. AND
30
X%=W%
6.
B i t g e l o e s c h t .
B i t 7 g e s e t z t war.
so
e r z e u g t e
POKE 7680,1
o b e r s t e n
l i n k e n
e i n
A
a b g e b i l d e t ,
i n der
e i n e F a r b i n f o r m a t i o n
F a r b z e l l e n
beginnen
B i l d s c h i r m d a r g e s t e l l t . Durch
B i l d s c h i r m d a r z u s t e l l e n ,
umfasst
B i l d s c h i r m c o d e zu e r h a l t e n , muss das
B i t , d i e s e s 8-Bit-Codes
63
128<>0 THEN W%=W%
I n Z e i l e
I n Z e i l e
B i l d s c h i r m c o d e
X%
zum
B i l d s c h i r m e c k e , der
das
j e d o c h
A s t e h t . Um
b e i
der
29
506
S p e i c h e r -
Zeichen
a b g e s p e i c h e r t
werden, d e r
g e l o e s c h t
OR
64
20
w i r d
30 w i r d der I n t e g e r -
z u g e w i e s e n . Um
S c h l u s s
128
a d d i e r t
sogenannten
u n s i c h t b a r
b l e i b t ,
das
A s i c h t b a r
F a r b i n f o r m a t i o n
a b g e l e g t werden
Adresse
$9600
B i l d -
e i n 8-
i n
den
B i t 6
d i e s e
zu
( d e z .
Inhaltsverzeichnis
loading

Verwandte Produkte für Commodore Computer VolksComputer VC-20

Inhaltsverzeichnis