Custom font

ZX80, ZX 81, ZX Spectrum, TS2068 and other clones
Post Reply
rkd77
Member
Posts: 50
Joined: Sun May 04, 2008 10:35 am

Custom font

Post by rkd77 »

Hi, could you tell me how to set own font 8x8 or 6x8 for ansi timex mode?
Second question, how to get modes 85x24 and 64x24 for Timex ansi? I know I can modify Makefile and recompile libraries, but I would like out of the box solution without "recompilation". Latest version checked was 2.1.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: Custom font

Post by dom »

I think from what you've written you're using +ts2068 -clib=ansi?

I can also see that the ts2068 vt100 library isn't as configurable as the +zx version, hence your questions.

If you're just using <conio.h> and don't actually care about VT100 codes, could I suggest you switch to the gencon version of the library? (+ts2068 --generic-console) - it was built to make these sort of things easy! If you do care about vt100 codes then I have a bit of work to do...

The --generic-console font can be changed at both compile time and run time, the compile time information is here:

https://github.com/z88dk/z88dk/wiki/Cla ... rnal-fonts

Setting at runtime is just above that section.

Similary, changing the screen mode is easier as well. The driver supports both full 8x8 and 4x8 characters, so you get up to 128x24 resolution. The screen modes for the TS2068 are detailed here:

https://github.com/z88dk/z88dk/wiki/Pla ... reen-modes

And the general mechanism on how to change screen modes is here:

https://github.com/z88dk/z88dk/wiki/Cla ... creen-mode

If you do care about vt100 codes, let me know and I'll do some work on the library.
rkd77
Member
Posts: 50
Joined: Sun May 04, 2008 10:35 am

Re: Custom font

Post by rkd77 »

If it is possible, please add choice of text modes and font in +ts2068 -clib=ansi.
I have an old code and porting to conio.h and genconsole did not suceed yet.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: Custom font

Post by dom »

Sure, I'm working on a couple of ways to do this.

1. Being able to define ansifont in the same way as +zx
2. Replacing the screen printing backend of -clib=ansi with the screen printing routine from gencon.

I've got 2. working (it's not merged yet) and it allows switching between 8x8 and 4x8 characters in all the hardware screen modes.There's a couple of minor differences - bold is implemented differently and reset all attributes doesn't reset the paper/ink (yet) but I think it's good enough to provide the VT100 terminal on all the recently added platforms that don't have it.

1. is also in progress, it looks like for the TS2068 it mandates uses of hires mode which I'm not happy about (since it will need to be documented!) so I've uncovered a bit more work to make the code a bit more general.

I suspect that in the medium term, I'm going to go with 2. for all targets - maintaining two sets of code that do pretty much the same thing isn't that appealing to me. That is a bit more work though so I'll get something working for you in the short term.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: Custom font

Post by dom »

Okay, both 1 and 2 have been merged and will be available in the nightly tomorrow.

Details on both methods are here on the wiki: https://github.com/z88dk/z88dk/wiki/Cla ... 0-terminal
rkd77
Member
Posts: 50
Joined: Sun May 04, 2008 10:35 am

Re: Custom font

Post by rkd77 »

Thank you! I the meantime I rewrote my code and it works with conio.h. I noticed that conio's cputs does not work right and ansi puts_cons either.
https://github.com/rkd77/tmxsnake .Version 0.0.5 is an old code, if you change Makefile a bit you can compile it. In this version there are these puts_cons, but if change them to printf, results are different.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: Custom font

Post by dom »

I'll try it out later - it may just be a target issue, but why they not right? They should behave as follows:

* cputs() -> Prints string without line feed
* puts_cons() -> Prints string with the linefeed

So puts_cons() is a drop in for puts() but bypasses stdio for low memory situations.
Post Reply