]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_snd.c
updated copyright www
[16.git] / src / lib / 16_snd.c
index 47cab348332462fb8a4a85e326c22b1888540818..e85fdf9b98683cd1fc27d7b05e08be3f0151874d 100755 (executable)
@@ -1,31 +1,30 @@
-/* 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.
- * 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.
- *
- */
-
-#include "src/lib/16_snd.h"
-
-void opl2out(word reg, word data)
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\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
+#include "src/lib/16_snd.h"\r
+\r
+void opl2out(word reg, word data)\r
 {\r
-       __asm
+       __asm\r
        {\r
                mov     ax,reg\r
                mov     dx,word ptr [ADLIB_FM_ADDRESS]\r
@@ -43,12 +42,12 @@ void opl2out(word reg, word data)
                mov     cx,36\r
 @@3:    in      al,dx\r
                loop    @@3\r
-       }
+       }\r
 }\r
 \r
-void opl3out(word reg, word data)
+void opl3out(word reg, word data)\r
 {\r
-       __asm
+       __asm\r
        {\r
                mov     ax,reg\r
                mov     dx,word ptr [ADLIB_FM_ADDRESS]\r
@@ -63,12 +62,12 @@ void opl3out(word reg, word data)
                mov     cx,26\r
 @@2:    in      al,dx\r
                loop    @@2\r
-       }
+       }\r
 }\r
 \r
-void opl3exp(word data)
+void opl3exp(word data)\r
 {\r
-       __asm
+       __asm\r
        {\r
                mov     ax,data\r
                mov     dx,word ptr [ADLIB_FM_ADDRESS]\r
@@ -82,17 +81,17 @@ void opl3exp(word data)
                out     dx,al\r
                mov     cx,36\r
 @@2:    in      al,dx\r
-               loop    @@2
+               loop    @@2\r
        }\r
-}
-
+}\r
+\r
 /* Function: FMResest *******************************************************\r
 *\r
 *     Description:        quick and dirty sound card reset (zeros all\r
 *                         registers).\r
 *\r
 */\r
-void FMReset(void/*int percusiveMode*/)
+void FMReset(void/*int percusiveMode*/)\r
 {\r
        int i;\r
 \r
@@ -106,8 +105,8 @@ void FMReset(void/*int percusiveMode*/)
        opl2out(0xBD, 0x20);\r
 \r
        //FMSetPercusiveMode(percusiveMode);\r
-} /* End of FMReset */
-
+} /* End of FMReset */\r
+\r
 /* Function: FMKeyOff *******************************************************\r
 *\r
 *     Parameters:        voice - which voice to turn off.\r
@@ -115,7 +114,7 @@ void FMReset(void/*int percusiveMode*/)
 *     Description:        turns off the specified voice.\r
 *\r
 */\r
-void FMKeyOff(int voice)
+void FMKeyOff(int voice)\r
 {\r
        int regNum;\r
 \r
@@ -134,17 +133,17 @@ void FMKeyOff(int voice)
 *                         octave.\r
 *\r
 */\r
-void FMKeyOn(int voice, int freq, int octave)
+void FMKeyOn(int voice, int freq, int octave)\r
 {\r
        int regNum, tmp;\r
 \r
        regNum = 0xA0 + voice % 11;//NUMVOICE;\r
        opl2out(regNum, freq & 0xff);\r
        regNum = 0xB0 + voice % 11;//NUMVOICE;\r
-       tmp = (freq >> 8) | (octave << 2) | 0x20;
+       tmp = (freq >> 8) | (octave << 2) | 0x20;\r
        opl2out(regNum, tmp);\r
-} /* End of FMKeyOn */
-
+} /* End of FMKeyOn */\r
+\r
 /* Function: FMSetVoice *****************************************************\r
 *\r
 *     Parameters:        voiceNum - which voice to set.\r
@@ -192,4 +191,4 @@ void FMSetVoice(int voiceNum, FMInstrument *ins){
        /* set Feedback/Selectivity */\r
        opCellNum = (byte)0xC0 + (byte)voiceNum;\r
        opl2out(opCellNum, ins->Feedback);\r
-} /* End of FMSetVoice */
+} /* End of FMSetVoice */\r