www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/31/01:24:54

Date: Thu, 31 Oct 1996 08:05:26 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Neil Miller <miller AT citilink DOT com>
Cc: djgpp AT delorie DOT com
Subject: Re: Help!! What's wrong with my code??
In-Reply-To: <01bbc6cf$711bd540$21d10bce@miller>
Message-Id: <Pine.SUN.3.91.961031075852.22915G@is>
Mime-Version: 1.0

On 31 Oct 1996, Neil Miller wrote:

> I am new to using DJGPP and am trying to use Denthor's VGA trainers to
> program graphics in 13h.  This is the code I have so far.  This is from the
> first tutorial.  I am getting errors on _AX (from SetMCA & SetText)
> something about the function is not declared??

The code you posted is specific to Borland/Turbo C, it won't compile with 
any other compiler.  Instead of this:

> 	  _AX = 0x0013;
> 	  geninterrupt (0x10);

use this:

	#include <dpmi.h>
	#include <go32.h>

	__dpmi_regs r;
	r.x.ax = 0x0013;
	__dpmi_int (0x10, &r);

> The other is vga, in the
> tutorial it says it is a pointer to the address 0xa000, is this automatic
> or do I have to do something with it??  Any help would be appreciated.

This is too long to explain here.  Please download the DJGPP FAQ list 
(v2/faq202b.zip from the same place you get DJGPP) and read Chapter 18 
there.  Accessing absolute memory addresses is done differently in DJGPP 
because of memory protection (this is what protected mode is all 
about!).  The following excerpt from your code will most probably crash 
your program:

> 	void CLS() {  
> 	  memset(vga, Colour, 0xffff); 
> 	  }

- Raw text -


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