User Tools

Site Tools


Sidebar



commodore64

Commodore64

draw blocks with light-pen in low-res mode

10 POKE 53280,0: POKE 53281,1
20 PRINT "{Shift+CLR}"
30 PRINT "                        DOODLE3D"
 
50 GOSUB 200
60 GOSUB 100
70 GOTO 10
 
100 POKE 780,0
110 POKE 781,Y
120 POKE 782,X
130 SYS 65520
140 PRINT "X"
150 RETURN
 
200 X=(PEEK(53267)-27)/4
210 Y=(PEEK(53268)-51)/8
220 IF X<1 THEN X=1
230 IF X>39 THEN X=39
240 IF Y<1 THEN Y=1
250 IF(Y>25 THEN Y=25
260 RETURN

modulo

use backslash

toggle upper/lower case

Shift+CommodoreKey

clear screen

print chr$(47)

or

print "{{Shift+CLR}}"

prints “X” at row=5, col=10

5 print chr$(147)
10 poke 780,0
20 poke 781,5
30 poke 782,10
40 sys 65520

read X,Y coord of light-pen

use a bright background with dark border

10 POKE 53280,0: POKE 53281,1

read values from 53267 and 53268 for X and Y (read more)

20 PRINT PEEK(53267)" "PEEK(53268)
30 GOTO 20

serial communication in both directions at 1200 baud

(send CAPITALS from the PC because the character-set of the c64 is different)

10 OPEN 5,2,2,CHR$(8)
20 GET#5,A$: IF A$<>"" THEN PRINT A$;
30 GET B$: IF B$<>"" THEN PRINT#5,B$;
40 GOTO 20

CHR$(6) = 400 baud (= bin 00000110)
CHR$(8) = 1200 baud (= bin 00001000)

tips van johan vandenbran.de

background color

POKE 53281,15

invert colors

POKE 53280,0: POKE 53281,1

tips

arduino to user port

read joystick

PEEK(56320)

save file to disk

SAVE "FILENAME",8

or

DSAVE "FILENAME"

overwrite:

DSAVE "@:FILENAME"

video: https://www.youtube.com/watch?v=F1rjCxT2w4c

delete a file from disk

OPEN 15,8,15
PRINT#15 "S0:FILENAME"
CLOSE 15

reference guide

list files

LOAD "$",8
LIST

of

F7 (met de Final Cartridge III)

final cardridge iii

http://en.wikipedia.org/wiki/The_Final_Cartridge_III tip: druk RUN/STOP in tijdens het indrukken van de Reset knop, dan kom je in basic en kun je de functietoetsen gebruiken waarmee je met F5 een disk runt en met F7 een dir listing opvraagt.

run first program on disk

load"*",8,1 

indien nodig gevolgd door:

run

of

DLOAD

format disk

OPEN1,8,15,"N:NEW DISK,00":CLOSE1 

dirmaster3

commodore64.txt · Last modified: 2016/02/13 23:29 by rick