www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/02/16:33:26

From: "DeHackEd" <Not DOT given AT out>
References: <6d9lkt$4um AT suriname DOT earthlink DOT net>
Subject: Re: newbie function question
Date: Mon, 2 Mar 1998 16:19:21 -0500
Lines: 44
Message-ID: <elBCqCiR9GA.254@upnetnews03>
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

DJGPP and GNU C/C++ does not use segments. This is protected mode. It means your
program shalt NOT touch memory where it should not be touching or thou shalt
immediately be receiving a signal entitled "General Protection Fault" killing
off your program. God voice off.

Try using Allegro. Setting graphics mode is as simple as
set_gfx_mode(GFX_INSERTCARDHERE, width, height, hoizontal_video_mem2reserve,
vertical_video_memory2reserve); nice command. And then, putting a pixel is as
easy as putpixel(screen, x, y, colour);

http://www.talula.demon.co.uk/allegro/ did I type that right?
--
"DeHackEd"

EMail address not given out due to low-life spammers. Do not reply by email.
Peter Jakubowicz wrote in message <6d9lkt$4um AT suriname DOT earthlink DOT net>...
>Hi,
>Wld someone be kind enough to tell me why this doesn't compile w/ gcc. I
>know other ways to plot a point in 16 colors. I'm actually just curious what
>is wrong here and too addled to figure it out myself
>Thank you
>
>
>void plot(int x, int y, int color)
>{
> #define graph_out(index,val)  {outp(0x3CE,index);\
>      outp(0x3CF,val);}
> int dummy,mask;
> char far * address;
> address = (char far *) 0xA0000000L + (long)y * xres/8L +
>  ((long)x / 8L);
> mask = 0x80 >> (x % 8);
> graph_out(8,mask);
> graph_out(5,2);
> dummy = *address;
> *address = color;
> graph_out(5,0);
> graph_out(8,0xFF);
>}
>
>
>


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019