×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

OUTP and screen modes

OUTP and screen modes

OUTP and screen modes

(OP)
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 .

RE: OUTP and screen modes

All sorts of vendors have a conio.h of some sort.  Which compiler/platform are you using?

RE: OUTP and screen modes

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...

RE: OUTP and screen modes

(OP)
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 .

RE: OUTP and screen modes

(OP)
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 .

RE: OUTP and screen modes

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.

RE: OUTP and screen modes

(OP)
xwb thank you
i cant use this built in features
i have to find another ways you can read
reasons above
thank you again .

RE: OUTP and screen modes

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.

RE: OUTP and screen modes

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.

RE: OUTP and screen modes

(OP)
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 .

RE: OUTP and screen modes

I converted that modes.asm to C (literally !). Ugliest conversion ever made :D

Only used conio.h header:

source:
http://monkster.hopto.org/~janez/Downloads/video.c
com:
http://monkster.hopto.org/~janez/Downloads/video.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)

RE: OUTP and screen modes

(OP)
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 .

RE: OUTP and screen modes

(OP)
monkhandle
thank you .

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close