Board index » delphi » HELP ME!!!!!! ASCII Characters in Turbo Pascal 7.0

HELP ME!!!!!! ASCII Characters in Turbo Pascal 7.0

Hi all,

Thanx everyone with your help on thi subject before but, my question is
still not answered. The person who got closest to the answer to my question
was Dr John Stockton. He pointed me to a website with an example of want I
wanted to do but, it didn't actually do it, and I wasn't sure how to modify
the coding to do what I wanted, so I am asking my question again:

Does anyone know how to redesign an ASCII character in Turbo Pascal 7.0?

To do it on Acorn's you do it like this. Say you wanted to redesign
character 250 to be a little man, you write down a table of 8 by 8 blocks.
The numbers that go across the top are:

128    64    32    16    8    4    2    1

You do the numbers along the side later. Shade the shape of your man on the
grid. Then you look at the shaded blocks on each horizontal line, and you
can notice that each shaded block is under one of the numbers on the top
row. You add up all the shaded blocks along each horizontal line and write
the number (added up) on the right of that horizontal line. Once you have
these numbers you can redesign character 250 to be your little man. You do
the following:

VDU23, 250, <followed by the numbers along the right of your table, each
separated by a ",")

then to see your little man, you type:

PRINT CHR$250

There must be a way to do this on Pascal. PLEASE, if anybody knows can you
tell me. Any advice of where I might find information about this subject is
welcome.

Thanx in advance,
AlphA

 

Re:HELP ME!!!!!! ASCII Characters in Turbo Pascal 7.0


Quote
AlphA wrote:

> Thanx everyone with your help on thi subject before but, my question is
> still not answered. The person who got closest to the answer to my question
> was Dr John Stockton. He pointed me to a website with an example of want I
> wanted to do but, it didn't actually do it, and I wasn't sure how to modify
> the coding to do what I wanted, so I am asking my question again:

> Does anyone know how to redesign an ASCII character in Turbo Pascal 7.0?

THIS IS NOT A PASCAL ISSUE, as I described. It is a BIOS issue, you
have to look for EGA/VGA BIOS system calls. There are several points
to consider, with CGA and EGA and VGA character sets.

Under MSDOS there is an additional approach, concerning the stupid
CODEPAGE.

But this has nothing to do with Pascal. Of course you can modify your
computer internals and then run a Pascal program. And it is even
possible to write a program, which modifies the computer's BIOS in
Pascal, at least with some ASM.

:-)
--
Franz Glaser, Glasau 3, A-4191 Vorderweissenbach Austria +43-7219-7035-0
Muehlviertler Elektronik Glaser.  Industrial control and instrumentation
http://members.eunet.at/meg-glaser/           mailto:meg-gla...@eunet.at
http://www.geocities.com/~franzglaser/ http://members.xoom.com/f_glaser/

Re:HELP ME!!!!!! ASCII Characters in Turbo Pascal 7.0


Thanx again, but

I will put it in easier terms. Say I want to make a game...with graphics.
How do I design these graphics? Don't tell me to just stick a couple of
lines on the screen. Take Pinball Fantasies for the Amiga for example. You
ain't gonna tell me that it was made just using lines. How do I create
images, and then use them for a "game" if you like. I ain't really wanting
to make a game, but if I can produce a graphic any size, I can also produce
a graphic the size of one ASCII character.

Thanx, again

AlphA

Re:HELP ME!!!!!! ASCII Characters in Turbo Pascal 7.0


Quote
AlphA wrote:

> Thanx again, but

> I will put it in easier terms. Say I want to make a game...with graphics.
> How do I design these graphics? Don't tell me to just stick a couple of
> lines on the screen. Take Pinball Fantasies for the Amiga for example. You
> ain't gonna tell me that it was made just using lines. How do I create
> images, and then use them for a "game" if you like. I ain't really wanting
> to make a game, but if I can produce a graphic any size, I can also produce
> a graphic the size of one ASCII character.

This is a TOTALLY different question!

If you talk about graphics, all that I have written is off topic.
I do not know anything about the Amiga, sorry. On a PC there are
two completely different modes on the CRT, the text mode and the
graphic mode. Windows has chosen to squeeze all into graphic mode,
but Turbo Pascal is primarily made so that it uses the text mode.

In graphic mode, each pixel must be painted by the application
program or by the operating system. Characters are "painted".

In text mode the characters are drawn on the screen by the BIOS, say
by the "hardware", by the CGA or EGA or MDA or VGA BIOS. The
application program sends a character (coded as a byte) to the
screen, not as pixels.

In Turbo Pascal you can switch to graphic mode, using the GRAPH.TPU
unit. Here you can PAINT the characters on the screen, the pixel
job is performed by the driver, eg. EGAVGA.BGI. There are bitfonts
and several stroked fonts available. For the stroked fonts you can
use the FE FontEditor, found in the BGI chapter of the TP-links.

Regards,
--
Franz Glaser, Glasau 3, A-4191 Vorderweissenbach Austria +43-7219-7035-0
Muehlviertler Elektronik Glaser.  Industrial control and instrumentation
http://members.eunet.at/meg-glaser/           mailto:meg-gla...@eunet.at
http://www.geocities.com/~franzglaser/ http://members.xoom.com/f_glaser/

Re:HELP ME!!!!!! ASCII Characters in Turbo Pascal 7.0


Hi,

on Fri, 29 Oct 1999 at 15:09:02 o'clock, AlphA wrote:

