Does anyone know the code for the place in memory that controls the background color of the VIC 20?
I am trying to change the colors of the border and the background but cant find the command.
If anyone knows how to change background and border colors on a VIC 20 please let me know.
Thanks for looking
Rob
Color codes
-
- Omega Star Commander
- Posts: 1375
- Joined: Thu Jan 31, 2008 2:12 pm
- Website: https://robert.hurst-ri.us
- Location: Providence, RI
- Occupation: Tech & Innovation
You can get these just about anywhere from a Google search, but here's my link to some useful programming docs.
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
https://robert.hurst-ri.us/rob/retrocomputing
More specifically:
POKE36879,(BG*16)+BC+8
BG = BackGround Color (0 to 15)
BC = Border Color (0 to 7)
The color codes are:
0=Black
1=White
2=Red
3=Cyan
4=Purple
5=Green
6=Blue
7=Yellow
8=Orange
9=Light Orange
10=Pink
11=Light Cyan
12=Light Purple
13=Light Green
14=Light Blue
15=Light Yellow
Edit: Oops, left off the +8.
POKE36879,(BG*16)+BC+8
BG = BackGround Color (0 to 15)
BC = Border Color (0 to 7)
The color codes are:
0=Black
1=White
2=Red
3=Cyan
4=Purple
5=Green
6=Blue
7=Yellow
8=Orange
9=Light Orange
10=Pink
11=Light Cyan
12=Light Purple
13=Light Green
14=Light Blue
15=Light Yellow
Edit: Oops, left off the +8.

Last edited by buzbard on Sat Nov 10, 2012 5:27 pm, edited 1 time in total.
Ray..
I'm having some difficulty with this.
The VIC-20 seems to handle colors differently than the C64. I mean, obviously the 64 has two separate addresses for border and background. But besides that. I can't seem to figure out how to get a black background, with black border, and white text. I always get text that appears reversed.
The VIC-20 seems to handle colors differently than the C64. I mean, obviously the 64 has two separate addresses for border and background. But besides that. I can't seem to figure out how to get a black background, with black border, and white text. I always get text that appears reversed.
I think this is what you are looking for, from the VIC 20 Programmer's Reference Guide:
One address 36879, with the above values for any combination of border and screen colour.
Poke 36879,8 for black border and screen.
Print"<ctrl-2>" for white letters.
Code: Select all
APPENDIX B
SCREEN & BORDER COLOR
COMBINATIONS
You can change the screen and border colors of the VIC anytime, in or
out of a program, by typing
POKE 36879,X
where X is one of the numbers shown in the chart below. POKE 36879,27
returns the screen to the normal color combinations, which is a CYAN
border and white screen.
Try typing POKE 36879,8. Then type CTRL{white} and you have
white letters on a totally black screen! Try some other combinations. This
POKE command is a quick and easy way to change the screen colors in a
program.
------------------------------------------------------------
BORDER
------------------------------------------------------------
SCREEN BLK WHT RED CYAN PUR GRN BLU YEL
BLACK 8 9 10 11 12 13 14 15
WHITE 24 25 26 27 28 29 30 31
RED 40 41 42 43 44 45 46 47
CYAN 56 57 58 59 60 61 62 63
PURPLE 72 73 74 75 76 77 78 79
GREEN 88 89 90 91 92 93 94 95
BLUE 104 105 106 107 108 109 110 111
YELLOW 120 121 122 123 124 125 126 127
ORANGE 136 137 138 139 140 141 142 143
LT.ORANGE 152 153 154 155 156 157 158 159
PINK 168 169 170 171 172 173 174 175
LT.CYAN 184 185 186 187 188 189 190 191
LT.PURPLE 200 201 202 203 204 205 206 207
LT.GREEN 216 217 218 219 220 221 222 223
LT.BLUE 232 233 234 235 236 237 238 239
LT.YELLOW 248 249 250 251 252 253 254 255
Poke 36879,8 for black border and screen.
Print"<ctrl-2>" for white letters.
You are correct:adric22 wrote:Ah yes.. that works much better. There must be an extra bit in there somewhere that is used for reverse or something. I am guessing bit 3 must have something to do with that?
Code: Select all
Bit 3: Default value: 1. This bit serves as the inverse color switch. When set to one, the background and foreground colors are in their respective places. Setting this to zero, however, inverts that scheme. The foreground color will be used for the background and all the characters are shaded in the background color.

I'm surprised no one caught that.
Ray..