z88dk / z88dk

The development kit for over a hundred z80 family machines - c compiler, assembler, linker, libraries.
https://www.z88dk.org
Other
913 stars 174 forks source link

[spectrum][udg][bug/question] How can I use the new standad udgs? #929

Closed Fabrizio-Caruso closed 6 years ago

Fabrizio-Caruso commented 6 years ago

I am getting

suborb commented 6 years ago

Docs are the extensions to the console for the ZX are here: https://github.com/z88dk/z88dk/wiki/Platform---Sinclair-ZX-Spectrum#console-driver-modes

Fabrizio-Caruso commented 6 years ago

@suborb THANKS a lot! So, I will need something like: printf("%c%c",1,32); ? Why not the same API as the one for targets with the 6847 when you use an explicit screen mode command?

suborb commented 6 years ago

The screen modes came later on - here it's the same screen mode but a different font size.

Having it in the stream means that it's possible mix both 64 and 32 column text on the same display.

Adding an ioctl probably does make sense - it would do a CLS at the same time (as does every other port).

Fabrizio-Caruso commented 6 years ago

@suborb The background color by default is not black as in all other targets with udg support (when black is available). It would be cool to have the same bahavior and/or have common api for this. I have the same problem with the C128

suborb commented 6 years ago

Have you tried textbackground() ?

Fabrizio-Caruso commented 6 years ago

Thanks! It does work for the Spectrum but not for the C128 (which does not have it)! Is there a cross-target solution for the border color?

suborb commented 6 years ago

There should be one for -clib=ansi unless there’s a typo anywhere. You can always send the vt100 escape code.

There’s bordercolour() - it may not be implemented on all targets though.