Archived

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

manipulating ASCII char set

This topic is 5043 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

Does anybody know how to do that? I know that it can be done... There is a very old game called "Zeux" and it changed most of the ASCII chars into game graphics. I think the font extension was ".chr" but I am not sure... can anyone help me out?

Share this post


Link to post
Share on other sites
IF you are in control of the font file, you can of course put ANY glyph in there for each character you want ... just look at the "wingdings" font ... all graphics, no text ...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Sorry, I am talking about the ASCII char set and not Windows fonts.. for example you change the char ''A'' and if you print that character on the screen you see, for example, a tree. Something like this:

<img>http://www.zeuxworld.com/joel/avalore_02.gif</img>

Share this post


Link to post
Share on other sites
The information stored in your video card or whereever that contains the basic ASCII character set is a bitmap of 1s and 0s, 1 being "print a pixel", 0 being "eat greanbeens". There''s no room for color like you see there.

It''s not ASCII characters printed to the screen, those are regular graphics.

Share this post


Link to post
Share on other sites
the website (if you take it out of the URL of that image) talks about using a modified ASCII set... plus look at it, that is SOOOOOO 25x80 the colors are just the standard DOS colors...

anyway, it seems to do the same thing as a normal 2D tile engine, except the tiles are limited in color and size. unless you have a good reason for it, i would recommend using slightly more modern technology to make a game.

[edited by - krez on February 20, 2004 2:02:17 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by TSwitch
The information stored in your video card or whereever that contains the basic ASCII character set is a bitmap of 1s and 0s, 1 being "print a pixel", 0 being "eat greanbeens". There''s no room for color like you see there.

It''s not ASCII characters printed to the screen, those are regular graphics.


Are not... look close. Each char has only two colors which are foreground and background.

Share this post


Link to post
Share on other sites
No, those are regular graphics, plain and simple. There is no way to change the standard ASCII characters, at least not without doing some really nasty tricks that you seriously shouldn't be trying. The number of colors, or the colors used are by no means proof that it's ASCII. It's just a reduced color depth and possibly a standard palette to make things easier on both the processor and memory. Don't try to change ASCII, learn to draw on the screen in ways other than printing text. Even if you can change the ASCII characters, it would be a LOT harder than just drawing in other ways.

[edit] A modified ASCII set may refer to something a bit different. That is to say, it might just mean that it uses an ascii format for the map, where letters correspond with tiles. That is to say, a map of grass and water might look something like this

gggggggggggwgg
gggggggggggwwg
gggggggggggwwg
ggggggggggwwgg
ggggggggggwwgg
gggggggggggwgg
gggggggggggwwg

And the program itself uses this ASCII data to draw the map... that is, a g tells it to draw a grass tile, w is water. I've done things similar to this before, and I can see how people might refer to it as a modified ASCII set, although it's certainly misleading.

-Arek the Absolute

[edited by - Arek the Absolute on February 20, 2004 2:18:47 PM]

Share this post


Link to post
Share on other sites
Ok, since no one in this thread (at time of beginning this post) has any clue at all, I''ll try and fix it up.

The game in question is using text mode (VGA mode 0x03 by the looks of it). In this mode video memory is storing two bytes for each entity on the screen: 1 byte is the ascii character (0-255), and the byte following it is the color byte - the lower 4 bits define a foreground color from a palette of 16, the next 3 bits define a background color from the lower range of the palette, and the last bit is used to control "blink", which can be used for things like the cursor so that they switch between a a character and null without having to constantly update video memory.

In this mode and other text modes (assuming you are writing a realmode DOS application with complete control over the video card - Windows console apps can''t do this) you can change the ASCII character table by using a software interrupt.

Interrupt 0x10
AX = 0x1100
BH = 16 (pixel height of character. 10 for EGA, 8 for 80x50 VGA)
BL = 0
CX = # of characters to be changed
DX = Index of first character to be changed
ES:BP = pointer to character data

The character data use 1 byte for each "line" of the character (so 16 bytes per character if the character is 16 pixels high), with each bit being a single pixel.

Share this post


Link to post
Share on other sites
@Michalson: Thanks a lot! That''s what I wanted to know!

@Arek: I know how to do regular graphics... I can work with both DirectX and OpenGL. I am just being very nostalgic lately.

Share this post


Link to post
Share on other sites
quote:
Original post by Michalson
Ok, since no one in this thread (at time of beginning this post) has any clue at all, I''ll try and fix it up.



Ouch.

quote:
Original post by Michalson
In this mode and other text modes (assuming you are writing a realmode DOS application with complete control over the video card - Windows console apps can''t do this) you can change the ASCII character table by using a software interrupt.


Bah. That''s the detail I forgot about, that things change when you''re not working with a console application. Either way, I don''t feel completely incorrect in what I was saying... it''s not like realmode DOS apps are common anymore. I just wasn''t thinking in terms of the right timeframe.

Oh well. I felt some odd compulsion to defend myself at least a little.

-Arek the Absolute

Share this post


Link to post
Share on other sites
One point to remember when trying this is to only modify characters from 128 to 255 (the extended character set), which are usually graphics characters anyway.

That way, if the program crashes for any reason, you can still read any error messages and DOS is still usable for other programs (such as a compiler or debugger).

Share this post


Link to post
Share on other sites