home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************
- Microsoft C (or Quick C) version 5.0, 5.1 program
- demonstrating interface to GRASP.
-
- NOTE: When compiling in small or medium memory models,
- this code will generate a warning message at the line
- where Strlen() is called. This is because Strlen()
- expects a near pointer as an argument, but the Grasp
- command strings must be declared far in order to use
- FP_SEG to initialize the ES register. You may safely
- ignore the warning message, or eliminate it (in small
- and medium models) by using the SEGREAD function to
- determine the value of DS and setting ES to the same
- value.
- ************************************************************/
-
- #include <string.h> /* include string functions */
- #include <dos.h> /* include interrupt functions */
-
- union REGS inregs, outregs; /* register data structures */
- struct SREGS segregs;
-
- #define GRASPCALL 0x10 /* we want interrupt 10h */
-
- char far *cmds[] = { /* array of GRASP commands */
- "Pload Grasp,1", /* must be far pointers for FP_SEG to work */
- "Pfade 0,1",
- "Waitkey"
- };
-
- main()
- {
- Grasp(cmds[0]); /* load picture into buffer 1 */
- Grasp(cmds[1]); /* fade it onto the screen */
- Grasp(cmds[2]); /* wait for user keystroke */
- }
-
- Grasp(command)
- char far *command;
- {
- inregs.x.cx = strlen(command); /* CX = length of command */
- segregs.es = FP_SEG(command);
- inregs.x.dx = FP_OFF(command); /* ES:DX points to string */
- inregs.h.ah = 'G'; /* do function 'G' */
-
- /* perform the interrupt */
-
- int86x(GRASPCALL, &inregs, &outregs, &segregs);
- }
-