Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!nosc!crash!jcs From: jcs@crash.cts.com (John Schultz) Newsgroups: comp.sys.amiga.tech Subject: Re: Bypassing the Audio Filter Message-ID: <3667@crash.cts.com> Date: 25 Jul 90 03:35:13 GMT References: <90195.001845L98CC@CUNYVM.BITNET> <3519@crash.cts.com> <826@bilver.UUCP> Organization: Crash TimeSharing, El Cajon, CA Lines: 27 In article <826@bilver.UUCP> alex@bilver.UUCP (Alex Matulich) writes: >In article <3519@crash.cts.com> jcs@crash.cts.com (John Schultz) writes: >>In article <90195.001845L98CC@CUNYVM.BITNET> L98CC@CUNYVM writes: >>> I want to write a program to turn off the hi-frequency filter on A500. >>>I do know that setting a certain bit in certain address will turn it off. >>>What is that address and bit? But even better, is there a system call I can >> >> In C: >> unsigned char * filter = (unsigned char *)0xBFE001; >> *filter = (*filter) & 0xfe; /* Turn off */ >> *filter = (*filter) | 1; /* Turn on */ > >No, NO! You only need to switch the second bit! > >For example, to toggle the bit on and off, you would say, > >*filter ^= 2; Whoops. Looks like I goofed the translation from assembly to C. Good eye, Alex. The above example only changes one bit, albeit the wrong bit. Should read: *filter = (*filter) & 0xfd; /* Turn off */ *filter = (*filter) | 2; /* Turn on */ Toggling will work as well, but the prior state cannot be guaranteed, so explicit on/off is best.