From: eonu24@castle.ed.ac.uk (I Reid)
Newsgroups: gnu.gcc.help,comp.os.msdos.programmer
Subject: djgpp 2.2.2 Q's: mouse/svga/assembler/bios
Date: 6 Sep 92 13:33:54 GMT
Distribution: gnu, comp
Organization: Edinburgh University

Subject: DJGPP 2.2.2 questions (mouse/video/assembler)

I updated my copy of djgpp to version 2.2.2 and have been happily using
it for some VGA/SVGA graphics programming in the 256 color modes (+ a
little bit in the 32K colour Hicolor modes... nice!). As a consequence
of all this, I have a few questions which I haven't been able to answer
as yet.

Thanks in advance for any information which anyone can give me. I
will, of course, summarise anything I receive and post it here if
there is a demand.

Iain Reid [Iain_Reid@ed.ac.uk]

Those questions.... 

Summary:

1. Where is the best place to ask djgpp questions ?
2. Problems with Trident 8900 chipset and djgpp ?
3. Mouse support (non libgr.a)? 1 svga bank only ok ?
4. Interrupt routines ?
5. 386 assembly & bios

Question 1: Asking questions about djgpp

Where is the best place to ask programming questions about djgpp? Is
there a mailing list/Usenet group that I should be looking at. Most of
my djgpp specific code will be for 8 bit graphics with assembly
routines for palette manipulation etc. Are there groups of people
working on/with similar things?

Question 2: Trident 8900 driver problems.

I have a Tseng ET4000 based svga board with a Sierra HiColor RAMDAC
and the standard driver (tseng4k.grd) works perfectly for everything I
have tried so far. Unfortunately my flatmate has not had the same
success with his trident 8900 based board (in a 486-50). We have tried
the trident.grd and tridnt89.grd without any success. I know my test
code is running perfectly on his machine in text mode so the problem
is definitely something to do with the graphics. Has anyone else had
this difficulty and found a solution?

Question 3: Murine musings

Much of the code I have been writing recently has been to aid
manipulation of sets of 8 bit graphics data files and I wanted to add
mouse support to it. I dug out some source to a previous version of
djgpp, temporarily copied libsrc\gr\int33.s to my source tree and have
been experimenting with that as a usable interface to the int33 mouse
driver. I tried to get a visible cursor using int33 (ax = 3) and
although this works succesfully in mode 0x13 (320x200x256) it doesn't
work in mode 0x2e (640x480x256). Is there any way to use this method
to get a visible cursor in all modes? My guess is that it works in
mode 0x13 because either there is only support for it in strictly VGA
modes or it works because 320x200x256 fits into the 64K vga window
without paging. Is either of these correct and is there a solution
that allows the use of the mouse driver to display the cursor in all
modes (including 800x600 and 1024x768 (both x256))?

Question 4: Interrupt routines

Are interrupt handlers possible using djgpp? Can anyone give me an
example of source code for one?

Question 4: 386 assembler and BIOS

2 questions really...

1. I'm fairly comfortable with 80x86 assembly language and make extensive
   use of the inline assembly features of Borland's Turbo C compiler. I
   read somewhere in the djgpp docs that it supports inline assembly? Can
   anyone send me an example of some to point me in the right direction?

2. Some BIOS functions require arguments in the ES:BP or ES:DX format
   (e.g int 10h, ax = 1130h (get font information)). What is the best
   way to interface to these from C. For example, int 33h function 9
   (set graphics cursor) requires ES:DX to point to a 16 byte bitmap.
   What would need to be done to this code fragment to achieve this?

   #include <sys/registers.h>
   char bitmap [16];
   REGISTERS reg;

   fill_bitmap (bitmap);    /* Fill bitmap with bits */	
   reg.ax = 0x9;
   reg.dx = ??;  <-- what goes here before the call to int33?
   int33 (&reg);