![]() |
Forum Index : Microcontroller and PC projects : CMM2: Redefining fonts characters in runtime
Author | Message | ||||
LeoNicolas![]() Guru ![]() Joined: 07/10/2020 Location: CanadaPosts: 504 |
Is it possible to change the fonts characters shape in runtime? This is something I did a lot in my old MSX to draw my games backgrounds only using text. I used to update the characters changing directly the characters table in memory using the poke command. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
If you re-download V5.07.00b3 then you can use the command MM.INFO(FONT ADDRESS n) This gives the address of font n in memory If you load a font from file to font 8 then this will be in RAM and could be "hacked" In addition you can use MM.INFO(FONT POINTER n) This one can really get you into trouble. This gives you the address of the pointer to font n so you could create a font in an integer array and then do something like dim b%(1000) ' code to create a font in b%() poke word mm.info(font pointer 12),peek(varaddr b%()) font 12 Edited 2021-01-12 19:19 by matherp |
||||
CircuitGizmos![]() Guru ![]() Joined: 08/09/2011 Location: United StatesPosts: 1427 |
"This one can really get you into trouble." An exciting thing to debug, for sure. Micromites and Maximites! - Beginning Maximite |
||||
johnd Newbie ![]() Joined: 22/10/2020 Location: United StatesPosts: 30 |
I don't think this will mimic the text mode of the older computers (and maybe this isn't what you want anyways). Since CMM2 only supports graphic screens, whatever text is drawn to the screen will stay that way until it is redrawn or erased. So if you print some 'A' characters to the screen, then change the font's 'A' char to look like a pacman, all the 'A's previously on the screen will still be 'A's. That won't change until you re-print the new 'A' pacman char to the screen -- and in that case, why not just use offscreen graphics and the blit command. On the vintage computers, I also like the ability to dynamically change the font and have it instantly updated on the screen (I think the old Ultima on the C64 used this mode from what I remember for the various animations of water and other stuff). But remember that in text mode, a chip was constantly refreshing the screen output with the text glyph data. The CMM2 doesn't do that. It displays screen memory, and unless YOU update the screen by drawing new glyphs, nothing will change. Anyways, if your only interested in a font that can be updated dynamically so you can print out more than 255 characters using the same font, then what I said above doesn't relate and is moot. |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1132 |
With great power comes great responsibility. Perfect for a font editing program. Visit Vegipete's *Mite Library for cool programs. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |