Mail Archives: djgpp/1996/01/13/13:15:26
> #include <mem.h>
> #include <conio.h>
>
> unsigned char far *screen=(unsigned char far *)MK_FP(0xa000, 0);
>
> void main()
> {
> setmode(0x13); /* vga mode 13h */
>
> screen[0]=2; /* put a green pixel at 0,0 */
>
> getch(); /* wait... */
>
> setmode(0x03); /* regular vga mode */
> }
Something like this (untested):
#include <dos.h>
#include <dpmi.h>
#include <sys/farptr.h>
main()
{
__dpmi_regs r;
r.x.ax = 0x13;
__dpmi_int(0x10, &r);
_farpokeb(_dos_ds, 0xa000 + 0, 2);
getch();
r.x.ax = 3;
__dpmi_int(0x10, &r);
}
- Raw text -