www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/22/09:19:46

Date: Mon, 22 Nov 1999 13:24:37 +0200
From: Marius Myburg <iti06469 AT mweb DOT co DOT za>
Subject: Re: Error: cannot convert `regs' from type `REGS' to type `REGS *'
To: djgpp AT delorie DOT com
Message-id: <0FLL00LEGJR9OU@cpt-proxy1.mweb.co.za>
MIME-version: 1.0
X-Mailer: Microsoft Internet Mail 4.70.1154
X-MSMail-Priority: Normal
X-Priority: 3
Reply-To: djgpp AT delorie DOT com

Instead of 
int86(0x10, regs, regs); 
try
int86(0x10, &regs, &regs); 

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019