As per my post earlier today I have some trouble with features I have to work around.
use c64
; Clear screen
; PRINT CHR$(147) ? But how do you put \x93 into a string?
screen @1024:array(0..39,0..24) of byte
for x:0..39 ; Clear screen, the hard way
for y:0..24
screen(x, y) = 32
;screen = 32 ? Range access not implemented
; Black screen ? Is there a shorter way?
in out bgcolor@$d020:byte
in out fgcolor@$d021:byte
bgcolor = 0
fgcolor = 0
; Set-up screen
screen(5, 11) = "(C)2014 DRONTSOFT PRODUCTIONS."
in out textcolor@55741:array(0..29) ; 54272 + 1024 + x + y * 40
color = 1
for c:0..25 step 4
for d:0..3
textcolor(c + d) = (textcolor(c + d) + color) mod 16
; mod 16 makes it work. How to coerce into one byte? (Nibble is ok here)
; looking at .asm there must be a better way
inc color
out raster@$D012:byte
out keyboard@197:byte ; ? Sooner or later VARHEAP and Basic/Kernel will collide
;in out joystick@56321:byte
; Glimra!
countdown = 4
;one_loop@
while keyboard <> 60
while raster <> 255 ( ) ; Wait for V blank
; textcolor(0..28) = textcolor(1..29) ? Not that way
for c:0..28
textcolor(c) = textcolor(c + 1)
dec countdown
if countdown = 0
inc textcolor(29)
countdown = 4
;goto one_loop ; A goto here, makes "screen_lo: :25 dta l(screen + #*40)" disappear from .asm
; Continues here after SPACE pressed