Mail Archives: djgpp/1998/03/02/16:33:26
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 -