Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!kth!draken!tut!hydra!hylka!teittinen From: teittinen@cc.helsinki.fi Newsgroups: comp.sys.ibm.pc Subject: Re: MCGA videomode Message-ID: <2830@cc.helsinki.fi> Date: 14 Mar 89 13:14:51 GMT References: <143@np1.hep.nl> Organization: University of Helsinki Computing Centre Lines: 46 In article <143@np1.hep.nl>, i14@np1.hep.nl (Martin Los) writes: > Can anyone tell me how I can access the MCGA cards 256 color mode (PS/2 model > 30) Please post a sample program (in pascal ,c or quickbasic) which places > 256 different colored points on the screen OK, here comes two C-functions. One to write a pixel to screen and the other to read the pixel value (This is typed without help of any manual, so it has not been compiled, but it should work). Before you use the functions below you should change the video mode to 0x13 which is the 256 color mode. You can use interrupt 0x10, subfunction 0. If you aren't familiar with it, ask somebody. I hope this helps. ---cut here-------- /* This is source code for Turbo C or Microsoft C */ /* I don't remember what files you should #include, look up from manual */ /* This is pointer to the display memory area */ unsigned char far *DispMem = (unsigned char far *) 0xA0000000L; /* This function plots a dot to the screen at (x,y) with color */ void putpixel(int x, int y, int color) { /* First we check the parameters */ if (x < 0 || x > 319 || y < 0 || y > 199 || color < 0 || color > 255) return; /* Put the pixel to screen */ *(DispMem+320*y+x) = color; } /* This function returns the color of the pixel (-1 if out of screen) */ int getpixel(int x, int y) { /* Check that the pixel is inside the screen area */ if (x < 0 || x > 319 || y < 0 || y > 199) return(-1); /* Get the color of the pixel */ return(*(DispMem+320*y+x)); } ---cut here-------- EARN: teittinen@finuh Internet: teittinen@cc.helsinki.fi Marko Teittinen, student of computer science