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