1 /* Project 16 Source Code~
\r
2 * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
\r
4 * This file is part of Project 16.
\r
6 * Project 16 is free software; you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation; either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * Project 16 is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with this program. If not, see <http://www.gnu.org/licenses/>, or
\r
18 * write to the Free Software Foundation, Inc., 51 Franklin Street,
\r
19 * Fifth Floor, Boston, MA 02110-1301 USA.
\r
26 #include "src/lib/16_head.h"
\r
27 #include "src/lib/16_tail.h"
\r
28 #include <hw/8254/8254.h> /* 8254 timer */
\r
29 #include <hw/adlib/adlib.h>
\r
30 #include <hw/vga/vga.h>
\r
31 #include <hw/dos/dos.h>
\r
32 #include <hw/8259/8259.h>
\r
34 #define MIN_REGISTER 0x01
\r
35 #define MAX_REGISTER 0xF5
\r
36 #define ADLIB_FM_ADDRESS 0x388 /* adlib address/status register */
\r
37 #define ADLIB_FM_DATA 0x389 /* adlib data register */
\r
40 * FM Instrument definition for .SBI files - SoundBlaster instrument
\r
41 * - these are the important parts - we will skip the header, but since
\r
42 * I am not sure where it starts and ends so I have had to guess.
\r
43 * However it SEEMS! to work. Each array has two values, one for
\r
47 byte SoundCharacteristic[2]; /* modulator frequency multiple... */
\r
48 byte Level[2]; /* modulator frequency level... */
\r
49 byte AttackDecay[2]; /* modulator attack/decay... */
\r
50 byte SustainRelease[2]; /* modulator sustain/release... */
\r
51 byte WaveSelect[2]; /* output waveform distortion */
\r
52 byte Feedback; /* feedback algorithm and strength */
\r
55 //extern void interrupt (*old_irq0)(void);
\r
57 void opl2out(word reg, word data);
\r
58 void opl3out(word reg, word data);
\r
59 void opl3exp(word data);
\r
61 void FMReset(void/*int percusiveMode*/);
\r
62 void FMKeyOff(int voice);
\r
63 void FMKeyOn(int voice, int freq, int octave);
\r
64 void FMSetVoice(int voiceNum, FMInstrument *ins);
\r
66 void SD_Initimf(global_game_variables_t *gvar);
\r
67 void SD_imf_free_music(global_game_variables_t *gvar);
\r
68 int SD_imf_load_music(const char *path, global_game_variables_t *gvar);
\r
69 void interrupt SD_irq0(void);
\r
70 void SD_imf_tick(global_game_variables_t *gvar);
\r
71 void SD_adlib_shut_up();
\r
73 #endif /*__16_SND_H_*/
\r