Posted By
Andrea on 2020-08-05 01:09:15
| Re: Problem to the BASIC listing, probably putting memory space to numeric variables with CLR
Hello to all Users's plus4,
I have fixed lines with CHAR,0,1,STR$(SC) and add line 20 for INIT RAM MAPPER, but I don't know if I well done.
The line 20 need for do space in RAM for numerical variables in theory. Correct me if I'm wrong.
10 REM INIT RAM MAPPER 20 POKE55,240:POKE56,55:CLR 30 SCNCLR:REM PULISCE SCHERMO 40 COLOR0,1:REM COLORE SFONDO 50 COLOR4,1:REM COLORE BORDO 60 COLOR1,15:REM COLORE TESTO 70 GOSUB530 80 X=5:Y=10 90 C=3:L=4:SC=0 100 REM C=COLORE CARATTERE 110 REM L=LUMINANZA COLORE 120 PRINT"SCORE" 130 CHAR,0,1,STR$(SC) 140 REM METTE OGGETTI 150 FORC=1TO20 160 XD=INT(RND(5)*40+1) 170 YD=INT(RND(8)*20+1) 180 POKE3072+XD+40*YD,1 190 POKE2048+XD+40*YD,09+7*16 200 NEXTC 210 POKE3072+X+40*Y,0 220 POKE2048+X+40*Y,C+L*16 230 GETKEYK$ 240 IFK$="Z"THENGOSUB320:X=X-1 250 IFK$="X"THENGOSUB370:X=X+1 260 IFK$="K"THENGOSUB420:Y=Y-1 270 IFK$="M"THENGOSUB470:Y=Y+1 280 IFK$=CHR$(27)THENEND 290 POKE3072+X+40*Y,0 300 POKE2048+X+40*Y,C+L*16 310 GOTO230 320 XC=X:YC=Y:XC=XC-1 330 IFX<1THENX=X+1:RETURN210 340 IFPEEK(3072+XC+40*YC)=1THENSC=SC+100:CHAR,0,1,STR$(SC) 350 POKE3072+X+40*Y,32 360 RETURN 370 XC=X:YC=Y:XC=XC+1 380 IFX>38THENX=X-1:RETURN210 390 IFPEEK(3072+XC+40*YC)=1THENSC=SC+100:CHAR,0,1,STR$(SC) 400 POKE3072+X+40*Y,32 410 RETURN 420 XC=X:YC=Y:YC=YC-1 430 IFY<3THENY=Y+1:RETURN210 440 IFPEEK(3072+XC+40*YC)=1THENSC=SC+100:CHAR,0,1,STR$(SC) 450 POKE3072+X+40*Y,32 460 RETURN 470 XC=X:YC=Y:YC=YC+1 480 IFY>23THENY=Y-1:RETURN210 490 IFPEEK(3072+XC+40*YC)=1THENSC=SC+100:CHAR,0,1,STR$(SC) 500 POKE3072+X+40*Y,32 510 RETURN 520 REM DEFINIZIONE CARATTERE PETSCII 530 RESTORE610 540 FORA=832TO849 550 READB:POKEA,B:NEXTA:SYS832 560 RESTORE630:FORA=14336TO14336+39 570 READB:POKEA,B:NEXTA 580 POKE65298,PEEK(65298)AND251 590 POKE65299,PEEK(65299)AND30OR56 600 RETURN 610 DATA 162,0,189,0,208,157,0,56,189,0 620 DATA 209,157,0,57,202,208,241,96 630 DATA 28,28,8,62,93,28,20,54 640 DATA 126,60,126,126,255,255,255,126 650 DATA 60,66,165,153,153,165,66,60 660 DATA 0,56,124,254,254,124,56,16 670 DATA 60,126,219,255,126,102,60,0
|