www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/27/16:37:33

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Questions about Allegro
Date: Thu, 27 Feb 1997 19:43:11 +0000
Organization: None
Distribution: world
Message-ID: <RwLHbJAPPeFzEwdg@talula.demon.co.uk>
References: <01bc2460$9a92bee0$8c081ecb AT sly>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 57
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Sly writes:
>These are a few questions that I have concerning the Allegro library...
>
>1. Why do the timer routines have to be installed in order to be able to
>see the mouse on SVGA resolutions?

Because the mouse pointer is drawn inside the timer interrupt handler. I
originally tried drawing the pointer directly in the mouse movement
interrupt, which is the logical place, but that was very unstable and
locked up on a lot of machines, so now the mouse interrupt just sets a
flag which causes the pointer to be redrawn in the next timer interrupt.
If the timer isn't installed, this means it will never get drawn...

>2.  What is happening when install_timer() is called, and Win95 complains
>about the program should be run in MS-DOS mode?  Cancel this requester and
>the program looks like it is running normally, and any subsequent execution
>of programs in that DOS box do not show this warning.  Is the program
>*really* running normally, or is something screwy going on in the
>background?

It's running quasi-normally, but with a 1-cycle lag between me adjusting
the interrupt speed and win95 noticing that it has changed :-) This
means that the timers will be out by up to 1/18.2 of a second.

If you grab Allegro 2.2 (from Simtel or my web page), you'll find a
version of the timer code which works round this problem. The warning no
longer comes up, and under win95 the timers are now accurate to 1/200 of
a second.

>3. I have read elsewhere that the timer should be reset to normal (ie. 18.2
>ticks/sec) before any disk access.  Is this still necessary?

Allegro takes care of this for you. It is a good idea not to access the
disk while running accelerated timers (not essential, but a lot of
floppy disk controllers use the timer interupt to switch off the drive
motor after the access is completed), but Allegro will call the original
timer handler at the correct 18.2 ticks/sec regardless of what you are
doing with it, so the disk controller stays happy.

>4. Are the various ModeX screen modes restricted to use the first 256k of
>video memory only?  Or do I have to use the VESA modes to access the rest
>of video memory?

Yup. Mode-X can only access 256k. This is a restriction of the VGA
hardware design: the video memory is accessed through a 64k aperture at
0xA0000, and together with the four planes used by the mode-X
architecture, that gives 256k. To access memory above that limit you
need to switch to a VESA mode. Unfortunately most VESA implementations
don't support resolutions below 640x400, but if you grab a copy of
UniVBE, it will give you various mode-X style (320x200, 320x240,
360x200, etc), resolutions that work on the majority of cards.


/*
 *  Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
 *  Beauty is a French phonetic corruption of a short cloth neck ornament.
 */

- Raw text -


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