pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/emulators/gnuboy-sdl SDL port of gnuboy, a Nintendo Ga...
details: https://anonhg.NetBSD.org/pkgsrc/rev/c1035c79e4f6
branches: trunk
changeset: 478567:c1035c79e4f6
user: dillo <dillo%pkgsrc.org@localhost>
date: Mon Jul 26 17:05:05 2004 +0000
description:
SDL port of gnuboy, a Nintendo Gameboy / Gameboy Color emulator.
diffstat:
emulators/gnuboy-sdl/DESCR | 2 +
emulators/gnuboy-sdl/Makefile | 28 ++++++++++++++
emulators/gnuboy-sdl/PLIST | 14 +++++++
emulators/gnuboy-sdl/distinfo | 5 ++
emulators/gnuboy-sdl/patches/patch-aa | 70 +++++++++++++++++++++++++++++++++++
5 files changed, 119 insertions(+), 0 deletions(-)
diffs (139 lines):
diff -r d7dcf5bec216 -r c1035c79e4f6 emulators/gnuboy-sdl/DESCR
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/gnuboy-sdl/DESCR Mon Jul 26 17:05:05 2004 +0000
@@ -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 -r d7dcf5bec216 -r c1035c79e4f6 emulators/gnuboy-sdl/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/gnuboy-sdl/Makefile Mon Jul 26 17:05:05 2004 +0000
@@ -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@localhost
+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 -r d7dcf5bec216 -r c1035c79e4f6 emulators/gnuboy-sdl/PLIST
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/gnuboy-sdl/PLIST Mon Jul 26 17:05:05 2004 +0000
@@ -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 -r d7dcf5bec216 -r c1035c79e4f6 emulators/gnuboy-sdl/distinfo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/gnuboy-sdl/distinfo Mon Jul 26 17:05:05 2004 +0000
@@ -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 -r d7dcf5bec216 -r c1035c79e4f6 emulators/gnuboy-sdl/patches/patch-aa
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/gnuboy-sdl/patches/patch-aa Mon Jul 26 17:05:05 2004 +0000
@@ -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;
++ }
+ }
+
+
Home |
Main Index |
Thread Index |
Old Index