3 * Copyright (C) 1998 Brainchild Design - http://brainchilddesign.com/
5 * Copyright (C) 2001 tarzeau@space.ch
7 * Copyright (C) 2002 Florian Schulze - crow@icculus.org
9 * Portions of this code are from the MPEG software simulation group
10 * idct implementation. This code will be replaced with a new
11 * implementation soon.
13 * This file is part of Jump'n'Bump.
15 * Jump'n'Bump is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * Jump'n'Bump is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
38 #include <sys/nearptr.h>
41 #define DJ_SD_TYPE_NOSOUND 0
42 #define DJ_SD_TYPE_SBLASTER 1
44 #define DJ_SFX_TYPE_SSS 0
45 #define DJ_SFX_TYPE_WAV 1
46 #define DJ_SFX_TYPE_SMP 2
49 typedef struct dj_hardware_info {
57 typedef struct dj_mixing_info {
58 char sfx_volume, num_sfx_channels;
59 char mod_volume, num_mod_channels;
60 char stereo_mix, auto_mix;
61 unsigned short mixing_freq;
62 unsigned short dma_time, dmabuf_len;
64 unsigned long dmabuf_address[2];
68 typedef struct sfx_data {
70 unsigned short default_freq;
74 unsigned long loop_start, loop_length;
78 typedef struct dj_mod_info {
87 unsigned short length;
90 unsigned short loop_start;
91 unsigned short loop_length;
101 extern char dj_init(void);
102 extern void dj_deinit(void);
103 extern void dj_start(void);
104 extern void dj_stop(void);
105 extern void dj_set_nosound(char flag);
106 extern char dj_set_sd(char sd_type, short port, char irq, char dma);
107 extern char dj_autodetect_sd(void);
108 extern void dj_get_sd_string(char *strbuf);
109 extern char dj_set_stereo(char flag);
110 extern void dj_reverse_stereo(char flag);
111 extern void dj_set_auto_mix(char flag);
112 extern unsigned short dj_set_mixing_freq(unsigned short freq);
113 extern void dj_set_dma_time(unsigned short time);
114 extern char dj_get_hardware_info(dj_hardware_info *ptr);
115 extern char dj_get_mixing_info(dj_mixing_info *ptr);
116 extern char dj_get_mod_info(char mod_num, dj_mod_info *ptr);
117 extern void dj_set_fake_vu_speed(unsigned char speed);
118 extern unsigned char dj_get_fake_vu(char channel);
119 extern char dj_reset_sd(void);
121 extern char dj_mix_needed(void);
122 extern void dj_mix(void);
124 extern char dj_set_num_sfx_channels(char num_channels);
125 extern void dj_set_sfx_volume(char volume);
126 extern char dj_get_sfx_volume(void);
127 extern void dj_play_sfx(unsigned char sfx_num, unsigned short freq, char volume, char panning, unsigned short delay, char channel);
128 extern char dj_get_sfx_settings(unsigned char sfx_num, sfx_data *data);
129 extern char dj_set_sfx_settings(unsigned char sfx_num, sfx_data *data);
130 extern void dj_set_sfx_channel_volume(char channel_num, char volume);
131 extern void dj_stop_sfx_channel(char channel_num);
132 extern char dj_load_sfx(FILE *file_handle, char *filename, int file_length, char sfx_type, unsigned char sfx_num);
133 extern void dj_free_sfx(unsigned char sfx_num);
135 extern char dj_ready_mod(char mod_num);
136 extern char dj_start_mod(void);
137 extern void dj_stop_mod(void);
138 extern void dj_set_mod_volume(char volume);
139 extern char dj_get_mod_volume(void);
140 extern char dj_load_mod(FILE *file_handle, char *filename, char mod_num);
141 extern void dj_free_mod(char mod_num);