]> 4ch.mooo.com Git - 16.git/commitdiff
started the porting of the adlib tracker playback system
authorsparky4 <sparky4@cock.li>
Wed, 15 Jul 2015 18:11:22 +0000 (13:11 -0500)
committersparky4 <sparky4@cock.li>
Wed, 15 Jul 2015 18:11:22 +0000 (13:11 -0500)
modified:   makefile
modified:   src/lib/16_snd.c
modified:   src/lib/16_snd.h

makefile
src/lib/16_snd.c
src/lib/16_snd.h

index 4ba3f02421886b43b6a1135dc107c4e2c9c9198d..90b48240a3ae1d84ccc2345fbbf8e6bbd1f016d4 100644 (file)
--- a/makefile
+++ b/makefile
@@ -22,7 +22,7 @@ JSMNLIB=$(SRCLIB)jsmn$(DIRSEP)
 EXMMLIB=$(SRCLIB)exmm$(DIRSEP)
 WCPULIB=$(SRCLIB)wcpu$(DIRSEP)
 
-16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) scroll16.$(OBJ) 16_ca.$(OBJ)
+16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) scroll16.$(OBJ) 16_ca.$(OBJ) 16_snd.$(OBJ)
 GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ)
 
 all: 16.exe test.exe pcxtest.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe inputest.exe exmmtest.exe fonttes0.exe fontgfx.exe
@@ -172,6 +172,9 @@ mapread.$(OBJ): $(SRCLIB)mapread.h $(SRCLIB)mapread.c 16.lib
 16_ca.$(OBJ): $(SRCLIB)16_ca.h $(SRCLIB)16_ca.c
        wcl $(FLAGS) -c $(SRCLIB)16_ca.c
 
+16_snd.$(OBJ): $(SRCLIB)16_snd.h $(SRCLIB)16_snd.c
+        wcl $(FLAGS) -c $(SRCLIB)16_snd.c
+
 16_head.$(OBJ): $(SRCLIB)16_head.h $(SRCLIB)16_head.c
        wcl $(FLAGS) -c $(SRCLIB)16_head.c
 
index 7e6b644481a2fdd7e48ff13c74796ebfbf76d5e9..5ade6445f2b89e83d4ec8fa12a3963f211b844ff 100644 (file)
@@ -12,6 +12,7 @@
  * 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
  * Fifth Floor, Boston, MA 02110-1301 USA.
  *
  */
+
+#include "src/lib/16_snd.h"
+
+void opl2out(word data, word reg)
+{\r
+       __asm
+       {\r
+               mov     ax,reg\r
+               mov     dx,word ptr [OPLPORT]\r
+               or      ah,ah\r
+               jz      @@1\r
+               add     dx,2\r
+@@1:    out     dx,al\r
+               mov     cx,6\r
+@@2:    in      al,dx\r
+               loop    @@2\r
+               inc     dl\r
+               mov     ax,data\r
+               out     dx,al\r
+               dec     dl\r
+               mov     cx,36\r
+@@3:    in      al,dx\r
+               loop    @@3\r
+       }
+}\r
+\r
+void opl3out(word data, word reg)
+{\r
+       __asm
+       {\r
+               mov     ax,reg\r
+               mov     dx,word ptr [OPLPORT]\r
+               or      ah,ah\r
+               jz      @@1\r
+               add     dx,2\r
+@@1:    out     dx,al\r
+               inc     dl\r
+               mov     ax,data\r
+               out     dx,al\r
+               dec     dl\r
+               mov     cx,26\r
+@@2:    in      al,dx\r
+               loop    @@2\r
+       }
+}\r
+\r
+void opl3exp(word data)
+{\r
+       __asm
+       {\r
+               mov     ax,data\r
+               mov     dx,word ptr [OPLPORT]\r
+               add     dx,2\r
+               out     dx,al\r
+               mov     cx,6\r
+@@1:    in      al,dx\r
+               loop    @@1\r
+               inc     dl\r
+               mov     al,ah\r
+               out     dx,al\r
+               mov     cx,36\r
+@@2:    in      al,dx\r
+               loop    @@2
+       }\r
+}
\ No newline at end of file
index 6abbe5d33895df512699b7d9d74549b948e02cf5..3f7529490a43fe57a6d34879fada484a00cdc40c 100644 (file)
 
 #include "src/lib/16_head.h"
 
-#endif /*__16_SND_H_*/
\ No newline at end of file
+#define OPLPORT 388
+
+void opl2out(word data, word reg);
+void opl3out(word data, word reg);
+void opl3exp(word data);
+
+#endif /*__16_SND_H_*/