Commodore 128 vector graphics

The Commodore 128 have a rich API for making colorful vector graphics. The low resolution (160×200) color mode allows you to make the classic “Forrest Gump” smiley using these five lines of code:

10 COLOR 0, 13 : REM GREY BACKGROUND
20 COLOR 4, 13 : REM GREY BORDER
30 COLOR 1, 1 : REM COLOR 1 IS BLACK
40 COLOR 2, 8 : REM COLOR 2 IS YELLOW
50 COLOR 3, 12 : REM COLOR 3 IS SHADOW (DARK GREY)
60 GRAPHIC 3, 1 : REM LOWRES MULTICOLOR MODE
70 CIRCLE 3, 80, 101, 49, 99 : REM SHADOW OUTLINE
80 PAINT 3, 80, 101 : REM SHADOW FILL
90 CIRCLE 2, 97, 99, 49, 99 : REM SMILEY SIZE
100 PAINT 2, 79, 99 : REM SMILEY FILL
110 CIRCLE 1, 79, 99, 49, 99 : REM SMILEY CONTOUR
120 CIRCLE 1, 65, 70, 8, 22 : REM LEFT EYE
130 PAINT 1, 65, 70 : REM LEFT EYE COLOR
140 CIRCLE 1, 92, 70, 8, 22 : REM RIGHT EYE
150 PAINT 1, 92, 70 : REM RIGHT EYE COLOR
160 CIRCLE 1, 79, 99, 39, 85, 90, 280 :REM MOUTH

smile

To exit the program on a real 128, press Runstop + Restore. On the Vice emulator, press Caps Lock + Page Up. However, the Commodore 128 API is not very suitable for bitmap graphics. For that, other Commodore Basic strategies are more suitable.

Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll:

Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll!

Comments

Important information: If you have not commented before, your comment will be reviewed before it is published. This means that you will not see it immediately, but I have received it. This is not because I want to filter comments, but because I want to prevent spam and advertising.

One response to “Commodore 128 vector graphics”

Leave a Reply

Your email address will not be published. Required fields are marked *