[comp.sys.atari.st] Help with timerA disassembling play.prg

dmb@wam.umd.edu (David M. Baggett) (05/04/91)

In article <1147@uqcspe.cs.uq.oz.au> warwick@cs.uq.oz.au writes:
>Check out what TimerB, C and D do, check Internals (though from memory
>there was a bug in that part :-( ), or grab play.arc from atari.archive
>and look for the interrupt code that writes to the Yamaha chip.

It bothers me that you're recommending that someone disassemble my code
and use it verbatim.  Whether or not this is legal, I have no idea, but
please note that play.prg is COPYRIGHTED, although it's freeware.  It's
NOT public domain.  This is the sort of thing that makes people not
release their software as shareware at all, especially considering that
only a handful of people every attach the programmer's name to the "gift"
in references like the above.

For the record, I've gotten many requests for my sample playing source
code, and I regret that I can't give it out because it's for a
commercial product.  In the past I have given detailed explanations of
how to play digitized sound on the ST, posted here.  I don't have time
to do it again at the moment, unfortunately.

Instead of disassembling play.prg, please look for resound.arc on
atari.archive.  If it's not already there, I'll put it there.  It's by
David Snow and implements the same techniques my routines do.  Source
is included in the arc file.

I don't mean to flame you, Warwick.  On the contrary, I'm glad you
post here -- your articles are quite helpful.  But consider how you'd
feel if I disassembled STrabble and used your dictionary without
your permission.


Dave Baggett
dmb%wam.umd.edu@uunet.uu.net

warwick@cs.uq.oz.au (Warwick Allison) (05/06/91)

I wrote:

>>Check out what TimerB, C and D do, check Internals (though from memory
>>there was a bug in that part :-( ), or grab play.arc from atari.archive
>>and look for the interrupt code that writes to the Yamaha chip.

I'd like to appologise to Dave for seeming to suggest anyone use his code.
I meant only to indicate a place to see interrupt code.  I was talking
about the couple of lines of hand waving the systems requires - you have
to reset interrupt pending flags or something.  The last thing I would
suggest is for someone to grab Dave's code verbatim - or grab anyone's.
Nobody learns anything by just copying code.

Now, to write a Timer A interrupt:

Use the XBIOS function Xbtimer to set the vector to your handler.
Your handler should:
	1. Save and restore ANY registers it uses.
	2. Before you exit, clear bit 5 of $fffffa0f, the Interrupt in-service
		bit for timer A.
	3. Exit using RTE

That, I think, is the bare essentials.  Dave would nodoubt do exactly that.
So would any other program used Timer A.

Warwick.
--
  _-_|\       warwick@cs.uq.oz.au
 /     *  <-- Computer Science Department,
 \_.-._/      University of Queensland,
      v       Brisbane, AUSTRALIA.