Startsidan  ▸  Texter  ▸  Teknikblogg

Anders Hesselbom

Programmerare, skeptiker, sekulärhumanist, antirasist.
Författare till bok om C64 och senbliven lantis.
Röstar pirat.

Commodore 128 vector graphics

2014-02-08

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.

Categories: Geeky

Tags: C128

One response to “Commodore 128 vector graphics”

Leave a Reply

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



En kopp kaffe!

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

Bjud på en kopp kaffe!

Om...

Kontaktuppgifter, med mera, finns här.

Följ mig

Twitter Instagram
GitHub RSS

Public Service

Folkbildning om public service.

Hem   |   linktr.ee/hesselbom   |   winsoft.se   |   80tal.se   |   Filmtips