• Advertisement

Archived

This topic is now archived and is closed to further replies.

Looking for some Help with old fashion ANSI Emulation File Parser

This topic is 5812 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I''ve been going though a boat load of old c/c++ BBS Source code. I''ve always wanted to make my own. and i''m trying to figure out excatly the best way to do the ANSI Text/Color Dispay and emulation. This is of cource making my own emulation without ANSI.SYS since it''s no longer used no a days.. Most of the source code i have is for Borland C++ 3.01, Old Watcom, and even some acient Turbo C++. Now the problem i''m having is all of this code is super.. but All the ANSI Parser code uses very old DOS / BIOS Call and links to header files that do video writes for color, cursor position, etc.. in DOS. And in current compilers these header files, functions, and just about everything are non existient. And i really don''t want to program on an outdated compiler. What i''m having the most problem in.. is how excatly should i go about creating my own ANSI Parser for displaying ANSI color and text in Windows. Would i want to make a parser that scans each escape sequence and converts to the apporiate WIN32 GDI CALL, DIRECTX CALL. what can i do or what should i use to give the best performance. I''m currently programming on Visual C++ 6, and some in Dev C++ 4.01.. But i''m so lost where to start. Thanks, and i hope there are some great old schoolers that can help.

Share this post


Link to post
Share on other sites
Advertisement
quote:

Would i want to make a parser that scans each escape sequence and converts to the apporiate WIN32 GDI CALL, DIRECTX CALL.

If you want your prog to run in a console then GDI/DX aren''t options.

There are ways to change the color of the text in a console. Lookup "Console Functions" in the Platform SDK - eg. SetConsoleTextAttribute, WriteConsoleOutputAttribute. After getting a feel for these you''ll have to decide if parsing escape sequences makes the most sense.

Alternatively, I have read that it''s possible to get ansi.sys working on NT, but I don''t know about XP.

Share this post


Link to post
Share on other sites
quote:
Original post by LessBread
[quote]
Would i want to make a parser that scans each escape sequence and converts to the apporiate WIN32 GDI CALL, DIRECTX CALL.

[quote]
If you want your prog to run in a console then GDI/DX aren't options.
There are ways to change the color of the text in a console. Lookup "Console Functions" in the Platform SDK - eg. SetConsoleTextAttribute, WriteConsoleOutputAttribute. After getting a feel for these you'll have to decide if parsing escape sequences makes the most sense.

Alternatively, I have read that it's possible to get ansi.sys working on NT, but I don't know about XP.



I'm looking to make this a Full Windows 32 App, not really console and that will work on all windows platforms accross the board. I want to impliment ANSI emulation. but also leave the door open for the next step.. which i would like to do with Direct X graphics, opengl anything really.. and making the next generation of Bulletin Board Systems. But to start i want to support and start out with ANSI before i go crazy. I just don't know the best implimention and how to go about it.

But i am looking for all suggestions and hopefully figure out the best, and fastest way to do what i want. I know the GDI is slow.. but i'm still courious if that.. or what else i can use..
And really the best implimentation and how to go about it..



Edited by - tonic151 on February 22, 2002 4:04:20 PM

Share this post


Link to post
Share on other sites
Well... With DX you''ll have to use one of the older apis if you want it to work on W95 too - IIRC DX5 tops? OpenGL should do fine - so long as you forego the extensions. With both of those, text output won''t be easy. GDI is probably the way to go. There are api''s for outputing text, text foreground color, background color. GDI won''t lag unless you want to blit large numbers of sprites or code a 3d fps. IIRC a bbs ui involved a login, a lot of menu screens and file transfers. I don''t want to rain on your parade, but it seems to me that using the built in window controls might be easier than rolling your own. However, an ansi emulator has it''s appeal - like a scripting language.

Share this post


Link to post
Share on other sites
quote:
Original post by LessBread
Well... With DX you'll have to use one of the older apis if you want it to work on W95 too - IIRC DX5 tops? OpenGL should do fine - so long as you forego the extensions. With both of those, text output won't be easy. GDI is probably the way to go. There are api's for outputing text, text foreground color, background color. GDI won't lag unless you want to blit large numbers of sprites or code a 3d fps. IIRC a bbs ui involved a login, a lot of menu screens and file transfers. I don't want to rain on your parade, but it seems to me that using the built in window controls might be easier than rolling your own. However, an ansi emulator has it's appeal - like a scripting language.


