Reading Colour RAM

Basic and Machine Language

Moderator: Moderators

Post Reply
SparkyNZ
Vic 20 Enthusiast
Posts: 183
Joined: Tue Jan 18, 2011 2:23 am

Reading Colour RAM

Post 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?
User avatar
Wilson
Vic 20 Devotee
Posts: 250
Joined: Mon Sep 28, 2009 7:19 am
Location: Brooklyn, NY

Re: Reading Colour RAM

Post 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.
SparkyNZ
Vic 20 Enthusiast
Posts: 183
Joined: Tue Jan 18, 2011 2:23 am

Re: Reading Colour RAM

Post 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 :-)
Post Reply