Page 1 of 1
How to use lowercase PET font?
Posted: Thu Oct 07, 2021 3:20 am
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!
How to use lowercase PET font?
Posted: Thu Oct 07, 2021 5:20 am
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.
How to use lowercase PET font?
Posted: Thu Oct 07, 2021 6:43 am
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.