/* This file is part of the GMOD package */

#define IDENT  "@(#) gmod version 1.3a"

#define TRUE 	1
#define FALSE	0

/* module types */
#define MODULE_NOT_S3M		0
#define MODULE_S3M		1

/* frequencies */
#define C2FREQ                  261632
#define NTSC_RATE               8363
#define PAL_RATE                8287

#define CVT_MOD_SPEED(x)        ((x) < 32 ? CMD_SET_TICKS : CMD_SET_BPM)

#define MIN(a, b)		((a) < (b) ? (a) : (b))

#define BYTE(x)		(*(u_char *)(x))
#define INTEL_SHORT(x)	(BYTE(x)  | (BYTE(x+1) <<8))
#define INTEL_LONG(x)	(INTEL_SHORT(x) | (INTEL_SHORT(x+2) <<16))

#define TICKS_PER_DIVISION(x)  (ticks_per_division = x)
#define TEMPO(x)               (tick_duration = 250.0 / x)

#define MAX_TRACK	32
#define MAX_PATTERN	256
#define MAX_POSITION	256
#define MAX_SAMPLES	255

#define HDR_SIZE        0x30	/* number of bytes to read to determine
				   module type */
#define VOL_SLIDE_RATE	4	/* rate for volume slides, bigger is faster */

/* slide defines */

#define SLIDE_UP	1	/* slide up */
#define SLIDE_DOWN      2	/* slide down */
#define SLIDE_ONCE	3	/* only slide once */
#define SLIDE_PORT	4	/* tone portamento */

#define SLIDE_NEG       0	/* positive rate */
#define SLIDE_POS       1	/* negative rate */

#define SLIDE_PERIOD_LIN  0
#define SLIDE_FREQ_LIN    1

#define SLIDE_RATE_669    2

/* panning flags */
#define PAN_NO_HARDWARE	0
#define PAN_HARDWARE	1

/* move types (bit flags) */

#define MOVE_LOOP	0x01
#define MOVE_JUMP	0x02
#define MOVE_EXIT	0x04

/* volume types */

#define VOL_LINEAR      0
#define VOL_LOG         1

/* exit codes */
#define ERR_NOERROR     0	/* no error - normal termination */
#define ERR_BADARGS     50	/* bad arguments */
#define ERR_SEQUENCER   51	/* error accessing sequencer */
#define ERR_BADLOAD     52	/* error loading a module */
#define ERR_NOGUS       53	/* no GUS found */
#define ERR_FORK        54	/* error forking */

/* timer state */
#define TIMER_OFF     0
#define TIMER_ON       1

/* terminal state */
#define TERMINAL_RAW   0
#define TERMINAL_RESTORE  1

/* stop types (non-zero) */
#define STOP_NEXT      1	/* stop current, go to next */
#define STOP_EXIT      2	/* stop current and exit */
#define STOP_PREV      3	/* stop current, go to previous */

/* special orders */
#define ORDER_STOP     -1	/* stop playing */
#define ORDER_SKIP     -2	/* skip position */

/* special notes */
#define NOTE_STOP      254	/* stop note playing */
#define NOTE_LAST      255	/* use last note played on channel */

/* mixer defines */
#define MIXER_MIN_VOL  0
#define MIXER_MAX_VOL 100

#define NUM_PERIODS 127		/* number of periods in period table */
#define NUM_VIBRA 64		/* number of values in vibrato table */
#define NOTE_BASE 1		/* lowest note possible */

#define DECOMP_PGM      "/usr/bin/gunzip -c "	/* program for decompression */
/* USE FULL PATHNAME because of possible security hole */
