[comp.sys.atari.st] GEM question: how to ring a bell?

STOOP@KVI.NL ("P.Stoop, KVI, Zernikeln 25, 9747 AA Groningen, NL") (12/15/89)

Netters,
Can anyone tell me how to ring the bell from within a GEM application?
From a TOS program it's no sweat, i know: printf("%c", 7); works fine.
If you try this from a GEM application you just get the symbol for char(7)
somewhere on you screen. I suppose there shoud be a VDI output function for
this but my MEGAMAX manual does not list such a function.

dag@per2.UUCP (Daniel A. Glasser) (12/20/89)

In article <0B4A9973765F4011CF@KVI.nl>, STOOP@KVI.NL ("P.Stoop, KVI, Zernikeln 25, 9747 AA Groningen, NL") writes:
> Can anyone tell me how to ring the bell from within a GEM application?
> From a TOS program it's no sweat, i know: printf("%c", 7); works fine.
> If you try this from a GEM application you just get the symbol for char(7)
> somewhere on you screen. I suppose there shoud be a VDI output function for
> this but my MEGAMAX manual does not list such a function.

This is relatively easy so long as you don't care about porting this
program to non-ST/STE/TT platforms.  There is a sound daemon built in to
TOS that allows you to make sounds and continue the normal flow of your
program concurrently.  The function is called Dosound, and is XBIOS function
#32 (decimal).

Dosound takes a single parameter which is a pointer to an array of unsigned
bytes.  This array contains commands to the sound daemon which load various
sound chip (and psudo) registers and commands which control looping and
sound output.  It returns a pointer to the current sound list position
(usually NULL) so interrupted sound lists can be restarted (though this
may cause rather odd results -- no sound register contents are preserved)
or so you can detect when the sound has completed.  See your compiler's
documentation for more details.

I'd type in an example, but I don't have any real ST documentation
here with me at work.  (I've got a copy of xbios.h from the MWC dist,
so I know the XBIOS function number and number of parameters, but that's
all.)

Anyway, using Dosound should work just fine, and allows much more interesting
sounds than just the bell (how 'bout a gun-shot, siren, bomb, or laser rifle?)
I hope this helps.
						Daniel A. Glasser
						    Trapped in the body of a
						    IBM PC programmer.
-- 
 _____________________________________________________________________________
    Daniel A. Glasser                           One of those things that goes
    uwvax!per2!dag                              "BUMP!!!(ouch)" in the night. 
 ---Persoft, Inc.---------465 Science Drive-------Madison, WI 53711-----------