Well for the moment i'm not to worred about the graphics, of course that will all be a very later implimentation.. Just the ANSI emulation at the moment.. And besides anyone running Win95 should be shot.. hehe you can run win98 lite easily.. and it's alot more stable then 95. But i know the basic of a bbs.. i ran one from early 91 till mid/late '98.. there are some great software out there.. but i really want to make my own. Really I'm just looking for the best implimentation for a WIN32 App thats also as fast or close and not noticeable between a dos implimentation of ANSI emulation. I guess i could give the GDI a shot.. doesn't look like there many options on how to do this.. i just hope this sucker isn't too slow.. but of cource it also very basic.. just color and cursor position, clear screen. and junk like that.. it's just matching each escape sequence with the apporiate GDI call thats going to be the huge headache.. and i'm not looking forward to that.. But yes, ANSI graphics do have a nice feel to it.. it would be awesome if i could add 32 bit graphics along with the ANSI Text/Fonts for Messages.. But first thing i want to do is ANSI.. then i'll worry about that login, users system, menu system, file transfer.. also going to convert file transfer to FTP protocol.. Telnet Zmodem just isn't that good, and i don't think you can resume it either over telnet.. i have a lot of ideas.. but just need to start simple.. then build on to it..

Or maybe i can make a .DLL with the old fashion Video Bios Calls and just add that in to my Win32 app.. then forget about it.. i'm not sure if i can do a DLL though one thoese old ass compilers.. argh.. so complicated it is yes..



Edited by - tonic151 on February 22, 2002 5:50:24 PM

Share this post


Link to post
Share on other sites
Hmm after a bit more thinking,, i''m probably just being stupid and crazy about this whole thing.. Making an Ansi parser would only be used for Local Logons to the BBS system, and watching users logged into your system move around the bbs.. , since all telnet programs have and ANSI emulation parser already built in.. i guess i could just use any telnet app for local logon''s to the bbs.. and spying on the users.. I just have to make sure it outputs the escape sequences correctly for the terminal/telnet program.. (lazy man''s way to do it i guess) hehe but then again i''m no expert programmer either.. Hmmm So much to think about.. Anyone else have any suggestions? I also have a grat idea of making Telnet the normal standard BBS ANSI interface.. then a new client.. to connect to a 32 BIT graphics interface.. to be created later...

Share this post


Link to post
Share on other sites
Last time I logged into a BBS was ''95 - using a 28.8 on W95 (or was it 3.11?)! IIRC I was using NetTerm or ZModem - Then the www started to kick in and aside from a few web based interfaces, bbs faded. It''s difficult to foresee a BBS comeback - at least a telephone based service - wireless on the other hand presents new possiblities.

quote:

very basic.. just color and cursor position, clear screen. and junk like that..


This is exactly the kind of thing to use GDI for.

quote:

it''s just matching each escape sequence with the apporiate GDI call thats going to be the huge headache..


Some of this might already be done - Batch files - Using ANSI sequences There''s also a link to an ansi.sys replacement at the bottom that comes with asm source.

Share this post


Link to post
Share on other sites
quote:
Original post by LessBread
Last time I logged into a BBS was '95 - using a 28.8 on W95 (or was it 3.11?)! IIRC I was using NetTerm or ZModem - Then the www started to kick in and aside from a few web based interfaces, bbs faded. It's difficult to foresee a BBS comeback - at least a telephone based service - wireless on the other hand presents new possiblities.



Yea.. there are still a lot of BBS's and a lot of new BBS software even being activally developed today.. There are really no more Dialup BBSes.. they are all Telnet now. I call quite a few of them.. If you do a search i'm sure you will find a lot on the net.. There are a lot of good Telnet boards with some very good message bases and some have a good selection of files.. And alot of the old files you can't find anymore.. BBSes were always great for keeping files that you can't find anymore

quote:

very basic.. just color and cursor position, clear screen. and junk like that..

This is exactly the kind of thing to use GDI for.

[quote]
it's just matching each escape sequence with the apporiate GDI call thats going to be the huge headache..

Some of this might already be done - Batch files - Using ANSI sequences There's also a link to an ansi.sys replacement at the bottom that comes with asm source.




Thanks man, i'll take a look at that and see what i can do



Edited by - Tonic151 on February 22, 2002 10:30:24 PM

Share this post


Link to post
Share on other sites

  • Advertisement