-/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
- *
- * This file is part of Project 16.
- *
- * Project 16 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Project 16 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>, or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-#ifndef __16_SND_H_
-#define __16_SND_H_
-
-#include "src/lib/16_head.h"
-
-#endif /*__16_SND_H_*/
\ No newline at end of file
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2019 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+\r
+#ifndef __16_SD_H_\r
+#define __16_SD_H_\r
+\r
+#include "src/lib/16_head.h"\r
+#include "src/lib/16_tail.h"\r
+#include <hw/8254/8254.h> /* 8254 timer */\r
+#include <hw/adlib/adlib.h>\r
+#include <hw/vga/vga.h>\r
+#include <hw/dos/dos.h>\r
+#include <hw/8259/8259.h>\r
+\r
+#define SD_USESCAMMPM\r
+\r
+#define MIN_REGISTER 0x01\r
+#define MAX_REGISTER 0xF5\r
+#define ADLIB_FM_ADDRESS 0x388 /* adlib address/status register */\r
+#define ADLIB_FM_DATA 0x389 /* adlib data register */\r
+\r
+/*\r
+* FM Instrument definition for .SBI files - SoundBlaster instrument\r
+* - these are the important parts - we will skip the header, but since\r
+* I am not sure where it starts and ends so I have had to guess.\r
+* However it SEEMS! to work. Each array has two values, one for\r
+* each operator.\r
+*/\r
+typedef struct{\r
+ byte SoundCharacteristic[2]; /* modulator frequency multiple... */\r
+ byte Level[2]; /* modulator frequency level... */\r
+ byte AttackDecay[2]; /* modulator attack/decay... */\r
+ byte SustainRelease[2]; /* modulator sustain/release... */\r
+ byte WaveSelect[2]; /* output waveform distortion */\r
+ byte Feedback; /* feedback algorithm and strength */\r
+} FMInstrument;\r
+\r
+void opl2out(word reg, word data);\r
+void opl3out(word reg, word data);\r
+void opl3exp(word data);\r
+\r
+void FMReset(void/*int percusiveMode*/);\r
+void FMKeyOff(int voice);\r
+void FMKeyOn(int voice, int freq, int octave);\r
+void FMSetVoice(int voiceNum, FMInstrument *ins);\r
+\r
+void SD_Initimf(global_game_variables_t *gvar);\r
+void SD_imf_reset_music(global_game_variables_t *gvar);\r
+void SD_StartupTimer(global_game_variables_t *gvar),\r
+ SD_ShutdownTimer();\r
+void SD_imf_free_music(global_game_variables_t *gvar);\r
+int SD_imf_load_music(const char *path, global_game_variables_t *gvar);\r
+void interrupt SD_irq0(void);\r
+void SD_imf_tick(global_game_variables_t *gvar);\r
+void SD_adlib_shut_up();\r
+\r
+#endif /*__16_SND_H_*/\r