Article View: comp.sys.mac
Article #17173vbl queue
From: Bob Loewenstein
Date: Sat, 04 Jul 1987 17:19
Date: Sat, 04 Jul 1987 17:19
56 lines
1788 bytes
1788 bytes
Here is some code I wrote in Neon that posts a procedure to the vbl queue. I think it's self explanatory even if you don't know Neon. :code vinstall move.l (a7)+,a0 call vinstall ext.l d0 move.l d0,-(a7) ;code :code vremove move.l (a7)+,a0 call vremove ext.l d0 move.l d0,-(a7) ;code :CLASS vbl <super object var qlink int qtype var procPtr int vblCount int vblPhase ( 1/60ths of second -- ) :M SetDelay: put: vblCount ;M ( cfaProc -- errcode) :M install: +base put: procptr abs: self vinstall abort" install error" ;M ( -- errcode) :M remove: abs: self vremove abort" remove error" ;M :M classinit: 1 put: qtype ;M ;class vbl myTask \ Now to use this, create a :proc definition which is the background task \ you want to perform. You can set the delay (in 1/60ths \ of a second) for periodic execution using the setDelay: method. The \ task itself must reset this delay everytime it executes. The task \ should ultimately be written in assembly, since all other events \ are on hold while your word is being executed. \ example below \ :Proc beeper 1 beep 120 setdelay: myTask ;proc \ 120 setdelay: myTask \ 'c beeper install: myTask \ to remove, say remove: myTask
Technical Details
Message-ID:
<3873@oddjob.UChicago.EDU>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!uwvax!oddjob!rflShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!uwvax!oddjob!rfl From: rfl@oddjob.UChicago.EDU (Bob Loewenstein) Newsgroups: comp.sys.mac Subject: vbl queue Message-ID: <3873@oddjob.UChicago.EDU> Date: Sat, 4-Jul-87 13:19:04 EDT Article-I.D.: oddjob.3873 Posted: Sat Jul 4 13:19:04 1987 Date-Received: Sat, 4-Jul-87 20:14:40 EDT Reply-To: rfl@oddjob.UChicago.EDU (Bob Loewenstein) Distribution: world Organization: U of Chicago - Astronomy & Astrophysics Lines: 56