Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!uupsi!cci632!ritcsh!ultb!axi0349 From: axi0349@isc.rit.edu (A.X. Ivasyuk ) Newsgroups: comp.sys.apple2 Subject: Re: CPU speed detection Summary: Yes, there is VBL on the //c Message-ID: <1990Dec6.180741.2522@isc.rit.edu> Date: 6 Dec 90 18:07:41 GMT References: <9012052301.AA15585@cs-sun-fsa.cpsc.ucalgary.ca> Organization: Rochester Institute of Technology Lines: 40 In article <9012052301.AA15585@cs-sun-fsa.cpsc.ucalgary.ca>, barcan@CPSC.UCALGARY.CA (Davor Barcan) writes: > I'm currently working on an application that is timing dependent. << stuff deleted>> > the CPU. One method that I can think of is by using the VBL and > keeping a counter until the VBL changes again. Would this be an > accurate method? I'd probably have to keep a very big counter > a very big counter if one happens to be running at 10 Mhz, > assuming that this is an effective method. This should be quite effective, because VBL is guaranteed to change 60 times per second on North American standard Apples. > There's a further complication in that the VBL is handled > differently on a //e and a GS, and as far as I know the //c > doesn't have a VBL (or at least one that works). Does anyone The //e has a VBL register at $C019, I believe, which tells the current state of the VBL. Bit seven indicates whether you are actually in the middle of VBL interrupt. The //gs has a different system, but I don't know about the //gs, since I don't have access to one. On my //c, however, you can have the (built-in) mouse card interrupt your program every time there is a VBL interrupt and proceed to run an interrupt routine. The easiest was to install interrupt routines is through the ProDOS system calls. I believe the //e mouse card and the gs mouse firmware behave in the same way as the //c. There is a program called Daemon which is, I believe, shareware, which runs stuff in the background based on the VBL. It should be available on FTP and on the listserv at APPLE2-L (listserv@brownvm.brown.edu). > Davor Barcan > barcan@cpsc.UCalgary.CA > University of Calgary @@@@ @@@@@ @@@@@ Anatoly Ivasyuk @@@ @@@ @ @ @ @ @ @ (axi0349@ultb.isc.rit.edu) @ @ @ @ @ @@@@ @ @ Computer Science House @ @@@ @@@@@ @ @ @ @ Rochester Institute of Technology @ @ @ @ @ @ @ @@@@@ @ "If all else fails, RTFM." @@@ @@@ @ @