🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #6929

Re: Hercules graphics with Turbo C and Debugger

#6929
From: sorrow
Date: Sun, 02 Jun 1991 02:06
32 lines
2226 bytes
In article <JARI.KARJALA.91May27134636@superman.hut.fi>, Jari.Karjala@niksula.hut.fi writes:
|>
|>When I set the graphics mode through BGI's initgraph() function, I can
|>singlestep through the following code with Turbo Debugger and the
|>graphics/text screen is flipped correctly. But if I replace the
|>initgraph() with my own function to set the graphics mode (and don't
|>link with graphics.lib), TD no longer notices the mode change and
|>thinks it is still in text mode (and of course the result is not very
|
|>
|>The question is: what does initgraph do to tell TD that now we are
|>in graphics mode? Or is there some hidden function in the BGI library
|>which is used by the debugger?

As far as I know, most graphics libraries require a call to a function such
as initgraph() or OpenGraphics() or InitGraphics() or something like that since
graphics stuff is dependent on certain global variables.  My guess would be
that the BGI routines have global variables describing the current page,
current mode, type of video adapter, amount of memory, etc. and all of these
are determined via initgraph().  If you want to write your own graphics 
routines I would do it completely, rather than deal with trying to make your
library work with someone elses (conflicts will arise more than likely).

Brian

/*
Brian Hook -- MS-DOS Programmer for Contract
-----------------------------------------------------------------
"I was in the kitchen, Seamus, that's my dog, was outside....and buried
ALIVE....fritter and waste...but this one goes to 11!....anymore of that
plutonium nyborg?....SNOW TIME!....This is home...this is Mean Street..
*/
Technical Details
Message-ID: <009497E5.514A35E0@MAPLE.CIRCA.UFL.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!rex!uflorida!SORROW@MAPLE.CIRCA.UFL.EDU
References: <JARI.KARJALA.91May27134636@superman.hut.fi>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!rex!uflorida!SORROW@MAPLE.CIRCA.UFL.EDU
From: sorrow@oak.circa.ufl.edu
Newsgroups: comp.os.msdos.programmer
Subject: Re: Hercules graphics with Turbo C and Debugger
Message-ID: <009497E5.514A35E0@MAPLE.CIRCA.UFL.EDU>
Date: 2 Jun 91 02:06:12 GMT
References: <JARI.KARJALA.91May27134636@superman.hut.fi>
Sender: news@uflorida.cis.ufl.EDU
Reply-To: sorrow@oak.circa.ufl.edu
Distribution: comp
Organization: University of Florida CIRCA VAX Cluster
Lines: 32