Path: utzoo!utgpu!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!osu-cis!killer!pollux!ti-csl!mips!holland From: holland@mips.csc.ti.com (Fred Hollander) Newsgroups: comp.sys.mac.programmer Subject: How to Patch Keywords: nothing to do with MF or GNE Message-ID: <62672@ti-csl.CSNET> Date: 3 Nov 88 17:07:22 GMT Sender: news@ti-csl.CSNET Lines: 42 I would like to patch the Alert trap and I've been having a hard time finding documentation that spells out the procedure on patches. I understand the basic idea: save the existing trap address, set the trap address to point to your patch, call the old trap, return. What's missing is how to install the patch in the first place. I don't know anything about a PTCH resource. How do I install the code permanently in the System heap? Here's a first pass at trying to update the trap dispatch table. The trap address for SysBeep seems to have changed while in LSC (by re-executing GetTrapAddress), but after exiting, the trap address reverts back to the original address. #define trapSysBeep 0xA9C8 long oldTrapAddress; newBeep (ignore) int ignore; { asm{ move.l oldTrapAddress,A1 jsr (A1) rts } } main () { oldTrapAddress = GetTrapAddress (trapSysBeep); SetTrapAddress (newBeep, trapSysBeep); } If someone could send me an example, preferrably in LSC, I'd sure appreciate it. Thanks, Fred Hollander Computer Science Center Texas Instruments, Inc. holland%ti-csl@csnet-rela The above statements are my own and not representative of Texas Instruments.