home *** CD-ROM | disk | FTP | other *** search
- Path: bruce.cs.monash.edu.au!not-for-mail
- From: bmeyer@bruce.cs.monash.edu.au (Bernd Meyer)
- Newsgroups: comp.sys.amiga.programmer,comp.sys.amiga.advocacy,comp.os.ms-windows.advocacy
- Subject: Re: intuition inefficient ?
- Followup-To: comp.sys.amiga.programmer,comp.sys.amiga.advocacy,comp.os.ms-windows.advocacy
- Date: 26 Feb 1996 08:50:03 GMT
- Organization: Computer Science, Monash University, Australia
- Distribution: world
- Message-ID: <4grs7r$plr@harbinger.cc.monash.edu.au>
- References: <4gm2qg$8lk@sunsystem5.informatik.tu-muenchen.de>
- NNTP-Posting-Host: molly.cs.monash.edu.au
- X-NNTP-Posting-User: bmeyer
- X-Newsreader: TIN [UNIX 1.3 950823BETA PL0]
-
- Juergen "Rally" Fischer (fischerj@Informatik.TU-Muenchen.DE) wrote:
- :
- : My argument was, that a given hardware, if supplying all those goodies
- : like vblank interrupt and timers would run animations best with
- : kickstart. His re was that future Win versions might also support this
- : and that kickstart isn't portable due to its features. Well, a Win
- : version using vblank would need something more than a PC, something
- : with a blank interrupt. An Amiga, for example ;)
-
- Or, Juergen, a PC with a VGA card? Shocking idea, isn't it? But guess
- what --- there is two standard ways to catch the vblank signal on a
- VGA card, and one of them is using an interrupt.
-
- Most animation programs, however, go with the other way --- which is
- making sure you start waiting for it a bit early, and just poll the
- register. This is due to the fact that almost everyone quickly disables
- the vblank interrupt as wasting valuable resources.
-
- Now of course, you might not want to have to make sure that you are
- in the right spot at the right time. You might want to run the main
- loop of you program as fast and long as possible --- no problem. You
- want an interrupt, you get one. How?
-
- Well, when you start the program and switched into the desired mode,
- you just take half a second to actually measure the frequency of the
- vblank signals. You can then set up one of those high precision timers
- found in every single PC, and start it as soon as you see the next
- vblank signal.
-
- Now of course you set it to a time that is only marginally shorter than
- the time it takes the video card to display one full screen. So as soon
- as that timer interrupt kicks in, you set it up again, then wait for
- the vblank signal (which will happen almost immediately), and restart
- the timer as soon as you see it.
-
- Next you do whatever you want to do when the vblank signal appears, and
- afterwards simply return from the interrupt and go on with your main
- loop.
-
- Now was that really so hard? All of the functionality used in this
- example is very well documented and readily available under DOS and,
- I presume, Windows.
-
- : We flamed what's more likely, kickstart getting mem protection features
- : or win getting vblank features ;)
-
- You probably know where my money is. Have a look at the SVGALIB for
- linux, especially the "wait_vblank" function....
-
- : I can't believe they'll ever implement those nice little things A500
- : already had (vblank & stuff) into PC hardware _and_ the OSes (win, linux).
-
- And I can't believe how narrow-minded you are, sorry.
-
- Bernie
-
-