[comp.sys.amiga.tech] Filter ON/OFF ; Direct hardware access

aaron@stat.tamu.edu (Aaron Hightower) (12/17/90)

In article <faheyr.661405562@silver> faheyr@silver.ucs.indiana.edu (Bob Fahey <NECR0SIS>) writes:
>aaron@stat.tamu.edu (Aaron Hightower) writes:
>
>>I have an Amiga3000 and was wondering how I can control the audio filter.
>
>Hmm... I'll probably regret posting this, since the last time I did so, 
>I got flamed to hell. (I am talking about reading/writing registers directly).
>
>filter_on:	move.w	#$7000,$bfe000
>filter_off:	move.w	#$7002,$bfe000
>
>>Thanks,
>> Aaron Hightower

FYI, it worked on the 3000.  I was trying another way that was mentioned before
and couldn't get it to work; just wanted to say thanks, and continue discussion
on hardware registers.  I recently changed a big joystick read portion of one
of my programs to directly read the hardware as described in the HW RKM.
I reduced about 3 pages of code down to about 5 lines.  :-)  I don't think that
there is anything wrong with using hardware registers as long as you are willingto suffer the possible consequences.  In some cases (such as the joystick) I
doubt that I would proceed with the methods described in the Libs/Devs RKM
again.  I found it very tiring to go through so many layers of (unneccesary)
software that inflated my program without need.  It is still possible to write
small C programs, but it is easier to maintain a scope of your program's size
when you are using an assembler (IMHO).  

Thanks for the quick info  
  Aaron Hightower

peter@sugar.hackercorp.com (Peter da Silva) (12/18/90)

In article <10942@helios.TAMU.EDU> aaron@stat.tamu.edu (Aaron Hightower) writes:
> In article <faheyr.661405562@silver> faheyr@silver.ucs.indiana.edu (Bob Fahey <NECR0SIS>) writes:
> >filter_on:	move.w	#$7000,$bfe000
> >filter_off:	move.w	#$7002,$bfe000

> It is still possible to write
> small C programs, but it is easier to maintain a scope of your program's size
> when you are using an assembler (IMHO).  

This has nothing to do with C versus Assembler. Try this:

	unsigned short *filter = ((unsigned short *)0xbfe000);
	*filter = 0x7000;
	*filter = 0x7002;

(modulo games with volatile to defeat the optimiser)

You can talk to the hardware directly in C, or assembler. You can use the ROMS
in C, or assembler. If you bypass the ROMS one day someone is going to get
pissed off when their whizz-bang joystick handler doesn't work with your
program.

But for the third time that's got nothing to do with whether your program is in
C or assembler, other than that folks who are into assembler are more likely to
want to play with the silicon directly.

Just make sure you get the address of the joystick registers from the ROMs,
and that you tell them you're stealing a game port.
-- 
Peter da Silva.   `-_-'
<peter@sugar.hackercorp.com>.