Mail Archives: djgpp/1999/11/22/09:19:46
Instead of
int86(0x10, regs, regs);
try
int86(0x10, ®s, ®s);
I hope I explain it correctly, but here goes anyhow: If you declare union
REGS regs, regs is a pointer to a memory location, not the data contained
at the memory location. The & means "use the data pointer to by the
following pointer, not the pointer itself". I may be wrong, but I may be
right.
Marius Myburg
----------
> From: Protozone <foster AT tig DOT com DOT au>
> To: djgpp AT delorie DOT com
> Subject: Error: cannot convert `regs' from type `REGS' to type `REGS *'
> Date: Monday, November 22, 1999 9:17 AM
>
> Hi,
> I'm trying out some basic graphics in DJGPP using a tutorial I found (
and
> when compiling RHIDE gives me the error:
> Error: cannot convert `regs' from type `REGS' to type `REGS *'
> I was wondering if anyone could tell me what this means and (hopefully)
how
> to fix it... Here is the source:
>
> #include <dos.h>
> #include <bios.h>
> #include <dpmi.h>
> #include <stdio.h>
> #include <conio.h>
> #include <math.h>
> #include <stdlib.h>
> #include <go32.h>
> #include <pc.h>
> #include <sys/nearptr.h>
>
> // Init VGA Mode Function Prototype
> int init_vga_mode(void);
>
> // Global Variables
> char *vgamemory;
> char *vgabuffer;
>
> // Main Function
> void main()
> {
> init_vga_mode();
> }
>
> // Init VGA Mode Function
> int init_vga_mode(void)
> {
> union REGS regs;
> __djgpp_nearptr_enable();
> vgamemory=(char *)(0xA0000 + __djgpp_conventional_base);
> if((vgabuffer=(char *)malloc(320*200))==NULL)
> {
> return(1);
> }
> regs.h.ah=0x00; file://Procedure 0x00: Set Video Mode
> regs.h.al=0x13; file://The mode to set (0x# = #h)
> int86(0x10, regs, regs); file://Call BIOS intr 0x10
> return(0);
> }
>
>
- Raw text -