Page 1 of 1

Re: Changing Fonts in ZX Spectrum :)

Posted: Thu Sep 26, 2019 7:22 pm
by spider
Neil48k wrote: Thu Sep 26, 2019 7:13 pm Thanks for all the work you’ve put into answering my question. Am I right in thinking this relates to emulators? I haven’t tried those yet. I’m using an original 48k Spectrum. I think I may have to investigate this :geek:

Thank you :D
You're welcome.

No that will work on a real machine. Just type it in and RUN it :)

Takes about a minute / minute and a half or so to 'work' as it has to 'draw' onto each character row.

At the end it will show the normal default font (or whatever was chosen at the time) then the 'new' one and leave the new one active. See POKE's provided and the SAVE if needed.

Note you can run it again to thicken the font again! But it gets very messy.

If you're stuck and can type blind then POKE 23607 , 60 and (not needed here but worth knowing) POKE 23606 , 0 should restore normality.

Re: Changing Fonts in ZX Spectrum :)

Posted: Fri Sep 27, 2019 10:05 am
by spider
If anything posted does not make sense or you cannot get it to work, don't struggle - just post back and someone will likely try to assist. :)

Re: Changing Fonts in ZX Spectrum :)

Posted: Fri Dec 13, 2019 10:58 am
by presuminged
Newbie here, how do you calculate the value to poke 23607? For example, I am working on an AGD project with a basic loader and I'd like to use the font in the AGD code in the loader. I know that the font address is 31232. Thanks.

Re: Changing Fonts in ZX Spectrum :)

Posted: Fri Dec 13, 2019 1:05 pm
by R-Tape
presuminged wrote: Fri Dec 13, 2019 10:58 am Newbie here, how do you calculate the value to poke 23607?
Hello!

Here's how it works:

The 16bit font address is stored in memory as two 8bit bytes, at 23606 and 23607.

Here's how to work it out:

-take your font address and minus 256 from it*
-divide it by 256, put the whole number in 23607
-whatever's left goes in 23606

So if your font is at 31232

23606: 0
23607: 121

Or if your font is at 64126, then it should be this:
23606: 126
23607: 249

*this is because your first printable character is ASCII 32 (a space), so you need 23606/7 to point to 256 bytes below where your font actually is. It's 256 because each character is 8 bytes, so it's 32 x 8.
For example, I am working on an AGD project with a basic loader and I'd like to use the font in the AGD code in the loader. I know that the font address is 31232. Thanks.
Trouble there is, you'll need a loader to load the font, before your loader that loads your game uses it! (If I understand right)

Re: Changing Fonts in ZX Spectrum :)

Posted: Fri Dec 13, 2019 5:30 pm
by presuminged
Thanks for the quick reply. Yes, my basic loader loads the code and then I'm going to build a menu in basic to handle things like define keys, etc. Anyway, I tried what you suggested and it works perfectly, thank you!