[comp.sys.amiga] DMA control

BBOURBIN@UMDD.BITNET (Brett S Bourbin) (03/04/88)

I am writing a assembly language game and I am not using Intuition in the
program so I disable Intuition from using port 0, which I use for my own
control, and I want to get rid of all the sprites.  I do not use the sprite
hardware at all, since I use an overscanned screen, so I want to shut down all
sprite DMA and turn off raster DMA until I set up my screen.

So here is the code I am using:
      XREF _custom
      movea.l _custom,a6
      move    #DMAF_RASTER!DMAF_SPRITE,dmacon(a6)

and to turn it on:
      move    #DMAF_SETCLR!DMAF_MASTER!DMAF_RASTER,dmacon(a6)

Is this the correct method for doing this, or do I have to SetPointer() to
a null sprite?  Also, is this legal, since this is direct hardware access or
is there a system function to turn off/on the DMA?  I want to follow all the
rules that Commodore states, but I can find no information on this.

Brett S Bourbin
President Selgus Ltd.
BITNET: BBOURBIN@UMDD

bryce@eris (Bryce Nesbitt) (03/08/88)

In article <8803031951.AA06762@jade.berkeley.edu> BBOURBIN@UMDD.BITNET (Brett S Bourbin) writes:
>I am writing a assembly language game and I am not using Intuition in the
>program so I disable Intuition from using port 0....
>
>[should I write to the hardware, or...]
>
>or do I have to SetPointer() to a null sprite?

In general, I say:

	If you are going to take over the system, do so.
	If you are not going to take it over, don't.

Wishy-washy in-betweeness creates messes.  (For example, if you play with
direct hardware copper lists, and leave intuition running at the same time.)

1> So, if your code is non-multitasking and writing to hardware anyway,
then just disable sprite DMA. 
2> If you are running under Intuition, the the *only* proper way is to set
the pointer to nothing (Intuition will handle showing the lack of a pointer
only when your window is active).


I make an exception to the above policy for "switchers" (ala mac :-).
These programs, usually games, will have somthing like a "Pause"
and "Resume" button set.  When the game is active it takes over the
entire machine.  When the game is paused, it gives it all back and
sits quietly out of harm's way.  The best of both worlds, for the
most part.

|\_/|  . ACK!, NAK!, EOT!, SOH!
{O_o} .     Bryce Nesbitt
 (")        BIX: mleeds (temporarily)
  U	    USENET: bryce@eris.berkeley.EDU -or- ucbvax!eris!bryce