1 #include "types.h"
2 #include "festalon.h"
3 
4 /*	Load an NSF from "buf" of size "size".
5 	Returns NULL on failure(memory allocation failed).
6 */
7 FESTALON *FESTAI_Load(uint8 *buf, uint32 size);
8 
9 
10 /*	Intialize emulation to use a sound playback rate of "rate" and a quality of "quality"(0 or 1).
11 	Quality "1" has a better frequency response in frequencies near the filters' cutoff frequencies.
12 
13 	This function should be called after FESTAI_Load(), and at least once before any other FESTAI_*()
14 	functions are called.
15 */
16 int FESTAI_SetSound(FESTALON *fe, uint32 rate, int quality);
17 
18 #define FESTAGFI_TAGS		0x1
19 #define FESTAGFI_TAGS_DATA	0x2
20 
21 FESTALON *FESTAI_GetFileInfo(uint8 *buf, uint32 size, int type);
22 void FESTAI_FreeFileInfo(FESTALON *fe);
23 
24 /* Emulate a segment of sound(approximately equal to the length of sound
25    of one video frame on the real system).  Returns a pointer to the sound
26    data.  Pass a pointer to an int variable to receive the amount(in samples)
27    of sound data generated.
28 */
29 float *FESTAI_Emulate(FESTALON *, int *Count);
30 
31 /* Sets the sound volume, in percentage.  100 is the default, and should not
32    be exceeded by default, as it can cause clipping with a few expansion
33    sound chips(this will probably be fixed in the future by reducing the
34    total volume of all output when some expansion chips are used).
35 
36    Returns the current volume(interal limits are set on how high the volume can be).
37 */
38 int32 FESTAI_SetVolume(FESTALON *, int32 volume);
39 
40 /* Changes the current song.  The current song is numbered starting from 1.
41    If o is zero, adjust the song number by the value specified by z.  Otherwise,
42    z will specify the song number.  Returns the adjusted/active song number.
43 */
44 int FESTAI_SongControl(FESTALON *, int z, int o);
45 
46 /* Free all memory associated with the FESTALON "object" pointer passed */
47 void FESTAI_Close(FESTALON *);
48 
49 /* Specify a channel disable mask.  The lower 5 bits(least-bit first) correspond
50    to the internal sound channel, and the adjacent higher bits correspond
51    to the expansion sound channel(s), if present.
52 */
53 void FESTAI_Disable(FESTALON *, int);
54 
55 int FESTAI_SetLowpass(FESTALON *, int on, uint32 corner, uint32 order);
56 
57 
58 /* Creates an NSF in memory, returning a pointer to it, and setting "totalsize" to
59    the size of the buffer/NSF.
60    Returns 0 on failure.
61 */
62 uint8 *FESTAI_CreateNSF(FESTALON *fe, uint32 *totalsize);
63 
64 uint8 *FESTAI_CreateNSFE(FESTALON *fe, uint32 *totalsize);
65