[SDCC] - New library to allow ANSI 16 Color text rendering on Screen 7

Page 1/3
| 2 | 3

By ducasp

Champion (274)

ducasp's picture

02-09-2019, 17:24

Hey everyone,

I've been developing an UNAPI Telnet Terminal with ANSI capabilities ( https://msx.org/forum/msx-talk/software/unapi-telnet-client ).

Tobias Keizer made in the past, a very fast ANSI-DRV.BIN file that allowed INLCLIES (a Telnet Client for Internestor Lite made in Turbo Pascal made by Sd-Snatcher / Carlos de Santa Ana) to have ANSI capabilities and was rendering text and animations really fast!

After talking to Tobias, he sent me the source code, and I've been improving it (i.e.: 25 lines support, border colors = background colors, added a cursor, fixed ANSI CUD and CUF with really large parameters not goint to line 25 / column 80, changed the way it restore screen so original palette and text mode are restored, when rolling too many lines the previous lines would appear on the bottom...) and just figured out, why not make a library so anyone can use it?

Of course it has not all ANSI features, but it has the most used ones... I think the two most notable absences at this moment are:

- Won't beep on BELL
- No support for blinking text (it won't blink at all)

(attributes currently supported are BOLD, FOREGROUND COLOR and BACKGROUND COLOR and RESET attributes)

Hope this helps and motivates more people to develop colorful MSX DOS / MSX2 apps :)

https://github.com/ducasp/MSX-Development/tree/master/SDCC/M...

Login or register to post comments

By Grauw

Ascended (8943)

Grauw's picture

02-09-2019, 19:32

This is neat! Smile

By gdx

Prophet (3436)

gdx's picture

03-09-2019, 01:27

I would also like a text viewer AINSI compatible.

By fr3nd

Expert (101)

fr3nd's picture

03-09-2019, 16:27

@ducasp added https://msxhub.com/TELNET

I had to fix the download url in the PR, but everything else was fine :)

By ducasp

Champion (274)

ducasp's picture

31-01-2020, 18:43

Hi everyone,

I've update MSX2ANSI to v1.1:

  • Fixed CSI J behavior when no parameter / 0 was choosen
  • Added CSI 1 J and CSI 2 J support
  • Fixed behavior when no parameters were given (it was not always correct)
  • Added CSI n P support for Linux telnet daemons

CSI J was only deleting all the screen and returning home, no matter what. I've fixed it to follow the specs / XTERM and Windows 10 ANSI Terminal, no parameter or 0 it will erase what is on cursor down to the end of the screen, 1 will erase what is on cursor up to the beginning of the screen and 2 will erase all screen.

Also, a few scenarios were not being handled properly as "no parameter", changed that in the escape code parser.

Finally, added support to CSI n P, it will delete a character on the cursor (if no parameter or 1 is provided) or n characters from cursor on. It is limited to delete on a line, so, it won't shift the screen contents up or delete characters on other lines if n is 99 as an example. This is the same behavior I've observed from XTERM and Windows 10 ANSI Terminal. (it is interesting to notice that this will have much worse performance than CSI K as it involves two VDP operations, one of which is a VRAM-VRAM high speed move and a VDP-VRAM high speed move (while CSI K is a single VDP-VRAM high speed move). But some linux telnet daemons use it, so it has been implemented.

You can find it at: https://github.com/ducasp/MSX-Development/releases/tag/MSX2A... and in the release you also have access to the source code. ;)

By ducasp

Champion (274)

ducasp's picture

31-01-2020, 20:02

gdx wrote:

I would also like a text viewer AINSI compatible.

gdx,

Would you like an ANSI file viewer that play it until the end? Something like the JDUMP application (it is really cool, you can tell it to stop on every time screen is cleared to wait for a key and a few other features) was for JANSI? Or how would it be different? I'm back working on a few MSX related stuff, and between the new Internet application I'm planing to develop and the updates to maintain the current applications/libraries/SM-X internet features I might take a look into one or two more projects. Smile

By rolandve

Master (215)

rolandve's picture

25-04-2020, 22:46

Is someone able to translate these assembly routines to turbo pascal inline functions? Automated, would to keep the amount of work low please.

By ducasp

Champion (274)

ducasp's picture

26-04-2020, 02:33

rolandve wrote:

Is someone able to translate these assembly routines to turbo pascal inline functions? Automated, would to keep the amount of work low please.

You are quite lucky that the original version of this library is provided in two (another one to support v9990) bin files and they were used with a Turbo Pascal telnet client, ANSTEL.

I've published the original code, binaries and instructions on how to use ANSI-DRV at my github (code by Tobias Keyzer, instructions by Carlos de Santana).

Now, it won't have the fixes and enhancements I did for SDCC, but if you really want to get it up to date, feel free to clone/fork my github and move the enhancements / fixes back to ANSI-DRV.BIN, I won't be doing it as I have really no interest in Turbo Pascal or keeping a library for it, but Toby was really kind providing the source code and allowing me to publish it so anyone can use it and make derivative work of it.

Hope that helps you:

https://github.com/ducasp/MSX-Development/tree/master/TURBOP...

P.s.: I don't have the binary for V9990 but it should be quite easy for you to compile, there is a batch file and tniasm there

By rolandve

Master (215)

rolandve's picture

26-04-2020, 09:24

Ok, thank you for your reply. I've downloaded the code. I like the way you decided to make the code in to a loadable module. Since I've got no knowledge of assembly, using it will be a challenge, but then what's life without challenges. I can read LD A, etc but can't translate to byte value which TP expects for an inline. There are tables for that, so I suppose I've got to look them up.

Have a nice day!

By gdx

Prophet (3436)

gdx's picture

26-04-2020, 09:42

ducasp wrote:

Would you like an ANSI file viewer that play it until the end?

I would like a simple text viewer for MSX-DOS that can display texts coded in ISO/Windows Latin 1.

By Dolphin101546015

Master (255)

Dolphin101546015's picture

26-04-2020, 17:57

gdx wrote:
ducasp wrote:

Would you like an ANSI file viewer that play it until the end?

I would like a simple text viewer for MSX-DOS that can display texts coded in ISO/Windows Latin 1.

You might create new font with my Universal Font Editor, and just load it before view your texts.

My GIT repo, have several fonts in another code pages already.

Long time ago, I doing it on Daewoo CPC-300 without russian language.
I wrote small driver, for loading fonts from russian machine, and after it viewing texts in TOR (from Baraz).

Page 1/3
| 2 | 3