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
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
* 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
#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_*/