Mail Archives: djgpp/1996/10/31/01:24:54
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 -