Quote
> I will put it in easier terms. Say I want to make a game...with graphics.
> How do I design these graphics? Don't tell me to just stick a couple of
> lines on the screen. Take Pinball Fantasies for the Amiga for example. You
> ain't gonna tell me that it was made just using lines. How do I create
> images, and then use them for a "game" if you like. I ain't really wanting
> to make a game, but if I can produce a graphic any size, I can also produce
> a graphic the size of one ASCII character.

This is a totally different thing - not technically, but from the
programmer's viewpoint. ASCII characters are brought on the screen by
switching the graphics adapter to a "text-mode", and filling a certain
memory area with ASCII and attribute values - as you sure have learned
by now. *How* an ASCII character looks like, would not necessarily have
to be user-definable, but luckily, it is. As with (almost) everything
in the PC, this can be done via a BIOS call, and since no Pascal that
I know of provides something like this as a built-in or RTL procedure,
you'll have to do it directly. Please consult an interrupt list.

To draw graphics, you switch the graphics adapter to one of the many
graphics modes that are available. You then place the pixel values
in another area of the memory; the format depends on the mode. For
example, in Mode 13h (named after the value of AL in the Int10h call),
each pixel is one byte in size. There is *lots* of information on this
mode available. The use of ASCII characters for graphics is very unusual
and impractical.

The text-mode memory can be found at segment $B800 or $B000. Try
writing to this area:

   Mem[$B800:0] := Random(256);

The graphics memory can usually be found at $A000. As I said, there is
lots of documentation available, and also many units.

 - Sebastian

--
This signature is under construction - be sure to visit back often!

Re:HELP ME!!!!!! ASCII Characters in Turbo Pascal 7.0


Are you saying that I need to plot each individual pixel?

AlphA

Re:HELP ME!!!!!! ASCII Characters in Turbo Pascal 7.0


Quote
AlphA wrote:

> Are you saying that I need to plot each individual pixel?

Eventually, yes.  But whether you do that yourself or make
use of someone elses libraries is up to you.  For a game,
handling motion is a pain, you need something called a
"blitter" that will draw an object onto a background.  I
would suggest you try to find a freeware library of game kit
code.

Jeff.

Re:HELP ME!!!!!! ASCII Characters in Turbo Pascal 7.0


JRS:  In article <7vc52d$6t...@news8.svr.pol.co.uk> of Fri, 29 Oct 1999
13:47:08 in news:comp.lang.pascal.misc, AlphA <emulat...@madasafish.com>
wrote:

Quote
>Thanx everyone with your help on thi subject before but, my question is
>still not answered. The person who got closest to the answer to my question
>was Dr John Stockton. He pointed me to a website with an example of want I
>wanted to do but, it didn't actually do it, and I wasn't sure how to modify
>the coding to do what I wanted, so I am asking my question again:

>Does anyone know how to redesign an ASCII character in Turbo Pascal 7.0?

>To do it on Acorn's you do it like this. Say you wanted to redesign
>character 250 to be a little man, you write down a table of 8 by 8 blocks.
>The numbers that go across the top are:

>128    64    32    16    8    4    2    1

>You do the numbers along the side later. Shade the shape of your man on the
>grid. Then you look at the shaded blocks on each horizontal line, and you
>can notice that each shaded block is under one of the numbers on the top
>row. You add up all the shaded blocks along each horizontal line and write
>the number (added up) on the right of that horizontal line. Once you have
>these numbers you can redesign character 250 to be your little man. You do
>the following:

>VDU23, 250, <followed by the numbers along the right of your table, each
>separated by a ",")

Those numbers are the contents of array CS in DELTA.PAS on my site; for
compactness of expression, it's written as a string of Hex characters.

The character whose Ord is taken is the equivalent of your 250.

The program is intended to be run under plain DOS;  it appears not to
work in a Windows DOS box.

--
? John Stockton, Surrey, UK.  j...@merlyn.demon.co.uk   Turnpike v4.00   MIME. ?
 Web <URL: http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
 Proper 4-line sig. separator is as above, a line exactly "-- " (SonOfRFC1036)
 Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)

Re:HELP ME!!!!!! ASCII Characters in Turbo Pascal 7.0


Is it easier to pixel paint in Turbo C++? If it is then could someone tell
me the command. I only recently got Turbo C++ and I must addmit that it is
MUCH more complicated than Pascal.

AlphA

Re:HELP ME!!!!!! ASCII Characters in Turbo Pascal 7.0


Quote
AlphA wrote:

> Are you saying that I need to plot each individual pixel?

No.

copied from the early posting:

Quote
>Here you can PAINT the characters on the screen, the pixel
>job is performed by the driver, eg. EGAVGA.BGI.

I suggest that you simply learn how to use the GRAPH.TPU unit,
how to initialize it for your VGA screen etc. Then look for
the OutTextXY procedure, it will do the job of "painting" the
characters.

Then read this again:

Quote
>For the stroked fonts you can
>use the FE FontEditor, found in the BGI chapter of the TP-links.

With the FE you can redefine particular stroked characters for
your desired font.

In the TP-links you will find other homepages with beautiful
bitfonts. BUT IT IS YOUR JOB.

http://bsn.ch/tp-links
--
Franz Glaser, Glasau 3, A-4191 Vorderweissenbach Austria +43-7219-7035-0
Muehlviertler Elektronik Glaser.  Industrial control and instrumentation
http://members.eunet.at/meg-glaser/    http://members.xoom.com/f_glaser/
http://www.geocities.com/~franzglaser/            http://start.at/bedarf

Re:HELP ME!!!!!! ASCII Characters in Turbo Pascal 7.0


Thanx everyone.

AlphA

Other Threads