I have this BASIC program that works great when VICE is set up like an unexpanded VIC, but not under other configurations. I learned it following a tutorial, but the tutorial doesn't really explain it as well as I'd like. I've been all over the net and some old books, but haven't found a clear explanation of exactly how this works. Here's the program:
Code: Select all
0 rem tells the VIC to use 7168 as the start of the character set
10 poke 36869, 255
11 rem and the rest is redefining my characters!
12 rem first, the smiley-face from the 8-bit guy's Commodore History video
20 poke 7168, 126
30 poke 7169, 129
40 poke 7170, 165
50 poke 7171, 129
60 poke 7172, 165
70 poke 7173, 153
80 poke 7174, 129
90 poke 7175, 126
100 rem next, a skate (my profile icon on most forums lol)
110 poke 7176, 192
120 poke 7177, 192
130 poke 7178, 224
140 poke 7179, 254
150 poke 7180, 255
160 poke 7181, 255
170 poke 7182, 195
180 poke 7183, 126
Okay, so my first question is, what is the logic behind line 10? How does POKE'ing 255 into that address give it 7168 (not 255 or some multiple of 255)? I know if I put 240 or 242 in there it gives me the standard character sets (defined in ROM), but these numbers seem to be totally random/arbitrary. I'm sure it has to do with how the computer is wired under the hood, but from a programming perspective it makes less sense than trying to build a web app in BASIC.
My second question is, where does the character RAM start if I do the same thing with the full 32K? If I run the program, I see moving the cursor around makes it a blinking smiley-face (lol) in some locations, so I'm guessing it's still somewhere in the 7100-8100-ish range, but haven't been able to pinpoint exactly where that could be. This could be related to the first question - if there is some formula involved in transforming 255 into 7168, then it's possible that maybe that same formula could be applied to other RAM layouts as well... or is there? It's all still Greek to me lol