🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.msdos.programmer
3 messages
3 total messages Started by Dennett Jaques Sat, 04 Aug 1990 12:27
Turbo C
#1705
Author: Dennett Jaques
Date: Sat, 04 Aug 1990 12:27
36 lines
1806 bytes
G'day there,

I am having a small problem with some functions in Turbo C 2.01 relating
to 'gets' and 'scanf' when in graphics mode.

The program runs fine on EGA VGA displays but the same code when run on
Hercules equipped machines causes small lines of scattered pixels to be
displayed across the top half of the screen at the point where 'scanf' or
'gets' are called. Additional pixels appear as keyboard input is processed 
by these functions. No characters are echoed to the screen at this time
although they should be, EGA and VGA OK here.

On the other hand if I program using 'getch' in place of the above - this
works for all types of graphics cards.
But this method is too sloppy.

The above code first uses 'InitGraph' to determin display hardware.

Anybody have any thoughts?


  
  Cheers.

  Dennett Jaques.

             _________________________________________________________________
            
   ,-_|\     Network Analyst             E-mail: dennett@usage.csd.unsw.edu.au
  /     \    The University of N.S.W     Phone:  +61 2 697-2324
  \_,-._* <- Sydney, AUSTRALIA           FAX:    +61 2 662-8665
       v     _________________________________________________________________

                         When I want my employers opinion,
                               I'll give it to them.
Re: Turbo C
#1791
Author: Steve Resnick
Date: Sun, 05 Aug 1990 15:21
54 lines
2972 bytes
In article <789@usage.csd.unsw.oz.au> dennett@usage.csd.unsw.oz.au (Dennett Jaques) writes:
>
>G'day there,
>
G'day !

>I am having a small problem with some functions in Turbo C 2.01 relating
>to 'gets' and 'scanf' when in graphics mode.
>
>The program runs fine on EGA VGA displays but the same code when run on
>Hercules equipped machines causes small lines of scattered pixels to be
>displayed across the top half of the screen at the point where 'scanf' or
>'gets' are called. Additional pixels appear as keyboard input is processed 
>by these functions. No characters are echoed to the screen at this time
>although they should be, EGA and VGA OK here.
>
>On the other hand if I program using 'getch' in place of the above - this
>works for all types of graphics cards.
>But this method is too sloppy.
>
>The above code first uses 'InitGraph' to determin display hardware.
>
>Anybody have any thoughts?
>
>
Time for some good news and some bad news....The good news:
DOS uses the BIOS for video output when not redirected. When you call gets, or
scanf (or anything else that reads stdin and echoes to the console the BIOS 
is called upon to draw your characters. If the EGA/VGA is in graphics mode, 
the characters are still drawn nicely (but more slowly) on the screen and all is
well. 
The bad news: The BIOS video services still think the herc is in mode 7 - MDA
text mode when you are in a hercules graphics mode. This is why you get extra
pixels and no text. To read a string from the console in a herc graphics mode
I believe you will have to code this yourselfand it may mean using a BGI font
rather than the PC's normal font. If this is a workable solution, I have a 
routine I could mail you (it is at work, and I am at home or I would post it
here) which reads characters from the console, takes care of editing, etc
and deals with "cursor" movement (there is normally no cursor in graphics mode).

If this is something that is workable for you let me know and I will e-mail you
the source for this routine (gcgets) it's only about 15 lines of code. If
anyone else is interested, let me know, and I will post it here as well.. :)

Hope this helps.....
Steve



-- 
----------------------------------------------------------------------------
steve.resnick@f105.n143.z1@FIDONET.ORG #include<std_disclaimer.h>
Flames, grammar errors, spelling errrors >/dev/nul
----------------------------------------------------------------------------
Re: Turbo C
#1797
Author: John Gordon
Date: Mon, 06 Aug 1990 16:05
10 lines
828 bytes
	Have you linked in all of the appropriate *.BGI files?  Specifically
the hercules BGI file?


---
John Gordon
Internet: gordon@osiris.cso.uiuc.edu        #include <disclaimer.h>
          gordon@cerl.cecer.army.mil       #include <clever_saying.h>
GEnie:    j.gordon14                  
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads