Page 1 of 1

Modifying ROM font on the fly

Posted: Sun Aug 04, 2019 5:20 pm
by R-Tape
Even though it's rare that there isn't enough memory to store a custom font in RAM, I like the idea of making the ROM font look better on the fly. The best known method must be using RRA and OR to make the font bold, I tweaked it slightly by only bolding the left hand side (RRA > AND 240 > OR (hl). Here's the result:

Image

As usual the lower case 'm' and 'w' look dodgy, but overall I think it looks pretty good.

Any more?

Re: Modifying ROM font on the fly

Posted: Sun Aug 04, 2019 9:36 pm
by Fahnn
I have a question, is the bold font one

33, 0, 61, 17, 57, 252, 1, 0, 3, 126, 203, 47, 182, 18, 19, 35, 11, 121, 176, 32, 244, 33, 57, 251, 34, 54, 92, 201

?

I used to use that in all my games at 65338, to fit (as I thought) directly below the UDGs but it did create some weirdness especially if a BASIC program more or less filled the memory. I'm sure I was doing it wrong. The more I read here, the more I realise that I didn't really know what I was doing :lol:

Re: Modifying ROM font on the fly

Posted: Sun Aug 04, 2019 10:14 pm
by R-Tape
Fahnn wrote: Sun Aug 04, 2019 9:36 pm I have a question, is the bold font one

33, 0, 61, 17, 57, 252, 1, 0, 3, 126, 203, 47, 182, 18, 19, 35, 11, 121, 176, 32, 244, 33, 57, 251, 34, 54, 92, 201
Yep that will make a bold font. Where did you get it from?
I used to use that in all my games at 65338, to fit (as I thought) directly below the UDGs but it did create some weirdness especially if a BASIC program more or less filled the memory. I'm sure I was doing it wrong. The more I read here, the more I realise that I didn't really know what I was doing :lol:
Do you mean 65368? That's where the UDGs start, but from a fresh reset the stack is at 65334, so you'd need to be below that (say 256 bytes?) to be safe. Are these pre-published days btw? Your games only show custom or ROM font.

Re: Modifying ROM font on the fly

Posted: Mon Aug 05, 2019 12:38 am
by Fahnn
R-Tape wrote: Sun Aug 04, 2019 10:14 pm
Fahnn wrote: Sun Aug 04, 2019 9:36 pm I have a question, is the bold font one

33, 0, 61, 17, 57, 252, 1, 0, 3, 126, 203, 47, 182, 18, 19, 35, 11, 121, 176, 32, 244, 33, 57, 251, 34, 54, 92, 201
Yep that will make a bold font. Where did you get it from?
I used to use that in all my games at 65338, to fit (as I thought) directly below the UDGs but it did create some weirdness especially if a BASIC program more or less filled the memory. I'm sure I was doing it wrong. The more I read here, the more I realise that I didn't really know what I was doing :lol:
Do you mean 65368? That's where the UDGs start, but from a fresh reset the stack is at 65334, so you'd need to be below that (say 256 bytes?) to be safe. Are these pre-published days btw? Your games only show custom or ROM font.

Honestly I don't remember. It would have been from some type-in program in a magazine, I think. Certainly I didn't come up with it myself. But when going through my tapes of the awful old stuff I'd written, a lot of it would have something like this in it, usually in the loader:

Image

It worked fine for most things but I never really knew why. I started off using it for the Trine Michelson game but like I said, that game filled the BASIC memory and certain weirdnesses started to happen, so I ditched it. As I said, I really don't know what I'm doing most of the time.

Re: Modifying ROM font on the fly

Posted: Mon Aug 05, 2019 10:56 am
by ZXDunny
This reminds me of a book I had when I was a kid - there was as short(ish) stub of code that made the system font appear handwritten. I wish I could remember which book it was.

Re: Modifying ROM font on the fly

Posted: Mon Aug 05, 2019 12:14 pm
by PQR
The October ’85 issue of Computer + Video Games has a type-in for a game called Moon Buggy.
Line 120 of that program contains almost exactly the same code for making a bold version of the ROM font:

Image

Here is the whole listing (Thank you archive.org!)

How do I remember? I typed the whole thing in myself and still have a copy on my computer. :lol:

Re: Modifying ROM font on the fly

Posted: Mon Aug 05, 2019 3:12 pm
by spider
I used that listing too a while back.

IIRC there was YS type-in game (I can see the game in my head just about) called Time-Bomb that would 'thicken' the font too, similar thing. Seem to recall actually that was also known as something else a few months later.

Re: Modifying ROM font on the fly

Posted: Mon Aug 05, 2019 5:17 pm
by Fahnn
One thing that I did notice when I was writing the porn game - even after ditching the font routine - is that once the program got too big, it started overwriting the UDG area. I never had any intention of using UDGs in the game so I figured that it shouldn't matter as long as I didn't go too far. But it did create some really interesting effects as the UDGs would redefine themselves with pretty much every keypress. I wonder if this could be exploited to create pseudo-random backgrounds that change in what might look like an organic way?

Re: Modifying ROM font on the fly

Posted: Tue Aug 06, 2019 10:19 am
by PQR
spider wrote: Mon Aug 05, 2019 3:12 pm I used that listing too a while back.

IIRC there was YS type-in game (I can see the game in my head just about) called Time-Bomb that would 'thicken' the font too, similar thing. Seem to recall actually that was also known as something else a few months later.
Indeed. Time Bomb was in the November ’86 issue of Your Sinclair. It used pure Basic to create a bold font.
Check out lines 700-715

(Yeah. I typed that one in too.)

Re: Modifying ROM font on the fly

Posted: Tue Aug 06, 2019 7:01 pm
by catmeows
R-Tape wrote: Sun Aug 04, 2019 5:20 pm Even though it's rare that there isn't enough memory to store a custom font in RAM, I like the idea of making the ROM font look better on the fly. The best known method must be using RRA and OR to make the font bold, I tweaked it slightly by only bolding the left hand side (RRA > AND 240 > OR (hl). Here's the result:
Do RRA/OR twice :) Didaktik has bold font in ROM and the notorious -make bold fount routine- produced quite interesting result.

Re: Modifying ROM font on the fly

Posted: Tue Aug 06, 2019 8:23 pm
by R-Tape
catmeows wrote: Tue Aug 06, 2019 7:01 pm Do RRA/OR twice :) Didaktik has bold font in ROM and the notorious -make bold fount routine- produced quite interesting result.
Like this you mean?

Image

And here it is triple bolded.

Image

Still just about okay I think, with the usual edge case checking for the 'M' and 'W'.

And still a million times better than

Image

(with apologies to 8I08r 58UB85)

Re: Modifying ROM font on the fly

Posted: Tue Aug 06, 2019 10:11 pm
by Morkin
Haha... That makes me think we need a separate discussion for 'games with the worst font'... :lol: