Mail Archives: djgpp/1994/03/14/01:02:11
This is a very simple routine, can somebody tell me why when windows is
running I get a Segmentaion Violation trying to execute this code.
The only thing that I can guess is that writing to 0xD0000000 is either
being used by windows or whatever. I have to admit that I am ignorrant of
the DPMI.H and am striving to decypher it:) Please give a little help. It
will be greatly appreciated. I love this compiler!!
#include <grx.h>
#include <std.h>
#include <malloc.h>
main()
{
char *VideoScreen = (char *)0xD0000000;
char *Buffer;
Buffer = (char *)malloc(64000);
memset(Buffer, 15, 64000);
GrSetMode(GR_default_graphics); /* 320x200x256 */
memcpy((char *)VideoScreen, (char *)Buffer, 64000);
getkey();
GrSetMode(GR_default_text);
return 1;
}
/***************************************************************************/
/* David Greback vette AT strauss DOT udel DOT edu University of Delaware */
/* Jr. Systems Programmer (302) 831-1129 NSS/Software Systems */
/***************************************************************************/
- Raw text -