Startsidan  ▸  Texter  ▸  Teknikblogg

Anders Hesselbom

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

Commodore 128 bitmap graphics 2/2

2014-02-13

Part 1. Part 2.

On the Commodore 128, the screen is divided into characters.

1

Each character consists of eight eight-pixel lines (bytes), which make a total of 64 pixels per character.

2

Each pixel pair represent one of four available colors in multicolor mode. This can be demonstrated using this simple code:

10 GRAPHIC 3, 1 : REM CREATE CLEAN MULTICOLOR DISPLAY
20 DRAW 1, 0, 0 : REM DRAW USING COLOR 1
30 DRAW 2, 0, 1 : REM DRAW USING COLOR 2
40 DRAW 3, 0, 2 : REM DRAW USING COLOR 3

Now, this pattern is shown:

3

If you add a line of code to change to high resolution graphics without clearing, we can see that two turned off pixels represent the first color, one off and one on represent color 2, one on and one off represent color 3 and two turned on pixels represent color 4.

50 GRAPHIC 1, 0 : REM CHANGE TO HIGH RESOLUTION WITHOUT CLEARING

4

The graphics memory is movable. This command places the graphics memory at 2000 (8192 in decimal):

POKE 53272, (PEEK(53272) AND 240) OR 8

The eight pixel pattern of each row in a character can be described using binary 00000000 for all off to 11111111 for all on (0 to 255 in decimal). Placing the number 00011011 (27) will draw one multicolor pixel of each color on the first line. 00 is color 0 (background), 01 is color 1, 10 is color 2 and 11 is color 3.

10 GRAPHICS 3, 1
20 POKE 53272, (PEEK(53272) AND 240) OR 8
30 POKE 8192, 27

5

Categories: Geeky

Tags: C128

One response to “Commodore 128 bitmap graphics 2/2”

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