Jump to content
IGNORED

C64 Question - Where and Where? - Character lookup table?


Recommended Posts

Hi C64 Experts!

 

I am enjoying learning very slooooowly about the C64, and have this nagging question...

 

I have many books on PDF and some in print about the C64 and I have looked through about ten of them for the answer to this question.

 

Where is the "lookup table" for each ASCII character found within the ROM? I am guessing that it would be a permanent table within the chip, but that is just a guess.

 

Please excuse me if I am using the wrong terms here... I am still learning big-time! :P

 

Also, could someone tell me what reference this information can be found in (probably many of them), so that I can find it also.

 

 

Thanks a lot! :-D

 

 

 

JR

Link to comment
Share on other sites

Not sure what you're asking here.

 

The character Rom is normally not visible to the CPU unless you switch out the I/O space via the 6510 on-chip control bit and switch in the character Rom. You only generally do this if you want to copy a character set or in some cases use the character data to do bitmapped characters.

 

There's not really a "lookup table" as such - the character code you want to display forms part of the address that Vic uses to grab the bitmap.

 

ie - there's 16 bits to the address. The lowest 3 bits are from whatever scanline the character is showing (0-7), the next 8 bits are from the character code itself (0-$FF), the next 3 bits control which of 8 possible places in the 16K "Vic bank" the character set lives in. The top 2 bits come from whatever Vic bank is active. The active Vic bank is controlled by bits within a CIA Port (they're inverted to get actual bank #)

 

There's a special case though with Vic reads - if the active bank is the first or third (ie $0000-$3FFF or $8000-$BFFF) then the character Rom will take precedence over Ram when Vic reads anything from that address range that would fall within what the characer set can map to, ie the second 4K of the 16). Note that this includes other stuff like bitmap and sprites.

 

Normally Vic will always read from Ram (e.g. if you point a bitmap to where Basic or OS Rom is) but in the case of these 2 banks there's an override which directs it to Rom.

 

Lots of games use the second bank $4000-$7FFF as it's a full free 16K and doesn't have any Rom overriding it, but the Rom character set isn't available so often part of it will be copied to that Ram so it can be used.

Edited by Rybags
Link to comment
Share on other sites

Wow, cool Rybags, thanks!

 

Well I was just kind of asking something like, "when the computer wants to print an "A" or a "H" or some other character, where in memory does it look this info up?".

 

But your answer is way more indepth. In fact, I'll have to read it several times to get my "tiny little mind" around it! :-D

 

By the way, how do you know this stuff so deeply! Man, you blow me away! ;-)

 

 

JR

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...