ANSiMat - a graphical viewer of ANSI files

User contributed sources that have become inactive, deprecated, or generally unusable. But ... we don't really want to throw them away either.
Fox
Posts: 353
Joined: Aug 08, 2006 13:39
Location: Lille, France
Contact:

ANSiMat - a graphical viewer of ANSI files

Post by Fox »

Hi there!

Today I finished my latest FreeBASIC project - ANSiMat!

ANSiMat is a graphical viewer of ANSI files (if you don't know what ANSI files are about, then don't waste your time here - ANSiMat will be worthless to you anyway).

It can also be used to convert ANSI files into regular (BMP, PCX, TGA...) graphic files, or into animation files (FLC). ANSiMat is available on Linux, Windows and DOS.

ANSiMat supports also modem emulation speed, therefore it can be used to display ANSI animations. ANSiMat is an opensource project, released under the GNU/GPL license.

Image

Here is the homepage of ANSiMat:
gopher://gopher.viste-family.net/1/projects/ansimat/

For these of you who are gopher-unaware, here is a http link (using a gopher->http proxy):
http://gopher.floodgap.com/gopher/gw?a= ... ansimat%2F

And here I posted a little gallery, which demonstrate what ANSiMat can achieve:
gopher://gopher.viste-family.net/1/projects/ansimat/ansigallery/
Last edited by Fox on Nov 10, 2010 16:51, edited 5 times in total.
agamemnus
Posts: 1842
Joined: Jun 02, 2005 4:48

Post by agamemnus »

Well, thanks. Might be useful in all those ansi text dungeon games..
angros47
Posts: 2329
Joined: Jun 21, 2005 19:04

Post by angros47 »

Well done!
It can be useful (and might help other people to learn about FreeBasic, too).
I'm interested in the font editor... maybe it could be used also for picture made by redefined characters (do you remember MegaZeux?)
Fox
Posts: 353
Joined: Aug 08, 2006 13:39
Location: Lille, France
Contact:

Post by Fox »

angros47 wrote:Well done!
It can be useful (and might help other people to learn about FreeBasic, too).
I'm interested in the font editor... maybe it could be used also for picture made by redefined characters (do you remember MegaZeux?)
Hi,

The font editor which appears in the source package of ANSiMat (called "chared") is a little editor I wrote few years ago in QuickBasic. It works on font files of my own format, therefore I don't know if it could be useful to anyone... But, well, if you plan to use my font format in a third-party program/game, then indeed, chared might be used to define custom characters. :)
My font format is rather simple: each character is stored in 16 bytes (each byte represent a row of the character, that is 8 points). Note, that ANSiMat doesn't use such font file, as I incorporated the font data file directly into the source code.
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:

Post by kiyotewolf »

This is neat.

I'm working on porting an movable resizeable ANSI window from QBasic into FreeBasic.

Anyone who missed out on ANSI missed out on alot.

BBS Door games.. Ahh.. those were the days.

L.O.R.D., etc..



~Kiyote!
Fox
Posts: 353
Joined: Aug 08, 2006 13:39
Location: Lille, France
Contact:

Post by Fox »

Hi all!

Nice to see that I am not the only ANSI freak out there :)

