Page 1 of 1

Reading Colour RAM

Posted: Mon May 05, 2025 2:46 pm
by SparkyNZ
I've noticed that if I try to do a PEEK(38400), I don't always get the actual colour value back - and I see the same thing in VICE (unexpanded Vic).

When the kernel scrolls the screen up (as it would during a LIST for example), I assume that the the kernel must read the colour RAM in order to move the colour codes up the screen.

What is needed in order to read the colour RAM correctly - and what causes the changing values that I see at 38400?

Re: Reading Colour RAM

Posted: Mon May 05, 2025 4:39 pm
by Wilson
The color RAM is only 4-bit. What you read on the upper 4 bits will just be garbage on the bus.
You need to AND your read value with $0f to get the actual contents of the memory between $9400-$9800.

Re: Reading Colour RAM

Posted: Mon May 05, 2025 4:45 pm
by SparkyNZ
Wilson wrote: Mon May 05, 2025 4:39 pm The color RAM is only 4-bit. What you read on the upper 4 bits will just be garbage on the bus.
You need to AND your read value with $0f to get the actual contents of the memory between $9400-$9800.
Oh, is it that simple? Hehe. Of course - that makes perfect sense now. Thanks for that :-)