$NetBSD: patch-af,v 1.2 2000/11/16 02:27:05 wiz Exp $

--- unix/unix.cpp.orig	Fri Oct  6 23:02:40 2000
+++ unix/unix.cpp
@@ -79,7 +79,14 @@
 #endif
 #endif
 
-#if defined(__sun) && defined(__GNUC__)
+#ifdef __NetBSD__
+#include <sys/ioctl.h>
+#include <sys/audioio.h>
+#endif
+
+#if defined(__NetBSD__)
+typedef void (*SIG_PF)(int);
+#elif defined(__sun) && defined(__GNUC__)
 typedef void (*SIG_PF)();
 #endif
 
@@ -167,7 +174,7 @@
 char *rom_filename = NULL;
 char *snapshot_filename = NULL;
 
-#if defined(__linux) || defined(__sun)
+#if defined(__linux) || defined(__sun) || defined(__NetBSD__)
 static void sigbrkhandler(int)
 {
 #ifdef DEBUGGER
@@ -1373,7 +1380,7 @@
 }
 #endif
 
-#ifdef __sun
+#if defined(__sun) || defined(__NetBSD__)
 static int Rates[8] =
 {
     0, 8000, 11025, 16000, 22050, 32000, 37800, 44100
@@ -1442,9 +1449,9 @@
 {
     int J, K;
 
-    if ((so.sound_fd = open ("/dev/dsp", O_WRONLY)) < 0)
+    if ((so.sound_fd = open ("/dev/audio", O_WRONLY)) < 0)
     {
-	perror ("/dev/dsp");
+	perror ("/dev/audio");
 	return (FALSE);
     }
 
@@ -1546,7 +1553,7 @@
 }
 #endif
 
-#if defined (__linux) || defined (__sun)
+#if defined (__linux) || defined (__sun) || defined(__NetBSD__)
 void S9xUnixProcessSound (void)
 {
 }
@@ -1669,7 +1676,7 @@
 #endif
 
 #endif
-#ifdef __sun
+#if defined(__sun) || defined(__NetBSD__)
     audio_info_t audio;
     if (!Settings.ThreadSound)
     {
