Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!unm-la!lanl!cmcl2!ccnysci!alexis From: alexis@ccnysci.UUCP (Alexis Rosen) Newsgroups: comp.sys.mac.programmer Subject: Re: VBL Tasks Message-ID: <1281@ccnysci.UUCP> Date: 17 Feb 89 02:47:05 GMT References: <4398@hubcap.UUCP> <99000007@silver> Reply-To: alexis@ccnysci.UUCP (Alexis Rosen) Organization: City College of New York Lines: 37 There is no way to do this patch stuff without access to registers, which in practice means assembler (you could do in-line asm from pascal, but that's the same thing). If you intend to muck around on this low level, though, you have to at least be able to read assembler. It's really not all that difficult (though coding significant programs in it ain't my idea of fun). If you're not willing, give it up. You won't be able to do it, I think. Anyway, the amount of assembly required is truly minimal. The assembly code posted for patching GetOSEvent is great except for one little problem- it is a tail patch. Tail patches are expressly forbidden, and this routine seems more likely than most to be susceptible to major trouble. On the other hand, my little scheme for legal tail patches would probably make it work. Another problem with this is that it might not work with apps which call WaitNextEvent (I don't know if WNE calls GetOSEvent, but I sort of doubt it). In any event (:-) there is no need to patch the trap. There is a hook already in place. I think it is a low-mem global called jGNEFilter or some such which takes a pointer to a routine. Check IM for more info. There has also been a tech note or two on the subject. I seem to recall that apple now discourages all use of this hook in the latest relevant technote, but that no alternatives are offered. Given this, I would say that the legal tail patch is the most future- compatible way of doing things, but that it may well impair performance (doing four traps + misc. stuff for every GetOSEvent). jGNEFilter will probably stick around for awhile (at least within an app's multifinder partition) so it's probably safe to use it for now. On the other hand, who the hell knows? Not me, that's for damn sure... Alexis Rosen alexis@ccnysci.uucp