summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordillo <dillo>2004-07-26 17:05:05 +0000
committerdillo <dillo>2004-07-26 17:05:05 +0000
commit5f2db52a005881dbc4ee63b03f28b589daad9270 (patch)
tree499e03d112d169b488df7d9422034437fbf087fc
parentdcc5a63853b52f6dbfd127a0fe1ed062ec1a893f (diff)
downloadpkgsrc-5f2db52a005881dbc4ee63b03f28b589daad9270.tar.gz
SDL port of gnuboy, a Nintendo Gameboy / Gameboy Color emulator.
-rw-r--r--emulators/gnuboy-sdl/DESCR2
-rw-r--r--emulators/gnuboy-sdl/Makefile28
-rw-r--r--emulators/gnuboy-sdl/PLIST14
-rw-r--r--emulators/gnuboy-sdl/distinfo5
-rw-r--r--emulators/gnuboy-sdl/patches/patch-aa70
5 files changed, 119 insertions, 0 deletions
diff --git a/emulators/gnuboy-sdl/DESCR b/emulators/gnuboy-sdl/DESCR
new file mode 100644
index 00000000000..1da77948b17
--- /dev/null
+++ b/emulators/gnuboy-sdl/DESCR
@@ -0,0 +1,2 @@
+Gnuboy is a portable program for emulating the Nintendo GameBoy Color
+software platform. This is the SDL port, with joystick support.
diff --git a/emulators/gnuboy-sdl/Makefile b/emulators/gnuboy-sdl/Makefile
new file mode 100644
index 00000000000..2834cd83ac2
--- /dev/null
+++ b/emulators/gnuboy-sdl/Makefile
@@ -0,0 +1,28 @@
+# $NetBSD: Makefile,v 1.1.1.1 2004/07/26 17:05:05 dillo Exp $
+
+DISTNAME= gnuboy-1.0.3
+PKGNAME= ${DISTNAME:S/-/-sdl-/}
+CATEGORIES= emulators
+MASTER_SITES= http://gnuboy.unix-fu.org/src/
+
+MAINTAINER= dillo@NetBSD.org
+HOMEPAGE= http://gnuboy.unix-fu.org/
+COMMENT= SDL port of Gameboy emulator
+
+GNU_CONFIGURE= yes
+USE_X11= yes
+USE_BUILDLINK3= yes
+CONFIGURE_ARGS+=--with-sdl
+
+.include "../../devel/SDL/buildlink3.mk"
+
+do-install:
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/gnuboy-sdl
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/gnuboy-sdl
+ ${INSTALL_PROGRAM} ${WRKSRC}/sdlgnuboy ${PREFIX}/bin/gnuboy-sdl
+ ${INSTALL_DATA} ${WRKSRC}/etc/sample.rc \
+ ${PREFIX}/share/examples/gnuboy-sdl/
+ ${INSTALL_DATA} ${WRKSRC}/README ${WRKSRC}/docs/* \
+ ${PREFIX}/share/doc/gnuboy-sdl/
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/gnuboy-sdl/PLIST b/emulators/gnuboy-sdl/PLIST
new file mode 100644
index 00000000000..973160f1d24
--- /dev/null
+++ b/emulators/gnuboy-sdl/PLIST
@@ -0,0 +1,14 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2004/07/26 17:05:05 dillo Exp $
+bin/gnuboy-sdl
+share/doc/gnuboy-sdl/CHANGES
+share/doc/gnuboy-sdl/CONFIG
+share/doc/gnuboy-sdl/CREDITS
+share/doc/gnuboy-sdl/FAQ
+share/doc/gnuboy-sdl/HACKING
+share/doc/gnuboy-sdl/LIBERTY
+share/doc/gnuboy-sdl/README
+share/doc/gnuboy-sdl/README.old
+share/doc/gnuboy-sdl/WHATSNEW
+share/examples/gnuboy-sdl/sample.rc
+@dirrm share/examples/gnuboy-sdl
+@dirrm share/doc/gnuboy-sdl
diff --git a/emulators/gnuboy-sdl/distinfo b/emulators/gnuboy-sdl/distinfo
new file mode 100644
index 00000000000..fad1bad779c
--- /dev/null
+++ b/emulators/gnuboy-sdl/distinfo
@@ -0,0 +1,5 @@
+$NetBSD: distinfo,v 1.1.1.1 2004/07/26 17:05:05 dillo Exp $
+
+SHA1 (gnuboy-1.0.3.tar.gz) = 4c371445b6599c6636d08ba9c5de7bb9fbf78437
+Size (gnuboy-1.0.3.tar.gz) = 187627 bytes
+SHA1 (patch-aa) = 266f39882e2aa3cc3350a6080ecc6e8738c92160
diff --git a/emulators/gnuboy-sdl/patches/patch-aa b/emulators/gnuboy-sdl/patches/patch-aa
new file mode 100644
index 00000000000..dd114909e6b
--- /dev/null
+++ b/emulators/gnuboy-sdl/patches/patch-aa
@@ -0,0 +1,70 @@
+$NetBSD: patch-aa,v 1.1.1.1 2004/07/26 17:05:05 dillo Exp $
+
+--- sys/sdl/sdl.c.orig 2001-09-17 18:40:14.000000000 +0200
++++ sys/sdl/sdl.c
+@@ -441,6 +441,8 @@ static int sound = 1;
+ static int samplerate = 44100;
+ static int stereo = 1;
+ static volatile int audio_done;
++static SDL_sem *pcm_rsem, *pcm_wsem;
++static int atexit_done = 0;
+
+ rcvar_t pcm_exports[] =
+ {
+@@ -453,8 +455,16 @@ rcvar_t pcm_exports[] =
+
+ static void audio_callback(void *blah, byte *stream, int len)
+ {
++ SDL_SemWait(pcm_rsem);
+ memcpy(stream, pcm.buf, len);
+- audio_done = 1;
++ SDL_SemPost(pcm_wsem);
++}
++
++
++static void audio_atexit(void)
++{
++ if (pcm_wsem)
++ SDL_SemPost(pcm_rsem);
+ }
+
+
+@@ -466,6 +476,13 @@ void pcm_init()
+ if (!sound) return;
+
+ SDL_InitSubSystem(SDL_INIT_AUDIO);
++ /* XXX: check for NULL */
++ pcm_rsem = SDL_CreateSemaphore(0);
++ pcm_wsem = SDL_CreateSemaphore(0);
++ if (!atexit_done) {
++ atexit(audio_atexit);
++ atexit_done = 1;
++ }
+ as.freq = samplerate;
+ as.format = AUDIO_U8;
+ as.channels = 1 + stereo;
+@@ -491,16 +508,20 @@ int pcm_submit()
+ {
+ if (!pcm.buf) return 0;
+ if (pcm.pos < pcm.len) return 1;
+- while (!audio_done)
+- SDL_Delay(4);
+- audio_done = 0;
++ SDL_SemPost(pcm_rsem);
++ SDL_SemWait(pcm_wsem);
+ pcm.pos = 0;
+ return 1;
+ }
+
+ void pcm_close()
+ {
+- if (sound) SDL_CloseAudio();
++ if (sound) {
++ SDL_CloseAudio();
++ SDL_DestroySemaphore(pcm_rsem);
++ SDL_DestroySemaphore(pcm_wsem);
++ pcm_rsem = pcm_wsem = 0;
++ }
+ }
+
+