summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emulators/Cygne-SDL/DESCR11
-rw-r--r--emulators/Cygne-SDL/Makefile37
-rw-r--r--emulators/Cygne-SDL/PLIST6
-rw-r--r--emulators/Cygne-SDL/distinfo8
-rw-r--r--emulators/Cygne-SDL/patches/patch-aa44
-rw-r--r--emulators/Cygne-SDL/patches/patch-ab26
-rw-r--r--emulators/Cygne-SDL/patches/patch-ac235
-rw-r--r--emulators/Cygne-SDL/patches/patch-ad15
8 files changed, 382 insertions, 0 deletions
diff --git a/emulators/Cygne-SDL/DESCR b/emulators/Cygne-SDL/DESCR
new file mode 100644
index 00000000000..0d34f8cd6ea
--- /dev/null
+++ b/emulators/Cygne-SDL/DESCR
@@ -0,0 +1,11 @@
+Originally Cygne was developed by Dox as a Bandai Wonderswan (Colour)
+emulator for Windows systems. From version 2.1 Dox decided to
+release the Windows sources to the public in GPL form which allows
+others to use the source and hack it :)
+
+Cygne/SDL is a Cygne port using the Simple Directmedia Layer (SDL)
+library. Cygne/SDL is released as OpenSource under the GPL license.
+It uses code from the orignal Cygne (allthough a bit modified),
+code from the MAME NEC CPU core as well as portions from several
+SDLemu emulation projects. Anybody may hack the current sourcecode
+if they like or can make additional changes into it.
diff --git a/emulators/Cygne-SDL/Makefile b/emulators/Cygne-SDL/Makefile
new file mode 100644
index 00000000000..716467cab4a
--- /dev/null
+++ b/emulators/Cygne-SDL/Makefile
@@ -0,0 +1,37 @@
+# $NetBSD: Makefile,v 1.1.1.1 2004/07/23 19:01:40 wiz Exp $
+#
+
+DISTNAME= Cygne-SDL-0.1-src
+PKGNAME= ${DISTNAME:S/-src//}
+CATEGORIES= emulators
+MASTER_SITES= http://sdlemu.ngemu.com/OpenProjects/
+
+MAINTAINER= wiz@NetBSD.org
+HOMEPAGE= http://icculus.org/Cygne-SDL/
+COMMENT= Bandai Wonderswan Color handheld emulator
+
+BUILD_DEPENDS+= nasm>=0.98:../../devel/nasm
+BUILD_DEPENDS+= zip>=2.0:../../archivers/zip
+
+WRKSRC= ${WRKDIR}/Cygne-SDL-0.1/src
+USE_BUILDLINK3= yes
+MAKEFILE= Makefiles/Makefile.unix
+NO_CONFIGURE= yes
+
+post-build:
+ cd ${WRKSRC}/../WonderSnake && \
+ ${LOCALBASE}/bin/zip Wondersnake.zip Wondersnake.wsc
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/cygne ${PREFIX}/bin/Cygne-SDL
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/Cygne-SDL
+ ${INSTALL_DATA} ${WRKSRC}/../README ${PREFIX}/share/doc/Cygne-SDL
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/Cygne-SDL
+ ${INSTALL_DATA} ${WRKSRC}/../WonderSnake/Wondersnake.txt \
+ ${PREFIX}/share/Cygne-SDL
+ ${INSTALL_DATA} ${WRKSRC}/../WonderSnake/Wondersnake.zip \
+ ${PREFIX}/share/Cygne-SDL
+
+.include "../../devel/SDL/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/Cygne-SDL/PLIST b/emulators/Cygne-SDL/PLIST
new file mode 100644
index 00000000000..78118f0852e
--- /dev/null
+++ b/emulators/Cygne-SDL/PLIST
@@ -0,0 +1,6 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2004/07/23 19:01:40 wiz Exp $
+bin/Cygne-SDL
+share/Cygne-SDL/Wondersnake.txt
+share/Cygne-SDL/Wondersnake.zip
+share/doc/Cygne-SDL/README
+@dirrm share/doc/Cygne-SDL
diff --git a/emulators/Cygne-SDL/distinfo b/emulators/Cygne-SDL/distinfo
new file mode 100644
index 00000000000..5f2e5b31b3e
--- /dev/null
+++ b/emulators/Cygne-SDL/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1.1.1 2004/07/23 19:01:40 wiz Exp $
+
+SHA1 (Cygne-SDL-0.1-src.tar.gz) = f9c50702d1911d0ff1728e5aa089e67cfdfd0030
+Size (Cygne-SDL-0.1-src.tar.gz) = 106448 bytes
+SHA1 (patch-aa) = 9f23ff20e32950b2821654ca8269ebe82294e8b6
+SHA1 (patch-ab) = 89789c935f2865a015a72cf11621971d8b43b538
+SHA1 (patch-ac) = bee744a1b007158d681da122615bab3d8414b824
+SHA1 (patch-ad) = 120c1df8c521c1ffbd7750335730849ac921dc41
diff --git a/emulators/Cygne-SDL/patches/patch-aa b/emulators/Cygne-SDL/patches/patch-aa
new file mode 100644
index 00000000000..0dc06c618a0
--- /dev/null
+++ b/emulators/Cygne-SDL/patches/patch-aa
@@ -0,0 +1,44 @@
+$NetBSD: patch-aa,v 1.1.1.1 2004/07/23 19:01:40 wiz Exp $
+
+--- Makefiles/Makefile.unix.orig 2002-03-26 17:50:55.000000000 +0100
++++ Makefiles/Makefile.unix
+@@ -1,5 +1,4 @@
+-CC = gcc
+-LD = gcc
++LD = g++
+ NASM = nasm
+
+ ### Include and lib stuff ####
+@@ -8,17 +7,13 @@ STDLIB = /usr/lib
+ SDLINCLUDE = /usr/local/include/SDL
+ SDLLIB = /usr/local/lib
+
+-CFLAGS = -O1 -DUNIX -DTARGET_UNIX -DGCC -DUSES_16BIT_ONLY -D__SDL__ -fomit-frame-pointer -march=pentium \
+- -mpentium -finline-functions -fexpensive-optimizations -funroll-loops -funroll-all-loops -pipe \
+- -fschedule-insns2 -fstrength-reduce -malign-double -mfancy-math-387 -ffast-math -fforce-addr \
+- -fforce-mem `sdl-config --cflags` \
+- -L$(STDLIB) -L$(SDLLIB) -I$(STDINCLUDE) -I$(SDLINCLUDE)
++CFLAGS = -DUNIX -DTARGET_UNIX -DGCC -DUSES_16BIT_ONLY -D__SDL__ `sdl-config --cflags`
+
+-LDFLAGS = $(CFLAGS)
++LDFLAGS = $(CFLAGS) `sdl-config --libs`
+
+ TARGET = cygne
+
+-OBJ = ddrawsdl.o filessdl.o gfx.o nec.o tcache.o memory.o mainsdl.o zlib/unzip.o
++OBJ = ddrawsdl.o filessdl.o gfx.o nec.o tcache.o memory.o mainsdl.o unzip.o
+
+ LIBS = `sdl-config --libs` -lz
+
+@@ -37,7 +32,10 @@ THECC = $(CC) $(CFLAGS) $(INCS)
+ %.o: %.cpp
+ $(THECC) -c $< -o $@
+
+-cygne: $(OBJ) Makefile
++unzip.o:
++ $(THECC) -c zlib/unzip.c -o $@
++
++cygne: $(OBJ)
+ $(LD) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
+
+ clean:
diff --git a/emulators/Cygne-SDL/patches/patch-ab b/emulators/Cygne-SDL/patches/patch-ab
new file mode 100644
index 00000000000..37c818a82a6
--- /dev/null
+++ b/emulators/Cygne-SDL/patches/patch-ab
@@ -0,0 +1,26 @@
+$NetBSD: patch-ab,v 1.1.1.1 2004/07/23 19:01:41 wiz Exp $
+
+--- Usage.h.orig 2002-03-26 16:55:20.000000000 +0100
++++ Usage.h
+@@ -1,13 +1,13 @@
+ void Usage()
+ {
+ printf(
+-"Usage: ./cygne romfile options
+- Where options are:
+-
+- romfile : Filename of the romfile. It can have several
+- extensions (.ws/.wsc/.rom/.bin). Gzipped and
+- zipped (.gz and .zip) are also supported.
+- -double : Scale the screen 2 times the normal size.
+- -scanline : Allows scanline output with scaling.
++"Usage: ./cygne romfile options\n\
++ Where options are:\n\
++\n\
++ romfile : Filename of the romfile. It can have several\n\
++ extensions (.ws/.wsc/.rom/.bin). Gzipped and\n\
++ zipped (.gz and .zip) are also supported.\n\
++ -double : Scale the screen 2 times the normal size.\n\
++ -scanline : Allows scanline output with scaling.\n\
+ ");
+ }
diff --git a/emulators/Cygne-SDL/patches/patch-ac b/emulators/Cygne-SDL/patches/patch-ac
new file mode 100644
index 00000000000..a6c8355dcb0
--- /dev/null
+++ b/emulators/Cygne-SDL/patches/patch-ac
@@ -0,0 +1,235 @@
+$NetBSD: patch-ac,v 1.1.1.1 2004/07/23 19:01:41 wiz Exp $
+
+--- ddrawsdl.cpp.orig 2002-03-26 16:02:25.000000000 +0100
++++ ddrawsdl.cpp
+@@ -174,66 +174,66 @@ void UpdateFrame_h()
+ {
+ switch(fBlitterMode) {
+ case 1:
+- __asm__ __volatile__(".align 32
+- cld
+- rep
++ __asm__ __volatile__(".align 32\n\
++ cld\n\
++ rep\n\
+ movsw"
+ :
+ :"S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"((g_pDDSPrimary->h * g_pDDSPrimary->pitch)>>1));
+ break;
+ case 2:
+- __asm__ __volatile__("pusha
+- xorl %%eax, %%eax
+- movl $448, %%ebx
+- emms
+- sum:
+- movq (%0, %%eax, 1), %%mm0
+- movq %%mm0, %%mm1
+- punpcklwd %%mm0, %%mm0
+- addl $8, %%eax
+- punpckhwd %%mm1,%%mm1
+- movq %%mm0, -16(%1, %%eax, 2)
+- cmpl %%ebx, %%eax
+-
+- movq %%mm1, -8(%1, %%eax, 2)
+- jnz sum
+- xorl %%eax, %%eax
+-
+- addl %2, %0
+- decl %%edx
+-
+- leal (%1, %2, 4), %1
+- jnz sum
+- emms
++ __asm__ __volatile__("pusha\n\
++ xorl %%eax, %%eax\n\
++ movl $448, %%ebx \n\
++ emms\n\
++ sum:\n\
++ movq (%0, %%eax, 1), %%mm0\n\
++ movq %%mm0, %%mm1\n\
++ punpcklwd %%mm0, %%mm0\n\
++ addl $8, %%eax\n\
++ punpckhwd %%mm1,%%mm1\n\
++ movq %%mm0, -16(%1, %%eax, 2)\n\
++ cmpl %%ebx, %%eax\n\
++ \n\
++ movq %%mm1, -8(%1, %%eax, 2)\n\
++ jnz sum\n\
++ xorl %%eax, %%eax\n\
++ \n\
++ addl %2, %0\n\
++ decl %%edx\n\
++ \n\
++ leal (%1, %2, 4), %1\n\
++ jnz sum\n\
++ emms\n\
+ popa"
+ :
+ : "S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"(g_pDDSPrimary->pitch>>1), "d"(144));
+ break;
+
+ case 3:
+- __asm__ __volatile__("pusha
+- xorl %%eax, %%eax
+- movl $896, %%ebx
+- emms
+- sum3:
+- movq (%0, %%eax, 1), %%mm0
+- movq %%mm0, %%mm1
+- punpcklwd %%mm0, %%mm0
+- addl $8, %%eax
+- punpckhwd %%mm1,%%mm1
+- movq %%mm0, -16(%1, %%eax, 2)
+- cmpl %%ebx, %%eax
+-
+- movq %%mm1, -8(%1, %%eax, 2)
+- jnz sum3
+- xorl %%eax, %%eax
+-
+- addl %2, %0
+- decl %%edx
+-
+- leal (%1, %2, 4), %1
+- jnz sum3
+- emms
++ __asm__ __volatile__("pusha\n\
++ xorl %%eax, %%eax\n\
++ movl $896, %%ebx \n\
++ emms\n\
++ sum3:\n\
++ movq (%0, %%eax, 1), %%mm0\n\
++ movq %%mm0, %%mm1\n\
++ punpcklwd %%mm0, %%mm0\n\
++ addl $8, %%eax\n\
++ punpckhwd %%mm1,%%mm1\n\
++ movq %%mm0, -16(%1, %%eax, 2)\n\
++ cmpl %%ebx, %%eax\n\
++ \n\
++ movq %%mm1, -8(%1, %%eax, 2)\n\
++ jnz sum3\n\
++ xorl %%eax, %%eax\n\
++ \n\
++ addl %2, %0\n\
++ decl %%edx\n\
++ \n\
++ leal (%1, %2, 4), %1\n\
++ jnz sum3\n\
++ emms\n\
+ popa"
+ :
+ : "S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"(g_pDDSPrimary->pitch>>1), "d"(144));
+@@ -418,65 +418,65 @@ void UpdateFrame_v()
+ {
+ switch(fBlitterMode) {
+ case 1:
+- __asm__ __volatile__(".align 32
+- cld
+- rep
++ __asm__ __volatile__(".align 32\n\
++ cld\n\
++ rep\n\
+ movsw"
+ :
+ :"S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"((g_pDDSPrimary->h * g_pDDSPrimary->pitch)>>1));
+ break;
+ case 2: // double scanlines
+- __asm__ __volatile__("pusha
+- xorl %%eax, %%eax
+- movl $288, %%ebx
+- emms
+- sumb:
+- movq (%0, %%eax, 1), %%mm0
+- movq %%mm0, %%mm1
+- punpcklwd %%mm0, %%mm0
+- addl $8, %%eax
+- punpckhwd %%mm1,%%mm1
+- movq %%mm0, -16(%1, %%eax, 2)
+- cmpl %%ebx, %%eax
+-
+- movq %%mm1, -8(%1, %%eax, 2)
+- jnz sumb
+- xorl %%eax, %%eax
+-
+- addl %2, %0
+- decl %%edx
+-
+- leal (%1, %2, 4), %1
+- jnz sumb
+- emms
++ __asm__ __volatile__("pusha\n\
++ xorl %%eax, %%eax\n\
++ movl $288, %%ebx \n\
++ emms\n\
++ sumb:\n\
++ movq (%0, %%eax, 1), %%mm0\n\
++ movq %%mm0, %%mm1\n\
++ punpcklwd %%mm0, %%mm0\n\
++ addl $8, %%eax\n\
++ punpckhwd %%mm1,%%mm1\n\
++ movq %%mm0, -16(%1, %%eax, 2)\n\
++ cmpl %%ebx, %%eax\n\
++ \n\
++ movq %%mm1, -8(%1, %%eax, 2)\n\
++ jnz sumb\n\
++ xorl %%eax, %%eax\n\
++ \n\
++ addl %2, %0\n\
++ decl %%edx\n\
++ \n\
++ leal (%1, %2, 4), %1\n\
++ jnz sumb\n\
++ emms\n\
+ popa"
+ :
+ : "S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"(g_pDDSPrimary->pitch>>1), "d"(224));
+ break;
+ case 3: // double stretch mode
+- __asm__ __volatile__("pusha
+- xorl %%eax, %%eax
+- movl $576, %%ebx
+- emms
+- sumc:
+- movq (%0, %%eax, 1), %%mm0
+- movq %%mm0, %%mm1
+- punpcklwd %%mm0, %%mm0
+- addl $8, %%eax
+- punpckhwd %%mm1,%%mm1
+- movq %%mm0, -16(%1, %%eax, 2)
+- cmpl %%ebx, %%eax
+-
+- movq %%mm1, -8(%1, %%eax, 2)
+- jnz sumc
+- xorl %%eax, %%eax
+-
+- addl %2, %0
+- decl %%edx
+-
+- leal (%1, %2, 4), %1
+- jnz sumc
+- emms
++ __asm__ __volatile__("pusha\n\
++ xorl %%eax, %%eax\n\
++ movl $576, %%ebx \n\
++ emms\n\
++ sumc:\n\
++ movq (%0, %%eax, 1), %%mm0\n\
++ movq %%mm0, %%mm1\n\
++ punpcklwd %%mm0, %%mm0\n\
++ addl $8, %%eax\n\
++ punpckhwd %%mm1,%%mm1\n\
++ movq %%mm0, -16(%1, %%eax, 2)\n\
++ cmpl %%ebx, %%eax\n\
++ \n\
++ movq %%mm1, -8(%1, %%eax, 2)\n\
++ jnz sumc\n\
++ xorl %%eax, %%eax\n\
++ \n\
++ addl %2, %0\n\
++ decl %%edx\n\
++ \n\
++ leal (%1, %2, 4), %1\n\
++ jnz sumc\n\
++ emms\n\
+ popa"
+ :
+ : "S"(dx_buffer), "D"(g_pDDSPrimary->pixels), "c"(g_pDDSPrimary->pitch>>1), "d"(224));
diff --git a/emulators/Cygne-SDL/patches/patch-ad b/emulators/Cygne-SDL/patches/patch-ad
new file mode 100644
index 00000000000..fce8d7d4b02
--- /dev/null
+++ b/emulators/Cygne-SDL/patches/patch-ad
@@ -0,0 +1,15 @@
+$NetBSD: patch-ad,v 1.1.1.1 2004/07/23 19:01:41 wiz Exp $
+
+--- zlib/unzip.h.orig 2002-03-21 19:42:46.000000000 +0100
++++ zlib/unzip.h
+@@ -49,6 +49,10 @@ extern "C" {
+ #include "zlib.h"
+ #endif
+
++#ifndef OF
++#define OF(a) a
++#endif
++
+ #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
+ /* like the STRICT of WIN32, we define a pointer that cannot be converted
+ from (void*) without cast */