home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
519b.lha
/
WaveMaker_v1.2
/
utils.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-09
|
799b
|
43 lines
#include <exec/types.h>
/****************************************************************/
USHORT amptopot(amp)
/* Convert an amplitude to an integer to put in the proportional */
/* gadget's VertPot value. */
LONG amp;
{
USHORT temp;
temp = (127-abs(amp))<<9;
return(temp);
}
/****************************************************************/
LONG pottoamp(pot,potsign)
/* Converts a proportional gadget's VertPot value to an amplitude */
USHORT pot;
SHORT potsign;
{
LONG temp;
temp = (127-(pot>>9))*potsign;
return(temp);
}
/************************************************************/
LONG randamp()
/* Picks a random amplitude (for the game mode) */
{
LONG temp;
temp=(rand()&0xFF)-127;
if (temp==128) temp=127;
return(temp);
}