Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OUTP and screen modes 1

Status
Not open for further replies.

coolerfantasy

Programmer
Mar 12, 2008
14
0
0
A2
hello every body
can i use ( OUTP ) which is found in CONIO.H
to switch screen mode to graphic mode ?
then use it to write pixels
thank you .
 
All sorts of vendors have a conio.h of some sort. Which compiler/platform are you using?
 
You can, but I don't recommend it (I was fiddling with such stuff when I was very young, and I am still sorry to have wasted so much time on this) :D
Here is something that might be useful to you. It's (very old) asm code how to setup 320x200x8 in "pure" way, without interrupts. Of course, to convert this code to C, you will need some asm knowledge. After that you can use a000:0000 to access pixels...

ftp://ftp.arnes.si/software/simtelnet/msdos/asmutl/modes.zip

I still don't understand why you don't want to use BIOS service tho. If something is written in C, it doesn't make it portable...
 
well ,thank you guys for replies
XWB >> i use QC v2.0 compiler under dos .

monkhandle >> i have a university project
should be complete under dos using ANSI C
i have no choice , coz ANSI C doesnt support
graphics ,doesnt support asm , doesnt support
even dos.h
the i have to find a method to switch mode to
graphics mode then writes pixels
either using POINTERS or using OUTP
or the both .
 
monkhandle
CONIO.H is allowed in my project
so if you can show me how can i
use outp to switch mode to graphic
mode then write pixels
please hurry
thank you .
 
QC has some built in routines to set the graphics mode and write pixels to the screen. I haven't used this for 15 years but I think I still have the manual. I'll try digging it out tonight and tell you what they are.

The only problem is the probable max resolution is 640x480 in 4 colours.
 
xwb thank you
i cant use this built in features
i have to find another ways you can read
reasons above
thank you again .
 
If it's a university project, I'd recommend having a (positively worded!) talk to whoever set it, and finding out what they define as graphic output, and how they expect you to produce it in ansi C. There may be a misunderstanding here about what tools you're allowed, or what you're expected to do. Some people would regard a graph plotted merely as "*" symbols on the text screen as a graphical output...

There's no point in specifying ansi C running in dos and then not allowing you to use bios interrupts because dos itself is using them - i.e. they must be there! Since you're already non-portable (must work on dos) there has to be some allowance for non-portable code. Perhaps if you can wrap up all the non-portable stuff in one easily-maintained chunk and put all your ansi-standard stuff in one easily-ported chunk?

Good luck, anyway. Otherwise it does sound like an impossible mission.
 
Saying that you can't use built in routines and then going on to use outp which is a built in routine doesn't make a lot of sense.

It depends on what your supervisor has defined as ANSI C. Does he/she mean not K&R C where it is legal to have
Code:
two ()
{
   return 2;
}
and no MS extensions like kbhit(). ANSI C means different things to different people. Best find out what they mean.
 
lionelhill , xwb
you are both all right
at this stage my project exactly how to do
bios interrupt 10h using OUTP , ANSI C
is the next stage of my project
if you can then help me there is no more time left
thank you .
 
I converted that modes.asm to C (literally !). Ugliest conversion ever made :D

Only used conio.h header:

source:
com:

I don't have MS C compiler, so I used one from Digital Mars.
Shouldn't be that different, but types may have different length, check upper lines in source and change if neccessary...

Program just switches to 320x200x8, clears screen and puts white pixel at 100,100.

type cls in dos to get back to text mode :)
I didn't implement that, something must be left for you (Of course I still expect all available stars for my effort :D)
 
monkhandle really thank you
the second link doesnt open :(
it compiled successfuly but run time error occured
however thank you very much i will analys it carefuly
to understand how it works
did you say it worked with
digital mars compiler .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top