CPCWiki forum

General Category => Programming => Topic started by: funkheld on 11:27, 27 July 20

Title: cpctelera : symbolafter?
Post by: funkheld on 11:27, 27 July 20
Hi good afternoon.

is there a way with cpctelera to change the ascii code similar to symbolafter in basic?
would be grateful for a suggestion even if it is only direct via sdcc-asm.

thank you.
Title: Re: cpctelera : symbolafter?
Post by: SpDizzy on 16:51, 27 July 20
Hi,
Best way to create your own fonts, is treating them as sprites.
That way you only need to convert a font image with image_conversion.mk on /cfg and create your own function for draw each character with 'cpct_drawSprite'.
On the other hand, you can use 'cpct_drawStringM1' (much more slower and byte consuming) for drawing on mode 1 with the system font, located at ROM.
If you want your own font in that case, this is a more difficult approach.
You must edit part of CPCTelera's source code, commenting part of the code from 'cpct_drawStringM1' function to disable read from ROM, and read from RAM instead for the drawing.
Your fonts must be absolutly located on RAM at 0x3980 starting from 'A', and, this is very important, 'cpct_drawStringM1' must be located above 0x4000 to work as needed.
Much more easy, fast and reliable solution: 'cpct_drawSprite'.
As usual, plenty of examples on CPCTelera (https://lronaldo.github.io/cpctelera/files/readme-txt.html) documentation, CPCTelera's samples folder, both for 'strings' and 'sprites' and on CPCRetroDev (http://cpcretrodev.byterealms.com/) games using CPCTelera along these editions.
Title: Re: cpctelera : symbolafter?
Post by: funkheld on 20:19, 27 July 20

thank you
I've already thought of something like that.
then I'll take the sprites for the text.


thank you.
greeting
Title: Re: cpctelera : symbolafter?
Post by: funkheld on 08:06, 31 July 20
how does that work with the cpctelera 1.4.2

https://www.cpcwiki.eu/forum/programming/cpctelera-any-lib-available-for-using-custom-fonts/msg165335/#msg165335 (https://www.cpcwiki.eu/forum/programming/cpctelera-any-lib-available-for-using-custom-fonts/msg165335/#msg165335)

greeting
Powered by SMFPacks Menu Editor Mod