I'm trying to understand how video memory worked on the Commodore64 in text mode. I see that the VIC-II has a memory setup register (at $D018) that keeps track of some of this information along with the CIA 2's VIC Memory Bank register (at $DD00).
In looking at this description of the C64 memory map, I'm a little confused about what the combination of these 2 registers is pointing at. I think I understand how to construct the appropriate pointer from those values, but I don't think I understand what it's pointing to. I'm wondering if anyone can elucidate this for me?
The memory bank appears to be a pointer to one of 4 16k-aligned areas of memory. The Memory Setup Register is a (bit-shifted) offset from that. It says this about the the memory setup register:
Memory setup register. Bits:
Bits #1-#3: In text mode, pointer to character memory (bits #11-#13), relative to VIC bank, memory address $DD00. Values:
%000, 0: $0000-$07FF, 0-2047.
%001, 1: $0800-$0FFF, 2048-4095.
%010, 2: $1000-$17FF, 4096-6143.
%011, 3: $1800-$1FFF, 6144-8191.
%100, 4: $2000-$27FF, 8192-10239.
%101, 5: $2800-$2FFF, 10240-12287.
%110, 6: $3000-$37FF, 12288-14335.
%111, 7: $3800-$3FFF, 14336-16383.
Values %010 and %011 in VIC bank #0 and #2 select Character ROM instead.
What is "character memory" in this case? Is it some sort of bitmap of what each character should look like, or is it the encoding of actual characters that are on the screen? (Like when you do POKE 1024,1
and it puts an "A" in the upper left of the screen?) The reason I'm confused is because each range is 2 kilobytes, and that seems too little for character bitmaps (only 64 characters) and too big for the number of characters displayed on screen (which can only fit 1000 characters).