Commodore Plus/4 Screen Memory Map (Display RAM)
Posted in: Plus/4
Posted: 2016-11-01 12:53:59

The Commodore Plus/4 – like his other brothers – has memory areas in which screen characters and color values are stored independently from each other. Because it uses the TED chip these memory addresses are different from the C64 and C128.

Each character from the top left corner to the bottom right corner occupies one byte of memory, 40 columns across in 25 rows.

Screen Memory

You can POKE screen display codes into each position using this formula:

POKE 3072 + X + 40 * Y, Z

// where 
// X = current column
// Y = current row
// Z = screen display code

// write the letter X into the top left corner of the screen
POKE 3072, 24

Note that there’s a difference between screen display codes (A = 1, B = 2…) and ASCII/PETSCII codes (A = 65, B = 66…). The latter are used when printing single charters via CHR$ or returning their values via ASC.

115365.image

Plus/4 Screen Memory

Color Memory

You can POKE color values into each cursor position using the following formula:

POKE 2048 + X + 40 * Y, C + L * 16

// where 
// X = current column
// Y = current row
// C = color value (0 to 15)
// L = luminescence value (0 to 7)

// turn the character in the top left corner of the screen light red
POKE (2048+0+0), 2 + 7 * 16
// or
POKE 2048, 114

Luminescence is a TED feature. It was an attempt to increase the color palette which still only consisted of 16 colors (like on the C64) by adding brightness to each value. When compared to the “pure” 16 colors of its brothers, the Plus/4 palette looks a little weird (for example, the standard BASIC background is white according to its color value, even though it appears to be some shade of “dirty grey”).

You can add 128 to each value to make the character flash at the same frequency as the cursor.

Contrary to the Plus/4 user guide, the color values are as follows (values in brackets show the luminescence variations):

0  (16 32 48 64 80 96 112) = black
1  (17 33 49 65 81 97 113) = white
2  (18 34 50 66 82 98 114) = red
3  (19 35 51 67 83 99 115) = cyan
4  (20 36 52 68 84 100 116) = purple
5  (21 37 53 69 85 101 117) = green
6  (22 38 54 70 86 102 118) = blue
7  (23 39 55 71 87 103 119) = yellow
8  (24 40 56 72 88 104 120) = orange
9  (25 41 57 73 89 105 121) = brown
10 (26 42 58 74 90 106 122) = yellow-green
11 (27 43 59 75 91 107 123) = pink
12 (28 44 60 76 92 108 124) = blue green
13 (29 45 61 77 93 109 125) = light blue
14 (30 46 62 78 94 110 126) = dark blue
15 (31 47 63 79 95 111 127) = light green
115366.image

Plus/4 Color Memory