Today, I released ANSiMat v0.91. Here is a quick changelog:
- Fixed the interpretation of ESC[H and ESC[f commands with only one parameter,
- When converting an ANSI file, graphic mode is not initiated anymore,
- Added support for 8bit (palettized) video modes,
- Generated BMP files are written with 8bit color depth (was: 24bit), therefore output BMP files are 3x smaller now,
- Heavy memory optimizations: ANSiMat should work fine with 4 MiB of RAM now (required over 32 MiB before),
- Added support for generating PPM (Portable Pixel Map), PCX and TGA (Targa) files,
- Interpreting EOF characters (ASCII 0x1A) as End of File,
- Added mouse support.
ANSiMat's homepage is still at the same place:
gopher://gopher.viste-family.net/1/projects/ansimat/

For these of you who are gopher-unaware, here is a http link (using a gopher->http proxy):
http://gopher.floodgap.com/gopher/gw?a= ... ansimat%2F
Last edited by Fox on Jul 23, 2010 7:26, edited 1 time in total.
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:

Post by kiyotewolf »

How did you figure out how to generate 8-bit BMP's?



~Kiyote!
Fox
Posts: 353
Joined: Aug 08, 2006 13:39
Location: Lille, France
Contact:

Post by Fox »

kiyotewolf wrote:How did you figure out how to generate 8-bit BMP's?
Simple - you need to write the BMP header first, then the dib header (containing basic informations about the image), then you just dump your palette (BGR triplets), and follows this by the actual image data, stored upside-down.

If you are curious, take a look into the savebmpfile.bi source file of the ANSiMat project ;-)

Anyway, implementing BMP was a piece of cake, the real headache was with PCX (and its RLE compression), as there is no real documentation on this format (and available informations are often buggy). :-/
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:

Post by kiyotewolf »

http://kiyotewolf2.webs.com/ansiexample.html

My ANSI decoder in FB is finally working.

I tinkered with it for quite awhile, gave up, then picked it up again just tonight.

It has a flag to control decoding ANSI files two ways, since the way some are encoded will add extra spaces between lines, which is odd.

I figured out the problem awhile ago, I just have to keep tinkering and re-figure-it-out-again.

Generally, it does fine on most ANSI's.



~Kiyote!

It's not in a "moveable" window yet, and my code is messy (like usual). I just got it to work properly just now. I'll fancy it up later.

Yes, I'm using the 4x6 font from Win 3.11, or maybe you might find it in the settings on a regular DOS box type window.

P.S. You have to view that link in FireFox or Chrome to view the image. It's a data resource embedded in html. I only have to host the HTML, not the image.

Anyone who can't view it let me know.[/url]
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:

Post by kiyotewolf »

Isn't PCX kinda outdated?

About the only thing I'd see using PCX as well as a few of those other graphic file types you mentioned, is for DOS portability.

How come you included so many graphics file types?



~Kiyote!

That's cool that you figured PCX out.

If you can figure out how to write animated GIF files, I'll give you money.
Fox
Posts: 353
Joined: Aug 08, 2006 13:39
Location: Lille, France
Contact:

Post by Fox »

kiyotewolf wrote:It has a flag to control decoding ANSI files two ways, since the way some are encoded will add extra spaces between lines, which is odd.
Interesting. Could you provide me such "oddly encoded" file, so I could check if ANSiMat is handling it properly?
Isn't PCX kinda outdated?
So is ANSI.
So what? ;-)
How come you included so many graphics file types?
Just had some time to waste :) Plus, I think it's nice to allow outputting anything else than just dumb BMP. About PCX - it's maybe outdated, but still, it's the most efficient format which is supported by ANSiMat!
That's cool that you figured PCX out.
If you can figure out how to write animated GIF files, I'll give you money.
Ahh, GIF format... Well... I do not have THAT much time to waste :)
I already studied GIF, and I decided that implementing GIF is not worth the amount of work required to implement GIF/LZW compression from scratch... Would be much easier to handle raw AVI (which is actually not a bad idea!).
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:

Post by kiyotewolf »

I will post the two ANSI files that I'm doing comparisons on in a ZIP file, as well as the outputs you see when things go "wrong."

Couldn't you just dump un-optimized GIF's into an animated GIF?

I've seen GIF creation code, I have some in my programming directory, but making animated GIF's.

I don't want the animated GIF's to be optimized, they can be fat bloated and ugly, just so they work.

Each frame could have it's own palette, and it could be just an exact copy of the frame, no LZW (or whatever.. brain fuzzy) encoding.

I just wanna see it WORKING.



~Kiyote!

No I'm not begging or demanding, just giving you ideas. If it's possible for it to be done, dirtiest and messy, just so long as it CAN be done, I'd srsly love to just see it work.

PCX "So what?" ~ Hee hee.. Good answer. Yeah.. I thrive on outdated stuff too.
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:

Post by kiyotewolf »

Here's the stuff I'm testing with.

http://kiyotewolf2.webs.com/ansihelp.zip

See what you get.

I haven't tested the ANSI's using a true viewer, such as ACiDview yet.

They may just be glitchy.

(And by true I mean one that complies 100% to the ANSI standard.)



~Kiyote!
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:

Post by kiyotewolf »

Ok, viewing in ACIDVIEW for Windows, there are no glitches from what it displays.

The glitchy line on Rodger Rabbit is a fault in my code, as well as the weird spacing on the girl's image.

I figured out this problem a long time ago, in another instance of this code in QB, I'll just have to tinker with it and see where it's hung up again.



~Kiyote!
Fox
Posts: 353
Joined: Aug 08, 2006 13:39
Location: Lille, France
Contact:

Post by Fox »

kiyotewolf wrote:Couldn't you just dump un-optimized GIF's into an animated GIF?
Well... In my opinion, GIF is politically wrong. So no, I don't plan GIF support in ANSiMat (plus, it's a mess to implement, which doesn't help its case) :)
If it's possible for it to be done, dirtiest and messy, just so long as it CAN be done, I'd srsly love to just see it work.
In fact, the next release of ANSiMat will support generating of animations!
The output animation will be written into a FLC (FLiC) file (which appears to be a really cool format). The output file won't be much optimized (just compressed using a single-pass RLE compression), so users should convert this FLC file into whatever file format they like (or just use an external FLC optimizer).

So... just wait for ANSiMat v0.92 to be released ;)
The code is already working on my PC - I just need to test it a bit, and possibly add some other things before publishing it officially. In the meantime, if you are interested, you can look at a FLC animation that I generated using my alfa version of ANSiMat 0.92:
http://www.viste-family.net/mateusz/Tem ... t-demo.zip

Enjoy!
kiyotewolf wrote:Ok, viewing in ACIDVIEW for Windows, there are no glitches from what it displays.
I tested ANSiMat against your "glitchy" files, and I'm happy to observe that ANSiMat renders them 100% correctly.
So I guess your code is just buggy ;-)
Post Reply