How to use lowercase PET font?

Tutorials and help articles.

(Posts require approval. See pinned post.)
Forum rules
Post guides, tutorials, and other instructional content here.

This topic area requires approval, so please be patient while we review content to make sure it fits the expectations for this topic area.

Tech support questions should be asked in Hardware or Software support.
Post Reply
rje
Posts: 1263
Joined: Mon Apr 27, 2020 10:00 pm
Location: Dallas Area

How to use lowercase PET font?

Post by rje »


I'm doing something wrong.

I've got a PET font, and a VIC-20 font, both 2K and apparently representing similar PETSCII sets.

I can load either one into the X16, like this:


cbm_k_setnam("chargen-font.bin");



cbm_k_setlfs(0,8,0);



cbm_k_load(2, 0x0f800);


So far, so good.

Now when I load them, lowercase is uppercase, and uppercase are those graphic chars.  

I solve that by printing the control code to switch cases:


cbm_k_bsout(14); // to upper+lower case


HOWEVER, what that does is switch the X16 back to its built-in Commodore 64 PETSCII font.  It does not get me the PET PETSCII (or the VIC-20 PETSCII if I use that binary instead).

I'm obviously doing something wrong in a simple way.  Can someone tell me what that is?

Thanks!

SlithyMatt
Posts: 913
Joined: Tue Apr 28, 2020 2:45 am

How to use lowercase PET font?

Post by SlithyMatt »


You need to load the upper/lower versions of those fonts. Sounds like you are loading an upper/graphics font. When you use CHROUT/BSOUT to change the character set, it will always load the font in ROM.

Ed Minchau
Posts: 503
Joined: Sat Jul 11, 2020 3:30 pm

How to use lowercase PET font?

Post by Ed Minchau »


There are a couple of different fonts in ROM bank 6.  Scrolling through it now, I see lower case a starting at C408 for one character set, and lower case a starting at CB08 for a subtly different set. That second one includes a few serifs and features curly braces at CBD8 and CBE8, in the place where square brackets normally go.

So, if you want upper and lower case and curly braces, and a whole bunch of international characters instead of petscii graphics, then copy from C800-CFFF in ROM  bank 6 to 0F800-0FFFF in VRAM. Or just copy the part you probably want most, from CB08-CBF7 to either 0F808-0F8F7 (unshifted characters) or 0FC08-0FCF7 (shifted characters). Those VRAM locations are assuming you're using the default location for the tile data.

Post Reply